summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/gambit
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2021-03-09 09:52:26 +0000
committerGitHub <noreply@github.com>2021-03-09 10:52:26 +0100
commit7273ebabfa39745fa6b7d85765a41d6ffb8b6d61 (patch)
tree25c0e979fe71615554de4020a91e2c37e63dc636 /pkgs/development/compilers/gambit
parent2deb6cf482be74745242b076683fbc860f4321e8 (diff)
gambit: refactor (#113405)
Diffstat (limited to 'pkgs/development/compilers/gambit')
-rw-r--r--pkgs/development/compilers/gambit/build.nix36
1 files changed, 19 insertions, 17 deletions
diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix
index a4b884147db1..84d51a2bc3f6 100644
--- a/pkgs/development/compilers/gambit/build.nix
+++ b/pkgs/development/compilers/gambit/build.nix
@@ -25,10 +25,11 @@ gccStdenv.mkDerivation rec {
inherit src version git-version;
bootstrap = gambit-support.gambit-bootstrap;
+ nativeBuildInputs = [ git autoconf ];
# TODO: if/when we can get all the library packages we depend on to have static versions,
# we could use something like (makeStaticLibraries openssl) to enable creation
# of statically linked binaries by gsc.
- buildInputs = [ git autoconf bootstrap openssl ];
+ buildInputs = [ openssl ];
# TODO: patch gambit's source so it has the full path to sed, grep, fgrep? Is there more?
# Or wrap relevant programs to add a suitable PATH ?
@@ -62,11 +63,11 @@ gccStdenv.mkDerivation rec {
lib.optional (!gccStdenv.isDarwin) "--enable-poll";
configurePhase = ''
- export CC=${gcc}/bin/gcc \
- CXX=${gcc}/bin/g++ \
- CPP=${gcc}/bin/cpp \
- CXXCPP=${gcc}/bin/cpp \
- LD=${gcc}/bin/ld \
+ export CC=${gccStdenv.cc.targetPrefix}gcc \
+ CXX=${gccStdenv.cc.targetPrefix}g++ \
+ CPP=${gccStdenv.cc.targetPrefix}cpp \
+ CXXCPP=${gccStdenv.cc.targetPrefix}cpp \
+ LD=${gccStdenv.cc.targetPrefix}ld \
XMKMF=${coreutils}/bin/false
unset CFLAGS LDFLAGS LIBS CPPFLAGS CXXFLAGS
@@ -76,22 +77,23 @@ gccStdenv.mkDerivation rec {
# OS-specific paths are hardcoded in ./configure
substituteInPlace config.status \
- --replace /usr/local/opt/openssl/lib "${openssl.out}/lib" \
- --replace /usr/local/opt/openssl@1.1/lib "${openssl.out}/lib"
+ --replace "/usr/local/opt/openssl@1.1" "${openssl.out}" \
+ --replace "/usr/local/opt/openssl" "${openssl.out}"
+
./config.status
'';
buildPhase = ''
# Make bootstrap compiler, from release bootstrap
- mkdir -p boot &&
- cp -rp ${bootstrap}/gambit/. boot/. &&
- chmod -R u+w boot &&
- cd boot &&
- cp ../gsc/makefile.in ../gsc/*.scm gsc/ && # */
- ./configure &&
- for i in lib gsi gsc ; do (cd $i ; make -j$NIX_BUILD_CORES) ; done &&
- cd .. &&
- cp boot/gsc/gsc gsc-boot &&
+ mkdir -p boot
+ cp -rp ${bootstrap}/gambit/. boot/.
+ chmod -R u+w boot
+ cd boot
+ cp ../gsc/makefile.in ../gsc/*.scm gsc/
+ ./configure
+ for i in lib gsi gsc ; do (cd $i ; make -j$NIX_BUILD_CORES) ; done
+ cd ..
+ cp boot/gsc/gsc gsc-boot
# Now use the bootstrap compiler to build the real thing!
make -j$NIX_BUILD_CORES from-scratch