1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 dbus,
7 fltk13,
8 gtk2,
9 libICE,
10 libSM,
11 libtiff,
12 pkg-config,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "afterstep";
17 version = "2.2.12";
18
19 src = fetchFromGitHub {
20 owner = "afterstep";
21 repo = "afterstep";
22 rev = finalAttrs.version;
23 hash = "sha256-j1ADTRZ3Mxv9VNZWhWCFMnM/CJfkphdrgbw9Ca3bBw0=";
24 };
25
26 patches = [
27 (fetchpatch {
28 url = "https://salsa.debian.org/debian/afterstep/raw/master/debian/patches/44-Fix-build-with-gcc-5.patch";
29 hash = "sha256-RNLB6PuFVA1PsYt2VwLyLyvY2OO3oIl1xk+0/6nwN+4=";
30 })
31
32 # Fix pending upstream inclusion for binutils-2.36 support:
33 # https://github.com/afterstep/afterstep/pull/7
34 (fetchpatch {
35 name = "binutils-2.36.patch";
36 url = "https://github.com/afterstep/afterstep/commit/5e9e897cf8c455390dd6f5b27fec49707f6b9088.patch";
37 hash = "sha256-aGMTyojzXEHGjO9lMT6dwLl01Fd333BUuCIX0FU9ac4=";
38 })
39 ];
40
41 postPatch = ''
42 # Causes fatal ldconfig cache generation attempt on non-NixOS Linux
43 for mkfile in autoconf/Makefile.common.lib.in libAfter{Base,Image}/Makefile.in; do
44 substituteInPlace $mkfile \
45 --replace 'test -w /etc' 'false'
46 done
47 '';
48
49 nativeBuildInputs = [
50 pkg-config
51 ];
52
53 buildInputs = [
54 dbus
55 fltk13
56 gtk2
57 libICE
58 libSM
59 libtiff
60 ];
61
62 outputs = [
63 "out"
64 "man"
65 ];
66
67 strictDeps = true;
68
69 # A strange type of bug: dbus is not immediately found by pkg-config
70 preConfigure = ''
71 # binutils 2.37 fix
72 # https://github.com/afterstep/afterstep/issues/2
73 fixupList=(
74 "autoconf/Makefile.defines.in"
75 "libAfterImage/aftershow/Makefile.in"
76 "libAfterImage/apps/Makefile.in"
77 "libAfterBase/Makefile.in"
78 "libAfterImage/Makefile.in"
79 )
80 for toFix in "''${fixupList[@]}"; do
81 substituteInPlace "$toFix" --replace "clq" "cq"
82 done
83 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config dbus-1 --cflags)"
84 '';
85
86 # Parallel build fails due to missing dependencies between private libraries:
87 # ld: cannot find ../libAfterConf/libAfterConf.a: No such file or directory
88 # Let's disable parallel builds until it's fixed upstream:
89 # https://github.com/afterstep/afterstep/issues/8
90 enableParallelBuilding = false;
91
92 meta = {
93 homepage = "http://www.afterstep.org/";
94 description = "NEXTStep-inspired window manager";
95 longDescription = ''
96 AfterStep is a window manager for the Unix X Window System. Originally
97 based on the look and feel of the NeXTStep interface, it provides end
98 users with a consistent, clean, and elegant desktop. The goal of AfterStep
99 development is to provide for flexibility of desktop configuration,
100 improving aestetics, and efficient use of system resources.
101 '';
102 license = lib.licenses.gpl2Plus;
103 maintainers = with lib.maintainers; [ ];
104 mainProgram = "afterstep";
105 platforms = lib.platforms.linux;
106 };
107})