about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-15 11:00:09 +0200
committeraszlig <aszlig@nix.build>2018-07-15 11:00:09 +0200
commit2c430626afff03bec16071843f0e661a43cfe2c9 (patch)
tree2faca234d98eadc52a811eb86675e36f3fd1dfb3 /pkgs/games
parent8e5d3291b2aa3901c6dc77a982450667d930dc86 (diff)
thimbleweed-park: Add desktop item
The Ransome Unbeeped DLC doesn't have a data/noarch/support directory
which we need for the icon so we need to change the unpack root to
data/noarch. This shouldn't make the unpacking phase that much longer
because the only additional files that get unpacked are small scripts
and docs.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/gog/thimbleweed-park.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/pkgs/games/gog/thimbleweed-park.nix b/pkgs/games/gog/thimbleweed-park.nix
index a37074cc..b9e14c32 100644
--- a/pkgs/games/gog/thimbleweed-park.nix
+++ b/pkgs/games/gog/thimbleweed-park.nix
@@ -17,7 +17,7 @@ buildGame rec {
     sha256 = "1cfll73qazm9nz40n963qvankqkznfjai9g88kgw6xcl40y8jrqn";
   });
 
-  unpackCmd = "${unzip}/bin/unzip -qq \"$curSrc\" 'data/noarch/game/*' || :";
+  unpackCmd = "${unzip}/bin/unzip -qq \"$curSrc\" 'data/noarch/*' || :";
 
   buildInputs = [ libGL ];
 
@@ -38,15 +38,29 @@ buildGame rec {
     }
     EOF
     patchelf --add-needed "$out/libexec/thimbleweed-park/preload.so" \
-      ThimbleweedPark
+      game/ThimbleweedPark
   '';
 
   installPhase = ''
-    install -vD ThimbleweedPark "$out/bin/thimbleweed-park"
+    install -vD game/ThimbleweedPark "$out/bin/thimbleweed-park"
     install -vD preload.so "$out/libexec/thimbleweed-park/preload.so"
-    for i in *.ggpack[0-9]*; do
-      install -vD -m 0644 "$i" "$out/share/thimbleweed-park/$i"
+    for i in game/*.ggpack[0-9]*; do
+      install -vD -m 0644 "$i" "$out/share/thimbleweed-park/$(basename "$i")"
     done
+
+    install -vD -m 0644 support/icon.png \
+      "$out/share/icons/thimbleweed-park.png"
+
+    mkdir -p "$out/share/applications"
+    cat > "$out/share/applications/thimbleweed-park.desktop" <<EOF
+    [Desktop Entry]
+    Name=Thimbleweed Park
+    Type=Application
+    Version=1.1
+    Exec=$out/bin/thimbleweed-park
+    Icon=$out/share/icons/thimbleweed-park.png
+    Categories=Game
+    EOF
   '';
 
   sandbox.paths.required = [