lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 22.05-pre 76 lines 2.7 kB view raw
1{ pkgs, lib, gccStdenv, callPackage, fetchFromGitHub }: 2# See ../gambit/build.nix regarding gccStdenv 3 4rec { 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 { }; 14 }; 15 16 # Use this function in any package that uses Gerbil libraries, to define the GERBIL_LOADPATH. 17 gerbilLoadPath = 18 gerbilInputs : builtins.concatStringsSep ":" (map (x : x + "/gerbil/lib") gerbilInputs); 19 20 # 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 buildInputs ? [], 28 buildScript ? "./build.ss", 29 softwareName ? ""} : 30 let buildInputs_ = buildInputs; in 31 gccStdenv.mkDerivation rec { 32 inherit src meta pname version; 33 passthru = { inherit gerbil-package version-path ;}; 34 buildInputs = [ gerbil ] ++ gerbilInputs ++ buildInputs_; 35 postPatch = '' 36 set -e ; 37 if [ -n "${version-path}.ss" ] ; then 38 echo -e '(import :clan/versioning${builtins.concatStringsSep "" 39 (map (x : lib.optionalString (x.passthru.version-path != "") 40 " :${x.passthru.gerbil-package}/${x.passthru.version-path}") 41 gerbilInputs) 42 })\n(register-software "${softwareName}" "v${git-version}")\n' > "${passthru.version-path}.ss" 43 fi 44 patchShebangs . ; 45 ''; 46 47 postConfigure = '' 48 export GERBIL_BUILD_CORES=$NIX_BUILD_CORES 49 export GERBIL_PATH=$PWD/.build 50 export GERBIL_LOADPATH=${gerbilLoadPath gerbilInputs} 51 ${pkgs.gambit-support.export-gambopt gambit-params} 52 ''; 53 54 buildPhase = '' 55 runHook preBuild 56 ${buildScript} 57 runHook postBuild 58 ''; 59 60 installPhase = '' 61 runHook preInstall 62 mkdir -p $out/gerbil/lib 63 cp -fa .build/lib $out/gerbil/ 64 bins=(.build/bin/*) 65 if [ 0 -lt ''${#bins} ] ; then 66 cp -fa .build/bin $out/gerbil/ 67 mkdir $out/bin 68 cd $out/bin 69 ln -s ../gerbil/bin/* . 70 fi 71 runHook postInstall 72 ''; 73 74 dontFixup = true; 75 }; 76}