@@ -0,0 +1,51 @@
1+{ stdenv, fetchFromGitHub,
2+ xlibsWrapper, libev, libXi, libXfixes,
3+ pkgconfig, asciidoc, libxslt, docbook_xsl }:
4+
5+let version = "1.2"; in
6+
7+stdenv.mkDerivation {
8+ name = "unclutter-xfixes-${version}";
9+ version = version;
10+
11+ src = fetchFromGitHub {
12+ owner = "Airblader";
13+ repo = "unclutter-xfixes";
14+ rev = "v${version}";
15+ sha256 = "1pw567mj7mq5kr8mqnyrvy7jj62qfg6zgqfyzz21nncslddnjzg8";
16+ };
17+
18+ nativeBuildInputs = [pkgconfig];
19+ buildInputs = [
20+ xlibsWrapper libev libXi libXfixes
21+ asciidoc libxslt docbook_xsl
22+ ];
23+
24+ postPatch = ''
25+ substituteInPlace Makefile --replace "CC = gcc" "CC = cc"
26+ '';
27+
28+ preBuild = ''
29+ # The Makefile calls git only to discover the package version,
30+ # but that doesn't work right in the build environment,
31+ # so we fake it.
32+ git() { echo v${version}; }
33+ export -f git
34+ '';
35+
36+ preInstall = ''
37+ export DESTDIR=$out MANDIR=/man/man1
38+ '';
39+
40+ postInstall = ''
41+ mv $out/usr/bin $out/bin
42+ mv $out/usr/share/man $out/man
43+ '';
44+
45+ meta = with stdenv.lib; {
46+ description = "Rewrite of unclutter using the X11 Xfixes extension";
47+ platforms = platforms.unix;
48+ license = stdenv.lib.licenses.mit;
49+ inherit version;
50+ };
51+}