From 993b7b921b55390e3c796cfaa7c957804260ee92 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 6 Nov 2021 12:51:10 -0400 Subject: [PATCH 1/5] 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 --- pkgs/servers/gpm/default.nix | 39 +++++++++++++----------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index 206ac6131e42d..023719010b7e7 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -1,16 +1,18 @@ -{ lib, stdenv, fetchurl, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch +{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch, pkgsStatic # Optional Dependencies , ncurses ? null }: stdenv.mkDerivation rec { - pname = "gpm"; - version = "1.20.7"; - - src = fetchurl { - url = "https://www.nico.schottelius.org/software/gpm/archives/gpm-${version}.tar.bz2"; - sha256 = "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"; + pname = "gpm-unstable"; + version = "2020-06-17"; + + src = fetchFromGitHub { + owner = "telmich"; + repo = "gpm"; + rev = "e82d1a653ca94aa4ed12441424da6ce780b1e530"; + sha256 = "0ndn6dwc87slvyqp2cnbb02a6hkjwb6zjhs6viysykv06hq7ihy6"; }; postPatch = '' @@ -23,24 +25,9 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; patches = [ - # musl compat patches, safe everywhere - (fetchpatch { - url = "https://raw.githubusercontent.com/gentoo/musl/5aed405d87dfa92a5cab1596f898e9dea07169b8/sys-libs/gpm/files/gpm-1.20.7-musl-missing-headers.patch"; - sha256 = "1g338m6j1sba84wlqp1r6rpabj5nm6ki577hjalg46czg0lfp20h"; - }) - # Touches same code as glibc fix in postPatch above, but on the non-glibc route - (fetchpatch { - url = "https://raw.githubusercontent.com/gentoo/musl/5aed405d87dfa92a5cab1596f898e9dea07169b8/sys-libs/gpm/files/gpm-1.20.7-musl-portable-sigaction.patch"; - sha256 = "0hfdqm9977hd5dpzn05y0a6jbj55w1kp4hd9gyzmg9wslmxni4rg"; - }) - (fetchpatch { - url = "https://raw.githubusercontent.com/gentoo/musl/5aed405d87dfa92a5cab1596f898e9dea07169b8/sys-libs/gpm/files/gpm-1.20.7-sysmacros.patch"; - sha256 = "0lg4l9phvy2n8gy17qsn6zn0qq52vm8g01pgq5kqpr8sd3fb21c2"; - }) - (fetchpatch { - # upstream build fix against -fno-common compilers like >=gcc-10 - url = "https://github.com/telmich/gpm/commit/f04f24dd5ca5c1c13608b144ab66e2ccd47f106a.patch"; - sha256 = "1q5hl5m61pci2f0x7r5in99rmqh328v1k0zj2693wdlafk9dabks"; + (fetchpatch { # pull request telmich/gpm#42 + url = "https://github.com/kaction/gpm/commit/217b4fe4c9b62298a4e9a54c1f07e3b52b013a09.patch"; + sha256 = "1f74h12iph4z1dldbxk9imcq11805c3ai2xhbsqvx8jpjrcfp19q"; }) ]; preConfigure = '' @@ -51,6 +38,7 @@ stdenv.mkDerivation rec { "--sysconfdir=/etc" "--localstatedir=/var" (if ncurses == null then "--without-curses" else "--with-curses") + (if stdenv.hostPlatform.isStatic then "--enable-shared=no" else "--enable-shared=yes") ]; # Provide libgpm.so for compatability @@ -58,6 +46,7 @@ stdenv.mkDerivation rec { 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"; From 40a00140fccd65182a335f301f28a4f35b272b7e Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Thu, 11 Nov 2021 18:31:26 -0500 Subject: [PATCH 2/5] Update pkgs/servers/gpm/default.nix Co-authored-by: Sandro --- pkgs/servers/gpm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index 023719010b7e7..139abee5494be 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -5,8 +5,8 @@ }: stdenv.mkDerivation rec { - pname = "gpm-unstable"; - version = "2020-06-17"; + pname = "gpm"; + version = "unstable-2020-06-17"; src = fetchFromGitHub { owner = "telmich"; From 46df16cbe65d3f9bec738eb03f33c870fdbaabf2 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Thu, 11 Nov 2021 18:31:46 -0500 Subject: [PATCH 3/5] Update pkgs/servers/gpm/default.nix Co-authored-by: Sandro --- pkgs/servers/gpm/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index 139abee5494be..aae1d7281d6ee 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -47,6 +47,7 @@ stdenv.mkDerivation rec { ''; 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"; From 4a5ec84caa62facf9cd2bc0d483f604e76fc4728 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 30 Apr 2022 23:01:26 -0400 Subject: [PATCH 4/5] Update pkgs/servers/gpm/default.nix Co-authored-by: Alyssa Ross --- pkgs/servers/gpm/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index aae1d7281d6ee..fd745da0f1408 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -38,7 +38,6 @@ stdenv.mkDerivation rec { "--sysconfdir=/etc" "--localstatedir=/var" (if ncurses == null then "--without-curses" else "--with-curses") - (if stdenv.hostPlatform.isStatic then "--enable-shared=no" else "--enable-shared=yes") ]; # Provide libgpm.so for compatability From fc3db96f2bc285130906f23442b9e7e068652ce8 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 30 Apr 2022 23:01:36 -0400 Subject: [PATCH 5/5] Update pkgs/servers/gpm/default.nix Co-authored-by: Sandro --- pkgs/servers/gpm/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index fd745da0f1408..f132f98344a99 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -1,7 +1,5 @@ { lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch, pkgsStatic - -# Optional Dependencies -, ncurses ? null +, withNcurses ? true, ncurses }: stdenv.mkDerivation rec {