summary refs log tree commit diff
diff options
context:
space:
mode:
authorTristan Gosselin-Hane <starcraft66@gmail.com>2022-01-10 20:34:31 -0500
committerTristan Gosselin-Hane <starcraft66@gmail.com>2022-01-15 18:07:29 -0500
commitf4ef264724d836112ec906f516a89b0193c3f546 (patch)
tree737da1074a29726aa68dc79cd31634e26f05d6a6
parent826f6dfb2620aa231f39ffad46591bc4904c3c9b (diff)
downloadnixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar.gz
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar.bz2
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar.lz
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar.xz
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.tar.zst
nixpkgs-f4ef264724d836112ec906f516a89b0193c3f546.zip
polymc: init at 1.0.4
-rw-r--r--pkgs/games/multimc/default.nix56
-rw-r--r--pkgs/games/polymc/0001-pick-latest-java-first.patch (renamed from pkgs/games/multimc/0001-pick-latest-java-first.patch)0
-rw-r--r--pkgs/games/polymc/default.nix92
-rw-r--r--pkgs/top-level/aliases.nix2
-rw-r--r--pkgs/top-level/all-packages.nix4
5 files changed, 96 insertions, 58 deletions
diff --git a/pkgs/games/multimc/default.nix b/pkgs/games/multimc/default.nix
deleted file mode 100644
index 732a66ef8b4..00000000000
--- a/pkgs/games/multimc/default.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ lib, mkDerivation, fetchFromGitHub, cmake, jdk8, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, libGL, msaClientID ? "" }:
-
-let
-  libpath = with xorg; lib.makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm libpulseaudio libGL ];
-in mkDerivation rec {
-  pname = "multimc";
-  version = "unstable-2021-09-08";
-  src = fetchFromGitHub {
-    owner = "MultiMC";
-    repo = "MultiMC5";
-    rev = "e2355eb276bf355ca4acf526a0f3cc390aa88f8b";
-    sha256 = "3G9QPoAbC+uVfUYR0Kq6hnxl9c2mvCzIEYGjwfarQJ8=";
-    fetchSubmodules = true;
-  };
-  nativeBuildInputs = [ cmake file makeWrapper ];
-  buildInputs = [ qtbase jdk8 zlib ];
-
-  patches = [ ./0001-pick-latest-java-first.patch ];
-
-  postPatch = ''
-    # hardcode jdk paths
-    substituteInPlace launcher/java/JavaUtils.cpp \
-      --replace 'scanJavaDir("/usr/lib/jvm")' 'javas.append("${jdk}/lib/openjdk/bin/java")' \
-      --replace 'scanJavaDir("/usr/lib32/jvm")' 'javas.append("${jdk8}/lib/openjdk/bin/java")'
-
-    # add client ID
-    substituteInPlace notsecrets/Secrets.cpp \
-      --replace 'QString MSAClientID = "";' 'QString MSAClientID = "${msaClientID}";'
-  '';
-
-  cmakeFlags = [ "-DMultiMC_LAYOUT=lin-system" ];
-
-  postInstall = ''
-    install -Dm644 ../launcher/resources/multimc/scalable/multimc.svg $out/share/pixmaps/multimc.svg
-    install -Dm755 ../launcher/package/linux/multimc.desktop $out/share/applications/multimc.desktop
-
-    # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
-    wrapProgram $out/bin/multimc \
-      --set GAME_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
-      --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]}
-  '';
-
-  meta = with lib; {
-    homepage = "https://multimc.org/";
-    description = "A free, open source launcher for Minecraft";
-    longDescription = ''
-      Allows you to have multiple, separate instances of Minecraft (each with their own mods, texture packs, saves, etc) and helps you manage them and their associated options with a simple interface.
-    '';
-    platforms = platforms.linux;
-    license = licenses.asl20;
-    # upstream don't want us to re-distribute this application:
-    # https://github.com/NixOS/nixpkgs/issues/131983
-    hydraPlatforms = [];
-    maintainers = with maintainers; [ cleverca22 starcraft66 ];
-  };
-}
diff --git a/pkgs/games/multimc/0001-pick-latest-java-first.patch b/pkgs/games/polymc/0001-pick-latest-java-first.patch
index a65dcbfd037..a65dcbfd037 100644
--- a/pkgs/games/multimc/0001-pick-latest-java-first.patch
+++ b/pkgs/games/polymc/0001-pick-latest-java-first.patch
diff --git a/pkgs/games/polymc/default.nix b/pkgs/games/polymc/default.nix
new file mode 100644
index 00000000000..ddfc76b8b97
--- /dev/null
+++ b/pkgs/games/polymc/default.nix
@@ -0,0 +1,92 @@
+{ lib
+, mkDerivation
+, makeDesktopItem
+, fetchFromGitHub
+, cmake
+, jdk8
+, jdk
+, zlib
+, file
+, makeWrapper
+, xorg
+, libpulseaudio
+, qtbase
+, libGL
+, msaClientID ? ""
+}:
+
+mkDerivation rec {
+  pname = "polymc";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "PolyMC";
+    repo = "PolyMC";
+    rev = version;
+    sha256 = "sha256-8aya0KfV9F+i2qBpweWcR9hwyTSQkqn2wHdtkCEeNvk=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake file makeWrapper ];
+  buildInputs = [ qtbase jdk8 zlib ];
+
+  patches = [ ./0001-pick-latest-java-first.patch ];
+
+  postPatch = ''
+    # hardcode jdk paths
+    substituteInPlace launcher/java/JavaUtils.cpp \
+      --replace 'scanJavaDir("/usr/lib/jvm")' 'javas.append("${jdk}/lib/openjdk/bin/java")' \
+      --replace 'scanJavaDir("/usr/lib32/jvm")' 'javas.append("${jdk8}/lib/openjdk/bin/java")'
+  '';
+
+  cmakeFlags = [ "-DLauncher_LAYOUT=lin-system" ] ++
+               lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "polymc";
+      desktopName = "PolyMC";
+      genericName = "Minecraft Launcher";
+      comment = "Free, open source launcher and instance manager for Minecraft.";
+      icon = "launcher";
+      exec = "polymc";
+      categories = "Game";
+      terminal = "false";
+    })
+  ];
+
+  dontWrapQtApps = true;
+
+  postInstall = let
+    libpath = with xorg; lib.makeLibraryPath [
+      libX11
+      libXext
+      libXcursor
+      libXrandr
+      libXxf86vm
+      libpulseaudio
+      libGL
+    ];
+  in ''
+    install -Dm644 ../launcher/resources/multimc/scalable/launcher.svg $out/share/pixmaps/polymc.svg
+
+    # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
+    wrapProgram $out/bin/polymc \
+      "''${qtWrapperArgs[@]}" \
+      --set GAME_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
+      --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]}
+  '';
+
+  meta = with lib; {
+    homepage = "https://polymc.org/";
+    description = "A free, open source launcher for Minecraft";
+    longDescription = ''
+      Allows you to have multiple, separate instances of Minecraft (each with
+      their own mods, texture packs, saves, etc) and helps you manage them and
+      their associated options with a simple interface.
+    '';
+    platforms = platforms.linux;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ cleverca22 starcraft66 ];
+  };
+}
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index bb63adac584..989901ccb07 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -1205,6 +1205,8 @@ mapAliases ({
     Its new location is obs-studio-plugins.wlrobs.
   '';
 
+  multimc = throw "multimc was removed from nixpkgs; use polymc instead"; # Added 2022-01-08
+
   /* If these are in the scope of all-packages.nix, they cause collisions
   between mixed versions of qt. See:
   https://github.com/NixOS/nixpkgs/pull/101369 */
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f6cb53114a4..e5bed745897 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8843,6 +8843,8 @@ with pkgs;
 
   poly2tri-c = callPackage ../development/libraries/poly2tri-c { };
 
+  polymc = libsForQt5.callPackage ../games/polymc { };
+
   ponysay = callPackage ../tools/misc/ponysay { };
 
   popfile = callPackage ../tools/text/popfile { };
@@ -30840,8 +30842,6 @@ with pkgs;
 
   moon-buggy = callPackage ../games/moon-buggy {};
 
-  multimc = libsForQt5.callPackage ../games/multimc { };
-
   inherit (callPackages ../games/minetest {
     inherit (darwin) libiconv;
     inherit (darwin.apple_sdk.frameworks) OpenGL OpenAL Carbon Cocoa;