ocaml: minor refactoring
This commit is contained in:
parent
342ec6fce6
commit
e40f4acb27
@ -1,12 +1,8 @@
|
|||||||
{ minor_version, major_version, patch_version
|
{ minor_version, major_version, patch_version
|
||||||
, url ? null
|
, ...}@args:
|
||||||
, sha256, ...}@args:
|
|
||||||
let
|
let
|
||||||
versionNoPatch = "${toString major_version}.${toString minor_version}";
|
versionNoPatch = "${toString major_version}.${toString minor_version}";
|
||||||
version = "${versionNoPatch}.${toString patch_version}";
|
version = "${versionNoPatch}.${toString patch_version}";
|
||||||
real_url = if url == null then
|
|
||||||
"http://caml.inria.fr/pub/distrib/ocaml-${versionNoPatch}/ocaml-${version}.tar.xz"
|
|
||||||
else url;
|
|
||||||
safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips);
|
safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips);
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -22,6 +18,13 @@ assert aflSupport -> stdenv.lib.versionAtLeast version "4.05";
|
|||||||
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
||||||
assert spaceTimeSupport -> stdenv.lib.versionAtLeast version "4.04";
|
assert spaceTimeSupport -> stdenv.lib.versionAtLeast version "4.04";
|
||||||
|
|
||||||
|
let
|
||||||
|
src = args.src or (fetchurl {
|
||||||
|
url = args.url or "http://caml.inria.fr/pub/distrib/ocaml-${versionNoPatch}/ocaml-${version}.tar.xz";
|
||||||
|
inherit (args) sha256;
|
||||||
|
});
|
||||||
|
in
|
||||||
|
|
||||||
let
|
let
|
||||||
useNativeCompilers = !stdenv.isMips;
|
useNativeCompilers = !stdenv.isMips;
|
||||||
inherit (stdenv.lib) optional optionals optionalString;
|
inherit (stdenv.lib) optional optionals optionalString;
|
||||||
@ -39,10 +42,7 @@ stdenv.mkDerivation (args // {
|
|||||||
inherit name;
|
inherit name;
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
src = fetchurl {
|
inherit src;
|
||||||
url = real_url;
|
|
||||||
inherit sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
prefixKey = "-prefix ";
|
prefixKey = "-prefix ";
|
||||||
configureFlags =
|
configureFlags =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user