nixpkgs/pkgs/by-name/un/unciv/package.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

64 lines
1.4 KiB
Nix

{ stdenv
, lib
, fetchurl
, copyDesktopItems
, makeDesktopItem
, makeWrapper
, jre
, libGL
, 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 (lib.optionals stdenv.isLinux [
libGL
libpulseaudio
libXxf86vm
]);
in
stdenv.mkDerivation rec {
pname = "unciv";
version = "4.11.16";
src = fetchurl {
url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
hash = "sha256-hvWXqPT+GeMaBa7so0S1KjsH5fpnbcbEIWsq6KUbFTk=";
};
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 = "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;
};
}