Files
nixpkgs/pkgs/by-name/un/unciv/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.7 KiB
Nix

{
stdenv,
lib,
fetchurl,
copyDesktopItems,
makeDesktopItem,
makeWrapper,
jre,
libGL,
libpulseaudio,
libXxf86vm,
}:
let
version = "4.18.4";
desktopItem = makeDesktopItem {
name = "unciv";
exec = "unciv";
comment = "An open-source Android/Desktop remake of Civ V";
desktopName = "Unciv";
icon = "unciv";
categories = [ "Game" ];
};
desktopIcon = fetchurl {
url = "https://github.com/yairm210/Unciv/blob/${version}/extraImages/Icons/Unciv%20icon%20v6.png?raw=true";
hash = "sha256-Zuz+HGfxjGviGBKTiHdIFXF8UMRLEIfM8f+LIB/xonk=";
};
envLibPath = lib.makeLibraryPath (
lib.optionals stdenv.hostPlatform.isLinux [
libGL
libpulseaudio
libXxf86vm
]
);
in
stdenv.mkDerivation rec {
pname = "unciv";
inherit version;
src = fetchurl {
url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
hash = "sha256-xF9Y6pil7UZzrN0k/2qZ/FKSj7WudRwF3u167Sz3RyA=";
};
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}"
install -Dm444 ${desktopIcon} $out/share/icons/hicolor/512x512/apps/unciv.png
runHook postInstall
'';
desktopItems = [ desktopItem ];
meta = with lib; {
description = "Open-source Android/Desktop remake of Civ V";
mainProgram = "unciv";
homepage = "https://github.com/yairm210/Unciv";
maintainers = with maintainers; [ tex ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.mpl20;
platforms = platforms.all;
};
}