mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 18:14:42 +00:00
Merge pull request #181944 from tomfitzhenry/sgtpuzzles-cmake
sgtpuzzles: bump 2 years, and fix icons
This commit is contained in:
commit
3aa086b0f0
@ -1,39 +1,38 @@
|
||||
{ lib, stdenv, fetchurl, desktop-file-utils
|
||||
, gtk3, libX11
|
||||
, makeWrapper, pkg-config, perl, autoreconfHook, wrapGAppsHook
|
||||
, gtk3, libX11, cmake, imagemagick
|
||||
, pkg-config, perl, wrapGAppsHook
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sgt-puzzles";
|
||||
version = "20200610.9aa7b7c";
|
||||
version = "20220613.387d323";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles-${version}.tar.gz";
|
||||
sha256 = "0rrd1c77ar91zqy4rr4xp1z7x3ywnshlac99cga4hnrgwb7vwl3f";
|
||||
hash = "sha256-Vcm7gxC9R7vvLkgkHblvEOONGLkYSHGMRfSBktgN/oQ=";
|
||||
};
|
||||
|
||||
sgt-puzzles-menu = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/Oleh-Kravchenko/portage/master/games-puzzle/sgt-puzzles/files/sgt-puzzles.menu";
|
||||
url = "https://raw.githubusercontent.com/gentoo/gentoo/720e614d0107e86fc1e520bac17726578186843d/games-puzzle/sgt-puzzles/files/sgt-puzzles.menu";
|
||||
sha256 = "088w0x9g3j8pn725ix8ny8knhdsfgjr3hpswsh9fvfkz5vlg2xkm";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook desktop-file-utils makeWrapper
|
||||
pkg-config perl wrapGAppsHook ];
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
desktop-file-utils
|
||||
imagemagick
|
||||
perl
|
||||
pkg-config
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [ gtk3 libX11 ];
|
||||
|
||||
makeFlags = [ "prefix=$(out)" "gamesdir=$(out)/bin"];
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p "$out"/{bin,share/doc/sgtpuzzles}
|
||||
cp gamedesc.txt LICENCE README "$out/share/doc/sgtpuzzles"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
for i in $(basename -s $out/bin/*); do
|
||||
|
||||
ln -s $out/bin/$i $out/bin/sgt-puzzle-$i
|
||||
install -Dm644 icons/$i-48d24.png -t $out/share/icons/hicolor/48x48/apps/
|
||||
install -Dm644 icons/$i-96d24.png -t $out/share/icons/hicolor/96x96/apps/
|
||||
|
||||
# Generate/validate/install .desktop files.
|
||||
echo "[Desktop Entry]" > $i.desktop
|
||||
@ -43,7 +42,7 @@ stdenv.mkDerivation rec {
|
||||
--set-key Name --set-value $i \
|
||||
--set-key Comment --set-value "${meta.description}" \
|
||||
--set-key Categories --set-value "Game;LogicGame;X-sgt-puzzles;" \
|
||||
--set-key Icon --set-value $out/share/icons/hicolor/48x48/apps/$i-48d24 \
|
||||
--set-key Icon --set-value $out/share/icons/hicolor/96x96/apps/$i-96d24.png \
|
||||
$i.desktop
|
||||
done
|
||||
|
||||
@ -57,16 +56,10 @@ stdenv.mkDerivation rec {
|
||||
install -Dm644 ${sgt-puzzles-menu} -t $out/etc/xdg/menus/applications-merged/
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
perl mkfiles.pl
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error"
|
||||
cp Makefile.gtk Makefile
|
||||
'';
|
||||
meta = with lib; {
|
||||
description = "Simon Tatham's portable puzzle collection";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.raskin ];
|
||||
maintainers = with maintainers; [ raskin tomfitzhenry ];
|
||||
platforms = platforms.linux;
|
||||
homepage = "https://www.chiark.greenend.org.uk/~sgtatham/puzzles/";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user