2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4
|
2015-04-05 13:09:16 +01:00
|
|
|
, makeWrapper , rlwrap, gnused, gnugrep, coreutils, xprop
|
2016-06-18 15:03:38 +01:00
|
|
|
, extraModulePaths ? []
|
|
|
|
, version }:
|
2014-10-05 13:50:08 +01:00
|
|
|
|
|
|
|
let
|
2015-04-05 13:09:16 +01:00
|
|
|
contrib = (fetchgit {
|
|
|
|
url = "https://github.com/stumpwm/stumpwm-contrib.git";
|
2016-04-13 00:48:18 +01:00
|
|
|
rev = "9bebe3622b2b6c31a6bada9055ef3862fa79b86f";
|
|
|
|
sha256 = "1ml6mjk2fsfv4sf65fdbji3q5x0qiq99g1k8w7a99gsl2i8h60gc";
|
2015-04-05 13:09:16 +01:00
|
|
|
});
|
2016-06-18 15:03:38 +01:00
|
|
|
versionSpec = {
|
|
|
|
"latest" = {
|
2017-01-16 02:23:39 +00:00
|
|
|
name = "1.0.0";
|
|
|
|
rev = "refs/tags/1.0.0";
|
|
|
|
sha256 = "16r0lwhxl8g71masmfbjr7s7m7fah4ii4smi1g8zpbpiqjz48ryb";
|
|
|
|
patches = [];
|
|
|
|
};
|
|
|
|
"0.9.9" = {
|
2016-06-18 15:03:38 +01:00
|
|
|
name = "0.9.9";
|
|
|
|
rev = "refs/tags/0.9.9";
|
2016-06-21 03:09:23 +01:00
|
|
|
sha256 = "0hmvbdk2yr5wrkiwn9dfzf65s4xc2qifj0sn6w2mghzp96cph79k";
|
2016-06-18 15:03:38 +01:00
|
|
|
patches = [ ./fix-module-path.patch ];
|
|
|
|
};
|
|
|
|
"git" = {
|
2017-02-04 21:18:59 +00:00
|
|
|
name = "git-20170203";
|
|
|
|
rev = "d20f24e58ab62afceae2afb6262ffef3cc318b97";
|
|
|
|
sha256 = "1gi29ds1x6dq7lz8lamnhcvcrr3cvvrg5yappfkggyhyvib1ii70";
|
2017-01-16 02:23:39 +00:00
|
|
|
patches = [];
|
2016-06-18 15:03:38 +01:00
|
|
|
};
|
|
|
|
}.${version};
|
2014-10-05 13:50:08 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2016-06-18 15:03:38 +01:00
|
|
|
name = "stumpwm-${versionSpec.name}";
|
2015-04-05 13:09:16 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/stumpwm/stumpwm";
|
2016-06-18 15:03:38 +01:00
|
|
|
rev = "${versionSpec.rev}";
|
|
|
|
sha256 = "${versionSpec.sha256}";
|
2015-04-05 13:09:16 +01:00
|
|
|
};
|
|
|
|
|
2016-06-18 15:03:38 +01:00
|
|
|
# NOTE: The patch needs an update for the next release.
|
|
|
|
# `(stumpwm:set-module-dir "@MODULE_DIR@")' needs to be in it.
|
|
|
|
patches = versionSpec.patches;
|
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
buildInputs = [
|
|
|
|
texinfo4 makeWrapper autoconf
|
|
|
|
sbcl
|
|
|
|
lispPackages.clx
|
|
|
|
lispPackages.cl-ppcre
|
2017-02-04 21:18:59 +00:00
|
|
|
lispPackages.alexandria
|
2015-04-05 13:09:16 +01:00
|
|
|
xdpyinfo
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
# Stripping destroys the generated SBCL image
|
|
|
|
dontStrip = true;
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
configurePhase = ''
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=$out --with-module-dir=$out/share/stumpwm/modules
|
|
|
|
'';
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
preBuild = ''
|
|
|
|
cp -r --no-preserve=mode ${contrib} modules
|
2015-06-26 11:05:04 +01:00
|
|
|
substituteInPlace head.lisp \
|
|
|
|
--replace 'run-shell-command "xdpyinfo' 'run-shell-command "${xdpyinfo}/bin/xdpyinfo'
|
2015-04-05 13:09:16 +01:00
|
|
|
'';
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
make install
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
mkdir -p $out/share/stumpwm/modules
|
|
|
|
cp -r modules/* $out/share/stumpwm/modules/
|
|
|
|
for d in ${stdenv.lib.concatStringsSep " " extraModulePaths}; do
|
|
|
|
cp -r --no-preserve=mode "$d" $out/share/stumpwm/modules/
|
|
|
|
done
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
# Copy stumpish;
|
|
|
|
cp $out/share/stumpwm/modules/util/stumpish/stumpish $out/bin/
|
|
|
|
chmod +x $out/bin/stumpish
|
|
|
|
wrapProgram $out/bin/stumpish \
|
2016-08-22 23:06:51 +01:00
|
|
|
--prefix PATH ":" "${stdenv.lib.makeBinPath [ rlwrap gnused gnugrep coreutils xprop ]}"
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2015-04-05 13:09:16 +01:00
|
|
|
# Paths in the compressed image $out/bin/stumpwm are not
|
|
|
|
# recognized by Nix. Add explicit reference here.
|
|
|
|
mkdir $out/nix-support
|
|
|
|
echo ${xdpyinfo} > $out/nix-support/xdpyinfo
|
|
|
|
'';
|
2014-10-05 13:50:08 +01:00
|
|
|
|
2016-03-21 18:55:25 +00:00
|
|
|
passthru = {
|
2018-02-26 10:16:20 +00:00
|
|
|
inherit sbcl lispPackages contrib;
|
2016-03-21 18:55:25 +00:00
|
|
|
};
|
|
|
|
|
2014-10-05 13:50:08 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A tiling window manager for X11";
|
|
|
|
homepage = https://github.com/stumpwm/;
|
|
|
|
license = licenses.gpl2Plus;
|
2016-11-03 10:54:54 +00:00
|
|
|
maintainers = with maintainers; [ the-kenny ];
|
2014-10-05 13:50:08 +01:00
|
|
|
platforms = platforms.linux;
|
2018-04-11 10:54:31 +01:00
|
|
|
broken = true; # 2018-04-11
|
2014-10-05 13:50:08 +01:00
|
|
|
};
|
2015-01-11 23:11:04 +00:00
|
|
|
}
|