mirror of https://github.com/materusPL/Nixerus.git
polymc: Init package
This commit is contained in:
parent
c8efd18a3a
commit
29ede6c65d
|
@ -0,0 +1,126 @@
|
||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchFromGitHub
|
||||||
|
, cmake
|
||||||
|
, ninja
|
||||||
|
, jdk8
|
||||||
|
, jdk
|
||||||
|
, ghc_filesystem
|
||||||
|
, zlib
|
||||||
|
, file
|
||||||
|
, wrapQtAppsHook
|
||||||
|
, xorg
|
||||||
|
, libpulseaudio
|
||||||
|
, qtbase
|
||||||
|
, quazip
|
||||||
|
, libGL
|
||||||
|
, msaClientID ? ""
|
||||||
|
, extra-cmake-modules
|
||||||
|
, qtcharts
|
||||||
|
# For wrapper
|
||||||
|
, makeWrapper
|
||||||
|
}:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let polymc =
|
||||||
|
let
|
||||||
|
|
||||||
|
libpath = with xorg; lib.makeLibraryPath ([
|
||||||
|
libX11
|
||||||
|
libXext
|
||||||
|
libXcursor
|
||||||
|
libXrandr
|
||||||
|
libXxf86vm
|
||||||
|
libpulseaudio
|
||||||
|
libGL
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
gameLibraryPath = libpath + ":/run/opengl-driver/lib";
|
||||||
|
|
||||||
|
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "polymc";
|
||||||
|
version = "5.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "PolyMC";
|
||||||
|
repo = "PolyMC";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "sha256-D7OYzuvrigtmbk3Apqf29v2bTMgmlDZKFYOx71isVRM=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
dontWrapQtApps = true;
|
||||||
|
nativeBuildInputs = [ cmake extra-cmake-modules ninja jdk ghc_filesystem file wrapQtAppsHook ];
|
||||||
|
buildInputs = [ qtbase quazip zlib qtcharts ];
|
||||||
|
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-GNinja"
|
||||||
|
"-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qtbase.version}"
|
||||||
|
] ++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
|
||||||
|
|
||||||
|
|
||||||
|
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")' \
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
||||||
|
wrapQtApp $out/bin/polymc \
|
||||||
|
--prefix LD_LIBRARY_PATH : "${gameLibraryPath}" \
|
||||||
|
--prefix PATH : "${lib.makeBinPath ([ xorg.xrandr ]) }"
|
||||||
|
'';
|
||||||
|
passthru = {
|
||||||
|
|
||||||
|
|
||||||
|
wrap =
|
||||||
|
{ extraJDKs ? [ ]
|
||||||
|
, extraPaths ? [ ]
|
||||||
|
, extraLibs ? [ ]
|
||||||
|
}: stdenv.mkDerivation rec {
|
||||||
|
pname = "polymc-wrapped";
|
||||||
|
version = polymc.version;
|
||||||
|
|
||||||
|
src = polymc;
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
phases = [ "installPhase" "fixupPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -s $src/bin/polymc $out/bin/polymc
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = let javaPaths = lib.makeSearchPath "bin/java" (extraJDKs); in
|
||||||
|
''
|
||||||
|
wrapProgram $out/bin/polymc \
|
||||||
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
|
||||||
|
--prefix POLYMC_JAVA_PATHS : "${javaPaths}" \
|
||||||
|
--prefix PATH : "${lib.makeBinPath extraPaths}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
preferLocalBuild = true;
|
||||||
|
meta = polymc.meta;
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://polymc.org/";
|
||||||
|
downloadPage = "https://polymc.org/download/";
|
||||||
|
changelog = "https://github.com/PolyMC/PolyMC/releases";
|
||||||
|
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 = [ "x86_64-linux" ];
|
||||||
|
license = licenses.gpl3Only;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
polymc
|
|
@ -1,17 +1,21 @@
|
||||||
{pkgs, callPackage}:
|
{ pkgs, callPackage }:
|
||||||
rec {
|
rec {
|
||||||
amdgpu-pro-libs = pkgs.lib.recurseIntoAttrs {
|
amdgpu-pro-libs = pkgs.lib.recurseIntoAttrs {
|
||||||
vulkan = callPackage ./libs/amdgpu-pro-libs { };
|
vulkan = callPackage ./libs/amdgpu-pro-libs { };
|
||||||
amf = callPackage ./libs/amdgpu-pro-libs/amf.nix { };
|
amf = callPackage ./libs/amdgpu-pro-libs/amf.nix { };
|
||||||
opengl = callPackage ./libs/amdgpu-pro-libs/opengl.nix { };
|
opengl = callPackage ./libs/amdgpu-pro-libs/opengl.nix { };
|
||||||
prefixes = callPackage ./libs/amdgpu-pro-libs/prefixes.nix { };
|
prefixes = callPackage ./libs/amdgpu-pro-libs/prefixes.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ffmpeg6-amf-full = pkgs.callPackage ./apps/ffmpeg {inherit (pkgs.darwin.apple_sdk.frameworks)
|
ffmpeg6-amf-full = pkgs.callPackage ./apps/ffmpeg {
|
||||||
|
inherit (pkgs.darwin.apple_sdk.frameworks)
|
||||||
Cocoa CoreServices CoreAudio CoreMedia AVFoundation MediaToolbox
|
Cocoa CoreServices CoreAudio CoreMedia AVFoundation MediaToolbox
|
||||||
VideoDecodeAcceleration VideoToolbox;};
|
VideoDecodeAcceleration VideoToolbox;
|
||||||
|
};
|
||||||
|
|
||||||
obs-amf = pkgs.qt6Packages.callPackage ./apps/obs { ffmpeg = ffmpeg6-amf-full;};
|
obs-amf = pkgs.qt6Packages.callPackage ./apps/obs { ffmpeg = ffmpeg6-amf-full; };
|
||||||
|
|
||||||
|
polymc = pkgs.qt6Packages.callPackage ./apps/games/polymc {};
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue