diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix index 9481078fd941..33391c156969 100644 --- a/pkgs/development/compilers/gambit/build.nix +++ b/pkgs/development/compilers/gambit/build.nix @@ -1,6 +1,11 @@ -{ gccStdenv, lib, git, openssl, autoconf, pkgs, makeStaticLibraries, gcc, coreutils, gnused, gnugrep, - src, version, git-version, stampYmd ? 0, stampHms ? 0, - gambit-support, optimizationSetting ? "-O1", gambit-params ? pkgs.gambit-support.stable-params }: +{ gccStdenv, lib, pkgs, + git, openssl, autoconf, gcc, coreutils, gnused, gnugrep, + makeStaticLibraries, + src, version, git-version, + stampYmd ? 0, stampHms ? 0, + gambit-support, + optimizationSetting ? "-O1", + gambit-params ? pkgs.gambit-support.stable-params }: # Note that according to a benchmark run by Marc Feeley on May 2018, # clang is 10x (with default settings) to 15% (with -O2) slower than GCC at compiling @@ -45,6 +50,7 @@ gccStdenv.mkDerivation rec { "--enable-shared" "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it. "--enable-openssl" + "--enable-dynamic-clib" #"--enable-default-compile-options='(compactness 9)'" # Make life easier on the JS backend "--enable-default-runtime-options=${gambit-params.defaultRuntimeOptions}" # "--enable-rtlib-debug" # used by Geiser, but only on recent-enough gambit, and messes js runtime @@ -62,6 +68,7 @@ gccStdenv.mkDerivation rec { # "--enable-coverage" # "--enable-inline-jumps" # "--enable-char-size=1" # default is 4 + # "--enable-march=native" # Nope, makes it not work on machines older than the builder ] ++ gambit-params.extraOptions # Do not enable poll on darwin due to https://github.com/gambit/gambit/issues/498 ++ lib.optional (!gccStdenv.isDarwin) "--enable-poll"; diff --git a/pkgs/development/compilers/gambit/gambit-support.nix b/pkgs/development/compilers/gambit/gambit-support.nix index f78c99a50700..6e42b9252f24 100644 --- a/pkgs/development/compilers/gambit/gambit-support.nix +++ b/pkgs/development/compilers/gambit/gambit-support.nix @@ -16,12 +16,13 @@ rec { --replace "echo > stamp.h;" "(echo '#define ___STAMP_VERSION \"${git-version}\"'; echo '#define ___STAMP_YMD ${toString stampYmd}'; echo '#define ___STAMP_HMS ${toString stampHms}';) > stamp.h;"; ''; modules = true; - extraOptions = []; + #extraOptions = []; + extraOptions = ["--enable-trust-c-tco" "CFLAGS=-foptimize-sibling-calls"]; }; unstable-params = stable-params // { stable = false; - extraOptions = ["--enable-trust-c-tco"]; + extraOptions = ["--enable-trust-c-tco"]; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable }; export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;"; diff --git a/pkgs/development/compilers/gambit/unstable.nix b/pkgs/development/compilers/gambit/unstable.nix index 26761d67d35d..092cbdb72483 100644 --- a/pkgs/development/compilers/gambit/unstable.nix +++ b/pkgs/development/compilers/gambit/unstable.nix @@ -1,15 +1,15 @@ { callPackage, fetchFromGitHub, gambit-support }: callPackage ./build.nix { - version = "unstable-2023-07-30"; - git-version = "4.9.5-3-ge059fffd"; - stampYmd = 20230730; - stampHms = 151945; + version = "unstable-2023-08-06"; + git-version = "4.9.5-5-gf1fbe9aa"; + stampYmd = 20230806; + stampHms = 195822; src = fetchFromGitHub { owner = "gambit"; repo = "gambit"; - rev = "e059fffdfbd91e27c350ff2ebd671adefadd5212"; - sha256 = "0q7hdfchl6lw53xawmmjvhyjdmqxjdsnzjqv9vpkl2qa4vyir5fs"; + rev = "f1fbe9aa0f461e89f2a91bc050c1373ee6d66482"; + sha256 = "0b0gd6cwj8zxwcqglpsnmanysiq4mvma2mrgdfr6qy99avhbhzxm"; }; gambit-params = gambit-support.unstable-params; } diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix index 110378244fd0..227f11b7c584 100644 --- a/pkgs/development/compilers/gerbil/build.nix +++ b/pkgs/development/compilers/gerbil/build.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { grep -Fl '#!/usr/bin/env' `find . -type f -executable` | while read f ; do substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env' ; done ; -''; + ''; ## TODO: make static compilation work. ## For that, get all the packages below to somehow expose static libraries, @@ -92,8 +92,8 @@ stdenv.mkDerivation rec { meta = { description = "Gerbil Scheme"; homepage = "https://github.com/vyzo/gerbil"; - license = lib.licenses.lgpl21; # also asl20, like Gambit - # NB regarding platforms: regularly tested on Linux, only occasionally on macOS. + license = lib.licenses.lgpl21Only; # dual, also asl20, like Gambit + # NB regarding platforms: regularly tested on Linux and on macOS. # Please report success and/or failure to fare. platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ fare ]; diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix index 3367ae581b2e..eeafde520de9 100644 --- a/pkgs/development/compilers/gerbil/default.nix +++ b/pkgs/development/compilers/gerbil/default.nix @@ -1,12 +1,12 @@ { callPackage, fetchFromGitHub }: callPackage ./build.nix rec { - version = "0.16"; + version = "0.17"; git-version = version; src = fetchFromGitHub { owner = "vyzo"; repo = "gerbil"; rev = "v${version}"; - sha256 = "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f"; + sha256 = "0xzi9mhrmzcajhlz5qcnz4yjlljvbkbm9426iifgjn47ac0965zw"; }; } diff --git a/pkgs/development/compilers/gerbil/ftw.nix b/pkgs/development/compilers/gerbil/ftw.nix new file mode 100644 index 000000000000..2f2c9956826d --- /dev/null +++ b/pkgs/development/compilers/gerbil/ftw.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, gerbilPackages, ... }: + +{ + pname = "ftw"; + version = "unstable-2022-01-14"; + git-version = "8ba16b3"; + softwareName = "FTW: For The Web!"; + gerbil-package = "drewc/ftw"; + + gerbilInputs = with gerbilPackages; [ gerbil-utils ]; + + pre-src = { + fun = fetchFromGitHub; + owner = "drewc"; + repo = "ftw"; + rev = "8ba16b3c1cdc2150df5af8ef3c92040ef8b563b9"; + sha256 = "153i6whm5jfcj9s1qpxz03sq67969lq11brssyjc3yv3wyb1b07h"; + }; + + meta = with lib; { + description = "Simple web handlers for Gerbil Scheme"; + homepage = "https://github.com/drewc/ftw"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ fare ]; + }; +} diff --git a/pkgs/development/compilers/gerbil/gerbil-crypto.nix b/pkgs/development/compilers/gerbil/gerbil-crypto.nix index 38943471a376..3d53c4da879e 100644 --- a/pkgs/development/compilers/gerbil/gerbil-crypto.nix +++ b/pkgs/development/compilers/gerbil/gerbil-crypto.nix @@ -1,28 +1,29 @@ -{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: +{ pkgs, lib, fetchFromGitHub, gerbilPackages, ... }: -gerbil-support.gerbilPackage { +{ pname = "gerbil-crypto"; - version = "unstable-2020-08-01"; - git-version = "0.0-6-ga228862"; + version = "unstable-2023-03-27"; + git-version = "0.0-18-ge57f887"; gerbil-package = "clan/crypto"; - gerbil = gerbil-unstable; - gerbilInputs = [gerbil-support.gerbilPackages-unstable.gerbil-utils]; + gerbilInputs = with gerbilPackages; [ gerbil-utils gerbil-poo ]; nativeBuildInputs = [ pkgs.pkg-config ]; - buildInputs = [pkgs.secp256k1 ]; - gambit-params = gambit-support.unstable-params; + buildInputs = [ pkgs.secp256k1 ]; version-path = "version"; softwareName = "Gerbil-crypto"; - src = fetchFromGitHub { + + pre-src = { + fun = fetchFromGitHub; owner = "fare"; repo = "gerbil-crypto"; - rev = "a22886260849ec92c3a34bfeedc1574e41e49e33"; - sha256 = "0qbanw2vnw2ymmr4pr1jap29cyc3icbhyq0apibpfnj2znns7w47"; + rev = "e57f88742d9b41640b4a7d9bd3e86c688d4a83f9"; + sha256 = "08hrk3s82hbigvza75vgx9kc7qf64yhhn3xm5calc859sy6ai4ka"; }; - meta = { + + meta = with lib; { description = "Gerbil Crypto: Extra Cryptographic Primitives for Gerbil"; homepage = "https://github.com/fare/gerbil-crypto"; - license = lib.licenses.asl20; - platforms = lib.platforms.unix; - maintainers = with lib.maintainers; [ fare ]; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ fare ]; }; } diff --git a/pkgs/development/compilers/gerbil/gerbil-ethereum.nix b/pkgs/development/compilers/gerbil/gerbil-ethereum.nix index e498818d2e61..d2d95284f09d 100644 --- a/pkgs/development/compilers/gerbil/gerbil-ethereum.nix +++ b/pkgs/development/compilers/gerbil/gerbil-ethereum.nix @@ -1,28 +1,49 @@ -{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: +{ lib, fetchFromGitHub, gerbilPackages, gerbil-support, gerbil, ... }: -gerbil-support.gerbilPackage { +rec { pname = "gerbil-ethereum"; - version = "unstable-2020-10-18"; - git-version = "0.0-26-gf27ada8"; - gerbil-package = "mukn/ethereum"; - gerbil = gerbil-unstable; - gerbilInputs = with gerbil-support.gerbilPackages-unstable; - [gerbil-utils gerbil-crypto gerbil-poo gerbil-persist]; - buildInputs = []; - gambit-params = gambit-support.unstable-params; - version-path = "version"; + version = "unstable-2023-05-30"; + git-version = "0.0-375-g989a5ca"; softwareName = "Gerbil-ethereum"; - src = fetchFromGitHub { + gerbil-package = "mukn/ethereum"; + version-path = "version"; + + gerbilInputs = with gerbilPackages; [ gerbil-utils gerbil-crypto gerbil-poo gerbil-persist ]; + + pre-src = { + fun = fetchFromGitHub; owner = "fare"; repo = "gerbil-ethereum"; - rev = "f27ada8e7f4de4f8fbdfede9fe055914b254d8e7"; - sha256 = "1lykjqim6a44whj1r8kkpiz68wghkfqx5vjlrc2ldxlmgd4r9gvd"; + rev = "989a5ca78958e42c4a1ec242786ade89f1887e48"; + sha256 = "0bs2knhx3hy3k72yidgaplwjd48y86arqscdik8hgxwmhm9z8kwp"; }; - meta = { + + postInstall = '' + cp scripts/{croesus.prv,genesis.json,logback.xml,yolo-evm.conf,yolo-kevm.conf,run-ethereum-test-net.ss} $out/gerbil/lib/mukn/ethereum/scripts/ + mkdir -p $out/bin + cat > $out/bin/run-ethereum-test-net < "${passthru.version-path}.ss" - fi + })\n(register-software "${softwareName}" "v${git-version}")\n' > "${version-path}.ss"''} patchShebangs . ; ''; postConfigure = '' export GERBIL_BUILD_CORES=$NIX_BUILD_CORES export GERBIL_PATH=$PWD/.build - export GERBIL_LOADPATH=${gerbilLoadPath gerbilInputs} + export GERBIL_LOADPATH=${gerbilLoadPath (["$out"] ++ gerbilInputs)} ${pkgs.gambit-support.export-gambopt gambit-params} ''; @@ -60,18 +118,36 @@ rec { installPhase = '' runHook preInstall - mkdir -p $out/gerbil/lib - cp -fa .build/lib $out/gerbil/ - bins=(.build/bin/*) - if [ 0 -lt ''${#bins} ] ; then - cp -fa .build/bin $out/gerbil/ - mkdir $out/bin - cd $out/bin - ln -s ../gerbil/bin/* . + mkdir -p $out/gerbil + cp -fa .build/* $out/gerbil/ + if [[ -d $out/gerbil/bin ]] ; then + ( cd $out/gerbil + bins=$(find ../gerbil/bin -type f) + if [[ -n $bins ]] ; then + ( mkdir -p ../bin + cd .. + ln -s $bins bin + ) + fi + ) fi runHook postInstall ''; dontFixup = true; + + checkPhase = '' + runHook preCheck + if [[ -f unit-tests.ss ]] ; then + export GERBIL_APPLICATION_HOME=$PWD + ./unit-tests.ss version + ./unit-tests.ss + else + echo "No gerbil-utils style unit-tests.ss detected for ${pname} ${version}."; + fi + runHook postCheck + ''; + + doCheck = true; }; } diff --git a/pkgs/development/compilers/gerbil/gerbil-utils.nix b/pkgs/development/compilers/gerbil/gerbil-utils.nix index 6d89e1181f2d..4e7042fe4f3c 100644 --- a/pkgs/development/compilers/gerbil/gerbil-utils.nix +++ b/pkgs/development/compilers/gerbil/gerbil-utils.nix @@ -1,25 +1,26 @@ -{ lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: +{ lib, fetchFromGitHub, ... }: -gerbil-support.gerbilPackage { +{ pname = "gerbil-utils"; - version = "unstable-2020-10-18"; - git-version = "0.2-36-g8b481b7"; - gerbil-package = "clan"; - gerbil = gerbil-unstable; - gambit-params = gambit-support.unstable-params; - version-path = "version"; + version = "unstable-2023-07-22"; + git-version = "0.2-198-g2fb01ce"; softwareName = "Gerbil-utils"; - src = fetchFromGitHub { + gerbil-package = "clan"; + version-path = "version"; + + pre-src = { + fun = fetchFromGitHub; owner = "fare"; repo = "gerbil-utils"; - rev = "8b481b787e13e07e14d0718d670aab016131a090"; - sha256 = "0br8k5b2wcv4wcp65r2bfhji3af2qgqjspf41syqslq9awx47f3m"; + rev = "2fb01ce0b302f232f5c4daf4987457b6357d609d"; + sha256 = "127q98gk1x6y1nlkkpnbnkz989ybpszy7aiy43hzai2q6xn4nv72"; }; - meta = { + + meta = with lib; { description = "Gerbil Clan: Community curated Collection of Common Utilities"; homepage = "https://github.com/fare/gerbil-utils"; - license = lib.licenses.lgpl21; - platforms = lib.platforms.unix; - maintainers = with lib.maintainers; [ fare ]; + license = licenses.lgpl21; + platforms = platforms.unix; + maintainers = with maintainers; [ fare ]; }; } diff --git a/pkgs/development/compilers/gerbil/glow-lang.nix b/pkgs/development/compilers/gerbil/glow-lang.nix new file mode 100644 index 000000000000..c6e5aa10fa3a --- /dev/null +++ b/pkgs/development/compilers/gerbil/glow-lang.nix @@ -0,0 +1,55 @@ +{ lib, fetchFromGitHub, gerbil-support, gerbilPackages, gerbil, ... }: + +rec { + pname = "glow-lang"; + version = "unstable-2023-04-26"; + git-version = "0.3.2-222-gb19cd980"; + softwareName = "Glow"; + gerbil-package = "mukn/glow"; + version-path = "version"; + + gerbilInputs = with gerbilPackages; + [ gerbil-utils gerbil-crypto gerbil-poo gerbil-persist gerbil-ethereum + gerbil-libp2p smug-gerbil ftw ]; + + pre-src = { + fun = fetchFromGitHub; + owner = "Glow-Lang"; + repo = "glow"; + rev = "b19cd98082dfc5156d1b4fc83cde161572d6a211"; + sha256 = "0k3qy5826pxqr9ylnnpq4iikxf4j50987vhpa5qiv99j0p643xr3"; + }; + + postPatch = '' + substituteInPlace "runtime/glow-path.ss" --replace \ + '(def glow-install-path (source-path "dapps"))' \ + '(def glow-install-path "$out")' + ''; + + postInstall = '' + mkdir -p $out/bin $out/gerbil/lib/mukn/glow $out/share/glow/dapps + cp main.ss $out/gerbil/lib/mukn/glow/ + cp dapps/{buy_sig,coin_flip,rps_simple}.glow $out/share/glow/dapps/ + cat > $out/bin/glow <