Adding lisp-packages subset. Adding a few test packages without dependencies.
This commit is contained in:
parent
d44439d03e
commit
56f0be1ba1
45
pkgs/development/lisp-modules/define-package.nix
Normal file
45
pkgs/development/lisp-modules/define-package.nix
Normal file
@ -0,0 +1,45 @@
|
||||
args @ {stdenv, clwrapper, baseName, version ? "latest", src, description, deps,
|
||||
buildInputs ? [], meta ? {}, overrides?(x: {})}:
|
||||
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_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"
|
||||
'';
|
||||
deployLaunchScript = ''
|
||||
launch_script="$out"/bin/${args.baseName}-lisp-launcher.sh
|
||||
mkdir -p "$(dirname "$launch_script")"
|
||||
touch "$launch_script"
|
||||
chmod a+x "$launch_script"
|
||||
echo "#! /bin/sh" >> "$launch_script"
|
||||
echo "source '$config_script'" >> "$launch_script"
|
||||
echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"
|
||||
'';
|
||||
basePackage = {
|
||||
name = "lisp-${baseName}-${version}";
|
||||
inherit src;
|
||||
|
||||
inherit deployConfigScript deployLaunchScript;
|
||||
installPhase = ''
|
||||
mkdir -p "$out"/share/doc/${args.baseName};
|
||||
mkdir -p "$out"/lib/common-lisp/${args.baseName};
|
||||
cp -r . "$out"/lib/common-lisp/${args.baseName};
|
||||
cp -rf doc/* LICENCE LICENSE COPYING README README.html README.md readme.html "$out"/share/doc/${args.baseName} || true
|
||||
|
||||
${deployConfigScript}
|
||||
${deployLaunchScript}
|
||||
'';
|
||||
propagatedBuildInputs = args.deps ++ [clwrapper clwrapper.lisp];
|
||||
buildInputs = buildInputs;
|
||||
dontStrip=true;
|
||||
meta = {
|
||||
inherit description version;
|
||||
} // meta;
|
||||
};
|
||||
package = basePackage // (overrides basePackage);
|
||||
in
|
||||
stdenv.mkDerivation package
|
47
pkgs/development/lisp-modules/lisp-packages.nix
Normal file
47
pkgs/development/lisp-modules/lisp-packages.nix
Normal file
@ -0,0 +1,47 @@
|
||||
{stdenv, clwrapper, pkgs}:
|
||||
let lispPackages = rec {
|
||||
inherit pkgs clwrapper stdenv;
|
||||
nixLib = pkgs.lib;
|
||||
callPackage = nixLib.callPackageWith lispPackages;
|
||||
|
||||
buildLispPackage = callPackage ./define-package.nix;
|
||||
|
||||
cl-ppcre = buildLispPackage rec {
|
||||
baseName = "cl-ppcre";
|
||||
version = "2.0.4";
|
||||
description = "Regular expression library for Common Lisp";
|
||||
deps = [];
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/edicl/cl-ppcre/archive/v${version}.tar.gz";
|
||||
sha256 = "16nkfg6j7nn8qkzxn462kqpdlbajpz2p55pdl12sia6yqkj3lh97";
|
||||
};
|
||||
};
|
||||
|
||||
clx = buildLispPackage rec {
|
||||
baseName = "clx";
|
||||
version = "2013-09";
|
||||
description = "X11 bindings for Common Lisp";
|
||||
deps = [];
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/sharplispers/clx/";
|
||||
rev = "e2b762ac93d78d6eeca4f36698c8dfd1537ce998";
|
||||
sha256 = "0jcrmlaayz7m8ixgriq7id3pdklyk785qvpcxdpcp4aqnfiiqhij";
|
||||
};
|
||||
};
|
||||
|
||||
iterate = buildLispPackage rec {
|
||||
baseName = "iterate";
|
||||
version = "1.4.3";
|
||||
description = "Iteration package for Common Lisp";
|
||||
deps = [];
|
||||
src = pkgs.fetchdarcs {
|
||||
url = "http://common-lisp.net/project/iterate/darcs/iterate";
|
||||
sha256 = "0m3q0s7h5s8varwx584m2akgdslj14df7kg4w1bj1fbgzsag5m1w";
|
||||
tag=version;
|
||||
};
|
||||
overrides = x: {
|
||||
configurePhase="buildPhase(){ true; }";
|
||||
};
|
||||
};
|
||||
};
|
||||
in lispPackages
|
@ -5883,6 +5883,12 @@ let
|
||||
asdf = callPackage ../development/lisp-modules/asdf {};
|
||||
clwrapperFunction = callPackage ../development/lisp-modules/clwrapper;
|
||||
wrapLisp = lisp: clwrapperFunction {lisp=lisp;};
|
||||
lispPackagesFor = clwrapper: callPackage ../development/lisp-modules/lisp-packages.nix{
|
||||
inherit clwrapper;
|
||||
};
|
||||
lispPackagesClisp = lispPackagesFor (wrapLisp clisp);
|
||||
lispPackagesSBCL = lispPackagesFor (wrapLisp sbcl);
|
||||
lispPackages = recurseIntoAttrs lispPackagesSBCL;
|
||||
|
||||
### DEVELOPMENT / PERL MODULES
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user