pkgs/development/compilers: stdenv.lib -> lib

This commit is contained in:
Ben Siraphob
2021-01-22 18:25:31 +07:00
parent bbaff89ceb
commit acc5f7b18a
320 changed files with 1660 additions and 1657 deletions

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, patchelf, gmp }:
{ lib, stdenv, fetchurl, patchelf, gmp }:
let
version = "20130715";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
sourceRoot = "${pname}-${version}";
buildInputs = [ gmp ];
nativeBuildInputs = stdenv.lib.optional stdenv.isLinux patchelf;
nativeBuildInputs = lib.optional stdenv.isLinux patchelf;
makeFlags = [ "all-no-docs" ];
@@ -61,9 +61,9 @@ stdenv.mkDerivation rec {
done
substituteInPlace $(pwd)/../${usr_prefix}/bin/mlton --replace '/${usr_prefix}/lib/mlton' $(pwd)/../${usr_prefix}/lib/mlton
'' + stdenv.lib.optionalString stdenv.cc.isClang ''
'' + lib.optionalString stdenv.cc.isClang ''
sed -i "s_ patch -s -p0 <gdtoa.hide-public-fns.patch_ patch -s -p0 <gdtoa.hide-public-fns.patch\n\tsed -i 's|printf(emptyfmt|printf(\"\"|g' ./gdtoa/arithchk.c_" ./runtime/Makefile
'' + stdenv.lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.isDarwin ''
sed -i 's|XCFLAGS += -I/usr/local/include -I/sw/include -I/opt/local/include||' ./runtime/Makefile
'';
@@ -79,13 +79,13 @@ stdenv.mkDerivation rec {
# So the builder runs the binary compiler with gmp.
export LD_LIBRARY_PATH=${gmp.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'' + stdenv.lib.optionalString stdenv.isLinux ''
'' + lib.optionalString stdenv.isLinux ''
# Patch ELF interpreter.
patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile
for e in mllex mlyacc ; do
patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/bin/$e
done
'' + stdenv.lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.isDarwin ''
# Patch libgmp linking
install_name_tool -change /opt/local/lib/libgmp.10.dylib ${gmp}/lib/libgmp.10.dylib $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile
install_name_tool -change /opt/local/lib/libgmp.10.dylib ${gmp}/lib/libgmp.10.dylib $(pwd)/../${usr_prefix}/bin/mlyacc

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, patchelf, gmp }:
{ lib, stdenv, fetchurl, patchelf, gmp }:
let
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
in
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
throw "Architecture not supported";
buildInputs = [ gmp ];
nativeBuildInputs = stdenv.lib.optional stdenv.isLinux patchelf;
nativeBuildInputs = lib.optional stdenv.isLinux patchelf;
buildPhase = ''
make update \
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
make install PREFIX=$out
'';
postFixup = stdenv.lib.optionalString stdenv.isLinux ''
postFixup = lib.optionalString stdenv.isLinux ''
patchelf --set-interpreter ${dynamic-linker} $out/lib/mlton/mlton-compile
patchelf --set-rpath ${gmp}/lib $out/lib/mlton/mlton-compile
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
patchelf --set-interpreter ${dynamic-linker} $out/bin/$e
patchelf --set-rpath ${gmp}/lib $out/bin/$e
done
'' + stdenv.lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -change \
/opt/local/lib/libgmp.10.dylib \
${gmp}/lib/libgmp.10.dylib \