Skip to content

Commit

Permalink
clwrapper, buildLispPackage: compile fasls and store them for all sys…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
7c6f434c committed Mar 31, 2017
1 parent 5793e12 commit 1e7bad5
Show file tree
Hide file tree
Showing 135 changed files with 29 additions and 533 deletions.
11 changes: 10 additions & 1 deletion pkgs/development/lisp-modules/clwrapper/default.nix
Expand Up @@ -10,6 +10,15 @@ stdenv.mkDerivation {
substituteAll "${./build-with-lisp.sh}" "$out/bin/build-with-lisp.sh"
substituteAll "${./cl-wrapper.sh}" "$out/bin/cl-wrapper.sh"
chmod a+x "$out"/bin/*
substituteAll "${./setup-hook.sh}" "setup-hook-parsed"
source setup-hook-parsed
setLisp "${lisp}"
echo "$NIX_LISP"
ASDF_OUTPUT_TRANSLATIONS="${asdf}/lib/common-lisp/:$out/lib/common-lisp-compiled/" \
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(uiop/lisp-build:compile-file* \"${asdf}/lib/common-lisp/asdf/build/asdf.lisp\")"' \
"$out/bin/common-lisp.sh" "$NIX_LISP"
'';

inherit asdf lisp;
Expand All @@ -22,7 +31,7 @@ stdenv.mkDerivation {
preferLocalBuild = true;

passthru = {
inherit lisp;
inherit lisp asdf;
};

meta = {
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/lisp-modules/clwrapper/setup-hook.sh
@@ -1,11 +1,15 @@
NIX_LISP_ASDF="@asdf@"

CL_SOURCE_REGISTRY="${CL_SOURCE_REGISTRY:+$CL_SOURCE_REGISTRY:}@asdf@/lib/common-lisp/asdf/:@asdf@/lib/common-lisp/asdf/uiop/"
ASDF_OUTPUT_TRANSLATIONS="@asdf@/lib/common-lisp/:@out@/lib/common-lisp-compiled/"

addASDFPaths () {
for j in "$1"/lib/common-lisp/*; do
if [ -d "$j" ]; then
CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$j/"
if [ -d "$(dirname "$(dirname "$j")")/common-lisp-compiled/$(basename "$j")" ]; then
ASDF_OUTPUT_TRANSLATIONS="$j:$(dirname "$(dirname "$j")")/common-lisp-compiled/$(basename "$j")${ASDF_OUTPUT_TRANSLATIONS:+:}$ASDF_OUTPUT_TRANSLATIONS"
fi
fi
done
}
Expand All @@ -31,7 +35,7 @@ collectNixLispLDLP () {
fi
}

export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF
export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF ASDF_OUTPUT_TRANSLATIONS

envHooks+=(addASDFPaths setLisp collectNixLispLDLP)

Expand Down
15 changes: 11 additions & 4 deletions pkgs/development/lisp-modules/define-package.nix
@@ -1,15 +1,17 @@
args @ {stdenv, clwrapper, baseName, version ? "latest", src, description, deps,
buildInputs ? [], meta ? {}, overrides?(x: {}), propagatedBuildInputs ? []}:
args @ {stdenv, clwrapper, baseName, testSystem ? baseName, version ? "latest"
, src, description, deps, buildInputs ? [], meta ? {}, overrides?(x: {})
, propagatedBuildInputs ? []}:
let
deployConfigScript = ''
config_script="$out"/lib/common-lisp-settings/${args.baseName}-shell-config.sh
mkdir -p "$(dirname "$config_script")"
touch "$config_script"
chmod a+x "$config_script"
echo "export NIX_CFLAGS_COMPILE='$NIX_CFLAGS_COMPILE'\"\''${NIX_CFLAGS_COMPILE:+ $NIX_CFLAGS_COMPILE}\"" >> "$config_script"
echo "export NIX_CFLAGS_COMPILE='$NIX_CFLAGS_COMPILE'\"\''${NIX_CFLAGS_COMPILE:+ \$NIX_CFLAGS_COMPILE}\"" >> "$config_script"
echo "export NIX_LISP_COMMAND='$NIX_LISP_COMMAND'" >> "$config_script"
echo "export NIX_LISP_ASDF='$NIX_LISP_ASDF'" >> "$config_script"
echo "export CL_SOURCE_REGISTRY="\$CL_SOURCE_REGISTRY\''${CL_SOURCE_REGISTRY:+:}"'$CL_SOURCE_REGISTRY:$out/lib/common-lisp/${args.baseName}/'" >> "$config_script"
echo "export ASDF_OUTPUT_TRANSLATIONS="\$ASDF_OUTPUT_TRANSLATIONS\''${ASDF_OUTPUT_TRANSLATIONS:+:}"'$out/lib/common-lisp/${args.baseName}/:$out/lib/common-lisp-compiled/${args.baseName}:$ASDF_OUTPUT_TRANSLATIONS'" >> "$config_script"
test -n "$LD_LIBRARY_PATH" &&
echo "export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}\"'$LD_LIBRARY_PATH'" >> "$config_script"
test -n "$NIX_LISP_LD_LIBRARY_PATH" &&
Expand Down Expand Up @@ -41,9 +43,14 @@ basePackage = {
${deployConfigScript}
${deployLaunchScript}
${if testSystem != null then ''
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :${testSystem})"' \
"$out/bin/${args.baseName}-lisp-launcher.sh" ""
'' else ""}
eval "$postInstall"
'';
propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp]
propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp clwrapper.asdf]
++ (args.propagatedBuildInputs or []);
buildInputs = buildInputs;
dontStrip=true;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/lisp-modules/lisp-packages.nix
Expand Up @@ -10,7 +10,7 @@ let lispPackages = rec {
baseName = "esrap-peg";
version = "git-20170320";
description = "A wrapper around Esrap to allow generating Esrap grammars from PEG definitions";
deps = with pkgs.quicklispPackages; [alexandria cl-unification esrap iterate];
deps = with (pkgs.quicklispPackagesFor clwrapper); [alexandria cl-unification esrap iterate];
src = pkgs.fetchgit {
url = "https://github.com/fb08af68/esrap-peg.git";
sha256 = "15yiial7cy2nbgszqxd26qqcc6n3pw5qlrppzx0mfr3xbd9pvzby";
Expand All @@ -22,7 +22,7 @@ let lispPackages = rec {
baseName = "clx-xkeyboard";
version = "git-20150523";
description = "CLX support for X Keyboard extensions";
deps = with pkgs.quicklispPackages; [clx];
deps = with (pkgs.quicklispPackagesFor clwrapper); [clx];
# Source type: git
src = pkgs.fetchgit {
url = ''https://github.com/filonenko-mikhail/clx-xkeyboard'';
Expand Down
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :alexandria)"' "$out/bin/alexandria-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :anaphora)"' "$out/bin/anaphora-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :array-utils)"' "$out/bin/array-utils-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :babel-streams)"' "$out/bin/babel-streams-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :babel)"' "$out/bin/babel-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :blackbird)"' "$out/bin/blackbird-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :bordeaux-threads)"' "$out/bin/bordeaux-threads-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :caveman)"' "$out/bin/caveman-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cffi-grovel)"' "$out/bin/cffi-grovel-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cffi-toolchain)"' "$out/bin/cffi-toolchain-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cffi)"' "$out/bin/cffi-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :chipz)"' "$out/bin/chipz-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :chunga)"' "$out/bin/chunga-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :circular-streams)"' "$out/bin/circular-streams-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl+ssl)"' "$out/bin/cl+ssl-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-aa)"' "$out/bin/cl-aa-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-annot)"' "$out/bin/cl-annot-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-ansi-text)"' "$out/bin/cl-ansi-text-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-async)"' "$out/bin/cl-async-base-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-async)"' "$out/bin/cl-async-util-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-async)"' "$out/bin/cl-async-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-base64)"' "$out/bin/cl-base64-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-colors)"' "$out/bin/cl-colors-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-cookie)"' "$out/bin/cl-cookie-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-emb)"' "$out/bin/cl-emb-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-fad)"' "$out/bin/cl-fad-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-fuse-meta-fs)"' "$out/bin/cl-fuse-meta-fs-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-fuse)"' "$out/bin/cl-fuse-lisp-launcher.sh" ""
'';
};
}
Expand Up @@ -13,9 +13,5 @@ rec {
};

overrides = x: {
postInstall = ''
echo "$CL_SOURCE_REGISTRY"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(asdf:load-system :cl-json)"' "$out/bin/cl-json-lisp-launcher.sh" ""
'';
};
}

0 comments on commit 1e7bad5

Please sign in to comment.