Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpm: fix static build #144909

Merged
merged 5 commits into from
May 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 13 additions & 26 deletions pkgs/servers/gpm/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{ lib, stdenv, fetchurl, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch

# Optional Dependencies
, ncurses ? null
{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, flex, bison, texinfo, fetchpatch, pkgsStatic
, withNcurses ? true, ncurses
}:

stdenv.mkDerivation rec {
pname = "gpm";
version = "1.20.7";
version = "unstable-2020-06-17";

src = fetchurl {
url = "https://www.nico.schottelius.org/software/gpm/archives/gpm-${version}.tar.bz2";
sha256 = "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh";
src = fetchFromGitHub {
owner = "telmich";
repo = "gpm";
rev = "e82d1a653ca94aa4ed12441424da6ce780b1e530";
sha256 = "0ndn6dwc87slvyqp2cnbb02a6hkjwb6zjhs6viysykv06hq7ihy6";
};

postPatch = ''
Expand All @@ -23,24 +23,9 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ];

patches = [
# musl compat patches, safe everywhere
(fetchpatch {
url = "https://github.com/raw/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://github.com/raw/gentoo/musl/5aed405d87dfa92a5cab1596f898e9dea07169b8/sys-libs/gpm/files/gpm-1.20.7-musl-portable-sigaction.patch";
sha256 = "0hfdqm9977hd5dpzn05y0a6jbj55w1kp4hd9gyzmg9wslmxni4rg";
})
(fetchpatch {
url = "https://github.com/raw/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 = ''
Expand All @@ -58,6 +43,8 @@ stdenv.mkDerivation rec {
ln -sv $out/lib/libgpm.so.2 $out/lib/libgpm.so
'';

passthru.tests.static = pkgsStatic.gpm;
KAction marked this conversation as resolved.
Show resolved Hide resolved

meta = with lib; {
homepage = "https://www.nico.schottelius.org/software/gpm/";
description = "A daemon that provides mouse support on the Linux console";
Expand Down