1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 12:11:28 +00:00
nixpkgs/pkgs/games/unciv/default.nix

60 lines
1.2 KiB
Nix
Raw Normal View History

2021-01-18 21:21:05 +00:00
{ stdenv
, lib
, fetchurl
, copyDesktopItems
, makeDesktopItem
, makeWrapper
, jre
, libpulseaudio
, libXxf86vm
}:
let
desktopItem = makeDesktopItem {
name = "unciv";
exec = "unciv";
comment = "An open-source Android/Desktop remake of Civ V";
desktopName = "Unciv";
categories = "Game;";
};
envLibPath = lib.makeLibraryPath [
libpulseaudio
libXxf86vm
];
in
stdenv.mkDerivation rec {
pname = "unciv";
2021-03-13 16:22:57 +00:00
version = "3.13.7-patch2";
2021-01-18 21:21:05 +00:00
src = fetchurl {
url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
2021-03-13 16:22:57 +00:00
sha256 = "sha256-5QYUYTnRblWWLYnhR1DBzoAt4d9EiYeXhzJRODmDHUA=";
2021-01-18 21:21:05 +00:00
};
dontUnpack = true;
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
installPhase = ''
runHook preInstall
makeWrapper ${jre}/bin/java $out/bin/unciv \
--prefix LD_LIBRARY_PATH : ${envLibPath} \
--prefix PATH : ${lib.makeBinPath [ jre ]} \
--add-flags "-jar ${src}"
runHook postInstall
'';
desktopItems = [ desktopItem ];
meta = with lib; {
description = "An open-source Android/Desktop remake of Civ V";
homepage = "https://github.com/yairm210/Unciv";
maintainers = with maintainers; [ tex ];
license = licenses.mpl20;
platforms = [ "x86_64-linux" ];
};
}