1 { stdenv, akku, chez, guile, chibi, makeWrapper, lib, writeShellScriptBin }:
2 { pname, version, src, buildInputs ? [ ], r7rs ? false, nativeBuildInputs ? [ ], ... } @ args:
4 parse-akku_ = writeShellScriptBin "parse-akku"
5 "${guile}/bin/guile --no-auto-compile ${./parse-akku.scm} \"$@\"";
6 parse-akku = "${parse-akku_}/bin/parse-akku";
11 pname = "akku-${pname}";
12 propagatedBuildInputs = buildInputs;
14 nativeBuildInputs = [ makeWrapper akku chez chibi ] ++ nativeBuildInputs;
18 # only install the project
19 rm -f Akku.lock Akku.manifest
23 # make sure akku metadata is present during testing and onwards
24 echo $PWD $CHEZSCHEMELIBDIRS \
27 | grep "metadata.sls" \
28 | xargs ${parse-akku} merge ${pname} ${version} > temp___
29 mv temp___ .akku/lib/akku/metadata.sls
38 propagated_chez=$CHEZSCHEMELIBDIRS
39 propagated_chibi=$CHIBI_MODULE_PATH
41 export CHEZSCHEMELIBDIRS="$PWD/.akku/lib:$CHEZSCHEMELIBDIRS"
42 export CHIBI_MODULE_PATH="$PWD/.akku/lib:$CHIBI_MODULE_PATH"
44 # Run all test .sps files if they exist
45 # and run tests for libs mirrored from snow-fort.
46 for path in $(find test* -type f | grep -e "\.sps") \
47 $(find . | grep "run-test" | grep "\.scm"); do
48 echo Running test: $path
49 [[ "\n$SKIP\n" =~ $(basename $path) ]] && continue
53 elif ${lib.trivial.boolToString r7rs}; then
62 export CHEZSCHEMELIBDIRS=$propagated_chez
63 export CHIBI_MODULE_PATH=$propagated_chibi
75 cp -rL lib $out/lib/scheme-libs
78 [ -d ffi ] && cp -rL ffi $out/lib
79 [ -d libobj ] && cp -rL libobj $out/lib
81 CHEZSCHEMELIBDIRS="$out/lib/scheme-libs:$CHEZSCHEMELIBDIRS"
83 # add support for other schemes
88 --prefix CHEZSCHEMELIBDIRS : $CHEZSCHEMELIBDIRS
94 inherit (akku.meta) platforms;
95 } // args.meta or { };
96 setupHook = ./setup-hook.sh;
97 } // builtins.removeAttrs args [ "name" "buildInputs" "meta" "nativeBuildInputs" ])