summaryrefslogtreecommitdiffstats
path: root/pkgs/games
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2020-11-29 13:26:40 +0100
committerGitHub <noreply@github.com>2020-11-29 13:26:40 +0100
commitdb29c15173d23c1574d618cfc05dae63f85c315e (patch)
treeab4eac89f585d85710bdfb0925787fb058f91280 /pkgs/games
parentda817c1a98cf4cc3654dbeff88254e7bc5219f2d (diff)
parentb65a1ab2a4d2e4d34f41e94ef59f2479561bd5c9 (diff)
Merge pull request #105151 from B4dM4n/copy-desktop-hook
copyDesktopItems: add new setup-hook
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/minecraft/default.nix11
-rw-r--r--pkgs/games/xonotic/default.nix7
2 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index 1b4cf3197210..f419be8d63bf 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,6 +1,7 @@
{ stdenv
, fetchurl
, nixosTests
+, copyDesktopItems
, makeDesktopItem
, makeWrapper
, wrapGAppsHook
@@ -38,7 +39,6 @@ let
comment = "Official launcher for Minecraft, a sandbox-building game";
desktopName = "Minecraft Launcher";
categories = "Game;";
- fileValidation = false;
};
envLibPath = stdenv.lib.makeLibraryPath [
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim";
};
- nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
+ nativeBuildInputs = [ makeWrapper wrapGAppsHook copyDesktopItems ];
buildInputs = [ gobject-introspection ];
sourceRoot = ".";
@@ -110,11 +110,14 @@ stdenv.mkDerivation rec {
dontBuild = true;
installPhase = ''
+ runHook preInstall
+
mkdir -p $out/opt
mv minecraft-launcher $out/opt
- ${desktopItem.buildCommand}
install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg
+
+ runHook postInstall
'';
preFixup = ''
@@ -140,6 +143,8 @@ stdenv.mkDerivation rec {
"''${gappsWrapperArgs[@]}"
'';
+ desktopItems = [ desktopItem ];
+
meta = with stdenv.lib; {
description = "Official launcher for Minecraft, a sandbox-building game";
homepage = "https://minecraft.net";
diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix
index ab6ac022b6c2..60ebdcf8eebf 100644
--- a/pkgs/games/xonotic/default.nix
+++ b/pkgs/games/xonotic/default.nix
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, fetchzip, makeWrapper, runCommandNoCC, makeDesktopItem
-, xonotic-data
+, xonotic-data, copyDesktopItems
, # required for both
unzip, libjpeg, zlib, libvorbis, curl
, # glx
@@ -131,7 +131,8 @@ in rec {
xonotic = runCommandNoCC "xonotic${variant}-${version}" {
inherit xonotic-unwrapped;
- buildInputs = [ makeWrapper ];
+ nativeBuildInputs = [ makeWrapper copyDesktopItems ];
+ desktopItems = [ desktopItem ];
passthru = {
inherit version;
meta = meta // {
@@ -151,7 +152,7 @@ in rec {
'' + lib.optionalString (withSDL || withGLX) ''
mkdir -p $out/share
ln -s ${xonotic-unwrapped}/share/icons $out/share/icons
- ${desktopItem.buildCommand}
+ copyDesktopItems
'' + ''
for binary in $out/bin/xonotic-*; do
wrapProgram $binary --add-flags "-basedir ${xonotic-data}"