summary refs log tree commit diff
path: root/pkgs/applications/misc/xneur/default.nix
blob: ff7c6a9e9767c181c68bf8eda9fa0b5ee06107dc (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
{ stdenv, fetchurl, pkgconfig, xorg, pcre, gstreamer, glib, libxml2
, aspell, cairo, imlib2, xosd, libnotify, gtk2, pango, atk, enchant,
 gdk_pixbuf}:

let s = import ./src-for-default.nix; in

stdenv.mkDerivation rec {
  inherit (s) version name;
  src = fetchurl {
    inherit(s) url;
    sha256 = s.hash;
  };

  buildInputs =
    [ xorg.libX11 pkgconfig pcre gstreamer glib libxml2 aspell cairo
      xorg.libXpm imlib2 xosd xorg.libXt xorg.libXext xorg.libXi libnotify
      gtk2 pango enchant gdk_pixbuf
    ];

  preConfigure = ''
    sed -e 's/-Werror//' -i configure
    sed -e 's@for aspell_dir in@for aspell_dir in ${aspell} @' -i configure
    sed -e 's@for imlib2_dir in@for imlib2_dir in ${imlib2} @' -i configure
    sed -e 's@for xosd_dir in@for xosd_dir in ${xosd} @' -i configure

    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gtk2.dev}/include/gtk-2.0"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gtk2.out}/lib/gtk-2.0/include"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${cairo.dev}/include/cairo"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pango.dev}/include/pango-1.0"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${atk.dev}/include/atk-1.0"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gdk_pixbuf.dev}/include/gdk-pixbuf-2.0"
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gdk_pixbuf.out}/lib/gdk-pixbuf-2.0/include"

    export NIX_LDFLAGS="$NIX_LDFLAGS -lnotify"
  '';

  meta = {
    description = "Utility for switching between keyboard layouts";
    homepage = https://xneur.ru;
    license = stdenv.lib.licenses.gpl2Plus;
    maintainers = [ stdenv.lib.maintainers.raskin ];
    platforms = stdenv.lib.platforms.linux;
  };
}