From d50469adc7ebbde95f808eee5e44f8466ec11192 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau Date: Mon, 26 Mar 2018 23:44:13 -0400 Subject: [PATCH] gambit-unstable: init at 2018-03-26 --- pkgs/development/compilers/gambit/build.nix | 70 ++++++++++++++++++ pkgs/development/compilers/gambit/default.nix | 72 ++----------------- .../development/compilers/gambit/unstable.nix | 11 +++ pkgs/top-level/all-packages.nix | 1 + 4 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 pkgs/development/compilers/gambit/build.nix create mode 100644 pkgs/development/compilers/gambit/unstable.nix diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix new file mode 100644 index 000000000000..202e55254222 --- /dev/null +++ b/pkgs/development/compilers/gambit/build.nix @@ -0,0 +1,70 @@ +{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, git-version, SRC }: + +stdenv.mkDerivation rec { + name = "gambit-${version}"; + src = SRC; + + bootstrap = import ./bootstrap.nix ( pkgs ); + + # Use makeStaticLibraries to enable creation of statically linked binaries + buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)]; + + configurePhase = '' + options=( + --prefix=$out + --enable-single-host + --enable-c-opt=-O2 + --enable-gcc-opts + --enable-shared + --enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it. + --enable-poll + --enable-openssl + --enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O + #--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log + + #--enable-multiple-versions # Nope, NixOS already does version multiplexing + #--enable-guide + #--enable-track-scheme + #--enable-high-res-timing + #--enable-max-processors=4 + #--enable-multiple-vms + #--enable-dynamic-tls + #--enable-multiple-vms + #--enable-multiple-threaded-vms ## when SMP branch is merged in + #--enable-thread-system=posix ## default when --enable-multiple-vms is on. + #--enable-profile + #--enable-coverage + #--enable-inline-jumps + #--enable-char-size=1" ; default is 4 + ) + ./configure ''${options[@]} + ''; + + buildPhase = '' + # Make bootstrap compiler, from release bootstrap + mkdir -p boot && + cp -rp ${bootstrap}/. 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 ) ; done && + cd .. && + cp boot/gsc/gsc gsc-boot && + + # Now use the bootstrap compiler to build the real thing! + make -j2 from-scratch + ''; + + doCheck = true; + + meta = { + description = "Optimizing Scheme to C compiler"; + homepage = "http://gambitscheme.org"; + license = stdenv.lib.licenses.lgpl2; + # NB regarding platforms: only actually tested on Linux, *should* work everywhere, + # but *might* need adaptation e.g. on macOS. + platforms = stdenv.lib.platforms.unix; + maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ]; + }; +} diff --git a/pkgs/development/compilers/gambit/default.nix b/pkgs/development/compilers/gambit/default.nix index 83e02b14708d..0996d0c3078a 100644 --- a/pkgs/development/compilers/gambit/default.nix +++ b/pkgs/development/compilers/gambit/default.nix @@ -1,75 +1,13 @@ -{ stdenv, fetchurl, fetchgit, git, openssl, autoconf, pkgs, makeStaticLibraries }: +{ callPackage, fetchgit }: -# TODO: distinct packages for gambit-release and gambit-devel - -stdenv.mkDerivation rec { - name = "gambit-${version}"; +callPackage ./build.nix { version = "4.8.9"; - bootstrap = import ./bootstrap.nix ( pkgs ); + # TODO: for next version, prefer the unpatched tarball for the stable/default gambit. + git-version = "4.8.9-8-g793679bd"; - src = fetchgit { + SRC = fetchgit { url = "https://github.com/feeley/gambit.git"; rev = "dd54a71dfc0bd09813592f1645d755867a02195d"; sha256 = "120kg73k39gshrwas8a3xcrxgnq1c7ww92wgy4d3mmrwy3j9nzzc"; }; - - # Use makeStaticLibraries to enable creation of statically linked binaries - buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)]; - - configurePhase = '' - options=( - --prefix=$out - --enable-single-host - --enable-c-opt=-O2 - --enable-gcc-opts - --enable-shared - --enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it. - --enable-poll - --enable-openssl - --enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O - #--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log - - #--enable-multiple-versions # Nope, NixOS already does version multiplexing - #--enable-guide - #--enable-track-scheme - #--enable-high-res-timing - #--enable-max-processors=4 - #--enable-multiple-vms - #--enable-dynamic-tls - #--enable-multiple-vms - #--enable-multiple-threaded-vms ## when SMP branch is merged in - #--enable-thread-system=posix ## default when --enable-multiple-vms is on. - #--enable-profile - #--enable-coverage - #--enable-inline-jumps - #--enable-char-size=1" ; default is 4 - ) - ./configure ''${options[@]} - ''; - - buildPhase = '' - # Make bootstrap compiler, from release bootstrap - mkdir -p boot && - cp -rp ${bootstrap}/. 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 ) ; done && - cd .. && - cp boot/gsc/gsc gsc-boot && - - # Now use the bootstrap compiler to build the real thing! - make -j2 from-scratch - ''; - - doCheck = true; - - meta = { - description = "Optimizing Scheme to C compiler"; - homepage = "http://gambitscheme.org"; - license = stdenv.lib.licenses.lgpl2; - platforms = stdenv.lib.platforms.unix; - maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ]; - }; } diff --git a/pkgs/development/compilers/gambit/unstable.nix b/pkgs/development/compilers/gambit/unstable.nix new file mode 100644 index 000000000000..f98fd5ca935a --- /dev/null +++ b/pkgs/development/compilers/gambit/unstable.nix @@ -0,0 +1,11 @@ +{ callPackage, fetchgit }: + +callPackage ./build.nix { + version = "unstable-2018-03-26"; + git-version = "4.8.9-8-g793679bd"; + SRC = fetchgit { + url = "https://github.com/feeley/gambit.git"; + rev = "793679bd57eb6275cb06e6570b05f4a78df61bf9"; + sha256 = "0bippvmrc8vcaa6ka3mhzfgkagb6a1616g7nxk0i0wapxai5cngj"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 490f3b3f45bb..8b8b9fdb1c95 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5966,6 +5966,7 @@ with pkgs; fpc = callPackage ../development/compilers/fpc { }; gambit = callPackage ../development/compilers/gambit { }; + gambit-unstable = callPackage ../development/compilers/gambit/unstable.nix { }; gerbil = callPackage ../development/compilers/gerbil { }; gccFun = callPackage ../development/compilers/gcc/7;