Skip to content

Commit

Permalink
fix(nix): include inputs from wrapped package in dev shell
Browse files Browse the repository at this point in the history
this allows for things like icons to work when compiled in the dev shell
using `cmake` as normal

Signed-off-by: seth <getchoo@tuta.io>
  • Loading branch information
getchoo committed Jan 23, 2024
1 parent 12583c8 commit 56e8a3d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 34 deletions.
13 changes: 11 additions & 2 deletions nix/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@
${config.pre-commit.installationScript}
'';

inputsFrom = [config.packages.prismlauncher-unwrapped];
buildInputs = with pkgs; [ccache ninja];
inputsFrom = [
config.packages.prismlauncher-unwrapped
config.packages.prismlauncher
];

buildInputs = with pkgs;
[ccache ninja]
++ (let
runtime = callPackage ./pkg/runtime.nix {};
in
runtime.libs ++ runtime.programs);
};

formatter = pkgs.alejandra;
Expand Down
35 changes: 35 additions & 0 deletions nix/pkg/runtime.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
stdenv,
glfw,
libGL,
libpulseaudio,
mesa-demos,
openal,
pciutils,
udev,
xorg,
}: {
libs = [
xorg.libX11
xorg.libXext
xorg.libXcursor
xorg.libXrandr
xorg.libXxf86vm

# lwjgl
libpulseaudio
libGL
glfw
openal
stdenv.cc.cc.lib

# oshi
udev
];

programs = [
xorg.xrandr
mesa-demos # need glxinfo
pciutils # need lspci
];
}
37 changes: 5 additions & 32 deletions nix/pkg/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@
lib,
stdenv,
symlinkJoin,
callPackage,
prismlauncher-unwrapped,
wrapQtAppsHook,
makeWrapper,
addOpenGLRunpath,
qtbase, # needed for wrapQtAppsHook
qtsvg,
qtwayland,
xorg,
libpulseaudio,
libGL,
glfw,
glfw-wayland-minecraft,
openal,
jdk8,
jdk17,
gamemode,
flite,
mesa-demos,
pciutils,
udev,
libusb1,
msaClientID ? null,
gamemodeSupport ? stdenv.isLinux,
Expand All @@ -43,6 +36,8 @@ assert lib.assertMsg (withWaylandGLFW -> stdenv.isLinux) "withWaylandGLFW is onl
unwrapped = prismlauncher-unwrapped.override {
inherit msaClientID gamemodeSupport;
};

runtime = callPackage ./runtime.nix {};
in
symlinkJoin {
name = "prismlauncher-${unwrapped.version}";
Expand Down Expand Up @@ -79,35 +74,13 @@ in

qtWrapperArgs = let
runtimeLibs =
[
xorg.libX11
xorg.libXext
xorg.libXcursor
xorg.libXrandr
xorg.libXxf86vm

# lwjgl
libpulseaudio
libGL
glfw
openal
stdenv.cc.cc.lib

# oshi
udev
]
runtime.libs
++ lib.optional gamemodeSupport gamemode.lib
++ lib.optional textToSpeechSupport flite
++ lib.optional controllerSupport libusb1
++ additionalLibs;

runtimePrograms =
[
xorg.xrandr
mesa-demos # need glxinfo
pciutils # need lspci
]
++ additionalPrograms;
runtimePrograms = runtime.programs ++ additionalPrograms;
in
["--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"]
++ lib.optionals stdenv.isLinux [
Expand Down

0 comments on commit 56e8a3d

Please sign in to comment.