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 darwinMinVersionHook, 9 dbus, 10 fetchFromGitHub, 11 - ibus, 12 installShellFiles, 13 libGL, 14 libayatana-appindicator, ··· 104 apple-sdk_11 105 ] 106 ++ lib.optionals ibusSupport [ 107 - ibus 108 ] 109 ++ lib.optional waylandSupport zenity; 110
··· 8 darwinMinVersionHook, 9 dbus, 10 fetchFromGitHub, 11 + ibusMinimal, 12 installShellFiles, 13 libGL, 14 libayatana-appindicator, ··· 104 apple-sdk_11 105 ] 106 ++ lib.optionals ibusSupport [ 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 112 ] 113 ++ lib.optional waylandSupport zenity; 114
+74 -48
pkgs/tools/inputmethods/ibus/default.nix
··· 27 python3, 28 json-glib, 29 libnotify ? null, 30 - enableUI ? true, 31 - withWayland ? true, 32 libxkbcommon, 33 wayland, 34 wayland-protocols, ··· 36 buildPackages, 37 runtimeShell, 38 nixosTests, 39 }: 40 41 let ··· 61 ''; 62 in 63 64 - stdenv.mkDerivation rec { 65 pname = "ibus"; 66 version = "1.5.32"; 67 68 src = fetchFromGitHub { 69 owner = "ibus"; 70 repo = "ibus"; 71 - tag = version; 72 hash = "sha256-Rp2Aw2C2LXMBp8++pnZtPHiPoFDERpkDsKd0E//twuY="; 73 }; 74 ··· 86 ./build-without-dbus-launch.patch 87 ]; 88 89 - outputs = [ 90 - "out" 91 - "dev" 92 - "installedTests" 93 - ]; 94 95 postPatch = '' 96 # Maintainer does not want to create separate tarballs for final release candidate and release versions, ··· 107 108 preAutoreconf = "touch ChangeLog"; 109 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 - ]; 131 132 - makeFlags = [ 133 "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" 134 "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" 135 ]; ··· 146 makeWrapper 147 pkg-config 148 python3BuildEnv 149 vala 150 wrapGAppsHook3 151 - dbus-launch 152 - gobject-introspection 153 ] 154 ++ lib.optionals withWayland [ 155 wayland-scanner ··· 164 dbus 165 systemd 166 dconf 167 - gdk-pixbuf 168 python3.pkgs.pygobject3 # for pygobject overrides 169 gtk3 170 gtk4 171 - isocodes 172 - json-glib 173 - libnotify 174 libdbusmenu-gtk3 175 vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) 176 ] 177 ++ lib.optionals withWayland [ ··· 181 ]; 182 183 enableParallelBuilding = true; 184 185 doCheck = false; # requires X11 daemon 186 doInstallCheck = true; 187 - installCheckPhase = '' 188 - $out/bin/ibus version 189 - ''; 190 191 - postInstall = '' 192 # It has some hardcoded FHS paths and also we do not use it 193 # since we set up the environment in NixOS tests anyway. 194 moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests" 195 ''; 196 197 - postFixup = '' 198 # set necessary environment also for tests 199 for f in $installedTests/libexec/installed-tests/ibus/*; do 200 wrapGApp $f ··· 202 ''; 203 204 passthru = { 205 - tests = { 206 installed-tests = nixosTests.installed-tests.ibus; 207 }; 208 }; 209 210 - meta = with lib; { 211 homepage = "https://github.com/ibus/ibus"; 212 description = "Intelligent Input Bus, input method framework"; 213 - license = licenses.lgpl21Plus; 214 - platforms = platforms.linux; 215 - maintainers = with maintainers; [ ttuegel ]; 216 }; 217 - }
··· 27 python3, 28 json-glib, 29 libnotify ? null, 30 + enableUI ? !libOnly, 31 + withWayland ? !libOnly, 32 libxkbcommon, 33 wayland, 34 wayland-protocols, ··· 36 buildPackages, 37 runtimeShell, 38 nixosTests, 39 + versionCheckHook, 40 + nix-update-script, 41 + libX11, 42 + libOnly ? false, 43 }: 44 45 let ··· 65 ''; 66 in 67 68 + stdenv.mkDerivation (finalAttrs: { 69 pname = "ibus"; 70 version = "1.5.32"; 71 72 src = fetchFromGitHub { 73 owner = "ibus"; 74 repo = "ibus"; 75 + tag = finalAttrs.version; 76 hash = "sha256-Rp2Aw2C2LXMBp8++pnZtPHiPoFDERpkDsKd0E//twuY="; 77 }; 78 ··· 90 ./build-without-dbus-launch.patch 91 ]; 92 93 + outputs = 94 + [ 95 + "out" 96 + "dev" 97 + ] 98 + ++ lib.optionals (!libOnly) [ 99 + "installedTests" 100 + ]; 101 102 postPatch = '' 103 # Maintainer does not want to create separate tarballs for final release candidate and release versions, ··· 114 115 preAutoreconf = "touch ChangeLog"; 116 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 + ]; 147 148 + makeFlags = lib.optionals (!libOnly) [ 149 "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" 150 "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" 151 ]; ··· 162 makeWrapper 163 pkg-config 164 python3BuildEnv 165 + dbus-launch 166 + glib # required to satisfy AM_PATH_GLIB_2_0 167 vala 168 + gobject-introspection 169 + ] 170 + ++ lib.optionals (!libOnly) [ 171 wrapGAppsHook3 172 ] 173 ++ lib.optionals withWayland [ 174 wayland-scanner ··· 183 dbus 184 systemd 185 dconf 186 python3.pkgs.pygobject3 # for pygobject overrides 187 + isocodes 188 + json-glib 189 + libX11 190 + ] 191 + ++ lib.optionals (!libOnly) [ 192 gtk3 193 gtk4 194 + gdk-pixbuf 195 libdbusmenu-gtk3 196 + libnotify 197 vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) 198 ] 199 ++ lib.optionals withWayland [ ··· 203 ]; 204 205 enableParallelBuilding = true; 206 + strictDeps = true; 207 208 doCheck = false; # requires X11 daemon 209 + 210 doInstallCheck = true; 211 + nativeInstallCheckInputs = [ versionCheckHook ]; 212 + versionCheckProgramArg = "version"; 213 + versionCheckProgram = "${placeholder "out"}/bin/ibus"; 214 215 + postInstall = lib.optionalString (!libOnly) '' 216 # It has some hardcoded FHS paths and also we do not use it 217 # since we set up the environment in NixOS tests anyway. 218 moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests" 219 ''; 220 221 + postFixup = lib.optionalString (!libOnly) '' 222 # set necessary environment also for tests 223 for f in $installedTests/libexec/installed-tests/ibus/*; do 224 wrapGApp $f ··· 226 ''; 227 228 passthru = { 229 + tests = lib.optionalAttrs (!libOnly) { 230 installed-tests = nixosTests.installed-tests.ibus; 231 }; 232 + updateScript = nix-update-script { }; 233 }; 234 235 + meta = { 236 + changelog = "https://github.com/ibus/ibus/releases/tag/${finalAttrs.src.tag}"; 237 homepage = "https://github.com/ibus/ibus"; 238 description = "Intelligent Input Bus, input method framework"; 239 + license = lib.licenses.lgpl21Plus; 240 + platforms = lib.platforms.linux; 241 + maintainers = with lib.maintainers; [ ttuegel ]; 242 }; 243 + })