From 7536d4128750e9482a61df4d6460eaebed9a1faf Mon Sep 17 00:00:00 2001 From: _1126 Date: Sun, 5 Oct 2014 14:50:08 +0200 Subject: [PATCH 1/2] stumpwm: update and refactoring This commit updates the stumpwm to version 0.9.8. Futhermore, it refactors the expression quite a lot: * stumpwm has been moved from lisp modules to window-managers. * stumpwm has been added to the window managers NixOS knows about, this enables the user to add stumpwm as a default window manager in his NixOS configuration like with Xmonad or i3. * the package has been split into stumpwm and stumpwmContrib. This is due to the fact that development of stumpwm and its extension modules has been split into two repositories. As of today, the release is the last one before this split. This split into two packages only reflect those upcoming upstream changes already. It is planned to make the addition of the extension modules voluntarily, like with Xmonads option "enableContribAndExtras". Furthermore it might be possible to add an option to compile stumpwm with clisp instead of sbcl. --- .../services/x11/window-managers/default.nix | 3 +- .../services/x11/window-managers/stumpwm.nix | 30 ++++++++++++++ .../window-managers/stumpwm/contrib.nix | 31 ++++++++++++++ .../window-managers/stumpwm/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 +- 5 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 nixos/modules/services/x11/window-managers/stumpwm.nix create mode 100644 pkgs/applications/window-managers/stumpwm/contrib.nix create mode 100644 pkgs/applications/window-managers/stumpwm/default.nix diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix index 45a4e947e0a..4f2a2309b60 100644 --- a/nixos/modules/services/x11/window-managers/default.nix +++ b/nixos/modules/services/x11/window-managers/default.nix @@ -18,6 +18,7 @@ in ./i3.nix ./herbstluftwm.nix ./bspwm.nix + ./stumpwm.nix ]; options = { @@ -60,4 +61,4 @@ in config = { services.xserver.displayManager.session = cfg.session; }; -} +} \ No newline at end of file diff --git a/nixos/modules/services/x11/window-managers/stumpwm.nix b/nixos/modules/services/x11/window-managers/stumpwm.nix new file mode 100644 index 00000000000..a876f13fd21 --- /dev/null +++ b/nixos/modules/services/x11/window-managers/stumpwm.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.xserver.windowManager.stumpwm; +in + +{ + options = { + services.xserver.windowManager.stumpwm = { + enable = mkOption { + type = types.bool; + default = false; + example = true; + description = "Enable the stumpwm tiling window manager."; + }; + }; + }; + + config = mkIf cfg.enable { + services.xserver.windowManager.session = singleton { + name = "stumpwm"; + start = " + ${pkgs.stumpwm}/bin/stumpwm + "; + }; + environment.systemPackages = [ pkgs.stumpwm ]; + }; +} diff --git a/pkgs/applications/window-managers/stumpwm/contrib.nix b/pkgs/applications/window-managers/stumpwm/contrib.nix new file mode 100644 index 00000000000..dc707983811 --- /dev/null +++ b/pkgs/applications/window-managers/stumpwm/contrib.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchgit }: + +let + tag = "0.9.8"; +in + +stdenv.mkDerivation rec { + name = "stumpwmContrib-${tag}"; + + src = fetchgit { + url = "https://github.com/stumpwm/stumpwm"; + rev = "refs/tags/${tag}"; + sha256 = "0a0lwwlly4hlmb30bk6dmi6bsdsy37g4crvv1z24gixippyv1qzm"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir -p $out/bin + cp -a $src/contrib $out/ + cp -a $src/contrib/stumpish $out/bin + ''; + + meta = with stdenv.lib; { + description = "Extension modules for the StumpWM"; + homepage = https://github.com/stumpwm/; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ _1126 ]; + platforms = platforms.linux; + }; +} \ No newline at end of file diff --git a/pkgs/applications/window-managers/stumpwm/default.nix b/pkgs/applications/window-managers/stumpwm/default.nix new file mode 100644 index 00000000000..7fe28b1678a --- /dev/null +++ b/pkgs/applications/window-managers/stumpwm/default.nix @@ -0,0 +1,41 @@ +{ stdenv, pkgs, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4, makeWrapper, stumpwmContrib }: + +let + tag = "0.9.8"; +in + +stdenv.mkDerivation rec { + name = "stumpwm-${tag}"; + + src = fetchgit { + url = "https://github.com/stumpwm/stumpwm"; + rev = "refs/tags/${tag}"; + sha256 = "0a0lwwlly4hlmb30bk6dmi6bsdsy37g4crvv1z24gixippyv1qzm"; + }; + + buildInputs = [ texinfo4 autoconf lispPackages.clx lispPackages.cl-ppcre sbcl makeWrapper stumpwmContrib ]; + + phases = [ "unpackPhase" "preConfigurePhase" "configurePhase" "installPhase" ]; + + preConfigurePhase = '' + $src/autogen.sh + mkdir -pv $out/bin + ''; + + configurePhase = '' + ./configure --prefix=$out --with-contrib-dir=${pkgs.stumpwmContrib}/contrib + ''; + + installPhase = '' + make + make install + ''; + + meta = with stdenv.lib; { + description = "A tiling window manager for X11"; + homepage = https://github.com/stumpwm/; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ _1126 ]; + platforms = platforms.linux; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f8382928e0b..07d3b3a5432 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10183,7 +10183,8 @@ let stp = callPackage ../applications/science/logic/stp {}; - stumpwm = lispPackages.stumpwm; + stumpwm = callPackage ../applications/window-managers/stumpwm {}; + stumpwmContrib = callPackage ../applications/window-managers/stumpwm/contrib.nix {}; sublime = callPackage ../applications/editors/sublime { }; From 7b81cd68b7b459727dd3d403c78acb6a6805ac89 Mon Sep 17 00:00:00 2001 From: _1126 Date: Sun, 5 Oct 2014 16:42:32 +0200 Subject: [PATCH 2/2] stumpwm: removed from lisp-packages. --- .../lisp-modules/lisp-packages.nix | 2 -- .../lisp-modules/stumpwm/default.nix | 36 ------------------- 2 files changed, 38 deletions(-) delete mode 100644 pkgs/development/lisp-modules/stumpwm/default.nix diff --git a/pkgs/development/lisp-modules/lisp-packages.nix b/pkgs/development/lisp-modules/lisp-packages.nix index 14c996fa05a..d9359da0a6a 100644 --- a/pkgs/development/lisp-modules/lisp-packages.nix +++ b/pkgs/development/lisp-modules/lisp-packages.nix @@ -44,8 +44,6 @@ let lispPackages = rec { }; }; - stumpwm = callPackage ./stumpwm {}; - alexandria = buildLispPackage rec { baseName = "alexandria"; version = "git-20131029"; diff --git a/pkgs/development/lisp-modules/stumpwm/default.nix b/pkgs/development/lisp-modules/stumpwm/default.nix deleted file mode 100644 index ae0dab1ec9d..00000000000 --- a/pkgs/development/lisp-modules/stumpwm/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{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) --with-contrib-dir=$out/lib/common-lisp/stumpwm/contrib/" - ''; - installPhase = with pkgs; x.installPhase + '' - make install - - if [ "$NIX_LISP" = "sbcl" ]; then - wrapProgram "$out"/bin/stumpwm --set SBCL_HOME "${clwrapper.lisp}/lib/sbcl" - fi; - - mv $out/lib/common-lisp/stumpwm/contrib/stumpish $out/bin/stumpish - wrapProgram "$out"/bin/stumpish --prefix PATH : "${xlibs.xprop}/bin:${coreutils}/bin:${gnugrep}/bin:${gnused}/bin:${rlwrap}/bin:${ncurses}/bin" - ''; - postInstall = ''false''; - }; -}