From 812965f02087f600ef94e0886952dfb65994ca6e Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Wed, 5 Aug 2026 15:41:08 +0800 Subject: [PATCH] fix: align GUI dependency pruning across packages --- Makefile | 17 +++++++++-------- packaging/deb/rules.in | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 41f4b93..5071797 100644 --- a/Makefile +++ b/Makefile @@ -320,18 +320,19 @@ init-debian: clean-debian tarball sed -i "s/@RUST_VERSION@/$(RUST_VERSION)/g" .build/deb/$(PKG)/debian/control - # Remove the GUI dependencies if BUILD_GUI_HELPER is set to 0 - if [ $(BUILD_GUI_HELPER) -eq 0 ]; then \ + # Remove the GUI dependencies if neither GUI component is included + if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \ sed -i "/libsecret-1-0/d" .build/deb/$(PKG)/debian/control; \ sed -i "/libayatana-appindicator3-1/d" .build/deb/$(PKG)/debian/control; \ sed -i "/gnome-keyring/d" .build/deb/$(PKG)/debian/control; \ fi - # Remove the WebKitGTK build dependency only if neither gpauth webview auth nor gpgui-helper needs it - if [ $(BUILD_GUI_HELPER) -eq 0 ] && [ $(BUILD_WEBVIEW_AUTH) -eq 0 ]; then \ + # Remove WebKitGTK only if no included component needs it + if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ] && [ $(BUILD_WEBVIEW_AUTH) -eq 0 ]; then \ sed -i "/libwebkit2gtk-4.1-dev/d" .build/deb/$(PKG)/debian/control; \ fi + sed -i "s/@INCLUDE_GUI@/$(INCLUDE_GUI)/g" .build/deb/$(PKG)/debian/rules sed -i "s/@BUILD_GUI_HELPER@/$(BUILD_GUI_HELPER)/g" .build/deb/$(PKG)/debian/rules sed -i "s/@BUILD_WEBVIEW_AUTH@/$(BUILD_WEBVIEW_AUTH)/g" .build/deb/$(PKG)/debian/rules sed -i "s/@RUST_VERSION@/$(RUST_VERSION)/g" .build/deb/$(PKG)/debian/rules @@ -433,14 +434,14 @@ init-apk: clean-apk tarball checksum=$$(sha512sum .build/apk/${PKG}.tar.gz | cut -d' ' -f1); \ sed -i "s/@SHA512@/$$checksum/g" .build/apk/APKBUILD - # Remove the GUI dependencies if BUILD_GUI_HELPER is set to 0 - if [ $(BUILD_GUI_HELPER) -eq 0 ]; then \ + # Remove the GUI dependencies if neither GUI component is included + if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \ sed -i "/^\tlibayatana-appindicator$$/d" .build/apk/APKBUILD; \ sed -i "/^\tlibsecret$$/d" .build/apk/APKBUILD; \ fi - # Remove the WebKitGTK dependency only if neither gpauth webview auth nor gpgui-helper needs it - if [ $(BUILD_GUI_HELPER) -eq 0 ] && [ $(BUILD_WEBVIEW_AUTH) -eq 0 ]; then \ + # Remove WebKitGTK only if no included component needs it + if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ] && [ $(BUILD_WEBVIEW_AUTH) -eq 0 ]; then \ sed -i "/^\twebkit2gtk-4.1$$/d" .build/apk/APKBUILD; \ fi diff --git a/packaging/deb/rules.in b/packaging/deb/rules.in index 6b6e0df..bc58331 100755 --- a/packaging/deb/rules.in +++ b/packaging/deb/rules.in @@ -1,5 +1,6 @@ #!/usr/bin/make -f +export INCLUDE_GUI = @INCLUDE_GUI@ export BUILD_GUI_HELPER = @BUILD_GUI_HELPER@ export BUILD_WEBVIEW_AUTH = @BUILD_WEBVIEW_AUTH@ export DISABLE_RUST_TOOLCHAIN = 0