Merge pull request #154051 from starcraft66/polymc

polymc: init at 1.0.4

polymc substitutes multimc.
This commit is contained in:
Anderson Torres 2022-01-15 22:18:26 -03:00 committed by GitHub
commit ce6fd0d857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 114 additions and 58 deletions

View File

@ -334,6 +334,22 @@
unmaintained
</para>
</listitem>
<listitem>
<para>
MultiMC has been replaced with the fork PolyMC due to upstream
developers being hostile to 3rd party package maintainers.
PolyMC removes all MultiMC branding and is aimed at providing
proper 3rd party packages like the one contained in Nixpkgs.
This change affects the data folder where game instances and
other save and configuration files are stored. Users with
existing installations should rename
<literal>~/.local/share/multimc</literal> to
<literal>~/.local/share/polymc</literal>. The main config
files path has also moved from
<literal>~/.local/share/multimc/multimc.cfg</literal> to
<literal>~/.local/share/polymc/polymc.cfg</literal>.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-release-22.05-notable-changes">

View File

@ -107,6 +107,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- `pkgs.docbookrx` was removed since it's unmaintained
- MultiMC has been replaced with the fork PolyMC due to upstream developers being hostile to 3rd party package maintainers. PolyMC removes all MultiMC branding and is aimed at providing proper 3rd party packages like the one contained in Nixpkgs. This change affects the data folder where game instances and other save and configuration files are stored. Users with existing installations should rename `~/.local/share/multimc` to `~/.local/share/polymc`. The main config file's path has also moved from `~/.local/share/multimc/multimc.cfg` to `~/.local/share/polymc/polymc.cfg`.
## Other Notable Changes {#sec-release-22.05-notable-changes}
- The option [services.redis.servers](#opt-services.redis.servers) was added

View File

@ -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 ];
};
}

View File

@ -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 ];
};
}

View File

@ -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 */

View File

@ -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;