nixpkgs/pkgs/by-name/un/unciv/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-18 21:21:05 +00:00
{ stdenv
, lib
, fetchurl
, copyDesktopItems
, makeDesktopItem
, makeWrapper
, jre
2024-01-28 17:49:56 +00:00
, libGL
2021-01-18 21:21:05 +00:00
, libpulseaudio
, libXxf86vm
}:
let
desktopItem = makeDesktopItem {
name = "unciv";
exec = "unciv";
comment = "An open-source Android/Desktop remake of Civ V";
desktopName = "Unciv";
categories = [ "Game" ];
2021-01-18 21:21:05 +00:00
};
2024-01-30 05:42:04 +00:00
envLibPath = lib.makeLibraryPath (lib.optionals stdenv.isLinux [
2024-01-28 17:49:56 +00:00
libGL
2021-01-18 21:21:05 +00:00
libpulseaudio
libXxf86vm
2024-01-30 05:42:04 +00:00
]);
2021-01-18 21:21:05 +00:00
in
stdenv.mkDerivation rec {
pname = "unciv";
2024-05-08 16:15:12 +00:00
version = "4.11.10";
2021-01-18 21:21:05 +00:00
src = fetchurl {
url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
2024-05-08 16:15:12 +00:00
hash = "sha256-RBdMgxJRVM8dj4eDh/ZAzJkyWoAJnpge3Vg25H9+Eak=";
2021-01-18 21:21:05 +00:00
};
dontUnpack = true;
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
installPhase = ''
runHook preInstall
makeWrapper ${jre}/bin/java $out/bin/unciv \
2024-01-30 05:42:04 +00:00
--prefix LD_LIBRARY_PATH : "${envLibPath}" \
2021-01-18 21:21:05 +00:00
--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";
mainProgram = "unciv";
2021-01-18 21:21:05 +00:00
homepage = "https://github.com/yairm210/Unciv";
maintainers = with maintainers; [ tex ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2021-01-18 21:21:05 +00:00
license = licenses.mpl20;
2023-02-07 12:09:02 +00:00
platforms = platforms.all;
2021-01-18 21:21:05 +00:00
};
}