git.iko.soy/typeable/nixpkgs
on master help sign in
mlton: adds binary release package for mlton version 20180207

This works the same as the binary package in the old derivation, by patching the release binary. The difference is that this derivation is also exposed at the top level.

commit30da2b565917622f52108bcb93bf759700e6a144 authorSophia Donataccio <srdqty@gmail.com> dateFri 12 Oct 2018, 00:21 (8 years ago) parent4845d93
3 files changed+63−1
pkgs/development/compilers/mlton/20180207-binary.nix+57 pkgs/development/compilers/mlton/default.nix+4 pkgs/top-level/all-packages.nix+2−1
pkgs/development/compilers/mlton/20180207-binary.nixnew file+57
@@ -0,0 +1,57 @@
1+{ stdenv, fetchurl, patchelf, gmp }:
2+let
3+ dynamic-linker = stdenv.cc.bintools.dynamicLinker;
4+in
5+stdenv.mkDerivation rec {
6+ name = "mlton-${version}";
7+ version = "20180207";
8+
9+ src = if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
10+ url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${name}-1.amd64-linux.tgz";
11+ sha256 = "0f4q575yfm5dpg4a2wsnqn4l2zrar96p6rlsk0dw10ggyfwvsjlf";
12+ })
13+ else if stdenv.hostPlatform.system == "x86_64-darwin" then (fetchurl {
14+ url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${name}-1.amd64-darwin.gmp-static.tgz";
15+ sha256 = "1cw7yhw48qp12q0adwf8srpjzrgkp84kmlkqw3pz8vkxz4p9hbdv";
16+ })
17+ else
18+ throw "Architecture not supported";
19+
20+ buildInputs = [ gmp ];
21+ nativeBuildInputs = stdenv.lib.optional stdenv.isLinux patchelf;
22+
23+ buildPhase = ''
24+ make update \
25+ CC="$(type -p cc)" \
26+ WITH_GMP_INC_DIR="${gmp.dev}/include" \
27+ WITH_GMP_LIB_DIR="${gmp}/lib"
28+ '';
29+
30+ installPhase = ''
31+ make install PREFIX=$out
32+ '';
33+
34+ postFixup = stdenv.lib.optionalString stdenv.isLinux ''
35+ patchelf --set-interpreter ${dynamic-linker} $out/lib/mlton/mlton-compile
36+ patchelf --set-rpath ${gmp}/lib $out/lib/mlton/mlton-compile
37+
38+ for e in mllex mlnlffigen mlprof mlyacc; do
39+ patchelf --set-interpreter ${dynamic-linker} $out/bin/$e
40+ patchelf --set-rpath ${gmp}/lib $out/bin/$e
41+ done
42+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
43+ install_name_tool -change \
44+ /opt/local/lib/libgmp.10.dylib \
45+ ${gmp}/lib/libgmp.10.dylib \
46+ $out/lib/mlton/mlton-compile
47+
48+ for e in mllex mlnlffigen mlprof mlyacc; do
49+ install_name_tool -change \
50+ /opt/local/lib/libgmp.10.dylib \
51+ ${gmp}/lib/libgmp.10.dylib \
52+ $out/bin/$e
53+ done
54+ '';
55+
56+ meta = import ./meta.nix;
57+}
pkgs/development/compilers/mlton/default.nix+4
@@ -3,4 +3,8 @@ rec {
33 mlton20130715 = import ./20130715.nix {
44 inherit stdenv fetchurl patchelf gmp;
55 };
6+
7+ mlton20180207Binary = import ./20180207-binary.nix {
8+ inherit stdenv fetchurl patchelf gmp;
9+ };
610}
pkgs/top-level/all-packages.nix+2−1
@@ -7163,7 +7163,8 @@ with pkgs;
71637163 mkcl = callPackage ../development/compilers/mkcl {};
71647164
71657165 inherit (callPackage ../development/compilers/mlton {})
7166− mlton20130715;
7166+ mlton20130715
7167+ mlton20180207Binary;
71677168
71687169 mlton = mlton20130715;
71697170