aboutsummaryrefslogtreecommitdiff
path: root/nix/default.nix
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-03-14 13:52:31 +0100
committerGitHub <noreply@github.com>2023-03-14 13:52:31 +0100
commit84e91ec3b56c1c4a6bac789a3be3cc17e164a91b (patch)
tree789978a0de3a9a1880e72d286d3939df3a7f85c5 /nix/default.nix
parente0e26a37b530254383fbb7b6853e8e3358f7100d (diff)
parent7707af08e3b6eca9cfd3678c10ef449f8523e640 (diff)
downloadPrismLauncher-84e91ec3b56c1c4a6bac789a3be3cc17e164a91b.tar.gz
PrismLauncher-84e91ec3b56c1c4a6bac789a3be3cc17e164a91b.tar.bz2
PrismLauncher-84e91ec3b56c1c4a6bac789a3be3cc17e164a91b.zip
Merge pull request #888 from Scrumplex/nix-stuff
Diffstat (limited to 'nix/default.nix')
-rw-r--r--nix/default.nix129
1 files changed, 64 insertions, 65 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 99bb2231..6d4f3f24 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,52 +1,54 @@
-{ lib
-, stdenv
-, cmake
-, jdk8
-, jdk17
-, zlib
-, file
-, wrapQtAppsHook
-, xorg
-, libpulseaudio
-, qtbase
-, qtsvg
-, qtwayland
-, libGL
-, quazip
-, glfw
-, openal
-, extra-cmake-modules
-, tomlplusplus
-, ghc_filesystem
-, cmark
-, msaClientID ? ""
-, jdks ? [ jdk17 jdk8 ]
-
+{
+ lib,
+ stdenv,
+ cmake,
+ jdk8,
+ jdk17,
+ zlib,
+ file,
+ wrapQtAppsHook,
+ xorg,
+ libpulseaudio,
+ qtbase,
+ qtsvg,
+ qtwayland,
+ libGL,
+ quazip,
+ glfw,
+ openal,
+ extra-cmake-modules,
+ tomlplusplus,
+ ghc_filesystem,
+ cmark,
+ msaClientID ? "",
+ jdks ? [jdk17 jdk8],
# flake
-, self
-, version
-, libnbtplusplus
+ self,
+ version,
+ libnbtplusplus,
}:
-
stdenv.mkDerivation rec {
pname = "prismlauncher";
inherit version;
src = lib.cleanSource self;
- nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 wrapQtAppsHook ];
- buildInputs = [
- qtbase
- qtsvg
- zlib
- quazip
- ghc_filesystem
- tomlplusplus
- cmark
- ] ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland;
+ nativeBuildInputs = [extra-cmake-modules cmake file jdk17 wrapQtAppsHook];
+ buildInputs =
+ [
+ qtbase
+ qtsvg
+ zlib
+ quazip
+ ghc_filesystem
+ tomlplusplus
+ cmark
+ ]
+ ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland;
- cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]
- ++ lib.optionals (lib.versionOlder qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=5" ];
+ cmakeFlags =
+ lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
+ ++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"];
dontWrapQtApps = true;
postUnpack = ''
@@ -57,30 +59,27 @@ stdenv.mkDerivation rec {
chown -R $USER: source/libraries/libnbtplusplus
'';
- postInstall =
- let
- libpath = with xorg;
- lib.makeLibraryPath [
- libX11
- libXext
- libXcursor
- libXrandr
- libXxf86vm
- libpulseaudio
- libGL
- glfw
- openal
- stdenv.cc.cc.lib
- ];
- in
- ''
- # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
- wrapQtApp $out/bin/prismlauncher \
- --set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
- --prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
- --prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
- '';
-
+ postInstall = let
+ libpath = with xorg;
+ lib.makeLibraryPath [
+ libX11
+ libXext
+ libXcursor
+ libXrandr
+ libXxf86vm
+ libpulseaudio
+ libGL
+ glfw
+ openal
+ stdenv.cc.cc.lib
+ ];
+ in ''
+ # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
+ wrapQtApp $out/bin/prismlauncher \
+ --set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
+ --prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
+ --prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
+ '';
meta = with lib; {
homepage = "https://prismlauncher.org/";
@@ -93,6 +92,6 @@ stdenv.mkDerivation rec {
platforms = platforms.linux;
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
license = licenses.gpl3Only;
- maintainers = with maintainers; [ minion3665 Scrumplex ];
+ maintainers = with maintainers; [minion3665 Scrumplex];
};
}