2021-11-07 08:19:12 +00:00
|
|
|
{ fetchFromGitHub, fetchpatch, ncurses, lib, stdenv,
|
2017-11-24 00:24:19 +00:00
|
|
|
updateAutotoolsGnuConfigScriptsHook }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "freesweep";
|
2017-11-24 00:24:19 +00:00
|
|
|
version = "1.0.1";
|
|
|
|
|
2018-11-15 06:48:39 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rwestlund";
|
|
|
|
repo = "freesweep";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0grkwmz9whg1vlnk6gbr0vv9i2zgbd036182pk0xj4cavaj9rpjb";
|
2017-11-24 00:24:19 +00:00
|
|
|
};
|
|
|
|
|
2021-11-07 08:19:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull fix pending upstream inclusion for -fno-common toolchains
|
|
|
|
# like upstream gcc-10+ or clang-13:
|
|
|
|
# https://github.com/rwestlund/freesweep/pull/8
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/rwestlund/freesweep/commit/a86245df4f3ff276a393f799d737d28a5cb0a5a8.patch";
|
|
|
|
sha256 = "13gs3bjb68ixyn9micza7gjd489rd2f5pdrv6sip9fsa6ya29xky";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Pull fix pending upstream inclusion for ncurses-6.3:
|
|
|
|
# https://github.com/rwestlund/freesweep/pull/10
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ncurses-6.3.patch";
|
|
|
|
url = "https://github.com/rwestlund/freesweep/commit/b0aef2bd0b2409d1e859af7d29bf2d86fc7bcea7.patch";
|
|
|
|
sha256 = "1nzvmvxhjxgm8228h1zz16w62iy6lak5sibif1s1f6p1ssn659jp";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-11-24 00:24:19 +00:00
|
|
|
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlags="$configureFlags --with-prefsdir=$out/share"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -D -m 0555 freesweep $out/bin/freesweep
|
|
|
|
install -D -m 0444 sweeprc $out/share/sweeprc
|
|
|
|
install -D -m 0444 freesweep.6 $out/share/man/man6/freesweep.6
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-11-24 00:24:19 +00:00
|
|
|
description = "A console minesweeper-style game written in C for Unix-like systems";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/rwestlund/freesweep";
|
2017-11-24 00:24:19 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ kierdavis ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|