3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/gpm/default.nix
Dmitry Bogatov 5e831c7d4d
gpm: fix static build
Patch I developed to add support for static build into upstream build system do
not apply cleanly on 1.20.7 release, so instead of backporting it, I decided to
switch to git snapshot instead.  It allowed to get rid of three other patches
in nix expression, since they are applied upstream.
=> https://github.com/telmich/gpm/pull/42

I requested proper release, but chance seems to be slim.
=> https://github.com/telmich/gpm/issues/33

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2022-05-01 06:50:23 +00:00

56 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch, pkgsStatic
, withNcurses ? true, ncurses
}:
stdenv.mkDerivation rec {
pname = "gpm";
version = "unstable-2020-06-17";
src = fetchFromGitHub {
owner = "telmich";
repo = "gpm";
rev = "e82d1a653ca94aa4ed12441424da6ce780b1e530";
sha256 = "0ndn6dwc87slvyqp2cnbb02a6hkjwb6zjhs6viysykv06hq7ihy6";
};
postPatch = ''
substituteInPlace src/prog/gpm-root.y --replace __sigemptyset sigemptyset
'';
nativeBuildInputs = [ automake autoconf libtool flex bison texinfo ];
buildInputs = [ ncurses ];
hardeningDisable = [ "format" ];
patches = [
(fetchpatch { # pull request telmich/gpm#42
url = "https://github.com/kaction/gpm/commit/217b4fe4c9b62298a4e9a54c1f07e3b52b013a09.patch";
sha256 = "1f74h12iph4z1dldbxk9imcq11805c3ai2xhbsqvx8jpjrcfp19q";
})
];
preConfigure = ''
./autogen.sh
'';
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
(if ncurses == null then "--without-curses" else "--with-curses")
];
# Provide libgpm.so for compatability
postInstall = ''
ln -sv $out/lib/libgpm.so.2 $out/lib/libgpm.so
'';
passthru.tests.static = pkgsStatic.gpm;
meta = with lib; {
homepage = "https://www.nico.schottelius.org/software/gpm/";
description = "A daemon that provides mouse support on the Linux console";
license = licenses.gpl2;
platforms = platforms.linux ++ platforms.cygwin;
maintainers = with maintainers; [ eelco ];
};
}