ocaml: minor refactoring

Changed files
+9 -9
pkgs
development
compilers
ocaml
+9 -9
pkgs/development/compilers/ocaml/generic.nix
···
{ 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
···
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}";
···
inherit name;
inherit version;
-
src = fetchurl {
-
url = real_url;
-
inherit sha256;
-
};
+
inherit src;
prefixKey = "-prefix ";
configureFlags =