git.iko.soy/typeable/nixpkgs
on master help sign in
Stumpwm: Fix contrib modules, install stumpish.

This was caused by multiple things: First, the module-path was wrong in the release. Second, when modules tried to load stumpwm, asdf searched for its sources in /tmp/nix-build-*. Both of these issues are fixed by a nix-specific patch that tells adsf to *never* try to load stumpwm (and others) from the filesystem. This is fine as those modules are already available in the image anyway. We also refactor some stuff & clean up the build. Stumpish works now too.

commit4eaf2f1114e3119e3f4f20a72b63e1cf6a361c0d authorMoritz Ulrich <moritz@tarn-vedra.de> dateSun 5 Apr 2015, 14:09 (12 years ago) parent5c866dc
4 files changed+73−60
pkgs/applications/window-managers/stumpwm/contrib.nix−31 pkgs/applications/window-managers/stumpwm/default.nix+57−28 pkgs/applications/window-managers/stumpwm/fix-module-path.patch+16 pkgs/top-level/all-packages.nix−1
pkgs/applications/window-managers/stumpwm/contrib.nixdeleted−31
@@ -1,31 +0,0 @@
1−{ stdenv, fetchgit }:
2−
3−let
4− tag = "0.9.8";
5−in
6−
7−stdenv.mkDerivation rec {
8− name = "stumpwmContrib-${tag}";
9−
10− src = fetchgit {
11− url = "https://github.com/stumpwm/stumpwm";
12− rev = "refs/tags/${tag}";
13− sha256 = "0a0lwwlly4hlmb30bk6dmi6bsdsy37g4crvv1z24gixippyv1qzm";
14− };
15−
16− phases = [ "unpackPhase" "installPhase" ];
17−
18− installPhase = ''
19− mkdir -p $out/bin
20− cp -a $src/contrib $out/
21− cp -a $src/contrib/stumpish $out/bin
22− '';
23−
24− meta = with stdenv.lib; {
25− description = "Extension modules for the StumpWM";
26− homepage = https://github.com/stumpwm/;
27− license = licenses.gpl2Plus;
28− maintainers = with maintainers; [ _1126 ];
29− platforms = platforms.linux;
30− };
31−}
pkgs/applications/window-managers/stumpwm/default.nix+57−28
@@ -1,46 +1,75 @@
1−{ stdenv, pkgs, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4, makeWrapper, stumpwmContrib }:
1+{ stdenv, pkgs, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4
2+, makeWrapper , rlwrap, gnused, gnugrep, coreutils, xprop
3+, extraModulePaths ? [] }:
24
35let
4− tag = "0.9.9";
6+ version = "0.9.9";
7+ contrib = (fetchgit {
8+ url = "https://github.com/stumpwm/stumpwm-contrib.git";
9+ rev = "e139885fffcedaeba4b263e4575daae4364cad52";
10+ sha256 = "fe75bb27538a56f2d213fb21e06a8983699e129a10da7014ddcf6eed5cd965f8";
11+ });
512in
6−
713stdenv.mkDerivation rec {
8− name = "stumpwm-${tag}";
14+ name = "stumpwm-${version}";
15+
16+ src = fetchgit {
17+ url = "https://github.com/stumpwm/stumpwm";
18+ rev = "refs/tags/${version}";
19+ sha256 = "05fkng2wlmhy3kb9zhrrv9zpa16g2p91p5y0wvmwkppy04cw04ps";
20+ };
21+
22+ buildInputs = [
23+ texinfo4 makeWrapper autoconf
24+ sbcl
25+ lispPackages.clx
26+ lispPackages.cl-ppcre
27+ xdpyinfo
28+ ];
29+
30+ # NOTE: The patch needs an update for the next release.
31+ # `(stumpwm:set-module-dir "@MODULE_DIR@")' needs to be in it.
32+ patches = [ ./fix-module-path.patch ];
33+
34+ # Stripping destroys the generated SBCL image
35+ dontStrip = true;
936
10− src = fetchgit {
11− url = "https://github.com/stumpwm/stumpwm";
12− rev = "refs/tags/${tag}";
13− sha256 = "05fkng2wlmhy3kb9zhrrv9zpa16g2p91p5y0wvmwkppy04cw04ps";
14− };
37+ configurePhase = ''
38+ ./autogen.sh
39+ ./configure --prefix=$out --with-module-dir=$out/share/stumpwm/modules
40+ '';
1541
16− buildInputs = [ texinfo4 autoconf lispPackages.clx lispPackages.cl-ppcre sbcl makeWrapper stumpwmContrib ];
42+ preBuild = ''
43+ cp -r --no-preserve=mode ${contrib} modules
44+ '';
1745
18− phases = [ "unpackPhase" "preConfigurePhase" "configurePhase" "installPhase" ];
46+ installPhase = ''
47+ mkdir -pv $out/bin
48+ make install
1949
20− preConfigurePhase = ''
21− $src/autogen.sh
22− mkdir -pv $out/bin
23− '';
50+ mkdir -p $out/share/stumpwm/modules
51+ cp -r modules/* $out/share/stumpwm/modules/
52+ for d in ${stdenv.lib.concatStringsSep " " extraModulePaths}; do
53+ cp -r --no-preserve=mode "$d" $out/share/stumpwm/modules/
54+ done
2455
25− configurePhase = ''
26− ./configure --prefix=$out --with-contrib-dir=${stumpwmContrib}/contrib
27− '';
56+ # Copy stumpish;
57+ cp $out/share/stumpwm/modules/util/stumpish/stumpish $out/bin/
58+ chmod +x $out/bin/stumpish
59+ wrapProgram $out/bin/stumpish \
60+ --prefix PATH ":" "${rlwrap}/bin:${gnused}/bin:${gnugrep}/bin:${coreutils}/bin:${xprop}/bin"
2861
29− installPhase = ''
30− make
31− make install
32− # For some reason, stumpwmContrib is not retained as a runtime
33− # dependency (probably because $out/bin/stumpwm is compressed or
34− # obfuscated in some way). Thus we add an explicit reference here.
35− mkdir $out/nix-support
36− echo ${stumpwmContrib} > $out/nix-support/stumpwm-contrib
37− '';
62+ # Paths in the compressed image $out/bin/stumpwm are not
63+ # recognized by Nix. Add explicit reference here.
64+ mkdir $out/nix-support
65+ echo ${xdpyinfo} > $out/nix-support/xdpyinfo
66+ '';
3867
3968 meta = with stdenv.lib; {
4069 description = "A tiling window manager for X11";
4170 homepage = https://github.com/stumpwm/;
4271 license = licenses.gpl2Plus;
43− maintainers = with maintainers; [ _1126 ];
72+ maintainers = with maintainers; [ _1126 the-kenny ];
4473 platforms = platforms.linux;
4574 };
4675}
pkgs/applications/window-managers/stumpwm/fix-module-path.patchnew file+16
@@ -0,0 +1,16 @@
1+diff --git a/make-image.lisp.in b/make-image.lisp.in
2+index 121e9d6..2210242 100644
3+--- a/make-image.lisp.in
4++++ b/make-image.lisp.in
5+@@ -2,7 +2,10 @@
6+
7+ (load "load-stumpwm.lisp")
8+
9+-#-ecl (stumpwm:set-module-dir "@CONTRIB_DIR@")
10++(setf asdf::*immutable-systems*
11++ (uiop:list-to-hash-set (asdf:already-loaded-systems)))
12++
13++#-ecl (stumpwm:set-module-dir "@MODULE_DIR@")
14+
15+ #+sbcl
16+ (sb-ext:save-lisp-and-die "stumpwm" :toplevel (lambda ()
pkgs/top-level/all-packages.nix−1
@@ -11834,7 +11834,6 @@ let
1183411834
1183511835 stp = callPackage ../applications/science/logic/stp {};
1183611836
11837− stumpwmContrib = callPackage ../applications/window-managers/stumpwm/contrib.nix { };
1183811837 stumpwm = callPackage ../applications/window-managers/stumpwm {
1183911838 sbcl = sbcl_1_2_5;
1184011839 lispPackages = lispPackagesFor (wrapLisp sbcl_1_2_5);