sdl3: avoid transitive gtk dependency (#413222)

authored by Peder Bergebakken Sundt and committed by GitHub 5d7ef155 bfd1b2cc

+81 -50
+1
pkgs/by-name/ib/ibusMinimal/package.nix
··· 1 + { ibus }: ibus.override { libOnly = true; }
+6 -2
pkgs/by-name/sd/sdl3/package.nix
··· 8 8 darwinMinVersionHook, 9 9 dbus, 10 10 fetchFromGitHub, 11 - ibus, 11 + ibusMinimal, 12 12 installShellFiles, 13 13 libGL, 14 14 libayatana-appindicator, ··· 104 104 apple-sdk_11 105 105 ] 106 106 ++ lib.optionals ibusSupport [ 107 - ibus 107 + # sdl3 only uses some constants of the ibus headers 108 + # it never actually loads the library 109 + # thus, it also does not have to care about gtk integration, 110 + # so using ibusMinimal avoids an unnecessarily large closure here. 111 + ibusMinimal 108 112 ] 109 113 ++ lib.optional waylandSupport zenity; 110 114
+74 -48
pkgs/tools/inputmethods/ibus/default.nix
··· 27 27 python3, 28 28 json-glib, 29 29 libnotify ? null, 30 - enableUI ? true, 31 - withWayland ? true, 30 + enableUI ? !libOnly, 31 + withWayland ? !libOnly, 32 32 libxkbcommon, 33 33 wayland, 34 34 wayland-protocols, ··· 36 36 buildPackages, 37 37 runtimeShell, 38 38 nixosTests, 39 + versionCheckHook, 40 + nix-update-script, 41 + libX11, 42 + libOnly ? false, 39 43 }: 40 44 41 45 let ··· 61 65 ''; 62 66 in 63 67 64 - stdenv.mkDerivation rec { 68 + stdenv.mkDerivation (finalAttrs: { 65 69 pname = "ibus"; 66 70 version = "1.5.32"; 67 71 68 72 src = fetchFromGitHub { 69 73 owner = "ibus"; 70 74 repo = "ibus"; 71 - tag = version; 75 + tag = finalAttrs.version; 72 76 hash = "sha256-Rp2Aw2C2LXMBp8++pnZtPHiPoFDERpkDsKd0E//twuY="; 73 77 }; 74 78 ··· 86 90 ./build-without-dbus-launch.patch 87 91 ]; 88 92 89 - outputs = [ 90 - "out" 91 - "dev" 92 - "installedTests" 93 - ]; 93 + outputs = 94 + [ 95 + "out" 96 + "dev" 97 + ] 98 + ++ lib.optionals (!libOnly) [ 99 + "installedTests" 100 + ]; 94 101 95 102 postPatch = '' 96 103 # Maintainer does not want to create separate tarballs for final release candidate and release versions, ··· 107 114 108 115 preAutoreconf = "touch ChangeLog"; 109 116 110 - configureFlags = [ 111 - # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, 112 - # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. 113 - # https://github.com/NixOS/nixpkgs/issues/21751 114 - "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" 115 - "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" 116 - "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" 117 - "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" 118 - "--disable-memconf" 119 - (lib.enableFeature (dconf != null) "dconf") 120 - (lib.enableFeature (libnotify != null) "libnotify") 121 - (lib.enableFeature withWayland "wayland") 122 - (lib.enableFeature enableUI "ui") 123 - "--disable-gtk2" 124 - "--enable-gtk4" 125 - "--enable-install-tests" 126 - "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" 127 - "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" 128 - "--with-python=${python3BuildEnv.interpreter}" 129 - "--with-ucd-dir=${unicode-character-database}/share/unicode" 130 - ]; 117 + configureFlags = 118 + [ 119 + # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, 120 + # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. 121 + # https://github.com/NixOS/nixpkgs/issues/21751 122 + "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" 123 + "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" 124 + "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" 125 + "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" 126 + "--disable-memconf" 127 + "--disable-gtk2" 128 + "--with-python=${python3BuildEnv.interpreter}" 129 + (lib.enableFeature (!libOnly && dconf != null) "dconf") 130 + (lib.enableFeature (!libOnly && libnotify != null) "libnotify") 131 + (lib.enableFeature withWayland "wayland") 132 + (lib.enableFeature enableUI "ui") 133 + (lib.enableFeature (!libOnly) "gtk3") 134 + (lib.enableFeature (!libOnly) "gtk4") 135 + (lib.enableFeature (!libOnly) "xim") 136 + (lib.enableFeature (!libOnly) "appindicator") 137 + (lib.enableFeature (!libOnly) "tests") 138 + (lib.enableFeature (!libOnly) "install-tests") 139 + (lib.enableFeature (!libOnly) "emoji-dict") 140 + (lib.enableFeature (!libOnly) "unicode-dict") 141 + ] 142 + ++ lib.optionals (!libOnly) [ 143 + "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" 144 + "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" 145 + "--with-ucd-dir=${unicode-character-database}/share/unicode" 146 + ]; 131 147 132 - makeFlags = [ 148 + makeFlags = lib.optionals (!libOnly) [ 133 149 "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" 134 150 "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" 135 151 ]; ··· 146 162 makeWrapper 147 163 pkg-config 148 164 python3BuildEnv 165 + dbus-launch 166 + glib # required to satisfy AM_PATH_GLIB_2_0 149 167 vala 168 + gobject-introspection 169 + ] 170 + ++ lib.optionals (!libOnly) [ 150 171 wrapGAppsHook3 151 - dbus-launch 152 - gobject-introspection 153 172 ] 154 173 ++ lib.optionals withWayland [ 155 174 wayland-scanner ··· 164 183 dbus 165 184 systemd 166 185 dconf 167 - gdk-pixbuf 168 186 python3.pkgs.pygobject3 # for pygobject overrides 187 + isocodes 188 + json-glib 189 + libX11 190 + ] 191 + ++ lib.optionals (!libOnly) [ 169 192 gtk3 170 193 gtk4 171 - isocodes 172 - json-glib 173 - libnotify 194 + gdk-pixbuf 174 195 libdbusmenu-gtk3 196 + libnotify 175 197 vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) 176 198 ] 177 199 ++ lib.optionals withWayland [ ··· 181 203 ]; 182 204 183 205 enableParallelBuilding = true; 206 + strictDeps = true; 184 207 185 208 doCheck = false; # requires X11 daemon 209 + 186 210 doInstallCheck = true; 187 - installCheckPhase = '' 188 - $out/bin/ibus version 189 - ''; 211 + nativeInstallCheckInputs = [ versionCheckHook ]; 212 + versionCheckProgramArg = "version"; 213 + versionCheckProgram = "${placeholder "out"}/bin/ibus"; 190 214 191 - postInstall = '' 215 + postInstall = lib.optionalString (!libOnly) '' 192 216 # It has some hardcoded FHS paths and also we do not use it 193 217 # since we set up the environment in NixOS tests anyway. 194 218 moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests" 195 219 ''; 196 220 197 - postFixup = '' 221 + postFixup = lib.optionalString (!libOnly) '' 198 222 # set necessary environment also for tests 199 223 for f in $installedTests/libexec/installed-tests/ibus/*; do 200 224 wrapGApp $f ··· 202 226 ''; 203 227 204 228 passthru = { 205 - tests = { 229 + tests = lib.optionalAttrs (!libOnly) { 206 230 installed-tests = nixosTests.installed-tests.ibus; 207 231 }; 232 + updateScript = nix-update-script { }; 208 233 }; 209 234 210 - meta = with lib; { 235 + meta = { 236 + changelog = "https://github.com/ibus/ibus/releases/tag/${finalAttrs.src.tag}"; 211 237 homepage = "https://github.com/ibus/ibus"; 212 238 description = "Intelligent Input Bus, input method framework"; 213 - license = licenses.lgpl21Plus; 214 - platforms = platforms.linux; 215 - maintainers = with maintainers; [ ttuegel ]; 239 + license = lib.licenses.lgpl21Plus; 240 + platforms = lib.platforms.linux; 241 + maintainers = with lib.maintainers; [ ttuegel ]; 216 242 }; 217 - } 243 + })