Merge branch 'origin/master' into stdenv-updates.
There was a minor conflict in 'stumpwm'. The package needs texinfo version 4.x. At least is used to, I'm not sure whether it still does.
This commit is contained in:
40
pkgs/development/lisp-modules/asdf/default.nix
Normal file
40
pkgs/development/lisp-modules/asdf/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{stdenv, fetchurl, texinfo, texLive}:
|
||||
let
|
||||
s = # Generated upstream information
|
||||
rec {
|
||||
baseName="asdf";
|
||||
version="3.0.2.1";
|
||||
name="${baseName}-${version}";
|
||||
hash="1npd4dxsgk06ayhln56mwwky0vdpf7i77mkxfh105pld8w5xs4r4";
|
||||
url="http://common-lisp.net/project/asdf/archives/asdf-3.0.2.1.tar.gz";
|
||||
sha256="1npd4dxsgk06ayhln56mwwky0vdpf7i77mkxfh105pld8w5xs4r4";
|
||||
};
|
||||
buildInputs = [
|
||||
texinfo texLive
|
||||
];
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit (s) name version;
|
||||
inherit buildInputs;
|
||||
src = fetchurl {
|
||||
inherit (s) url sha256;
|
||||
};
|
||||
buildPhase = ''
|
||||
make build/asdf.lisp
|
||||
make -C doc asdf.info asdf.html
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p "$out"/lib/common-lisp/asdf/
|
||||
mkdir -p "$out"/share/doc/asdf/
|
||||
cp -r ./* "$out"/lib/common-lisp/asdf/
|
||||
cp -r doc/* "$out"/share/doc/asdf/
|
||||
'';
|
||||
sourceRoot=".";
|
||||
meta = {
|
||||
inherit (s) version;
|
||||
description = ''Standard software-system definition library for Common Lisp'';
|
||||
license = stdenv.lib.licenses.mit ;
|
||||
maintainers = [stdenv.lib.maintainers.raskin];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
2
pkgs/development/lisp-modules/asdf/default.upstream
Normal file
2
pkgs/development/lisp-modules/asdf/default.upstream
Normal file
@@ -0,0 +1,2 @@
|
||||
url http://common-lisp.net/project/asdf/archives/
|
||||
version_link asdf-[0-9].*[.]tar[.].*
|
||||
44
pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
Executable file
44
pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#! /bin/sh
|
||||
# Part of NixPkgs package collection
|
||||
# This script can be used at your option under the same license as NixPkgs or
|
||||
# under MIT/X11 license
|
||||
|
||||
eval "$NIX_LISP_PREHOOK"
|
||||
|
||||
NIX_LISP_COMMAND="$1"
|
||||
shift
|
||||
|
||||
[ -z "$NIX_LISP" ] && NIX_LISP="${NIX_LISP_COMMAND##*/}"
|
||||
|
||||
export NIX_LISP NIX_LISP_LOAD_FILE NIX_LISP_EXEC_CODE NIX_LISP_COMMAND NIX_LISP_FINAL_PARAMETERS
|
||||
|
||||
case "$NIX_LISP" in
|
||||
sbcl)
|
||||
NIX_LISP_LOAD_FILE="--load"
|
||||
NIX_LISP_EXEC_CODE="--eval"
|
||||
NIX_LISP_FINAL_PARAMETERS=
|
||||
;;
|
||||
ecl)
|
||||
NIX_LISP_LOAD_FILE="-load"
|
||||
NIX_LISP_EXEC_CODE="-eval"
|
||||
NIX_LISP_FINAL_PARAMETERS=
|
||||
;;
|
||||
clisp)
|
||||
NIX_LISP_LOAD_FILE="-c -l"
|
||||
NIX_LISP_EXEC_CODE="-x"
|
||||
NIX_LISP_FINAL_PARAMETERS="-repl"
|
||||
;;
|
||||
esac
|
||||
|
||||
NIX_LISP_ASDF_REGISTRY_CODE="
|
||||
(progn
|
||||
(setf asdf:*default-source-registries* '(asdf/source-registry:environment-source-registry))
|
||||
(asdf:initialize-source-registry)
|
||||
)
|
||||
"
|
||||
|
||||
[ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
|
||||
$NIX_LISP_EXEC_CODE "(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.lisp\")" \
|
||||
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
|
||||
$NIX_LISP_FINAL_PARAMETERS \
|
||||
"$@"
|
||||
3
pkgs/development/lisp-modules/clwrapper/common-lisp.sh
Executable file
3
pkgs/development/lisp-modules/clwrapper/common-lisp.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
"$(dirname "$0")"/cl-wrapper.sh "${NIX_LISP_COMMAND:-sbcl}" "$@"
|
||||
28
pkgs/development/lisp-modules/clwrapper/default.nix
Normal file
28
pkgs/development/lisp-modules/clwrapper/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{stdenv, fetchurl, asdf, lisp ? null}:
|
||||
stdenv.mkDerivation {
|
||||
name = "cl-wrapper-script";
|
||||
|
||||
buildPhase="";
|
||||
|
||||
installPhase=''
|
||||
mkdir -p "$out"/bin
|
||||
cp ${./cl-wrapper.sh} "$out"/bin/cl-wrapper.sh
|
||||
cp ${./common-lisp.sh} "$out"/bin/common-lisp.sh
|
||||
chmod a+x "$out"/bin/*
|
||||
'';
|
||||
|
||||
inherit asdf lisp;
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
phases="installPhase fixupPhase";
|
||||
|
||||
passthru = {
|
||||
inherit lisp;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = ''Script used to wrap Common Lisp implementations'';
|
||||
maintainers = [stdenv.lib.maintainers.raskin];
|
||||
};
|
||||
}
|
||||
33
pkgs/development/lisp-modules/clwrapper/setup-hook.sh
Normal file
33
pkgs/development/lisp-modules/clwrapper/setup-hook.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
NIX_LISP_ASDF="@asdf@"
|
||||
|
||||
CL_SOURCE_REGISTRY="@asdf@/lib/common-lisp/asdf/:@asdf@/lib/common-lisp/asdf/uiop/"
|
||||
|
||||
addASDFPaths () {
|
||||
for j in "$1"/lib/common-lisp/*; do
|
||||
if [ -d "$j" ]; then
|
||||
CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$j/"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
setLisp () {
|
||||
if [ -z "$NIX_LISP_COMMAND" ]; then
|
||||
for j in "$1"/bin/*; do
|
||||
case "$(basename "$j")" in
|
||||
sbcl) NIX_LISP_COMMAND="$j" ;;
|
||||
ecl) NIX_LISP_COMMAND="$j" ;;
|
||||
clisp) NIX_LISP_COMMAND="$j" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ -z "$NIX_LISP" ]; then
|
||||
NIX_LISP="${NIX_LISP_COMMAND##*/}"
|
||||
fi
|
||||
}
|
||||
|
||||
export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF
|
||||
|
||||
envHooks=(envHooks[@] addASDFPaths setLisp)
|
||||
|
||||
mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-$USER-home"
|
||||
mkdir -p "$HOME"/.cache/common-lisp
|
||||
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
|
||||
49
pkgs/development/lisp-modules/lisp-packages.nix
Normal file
49
pkgs/development/lisp-modules/lisp-packages.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{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; }";
|
||||
};
|
||||
};
|
||||
|
||||
stumpwm = callPackage ./stumpwm {};
|
||||
};
|
||||
in lispPackages
|
||||
33
pkgs/development/lisp-modules/stumpwm/default.nix
Normal file
33
pkgs/development/lisp-modules/stumpwm/default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{pkgs, nixLib, clwrapper, cl-ppcre, clx, buildLispPackage}:
|
||||
buildLispPackage rec {
|
||||
baseName = "stumpwm";
|
||||
version = "2013-09";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/sabetts/stumpwm";
|
||||
sha256 = "0dd69myssfn2bsdx3xdp65mjrvs9x81dl3y3659pyf1avnjlir7h";
|
||||
rev = "565ef58f04f59e1667ec1da4087f1a43a32cd67f";
|
||||
};
|
||||
description = "Tiling window manager for X11";
|
||||
deps = [cl-ppcre clx];
|
||||
buildInputs = with pkgs; [texinfo4 autoconf which makeWrapper];
|
||||
meta = {
|
||||
maintainers = [nixLib.maintainers.raskin];
|
||||
platforms = nixLib.platforms.linux;
|
||||
};
|
||||
overrides = x: {
|
||||
preConfigure = ''
|
||||
${x.deployConfigScript}
|
||||
export CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$PWD/"
|
||||
./autogen.sh
|
||||
configureFlags=" --with-lisp=$NIX_LISP --with-$NIX_LISP=$(which common-lisp.sh) "
|
||||
'';
|
||||
installPhase=x.installPhase + ''
|
||||
make install
|
||||
|
||||
if [ "$NIX_LISP" = "sbcl" ]; then
|
||||
wrapProgram "$out"/bin/stumpwm --set SBCL_HOME "${clwrapper.lisp}/lib/sbcl"
|
||||
fi;
|
||||
'';
|
||||
postInstall = ''false'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user