1{ lib, stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "libclxclient";
5 version = "3.9.2";
6
7 src = fetchurl {
8 url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clxclient-${version}.tar.bz2";
9 sha256 = "10bq6fy8d3pr1x2x3xx9qhf2hdxrwdgvg843a2y6lx70y1jfj0c5";
10 };
11
12 buildInputs = [ libclthreads libX11 libXft xorg.xorgproto ];
13
14 nativeBuildInputs = [ pkg-config ];
15
16 env.NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include";
17
18 patchPhase = ''
19 cd source
20 # use pkg-config instead of pkgcon:
21 sed -e 's/pkgconf/pkg-config/g' -i ./Makefile
22 # don't run ldconfig:
23 sed -e "/ldconfig/d" -i ./Makefile
24 # make sure it can find clxclient.h:
25 sed -e 's/<clxclient.h>/"clxclient.h"/' -i ./enumip.cc
26 '';
27
28 makeFlags = [
29 "PREFIX=$(out)"
30 "SUFFIX=''"
31 ];
32
33 preInstall = ''
34 # The Makefile does not create the include directory
35 mkdir -p $out/include
36 '';
37
38 postInstall = ''
39 ln $out/lib/libclxclient.so $out/lib/libclxclient.so.3
40 '';
41
42 meta = with lib; {
43 description = "Zita X11 library";
44 homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
45 license = licenses.lgpl21;
46 maintainers = with maintainers; [ magnetophon ];
47 platforms = platforms.linux;
48 };
49}