@ -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 = " g p m " ;
version = " 1 . 2 0 . 7 " ;
version = " u n s t a b l e - 2 0 2 0 - 0 6 - 1 7 " ;
src = fetchurl {
url = " h t t p s : / / w w w . n i c o . s c h o t t e l i u s . o r g / s o f t w a r e / g p m / a r c h i v e s / g p m - ${ version } . t a r . b z 2 " ;
sha256 = " 1 3 d 4 2 6 a 8 h 4 0 3 c k p c 8 z y f 7 s 2 p 5 r q l 0 l q b g 2 b v 0 4 5 4 x 0 p v g b f b f 4 g h " ;
src = fetchFromGitHub {
owner = " t e l m i c h " ;
repo = " g p m " ;
rev = " e 8 2 d 1 a 6 5 3 c a 9 4 a a 4 e d 1 2 4 4 1 4 2 4 d a 6 c e 7 8 0 b 1 e 5 3 0 " ;
sha256 = " 0 n d n 6 d w c 8 7 s l v y q p 2 c n b b 0 2 a 6 h k j w b 6 z j h s 6 v i y s y k v 0 6 h q 7 i h y 6 " ;
} ;
postPatch = ''
@ -23,24 +23,9 @@ stdenv.mkDerivation rec {
hardeningDisable = [ " f o r m a t " ] ;
patches = [
# musl compat patches, safe everywhere
( fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / g e n t o o / m u s l / 5 a e d 4 0 5 d 8 7 d f a 9 2 a 5 c a b 1 5 9 6 f 8 9 8 e 9 d e a 0 7 1 6 9 b 8 / s y s - l i b s / g p m / f i l e s / g p m - 1 . 2 0 . 7 - m u s l - m i s s i n g - h e a d e r s . p a t c h " ;
sha256 = " 1 g 3 3 8 m 6 j 1 s b a 8 4 w l q p 1 r 6 r p a b j 5 n m 6 k i 5 7 7 h j a l g 4 6 c z g 0 l f p 2 0 h " ;
} )
# Touches same code as glibc fix in postPatch above, but on the non-glibc route
( fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / g e n t o o / m u s l / 5 a e d 4 0 5 d 8 7 d f a 9 2 a 5 c a b 1 5 9 6 f 8 9 8 e 9 d e a 0 7 1 6 9 b 8 / s y s - l i b s / g p m / f i l e s / g p m - 1 . 2 0 . 7 - m u s l - p o r t a b l e - s i g a c t i o n . p a t c h " ;
sha256 = " 0 h f d q m 9 9 7 7 h d 5 d p z n 0 5 y 0 a 6 j b j 5 5 w 1 k p 4 h d 9 g y z m g 9 w s l m x n i 4 r g " ;
} )
( fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / g e n t o o / m u s l / 5 a e d 4 0 5 d 8 7 d f a 9 2 a 5 c a b 1 5 9 6 f 8 9 8 e 9 d e a 0 7 1 6 9 b 8 / s y s - l i b s / g p m / f i l e s / g p m - 1 . 2 0 . 7 - s y s m a c r o s . p a t c h " ;
sha256 = " 0 l g 4 l 9 p h v y 2 n 8 g y 1 7 q s n 6 z n 0 q q 5 2 v m 8 g 0 1 p g q 5 k q p r 8 s d 3 f b 2 1 c 2 " ;
} )
( fetchpatch {
# upstream build fix against -fno-common compilers like >=gcc-10
url = " h t t p s : / / g i t h u b . c o m / t e l m i c h / g p m / c o m m i t / f 0 4 f 2 4 d d 5 c a 5 c 1 c 1 3 6 0 8 b 1 4 4 a b 6 6 e 2 c c d 4 7 f 1 0 6 a . p a t c h " ;
sha256 = " 1 q 5 h l 5 m 6 1 p c i 2 f 0 x 7 r 5 i n 9 9 r m q h 3 2 8 v 1 k 0 z j 2 6 9 3 w d l a f k 9 d a b k s " ;
( fetchpatch { # pull request telmich/gpm#42
url = " h t t p s : / / g i t h u b . c o m / k a c t i o n / g p m / c o m m i t / 2 1 7 b 4 f e 4 c 9 b 6 2 2 9 8 a 4 e 9 a 5 4 c 1 f 0 7 e 3 b 5 2 b 0 1 3 a 0 9 . p a t c h " ;
sha256 = " 1 f 7 4 h 1 2 i p h 4 z 1 d l d b x k 9 i m c q 1 1 8 0 5 c 3 a i 2 x h b s q v x 8 j p j r c f p 1 9 q " ;
} )
] ;
preConfigure = ''
@ -58,6 +43,8 @@ stdenv.mkDerivation rec {
ln - sv $ out/lib/libgpm.so.2 $ out/lib/libgpm.so
'' ;
passthru . tests . static = pkgsStatic . gpm ;
meta = with lib ; {
homepage = " h t t p s : / / w w w . n i c o . s c h o t t e l i u s . o r g / s o f t w a r e / g p m / " ;
description = " A d a e m o n t h a t p r o v i d e s m o u s e s u p p o r t o n t h e L i n u x c o n s o l e " ;