about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
blob: 40f259677ff4e63d498f3986780f770625489214 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkg-config }:

stdenv.mkDerivation rec {
  pname = "libclxclient";
  version = "3.9.2";

  src = fetchurl {
    url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clxclient-${version}.tar.bz2";
    sha256 = "10bq6fy8d3pr1x2x3xx9qhf2hdxrwdgvg843a2y6lx70y1jfj0c5";
  };

  buildInputs = [ libclthreads libX11 libXft xorg.xorgproto ];

  nativeBuildInputs = [ pkg-config ];

  env.NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include";

  patchPhase = ''
    cd source
    # use pkg-config instead of pkgcon:
    sed -e 's/pkgconf/pkg-config/g' -i ./Makefile
    # don't run ldconfig:
    sed -e "/ldconfig/d" -i ./Makefile
    # make sure it can find clxclient.h:
    sed -e 's/<clxclient.h>/"clxclient.h"/' -i ./enumip.cc
  '';

  makeFlags = [
    "PREFIX=$(out)"
    "SUFFIX=''"
  ];

  preInstall = ''
    # The Makefile does not create the include directory
    mkdir -p $out/include
  '';

  postInstall = ''
    ln $out/lib/libclxclient.so $out/lib/libclxclient.so.3
  '';

  meta = with lib; {
    description = "Zita X11 library";
    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
    license = licenses.lgpl21;
    maintainers = with maintainers; [ magnetophon ];
    platforms = platforms.linux;
  };
}