diff options
author | Vincent Laporte <Vincent.Laporte@gmail.com> | 2020-11-18 08:10:35 +0100 |
---|---|---|
committer | Vincent Laporte <vbgl@users.noreply.github.com> | 2020-11-25 07:55:44 +0100 |
commit | e40f4acb2706513eda92e1c7c92f085162844e01 (patch) | |
tree | 501f08c223509f496cc77c318313d6ab5d9ec5b7 /pkgs/development/compilers/ocaml | |
parent | 342ec6fce6b91ec2a8d95c4f122dc9f17e11a512 (diff) |
ocaml: minor refactoring
Diffstat (limited to 'pkgs/development/compilers/ocaml')
-rw-r--r-- | pkgs/development/compilers/ocaml/generic.nix | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 1558756e16b17..79aab1ffe8317 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -1,12 +1,8 @@ { minor_version, major_version, patch_version -, url ? null -, sha256, ...}@args: +, ...}@args: let versionNoPatch = "${toString major_version}.${toString minor_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); in @@ -23,6 +19,13 @@ assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03"; 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 useNativeCompilers = !stdenv.isMips; inherit (stdenv.lib) optional optionals optionalString; name = "ocaml${optionalString aflSupport "+afl"}${optionalString spaceTimeSupport "+spacetime"}${optionalString flambdaSupport "+flambda"}-${version}"; @@ -39,10 +42,7 @@ stdenv.mkDerivation (args // { inherit name; inherit version; - src = fetchurl { - url = real_url; - inherit sha256; - }; + inherit src; prefixKey = "-prefix "; configureFlags = |