Merge pull request #247840 from MuKnIO/alpha

Update Gambit, Gerbil, Glow

authored by 7c6f434c and committed by GitHub 55e89d57 e74fa540

+366 -180
+10 -3
pkgs/development/compilers/gambit/build.nix
··· 1 - { gccStdenv, lib, git, openssl, autoconf, pkgs, makeStaticLibraries, gcc, coreutils, gnused, gnugrep, 2 - src, version, git-version, stampYmd ? 0, stampHms ? 0, 3 - gambit-support, optimizationSetting ? "-O1", gambit-params ? pkgs.gambit-support.stable-params }: 1 + { gccStdenv, lib, pkgs, 2 + git, openssl, autoconf, gcc, coreutils, gnused, gnugrep, 3 + makeStaticLibraries, 4 + src, version, git-version, 5 + stampYmd ? 0, stampHms ? 0, 6 + gambit-support, 7 + optimizationSetting ? "-O1", 8 + gambit-params ? pkgs.gambit-support.stable-params }: 4 9 5 10 # Note that according to a benchmark run by Marc Feeley on May 2018, 6 11 # clang is 10x (with default settings) to 15% (with -O2) slower than GCC at compiling ··· 45 50 "--enable-shared" 46 51 "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it. 47 52 "--enable-openssl" 53 + "--enable-dynamic-clib" 48 54 #"--enable-default-compile-options='(compactness 9)'" # Make life easier on the JS backend 49 55 "--enable-default-runtime-options=${gambit-params.defaultRuntimeOptions}" 50 56 # "--enable-rtlib-debug" # used by Geiser, but only on recent-enough gambit, and messes js runtime ··· 62 68 # "--enable-coverage" 63 69 # "--enable-inline-jumps" 64 70 # "--enable-char-size=1" # default is 4 71 + # "--enable-march=native" # Nope, makes it not work on machines older than the builder 65 72 ] ++ gambit-params.extraOptions 66 73 # Do not enable poll on darwin due to https://github.com/gambit/gambit/issues/498 67 74 ++ lib.optional (!gccStdenv.isDarwin) "--enable-poll";
+3 -2
pkgs/development/compilers/gambit/gambit-support.nix
··· 16 16 --replace "echo > stamp.h;" "(echo '#define ___STAMP_VERSION \"${git-version}\"'; echo '#define ___STAMP_YMD ${toString stampYmd}'; echo '#define ___STAMP_HMS ${toString stampHms}';) > stamp.h;"; 17 17 ''; 18 18 modules = true; 19 - extraOptions = []; 19 + #extraOptions = []; 20 + extraOptions = ["--enable-trust-c-tco" "CFLAGS=-foptimize-sibling-calls"]; 20 21 }; 21 22 22 23 unstable-params = stable-params // { 23 24 stable = false; 24 - extraOptions = ["--enable-trust-c-tco"]; 25 + extraOptions = ["--enable-trust-c-tco"]; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable 25 26 }; 26 27 27 28 export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;";
+6 -6
pkgs/development/compilers/gambit/unstable.nix
··· 1 1 { callPackage, fetchFromGitHub, gambit-support }: 2 2 3 3 callPackage ./build.nix { 4 - version = "unstable-2023-07-30"; 5 - git-version = "4.9.5-3-ge059fffd"; 6 - stampYmd = 20230730; 7 - stampHms = 151945; 4 + version = "unstable-2023-08-06"; 5 + git-version = "4.9.5-5-gf1fbe9aa"; 6 + stampYmd = 20230806; 7 + stampHms = 195822; 8 8 src = fetchFromGitHub { 9 9 owner = "gambit"; 10 10 repo = "gambit"; 11 - rev = "e059fffdfbd91e27c350ff2ebd671adefadd5212"; 12 - sha256 = "0q7hdfchl6lw53xawmmjvhyjdmqxjdsnzjqv9vpkl2qa4vyir5fs"; 11 + rev = "f1fbe9aa0f461e89f2a91bc050c1373ee6d66482"; 12 + sha256 = "0b0gd6cwj8zxwcqglpsnmanysiq4mvma2mrgdfr6qy99avhbhzxm"; 13 13 }; 14 14 gambit-params = gambit-support.unstable-params; 15 15 }
+3 -3
pkgs/development/compilers/gerbil/build.nix
··· 29 29 grep -Fl '#!/usr/bin/env' `find . -type f -executable` | while read f ; do 30 30 substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env' ; 31 31 done ; 32 - ''; 32 + ''; 33 33 34 34 ## TODO: make static compilation work. 35 35 ## For that, get all the packages below to somehow expose static libraries, ··· 92 92 meta = { 93 93 description = "Gerbil Scheme"; 94 94 homepage = "https://github.com/vyzo/gerbil"; 95 - license = lib.licenses.lgpl21; # also asl20, like Gambit 96 - # NB regarding platforms: regularly tested on Linux, only occasionally on macOS. 95 + license = lib.licenses.lgpl21Only; # dual, also asl20, like Gambit 96 + # NB regarding platforms: regularly tested on Linux and on macOS. 97 97 # Please report success and/or failure to fare. 98 98 platforms = lib.platforms.unix; 99 99 maintainers = with lib.maintainers; [ fare ];
+2 -2
pkgs/development/compilers/gerbil/default.nix
··· 1 1 { callPackage, fetchFromGitHub }: 2 2 3 3 callPackage ./build.nix rec { 4 - version = "0.16"; 4 + version = "0.17"; 5 5 git-version = version; 6 6 src = fetchFromGitHub { 7 7 owner = "vyzo"; 8 8 repo = "gerbil"; 9 9 rev = "v${version}"; 10 - sha256 = "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f"; 10 + sha256 = "0xzi9mhrmzcajhlz5qcnz4yjlljvbkbm9426iifgjn47ac0965zw"; 11 11 }; 12 12 }
+27
pkgs/development/compilers/gerbil/ftw.nix
··· 1 + { lib, fetchFromGitHub, gerbilPackages, ... }: 2 + 3 + { 4 + pname = "ftw"; 5 + version = "unstable-2022-01-14"; 6 + git-version = "8ba16b3"; 7 + softwareName = "FTW: For The Web!"; 8 + gerbil-package = "drewc/ftw"; 9 + 10 + gerbilInputs = with gerbilPackages; [ gerbil-utils ]; 11 + 12 + pre-src = { 13 + fun = fetchFromGitHub; 14 + owner = "drewc"; 15 + repo = "ftw"; 16 + rev = "8ba16b3c1cdc2150df5af8ef3c92040ef8b563b9"; 17 + sha256 = "153i6whm5jfcj9s1qpxz03sq67969lq11brssyjc3yv3wyb1b07h"; 18 + }; 19 + 20 + meta = with lib; { 21 + description = "Simple web handlers for Gerbil Scheme"; 22 + homepage = "https://github.com/drewc/ftw"; 23 + license = licenses.mit; 24 + platforms = platforms.unix; 25 + maintainers = with maintainers; [ fare ]; 26 + }; 27 + }
+16 -15
pkgs/development/compilers/gerbil/gerbil-crypto.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { pkgs, lib, fetchFromGitHub, gerbilPackages, ... }: 2 2 3 - gerbil-support.gerbilPackage { 3 + { 4 4 pname = "gerbil-crypto"; 5 - version = "unstable-2020-08-01"; 6 - git-version = "0.0-6-ga228862"; 5 + version = "unstable-2023-03-27"; 6 + git-version = "0.0-18-ge57f887"; 7 7 gerbil-package = "clan/crypto"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = [gerbil-support.gerbilPackages-unstable.gerbil-utils]; 8 + gerbilInputs = with gerbilPackages; [ gerbil-utils gerbil-poo ]; 10 9 nativeBuildInputs = [ pkgs.pkg-config ]; 11 - buildInputs = [pkgs.secp256k1 ]; 12 - gambit-params = gambit-support.unstable-params; 10 + buildInputs = [ pkgs.secp256k1 ]; 13 11 version-path = "version"; 14 12 softwareName = "Gerbil-crypto"; 15 - src = fetchFromGitHub { 13 + 14 + pre-src = { 15 + fun = fetchFromGitHub; 16 16 owner = "fare"; 17 17 repo = "gerbil-crypto"; 18 - rev = "a22886260849ec92c3a34bfeedc1574e41e49e33"; 19 - sha256 = "0qbanw2vnw2ymmr4pr1jap29cyc3icbhyq0apibpfnj2znns7w47"; 18 + rev = "e57f88742d9b41640b4a7d9bd3e86c688d4a83f9"; 19 + sha256 = "08hrk3s82hbigvza75vgx9kc7qf64yhhn3xm5calc859sy6ai4ka"; 20 20 }; 21 - meta = { 21 + 22 + meta = with lib; { 22 23 description = "Gerbil Crypto: Extra Cryptographic Primitives for Gerbil"; 23 24 homepage = "https://github.com/fare/gerbil-crypto"; 24 - license = lib.licenses.asl20; 25 - platforms = lib.platforms.unix; 26 - maintainers = with lib.maintainers; [ fare ]; 25 + license = licenses.asl20; 26 + platforms = platforms.unix; 27 + maintainers = with maintainers; [ fare ]; 27 28 }; 28 29 }
+38 -17
pkgs/development/compilers/gerbil/gerbil-ethereum.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { lib, fetchFromGitHub, gerbilPackages, gerbil-support, gerbil, ... }: 2 2 3 - gerbil-support.gerbilPackage { 3 + rec { 4 4 pname = "gerbil-ethereum"; 5 - version = "unstable-2020-10-18"; 6 - git-version = "0.0-26-gf27ada8"; 5 + version = "unstable-2023-05-30"; 6 + git-version = "0.0-375-g989a5ca"; 7 + softwareName = "Gerbil-ethereum"; 7 8 gerbil-package = "mukn/ethereum"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = with gerbil-support.gerbilPackages-unstable; 10 - [gerbil-utils gerbil-crypto gerbil-poo gerbil-persist]; 11 - buildInputs = []; 12 - gambit-params = gambit-support.unstable-params; 13 9 version-path = "version"; 14 - softwareName = "Gerbil-ethereum"; 15 - src = fetchFromGitHub { 10 + 11 + gerbilInputs = with gerbilPackages; [ gerbil-utils gerbil-crypto gerbil-poo gerbil-persist ]; 12 + 13 + pre-src = { 14 + fun = fetchFromGitHub; 16 15 owner = "fare"; 17 16 repo = "gerbil-ethereum"; 18 - rev = "f27ada8e7f4de4f8fbdfede9fe055914b254d8e7"; 19 - sha256 = "1lykjqim6a44whj1r8kkpiz68wghkfqx5vjlrc2ldxlmgd4r9gvd"; 17 + rev = "989a5ca78958e42c4a1ec242786ade89f1887e48"; 18 + sha256 = "0bs2knhx3hy3k72yidgaplwjd48y86arqscdik8hgxwmhm9z8kwp"; 20 19 }; 21 - meta = { 20 + 21 + postInstall = '' 22 + 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/ 23 + mkdir -p $out/bin 24 + cat > $out/bin/run-ethereum-test-net <<EOF 25 + #!/bin/sh 26 + #| 27 + ORIG_GERBIL_LOADPATH="\$GERBIL_LOADPATH" 28 + ORIG_GERBIL_PATH="\$GERBIL_PATH" 29 + ORIG_GERBIL_HOME="\$GERBIL_HOME" 30 + unset GERBIL_HOME 31 + GERBIL_LOADPATH="${gerbil-support.gerbilLoadPath (["$out"] ++ gerbilInputs)}" 32 + GERBIL_PATH="\$HOME/.cache/gerbil-ethereum/gerbil" 33 + export GERBIL_PATH GERBIL_LOADPATH GLOW_SOURCE ORIG_GERBIL_PATH ORIG_GERBIL_LOADPATH 34 + exec ${gerbil}/bin/gxi "\$0" "\$@" 35 + |# 36 + (import :mukn/ethereum/scripts/run-ethereum-test-net :clan/multicall) 37 + (apply call-entry-point (cdr (command-line))) 38 + EOF 39 + chmod a+x $out/bin/run-ethereum-test-net 40 + ''; 41 + 42 + meta = with lib; { 22 43 description = "Gerbil Ethereum: a Scheme alternative to web3.js"; 23 44 homepage = "https://github.com/fare/gerbil-ethereum"; 24 - license = lib.licenses.asl20; 25 - platforms = lib.platforms.unix; 26 - maintainers = with lib.maintainers; [ fare ]; 45 + license = licenses.asl20; 46 + platforms = platforms.unix; 47 + maintainers = with maintainers; [ fare ]; 27 48 }; 28 49 }
+17 -17
pkgs/development/compilers/gerbil/gerbil-libp2p.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { lib, fetchFromGitHub, ... }: 2 2 3 - gerbil-support.gerbilPackage { 3 + { 4 4 pname = "gerbil-libp2p"; 5 - version = "unstable-2018-12-27"; 6 - git-version = "2376b3f"; 5 + version = "unstable-2022-02-03"; 6 + git-version = "15b3246"; 7 + softwareName = "Gerbil-libp2p"; 7 8 gerbil-package = "vyzo"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = []; 10 - buildInputs = []; # Note: at *runtime*, depends on go-libp2p-daemon 11 - gambit-params = gambit-support.unstable-params; 12 - version-path = "version"; 13 - softwareName = "Gerbil-libp2p"; 14 - src = fetchFromGitHub { 9 + 10 + buildInputs = []; # Note: at *runtime*, this depends on go-libp2p-daemon running 11 + 12 + pre-src = { 13 + fun = fetchFromGitHub; 15 14 owner = "vyzo"; 16 15 repo = "gerbil-libp2p"; 17 - rev = "2376b3f39cee04dd4ec455c8ea4e5faa93c2bf88"; 18 - sha256 = "0jcy7hfg953078msigyfwp2g4ii44pi6q7vcpmq01cbbvxpxz6zw"; 16 + rev = "15b32462e683d89ffce0ff15ad373d293ea0ee5d"; 17 + sha256 = "059lydp7d6pjgrd4pdnqq2zffzlba62ch102f01rgzf9aps3c8lz"; 19 18 }; 20 - meta = { 19 + 20 + meta = with lib; { 21 21 description = "Gerbil libp2p: use libp2p from Gerbil"; 22 22 homepage = "https://github.com/vyzo/gerbil-libp2p"; 23 - license = lib.licenses.mit; 24 - platforms = lib.platforms.unix; 25 - maintainers = with lib.maintainers; [ fare ]; 23 + license = licenses.mit; 24 + platforms = platforms.unix; 25 + maintainers = with maintainers; [ fare ]; 26 26 }; 27 27 }
+17 -17
pkgs/development/compilers/gerbil/gerbil-persist.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 2 - 3 - gerbil-support.gerbilPackage { 1 + { lib, fetchFromGitHub, gerbilPackages, ... }: 2 + { 4 3 pname = "gerbil-persist"; 5 - version = "unstable-2020-08-31"; 6 - git-version = "0.0-8-gd211390"; 4 + version = "unstable-2023-03-02"; 5 + git-version = "0.1.0-24-ge2305f5"; 6 + softwareName = "Gerbil-persist"; 7 7 gerbil-package = "clan/persist"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = with gerbil-support.gerbilPackages-unstable; [gerbil-utils gerbil-crypto gerbil-poo]; 10 - buildInputs = []; 11 - gambit-params = gambit-support.unstable-params; 12 8 version-path = "version"; 13 - softwareName = "Gerbil-persist"; 14 - src = fetchFromGitHub { 9 + 10 + gerbilInputs = with gerbilPackages; [ gerbil-utils gerbil-crypto gerbil-poo ]; 11 + 12 + pre-src = { 13 + fun = fetchFromGitHub; 15 14 owner = "fare"; 16 15 repo = "gerbil-persist"; 17 - rev = "d211390c8a199cf2b8c7400cd98977524e960015"; 18 - sha256 = "13s6ws8ziwalfp23nalss41qnz667z2712lr3y123sypm5n5axk7"; 16 + rev = "e2305f53571e55292179286ca2d88e046ec6638b"; 17 + sha256 = "1vsi4rfzpqg4hhn53d2r26iw715vzwz0hiai9r34z4diwzqixfgn"; 19 18 }; 20 - meta = { 19 + 20 + meta = with lib; { 21 21 description = "Gerbil Persist: Persistent data and activities"; 22 22 homepage = "https://github.com/fare/gerbil-persist"; 23 - license = lib.licenses.asl20; 24 - platforms = lib.platforms.unix; 25 - maintainers = with lib.maintainers; [ fare ]; 23 + license = licenses.asl20; 24 + platforms = platforms.unix; 25 + maintainers = with maintainers; [ fare ]; 26 26 }; 27 27 }
+18 -17
pkgs/development/compilers/gerbil/gerbil-poo.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { lib, fetchFromGitHub, gerbilPackages, ... }: 2 2 3 - gerbil-support.gerbilPackage { 4 - pname = "gerbil-ethereum"; 5 - version = "unstable-2020-10-17"; 6 - git-version = "0.0-35-g44d490d"; 3 + { 4 + pname = "gerbil-poo"; 5 + version = "unstable-2023-04-28"; 6 + git-version = "0.0-106-g418b582"; 7 + softwareName = "Gerbil-POO"; 7 8 gerbil-package = "clan/poo"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = with gerbil-support.gerbilPackages-unstable; [gerbil-utils gerbil-crypto]; 10 - buildInputs = []; 11 - gambit-params = gambit-support.unstable-params; 12 9 version-path = "version"; 13 - softwareName = "Gerbil-POO"; 14 - src = fetchFromGitHub { 10 + 11 + gerbilInputs = with gerbilPackages; [ gerbil-utils ]; 12 + 13 + pre-src = { 14 + fun = fetchFromGitHub; 15 15 owner = "fare"; 16 16 repo = "gerbil-poo"; 17 - rev = "44d490d95b9d1b5d54eaedf2602419af8e086837"; 18 - sha256 = "082ndpy281saybcnp3bdidcibkk2ih6glrkbb5fdj1524ban4d0k"; 17 + rev = "418b582ae72e1494cf3a5f334d31d4f6503578f5"; 18 + sha256 = "0qdzs7l6hp45dji5bc3879k4c8k9x6cj4qxz68cskjhn8wrc5lr8"; 19 19 }; 20 - meta = { 20 + 21 + meta = with lib; { 21 22 description = "Gerbil POO: Prototype Object Orientation for Gerbil Scheme"; 22 23 homepage = "https://github.com/fare/gerbil-poo"; 23 - license = lib.licenses.asl20; 24 - platforms = lib.platforms.unix; 25 - maintainers = with lib.maintainers; [ fare ]; 24 + license = licenses.asl20; 25 + platforms = platforms.unix; 26 + maintainers = with maintainers; [ fare ]; 26 27 }; 27 28 }
+118 -42
pkgs/development/compilers/gerbil/gerbil-support.nix
··· 1 - { pkgs, lib, gccStdenv, callPackage, fetchFromGitHub }: 2 - # See ../gambit/build.nix regarding gccStdenv 1 + { pkgs, lib, callPackage, ... }: 3 2 4 - rec { 5 - # Gerbil libraries 6 - gerbilPackages-unstable = { 7 - gerbil-libp2p = callPackage ./gerbil-libp2p.nix { }; 8 - gerbil-utils = callPackage ./gerbil-utils.nix { }; 9 - gerbil-crypto = callPackage ./gerbil-crypto.nix { }; 10 - gerbil-poo = callPackage ./gerbil-poo.nix { }; 11 - gerbil-persist = callPackage ./gerbil-persist.nix { }; 12 - gerbil-ethereum = callPackage ./gerbil-ethereum.nix { }; 13 - smug-gerbil = callPackage ./smug-gerbil.nix { }; 3 + with pkgs.gerbil-support; { 4 + 5 + prePackages-unstable = 6 + let pks = [ ./gerbil-libp2p.nix ./smug-gerbil.nix ./ftw.nix 7 + ./gerbil-utils.nix ./gerbil-crypto.nix ./gerbil-poo.nix 8 + ./gerbil-persist.nix ./gerbil-ethereum.nix ./glow-lang.nix ]; 9 + call = pkg: callPackage pkg prePackage-defaults; 10 + pkgName = pkg: lib.removeSuffix ".nix" (baseNameOf pkg); 11 + f = pkg: { name = pkgName pkg; value = call pkg; }; in 12 + builtins.listToAttrs (map f pks); 13 + 14 + prePackage-defaults = { 15 + gerbil = pkgs.gerbil-unstable; 16 + gambit-params = pkgs.gambit-support.unstable-params; 17 + gerbilPackages = gerbilPackages-unstable; 18 + git-version = ""; 19 + version-path = ""; 20 + gerbilInputs = []; 21 + nativeBuildInputs = []; 22 + buildInputs = []; 23 + buildScript = "./build.ss"; 24 + postInstall = ""; 25 + softwareName = ""; 14 26 }; 15 27 28 + gerbilPackages-unstable = 29 + builtins.mapAttrs (_: gerbilPackage) prePackages-unstable; 30 + 31 + resolve-pre-src = pre-src: pre-src.fun (removeAttrs pre-src ["fun"]); 32 + 33 + gerbilVersionFromGit = pkg: 34 + let version-path = "${pkg.passthru.pre-pkg.version-path}.ss"; in 35 + if builtins.pathExists version-path then 36 + let m = 37 + builtins.match "\\(import :clan/versioning.*\\)\n\\(register-software \"([-_.A-Za-z0-9]+)\" \"([-_.A-Za-z0-9]+)\"\\) ;; ([-0-9]+)\n" 38 + (builtins.readFile version-path); in 39 + { version = builtins.elemAt m 2; git-version = builtins.elemAt m 1; } 40 + else { version = "0.0"; 41 + git-version = let gitpath = "${toString pkg.src}/.git"; in 42 + if builtins.pathExists gitpath then lib.commitIdFromGitRepo gitpath else "0"; }; 43 + 44 + gerbilSkippableFiles = [".git" ".build" ".build_outputs" "run" "result" "dep" "BLAH" 45 + "version.ss" "tmp.nix"]; 46 + 47 + gerbilSourceFilter = path: type: 48 + let baseName = baseNameOf path; in 49 + ! (builtins.elem baseName gerbilSkippableFiles || lib.hasSuffix "~" baseName); 50 + 51 + gerbilFilterSource = builtins.filterSource gerbilSourceFilter; 52 + 16 53 # Use this function in any package that uses Gerbil libraries, to define the GERBIL_LOADPATH. 17 54 gerbilLoadPath = 18 - gerbilInputs : builtins.concatStringsSep ":" (map (x : x + "/gerbil/lib") gerbilInputs); 55 + gerbilInputs: builtins.concatStringsSep ":" (map (x: x + "/gerbil/lib") gerbilInputs); 56 + 57 + path-src = path: { fun = _: path; }; 58 + 59 + view = lib.debug.traceSeqN 4; 60 + 61 + sha256-of-pre-src = pre-src: if pre-src ? sha256 then pre-src.sha256 else "none"; 62 + 63 + overrideSrcIfShaDiff = name: new-pre-src: super: 64 + let old-sha256 = sha256-of-pre-src super.${name}.pre-src; 65 + new-sha256 = sha256-of-pre-src new-pre-src; in 66 + if old-sha256 == new-sha256 then {} else 67 + view "Overriding ${name} old-sha256: ${old-sha256} new-sha256: ${new-sha256}" 68 + { ${name} = super.${name} // { 69 + pre-src = new-pre-src; 70 + version = "override"; 71 + git-version = if new-pre-src ? rev then lib.substring 0 7 new-pre-src.rev else "unknown";};}; 72 + 73 + pkgsOverrideGerbilPackageSrc = name: pre-src: pkgs: super: { 74 + gerbil-support = (super-support: 75 + { prePackages-unstable = 76 + (super-ppu: super-ppu // (overrideSrcIfShaDiff name pre-src super-ppu)) 77 + super-support.prePackages-unstable;}) super.gerbil-support;}; 19 78 20 79 # Use this function to create a Gerbil library. See gerbil-utils as an example. 21 - gerbilPackage = { 22 - pname, version, src, meta, gerbil-package, 23 - git-version ? "", version-path ? "", 24 - gerbil ? pkgs.gerbil-unstable, 25 - gambit-params ? pkgs.gambit-support.stable-params, 26 - gerbilInputs ? [], 27 - nativeBuildInputs ? [], 28 - buildInputs ? [], 29 - buildScript ? "./build.ss", 30 - softwareName ? ""} : 31 - let buildInputs_ = buildInputs; in 32 - gccStdenv.mkDerivation rec { 33 - inherit src meta pname version nativeBuildInputs; 34 - passthru = { inherit gerbil-package version-path ;}; 80 + gerbilPackage = prePackage: 81 + let pre-pkg = prePackage-defaults // prePackage; 82 + inherit (pre-pkg) pname version pre-src git-version meta 83 + softwareName gerbil-package version-path gerbil gambit-params 84 + gerbilInputs nativeBuildInputs buildInputs buildScript postInstall; 85 + buildInputs_ = buildInputs; in 86 + pkgs.gccStdenv.mkDerivation rec { # See ../gambit/build.nix regarding why we use gccStdenv 87 + inherit meta pname version nativeBuildInputs postInstall; 88 + passthru = { 89 + inherit pre-pkg; 90 + }; 91 + src = resolve-pre-src pre-src; 35 92 buildInputs = [ gerbil ] ++ gerbilInputs ++ buildInputs_; 93 + 36 94 postPatch = '' 37 95 set -e ; 38 - if [ -n "${version-path}.ss" ] ; then 39 - echo -e '(import :clan/versioning${builtins.concatStringsSep "" 40 - (map (x : lib.optionalString (x.passthru.version-path != "") 41 - " :${x.passthru.gerbil-package}/${x.passthru.version-path}") 96 + ${lib.optionalString (version-path != "") 97 + ''echo -e '(import :clan/versioning${builtins.concatStringsSep "" 98 + (map (x: let px = x.passthru.pre-pkg; in 99 + lib.optionalString (px.version-path != "") 100 + " :${px.gerbil-package}/${px.version-path}") 42 101 gerbilInputs) 43 - })\n(register-software "${softwareName}" "v${git-version}")\n' > "${passthru.version-path}.ss" 44 - fi 102 + })\n(register-software "${softwareName}" "v${git-version}")\n' > "${version-path}.ss"''} 45 103 patchShebangs . ; 46 104 ''; 47 105 48 106 postConfigure = '' 49 107 export GERBIL_BUILD_CORES=$NIX_BUILD_CORES 50 108 export GERBIL_PATH=$PWD/.build 51 - export GERBIL_LOADPATH=${gerbilLoadPath gerbilInputs} 109 + export GERBIL_LOADPATH=${gerbilLoadPath (["$out"] ++ gerbilInputs)} 52 110 ${pkgs.gambit-support.export-gambopt gambit-params} 53 111 ''; 54 112 ··· 60 118 61 119 installPhase = '' 62 120 runHook preInstall 63 - mkdir -p $out/gerbil/lib 64 - cp -fa .build/lib $out/gerbil/ 65 - bins=(.build/bin/*) 66 - if [ 0 -lt ''${#bins} ] ; then 67 - cp -fa .build/bin $out/gerbil/ 68 - mkdir $out/bin 69 - cd $out/bin 70 - ln -s ../gerbil/bin/* . 121 + mkdir -p $out/gerbil 122 + cp -fa .build/* $out/gerbil/ 123 + if [[ -d $out/gerbil/bin ]] ; then 124 + ( cd $out/gerbil 125 + bins=$(find ../gerbil/bin -type f) 126 + if [[ -n $bins ]] ; then 127 + ( mkdir -p ../bin 128 + cd .. 129 + ln -s $bins bin 130 + ) 131 + fi 132 + ) 71 133 fi 72 134 runHook postInstall 73 135 ''; 74 136 75 137 dontFixup = true; 138 + 139 + checkPhase = '' 140 + runHook preCheck 141 + if [[ -f unit-tests.ss ]] ; then 142 + export GERBIL_APPLICATION_HOME=$PWD 143 + ./unit-tests.ss version 144 + ./unit-tests.ss 145 + else 146 + echo "No gerbil-utils style unit-tests.ss detected for ${pname} ${version}."; 147 + fi 148 + runHook postCheck 149 + ''; 150 + 151 + doCheck = true; 76 152 }; 77 153 }
+15 -14
pkgs/development/compilers/gerbil/gerbil-utils.nix
··· 1 - { lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { lib, fetchFromGitHub, ... }: 2 2 3 - gerbil-support.gerbilPackage { 3 + { 4 4 pname = "gerbil-utils"; 5 - version = "unstable-2020-10-18"; 6 - git-version = "0.2-36-g8b481b7"; 5 + version = "unstable-2023-07-22"; 6 + git-version = "0.2-198-g2fb01ce"; 7 + softwareName = "Gerbil-utils"; 7 8 gerbil-package = "clan"; 8 - gerbil = gerbil-unstable; 9 - gambit-params = gambit-support.unstable-params; 10 9 version-path = "version"; 11 - softwareName = "Gerbil-utils"; 12 - src = fetchFromGitHub { 10 + 11 + pre-src = { 12 + fun = fetchFromGitHub; 13 13 owner = "fare"; 14 14 repo = "gerbil-utils"; 15 - rev = "8b481b787e13e07e14d0718d670aab016131a090"; 16 - sha256 = "0br8k5b2wcv4wcp65r2bfhji3af2qgqjspf41syqslq9awx47f3m"; 15 + rev = "2fb01ce0b302f232f5c4daf4987457b6357d609d"; 16 + sha256 = "127q98gk1x6y1nlkkpnbnkz989ybpszy7aiy43hzai2q6xn4nv72"; 17 17 }; 18 - meta = { 18 + 19 + meta = with lib; { 19 20 description = "Gerbil Clan: Community curated Collection of Common Utilities"; 20 21 homepage = "https://github.com/fare/gerbil-utils"; 21 - license = lib.licenses.lgpl21; 22 - platforms = lib.platforms.unix; 23 - maintainers = with lib.maintainers; [ fare ]; 22 + license = licenses.lgpl21; 23 + platforms = platforms.unix; 24 + maintainers = with maintainers; [ fare ]; 24 25 }; 25 26 }
+55
pkgs/development/compilers/gerbil/glow-lang.nix
··· 1 + { lib, fetchFromGitHub, gerbil-support, gerbilPackages, gerbil, ... }: 2 + 3 + rec { 4 + pname = "glow-lang"; 5 + version = "unstable-2023-04-26"; 6 + git-version = "0.3.2-222-gb19cd980"; 7 + softwareName = "Glow"; 8 + gerbil-package = "mukn/glow"; 9 + version-path = "version"; 10 + 11 + gerbilInputs = with gerbilPackages; 12 + [ gerbil-utils gerbil-crypto gerbil-poo gerbil-persist gerbil-ethereum 13 + gerbil-libp2p smug-gerbil ftw ]; 14 + 15 + pre-src = { 16 + fun = fetchFromGitHub; 17 + owner = "Glow-Lang"; 18 + repo = "glow"; 19 + rev = "b19cd98082dfc5156d1b4fc83cde161572d6a211"; 20 + sha256 = "0k3qy5826pxqr9ylnnpq4iikxf4j50987vhpa5qiv99j0p643xr3"; 21 + }; 22 + 23 + postPatch = '' 24 + substituteInPlace "runtime/glow-path.ss" --replace \ 25 + '(def glow-install-path (source-path "dapps"))' \ 26 + '(def glow-install-path "$out")' 27 + ''; 28 + 29 + postInstall = '' 30 + mkdir -p $out/bin $out/gerbil/lib/mukn/glow $out/share/glow/dapps 31 + cp main.ss $out/gerbil/lib/mukn/glow/ 32 + cp dapps/{buy_sig,coin_flip,rps_simple}.glow $out/share/glow/dapps/ 33 + cat > $out/bin/glow <<EOF 34 + #!/bin/sh 35 + ORIG_GERBIL_LOADPATH="\$GERBIL_LOADPATH" 36 + ORIG_GERBIL_PATH="\$GERBIL_PATH" 37 + ORIG_GERBIL_HOME="\$GERBIL_HOME" 38 + unset GERBIL_HOME 39 + GERBIL_LOADPATH="${gerbil-support.gerbilLoadPath (["$out"] ++ gerbilInputs)}" 40 + GLOW_SOURCE="\''${GLOW_SOURCE:-$out/share/glow}" 41 + GERBIL_PATH="\$HOME/.cache/glow/gerbil" 42 + export GERBIL_PATH GERBIL_LOADPATH GLOW_SOURCE ORIG_GERBIL_PATH ORIG_GERBIL_LOADPATH ORIG_GERBIL_HOME 43 + exec ${gerbil}/bin/gxi $out/gerbil/lib/mukn/glow/main.ss "\$@" 44 + EOF 45 + chmod a+x $out/bin/glow 46 + ''; 47 + 48 + meta = with lib; { 49 + description = "Glow: language for safe Decentralized Applications (DApps)"; 50 + homepage = "https://glow-lang.org"; 51 + license = licenses.asl20; 52 + platforms = platforms.unix; 53 + maintainers = with maintainers; [ fare ]; 54 + }; 55 + }
+15 -20
pkgs/development/compilers/gerbil/smug-gerbil.nix
··· 1 - { pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }: 1 + { lib, fetchFromGitHub, ... }: 2 2 3 - gerbil-support.gerbilPackage { 3 + { 4 4 pname = "smug-gerbil"; 5 - version = "unstable-2019-12-24"; 6 - git-version = "95d60d4"; 7 - gerbil-package = "drewc/smug"; 8 - gerbil = gerbil-unstable; 9 - gerbilInputs = []; 10 - buildInputs = []; 11 - gambit-params = gambit-support.unstable-params; 12 - version-path = ""; #"version"; 5 + version = "unstable-2020-12-12"; 6 + git-version = "0.4.20"; 13 7 softwareName = "Smug-Gerbil"; 14 - src = fetchFromGitHub { 8 + gerbil-package = "drewc/smug"; 9 + 10 + pre-src = { 11 + fun = fetchFromGitHub; 15 12 owner = "drewc"; 16 13 repo = "smug-gerbil"; 17 - rev = "95d60d486c1603743c6d3c525e6d5f5761b984e5"; 18 - sha256 = "0ys07z78gq60z833si2j7xa1scqvbljlx1zb32vdf32f1b27c04j"; 14 + rev = "cf23a47d0891aa9e697719309d04dd25dd1d840b"; 15 + sha256 = "13fdijd71m3fzp9fw9xp6ddgr38q1ly6wnr53salp725w6i4wqid"; 19 16 }; 20 - meta = { 17 + 18 + meta = with lib; { 21 19 description = "Super Monadic Über Go-into : Parsers and Gerbil Scheme"; 22 20 homepage = "https://github.com/drewc/smug-gerbil"; 23 - license = lib.licenses.mit; 24 - platforms = lib.platforms.unix; 25 - maintainers = with lib.maintainers; [ fare ]; 21 + license = licenses.mit; 22 + platforms = platforms.unix; 23 + maintainers = with maintainers; [ fare ]; 26 24 }; 27 - buildScript = '' 28 - for i in primitive simple tokens smug ; do gxc -O $i.ss ; done 29 - ''; 30 25 }
+4 -4
pkgs/development/compilers/gerbil/unstable.nix
··· 1 1 { callPackage, fetchFromGitHub, gambit-unstable, gambit-support }: 2 2 3 3 callPackage ./build.nix rec { 4 - version = "unstable-2020-11-05"; 5 - git-version = "0.16-152-g808929ae"; 4 + version = "unstable-2023-08-07"; 5 + git-version = "0.17.0-187-gba545b77"; 6 6 src = fetchFromGitHub { 7 7 owner = "vyzo"; 8 8 repo = "gerbil"; 9 - rev = "808929aeb8823959191f35df53bc0c0150911b4b"; 10 - sha256 = "0d9k2gkrs9qvlnk7xa3gjzs3gln3ydds7yd2313pvbw4q2lcz8iw"; 9 + rev = "ba545b77e8e85118089232e3cd263856e414b24b"; 10 + sha256 = "1f4v1qawx2i8333kshj4pbj5r21z0868pwrr3r710n6ng3pd9gqn"; 11 11 }; 12 12 inherit gambit-support; 13 13 gambit = gambit-unstable;
+2 -1
pkgs/top-level/all-packages.nix
··· 15557 15557 gerbil = callPackage ../development/compilers/gerbil { }; 15558 15558 gerbil-unstable = callPackage ../development/compilers/gerbil/unstable.nix { }; 15559 15559 gerbil-support = callPackage ../development/compilers/gerbil/gerbil-support.nix { }; 15560 - gerbilPackages-unstable = gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries 15560 + gerbilPackages-unstable = pkgs.gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries 15561 + glow-lang = pkgs.gerbilPackages-unstable.glow-lang; 15561 15562 15562 15563 gbforth = callPackage ../development/compilers/gbforth { }; 15563 15564