From 9a2c16346104bac8de1bcfc9430369266a5bdfef Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 22 Sep 2024 02:05:27 +1000 Subject: [PATCH] Nix expr: Add `gtk2-x11` (`libgtk-x11-2.0.so.0`) to `buildInputs` --- Dist/launch-scripts.nix | 9 ++++++++- Dist/packages.nix | 6 +++++- default.nix | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dist/launch-scripts.nix b/Dist/launch-scripts.nix index 2b16bb415c..04b56535a8 100644 --- a/Dist/launch-scripts.nix +++ b/Dist/launch-scripts.nix @@ -83,7 +83,14 @@ fi ${if isManualLocalBuild then noAssetManagementScript else assetManagementScript} - ldLibPath="$BIZHAWK_INT_SYSLIB_PATH:${lib.makeLibraryPath bizhawkAssemblies.buildInputs}" + ${""/* + here's the breakdown for the GTK theme problem: + problem 1: `Gtk not found (missing LD_LIBRARY_PATH to libgtk-x11-2.0.so.0?), using built-in colorscheme` printed to stderr + fixed by adding `${pkgs.gtk2-x11.out}/lib` to `$LD_LIBRARY_PATH` + we're now in Adwaita (light) instead of ugly beige! + this does add a new warning to stderr though: `Unable to locate theme engine in module_path: "adwaita"` + sadly, it still doesn't seem to respect `$GTK_RC_FILES` or even `$GTK_THEME` :( + */}ldLibPath="$BIZHAWK_INT_SYSLIB_PATH:${lib.makeLibraryPath bizhawkAssemblies.buildInputs}" if [ -z "$LD_LIBRARY_PATH" ]; then export LD_LIBRARY_PATH="$ldLibPath" else diff --git a/Dist/packages.nix b/Dist/packages.nix index e6fc996718..6e753d69b5 100644 --- a/Dist/packages.nix +++ b/Dist/packages.nix @@ -16,6 +16,7 @@ # makedeps , git # rundeps +, gtk2-x11 , libgdiplus , libGL , lua @@ -63,7 +64,8 @@ ''; dontFixup = true; }; - genDepsHostTargetFor = { hawkSourceInfo, mono' ? mono }: [ + genDepsHostTargetFor = { hawkSourceInfo, gtk2-x11' ? getMainOutput gtk2-x11, mono' ? mono }: [ + gtk2-x11' (getMainOutput libgdiplus) lua mono' @@ -89,8 +91,10 @@ strictDeps = true; nativeBuildInputs = lib.optional finalAttrs.doCheck finalAttrs.mono ++ lib.optional finalAttrs.isLocalBuild git; + gtk2-x11 = getMainOutput gtk2-x11; buildInputs = genDepsHostTargetFor { inherit hawkSourceInfo; + gtk2-x11' = finalAttrs.gtk2-x11; mono' = finalAttrs.mono; }; patches = lib.optional (!hawkSourceInfo.hasMiscTypeCheckerPatch_6afb3be98) (fetchpatch { diff --git a/default.nix b/default.nix index 66ab628c53..f2e208eb65 100644 --- a/default.nix +++ b/default.nix @@ -38,6 +38,7 @@ in { , git ? pkgs.gitMinimal # only when building from-CWD (`-local`) # rundeps , coreutils ? pkgs.coreutils +, gtk2-x11 ? pkgs.gtk2-x11 , kate ? pkgs.kate.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or []) ++ [ (fetchpatch { url = "https://invent.kde.org/utilities/kate/-/commit/9ddf4f0c9eb3c26a0ab33c862d2b161bcbdc6a6e.patch"; # Fix name of OmniSharp LSP binary @@ -110,7 +111,7 @@ in { buildDotnetModule fetchpatch fetchzip hardLinkJoin launchScriptsFor makeDesktopItem releaseTagSourceInfos runCommand symlinkJoin writeShellScriptBin git - libgdiplus libGL lua openal SDL2 udev zstd + gtk2-x11 libgdiplus libGL lua openal SDL2 udev zstd buildConfig doCheck extraDefines extraDotnetBuildFlags; mono = if mono != null then mono # allow older Mono if set explicitly