From 6079dc6aee54bf54aff74f22145e820135bbb3a9 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Fri, 18 Jul 2025 13:47:20 +0800 Subject: [PATCH] fix: update Rust version and dependencies for packaging --- .github/workflows/publish.yaml | 4 +--- Makefile | 10 +++------- packaging/deb/control.in | 3 ++- packaging/deb/rules.in | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2f761ce..69d1334 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -81,10 +81,8 @@ jobs: cp -v packaging/deb/compat .build/debian/compat cp -v packaging/deb/postrm .build/debian/postrm - sed -i "s/@RUST@/cargo-1.80/g" .build/debian/control sed -i "s/@OFFLINE@/1/g" .build/debian/rules sed -i "s/@BUILD_GUI@/1/g" .build/debian/rules - sed -i "s/@RUST_VERSION@/1.80/g" .build/debian/rules - name: Publish to PPA uses: yuezk/publish-ppa-package@gp @@ -96,7 +94,7 @@ jobs: debian_dir: publish-ppa/globalprotect-openconnect-*/.build/debian deb_email: "k3vinyue@gmail.com" deb_fullname: "Kevin Yue" - extra_ppa: "yuezk/globalprotect-openconnect liushuyu-011/rust-updates-1.80" + extra_ppa: "yuezk/globalprotect-openconnect" # Ubuntu 18.04 and 20.04 are excluded because tauri2 no longer supports them excluded_series: "bionic focal" revision: ${{ inputs.revision }} diff --git a/Makefile b/Makefile index c84a7e8..22ecfed 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ OFFLINE ?= 0 BUILD_FE ?= 1 INCLUDE_GUI ?= 0 CARGO ?= cargo -RUST_VERSION = 1.80 VERSION = $(shell $(CARGO) metadata --no-deps --format-version 1 | jq -r '.packages[0].version') REVISION ?= 1 @@ -180,7 +179,6 @@ init-debian: clean-debian tarball sed -i "s/@OFFLINE@/$(OFFLINE)/g" .build/deb/$(PKG)/debian/rules sed -i "s/@BUILD_GUI@/$(BUILD_GUI)/g" .build/deb/$(PKG)/debian/rules - sed -i "s/@RUST_VERSION@/$(RUST_VERSION)/g" .build/deb/$(PKG)/debian/rules # Remove the GUI dependencies if BUILD_GUI is set to 0 if [ $(BUILD_GUI) -eq 0 ]; then \ @@ -194,11 +192,11 @@ init-debian: clean-debian tarball rm -f .build/deb/$(PKG)/debian/changelog deb: init-debian - # Remove the rust build dependency from the control file - sed -i "s/@RUST@//g" .build/deb/$(PKG)/debian/control - cd .build/deb/$(PKG) && dch --create --distribution unstable --package $(PKG_NAME) --newversion $(VERSION)-$(REVISION) "Bugfix and improvements." + # Install build dependencies + cd .build/deb/$(PKG) && sudo mk-build-deps --install --remove debian/control + cd .build/deb/$(PKG) && debuild --preserve-env -e PATH -us -uc -b check-ppa: @@ -208,8 +206,6 @@ check-ppa: # Usage: make ppa SERIES=focal OFFLINE=1 PUBLISH=1 ppa: check-ppa init-debian - sed -i "s/@RUST@/cargo-1.80/g" .build/deb/$(PKG)/debian/control - $(eval SERIES_VER = $(shell distro-info --series $(SERIES) -r | cut -d' ' -f1)) @echo "Building for $(SERIES) $(SERIES_VER)" diff --git a/packaging/deb/control.in b/packaging/deb/control.in index a9b3ecb..d3f7af9 100644 --- a/packaging/deb/control.in +++ b/packaging/deb/control.in @@ -13,7 +13,8 @@ Build-Depends: debhelper (>= 9), libayatana-appindicator3-1, gnome-keyring, libwebkit2gtk-4.1-dev, - libopenconnect-dev (>= 8.20),@RUST@ + libopenconnect-dev (>= 8.20), + rust-1.82-all Homepage: https://github.com/yuezk/GlobalProtect-openconnect Package: globalprotect-openconnect diff --git a/packaging/deb/rules.in b/packaging/deb/rules.in index 114384b..591d12f 100755 --- a/packaging/deb/rules.in +++ b/packaging/deb/rules.in @@ -4,7 +4,7 @@ export OFFLINE = @OFFLINE@ export BUILD_FE = 0 export BUILD_GUI = @BUILD_GUI@ -export PATH := /usr/lib/rust-@RUST_VERSION@/bin:$(PATH) +export PATH := /usr/lib/rust-1.82/bin:$(PATH) %: which cargo diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a56a283..76fcadb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.1" +channel = "1.82"