summaryrefslogtreecommitdiffstats
path: root/pkgs/games
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-22 12:55:01 +0100
committerGitHub <noreply@github.com>2021-01-22 12:55:01 +0100
commitbedf58b78f9b9c99bb41fcb44287a2e679057fb0 (patch)
treeff6b4af24ded3f62267c550c582036b9cdea6b68 /pkgs/games
parent0f11e27d6c1c4d6e8d55092d2af92dfa9d37d2cd (diff)
parent52a7a2df1545834cccacca114c0ac7ad4e8da244 (diff)
Merge pull request #91123 from tex/unciv
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/unciv/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/games/unciv/default.nix b/pkgs/games/unciv/default.nix
new file mode 100644
index 000000000000..917cf328e7ed
--- /dev/null
+++ b/pkgs/games/unciv/default.nix
@@ -0,0 +1,59 @@
+{ 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";
+ version = "3.12.8";
+
+ src = fetchurl {
+ url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
+ sha256 = "178lasa6ahwg2s2hamm13yysg42qm13v6a9pgs6nm66np93nskc7";
+ };
+
+ 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" ];
+ };
+}