ttaenc: init at 3.4.1 (#238757)
[NixPkgs.git] / pkgs / servers / gpm / default.nix
blob3b71f1033474b420f43685de3dec25398e4cd510
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   automake,
6   autoconf,
7   libtool,
8   flex,
9   bison,
10   texinfo,
11   fetchpatch,
12   pkgsStatic,
13   withNcurses ? true,
14   ncurses,
17 stdenv.mkDerivation rec {
18   pname = "gpm";
19   version = "unstable-2020-06-17";
21   src = fetchFromGitHub {
22     owner = "telmich";
23     repo = "gpm";
24     rev = "e82d1a653ca94aa4ed12441424da6ce780b1e530";
25     sha256 = "0ndn6dwc87slvyqp2cnbb02a6hkjwb6zjhs6viysykv06hq7ihy6";
26   };
28   postPatch = ''
29     substituteInPlace src/prog/gpm-root.y --replace __sigemptyset sigemptyset
30   '';
32   nativeBuildInputs = [
33     automake
34     autoconf
35     libtool
36     flex
37     bison
38     texinfo
39   ];
40   buildInputs = [ ncurses ];
42   hardeningDisable = [ "format" ];
44   patches = [
45     (fetchpatch {
46       # pull request telmich/gpm#42
47       url = "https://github.com/kaction/gpm/commit/217b4fe4c9b62298a4e9a54c1f07e3b52b013a09.patch";
48       sha256 = "1f74h12iph4z1dldbxk9imcq11805c3ai2xhbsqvx8jpjrcfp19q";
49     })
51     # Pull fix pending upstream inclusion to fix parallel installation:
52     #   https://github.com/telmich/gpm/pull/43
53     (fetchpatch {
54       name = "parallel-install.patch";
55       url = "https://github.com/telmich/gpm/commit/a88fb82a7afe96e872bb31c554e9ad5888f5a451.patch";
56       sha256 = "0g1jhz9bjw7vqjv922xkhs8xkjxdqh11nj38jj3c8nv5lcil76nx";
57     })
58   ];
59   preConfigure = ''
60     ./autogen.sh
61   '';
63   configureFlags = [
64     "--sysconfdir=/etc"
65     "--localstatedir=/var"
66     (if withNcurses then "--with-curses" else "--without-curses")
67   ];
69   enableParallelBuilding = true;
71   # Provide libgpm.so for compatibility
72   postInstall = ''
73     ln -sv $out/lib/libgpm.so.2 $out/lib/libgpm.so
74   '';
76   passthru.tests.static = pkgsStatic.gpm;
78   meta = with lib; {
79     homepage = "https://www.nico.schottelius.org/software/gpm/";
80     description = "Daemon that provides mouse support on the Linux console";
81     license = licenses.gpl2Plus;
82     platforms = platforms.linux ++ platforms.cygwin;
83     maintainers = [ ];
84   };