diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix new file mode 100644 index 000000000000..5609de15d4cb --- /dev/null +++ b/pkgs/development/compilers/gerbil/build.nix @@ -0,0 +1,88 @@ +{ stdenv, lib, makeStaticLibraries, + coreutils, rsync, bash, + openssl, zlib, sqlite, libxml2, libyaml, mysql, lmdb, leveldb, postgresql, + version, git-version, GAMBIT, SRC }: + +# TODO: distinct packages for gerbil-release and gerbil-devel +# TODO: make static compilation work + +stdenv.mkDerivation rec { + name = "gerbil-${version}"; + src = SRC; + + # Use makeStaticLibraries to enable creation of statically linked binaries + buildInputs_libraries = [ openssl zlib sqlite libxml2 libyaml mysql.connector-c lmdb leveldb postgresql ]; + buildInputs_staticLibraries = map makeStaticLibraries buildInputs_libraries; + + buildInputs = [ GAMBIT coreutils rsync bash ] + ++ buildInputs_libraries ++ buildInputs_staticLibraries; + + NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ]; + + postPatch = '' + echo '(define (gerbil-version-string) "v${git-version}")' > src/gerbil/runtime/gx-version.scm + + patchShebangs . + + find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do + substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env' + done + + cat > etc/gerbil_static_libraries.sh < $out/bin/gxi < src/gerbil/runtime/gx-version.scm - - patchShebangs . - - find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do - substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env' - done - - cat > etc/gerbil_static_libraries.sh < $out/bin/gxi <