Merge pull request #234184 from wegank/gnushogi-fix
gnushogi: refactor, unbreak on darwin
This commit is contained in:
commit
42c9b42453
|
@ -1,21 +1,31 @@
|
||||||
{ lib, stdenv, fetchurl, zlib }:
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchurl
|
||||||
|
, fetchpatch
|
||||||
|
, zlib
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "gnushogi";
|
pname = "gnushogi";
|
||||||
version = "1.4.2";
|
version = "1.4.2";
|
||||||
buildInputs = [ zlib ];
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://gnu/gnushogi/${pname}-${version}.tar.gz";
|
url = "mirror://gnu/gnushogi/${pname}-${version}.tar.gz";
|
||||||
sha256 = "0a9bsl2nbnb138lq0h14jfc5xvz7hpb2bcsj4mjn6g1hcsl4ik0y";
|
hash = "sha256-HsxIqGYwPGNlJVKzJdaF5+9emJMkQIApGmHZZQXVKyk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
env.LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-Wl,-z,muldefs";
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.org/data/main/g/gnushogi/1.4.2-7/debian/patches/01-make-dont-ignore";
|
||||||
|
hash = "sha256-Aw0zfH+wkj+rQQzKIn6bSilP76YIO27FwJ8n1UzG6ow=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.org/data/main/g/gnushogi/1.4.2-7/debian/patches/globals";
|
||||||
|
hash = "sha256-wZJBPMYSz4n1kOyLmR9QOp70650R9xXQUWD5hvaMRok=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
# Makefile ignores errors, so the build may silently succeed erroneously
|
buildInputs = [ zlib ];
|
||||||
postBuild = ''
|
|
||||||
test -e gnushogi/gnushogi || { echo "ERROR: no binary produced"; exit 1; }
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "GNU implementation of Shogi, also known as Japanese Chess";
|
description = "GNU implementation of Shogi, also known as Japanese Chess";
|
||||||
|
@ -23,6 +33,5 @@ stdenv.mkDerivation rec {
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
maintainers = [ maintainers.ciil ];
|
maintainers = [ maintainers.ciil ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
broken = stdenv.isDarwin; # darwin does not support -z muldefs
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue