diff --git a/.gitignore b/.gitignore index 9549d938..f81130ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +debian/* !debian/*.install !debian/*.postinst !debian/changelog @@ -7,8 +8,7 @@ !debian/source .cargo/ **/*.rs.bk -debian/ gtk/ffi/examples/c/build target/ vendor.tar -vendor \ No newline at end of file +vendor diff --git a/Cargo.toml b/Cargo.toml index 44431513..95e0acbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["daemon", "gtk", "gtk/ffi"] [workspace.package] -rust-version = "1.75.0" +rust-version = "1.80" [workspace.dependencies] apt-cmd = "0.5.0" diff --git a/Makefile b/Makefile index d53874d7..d0a28adf 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,9 @@ NOTIFY = pop-upgrade-notify NOTIFY_APPID = $(ID).Notify STARTUP_DESKTOP = $(NOTIFY_APPID).desktop +VERSION=$(shell lsb_release -rs) +ENABLE_GTK_LIB=$(shell dpkg --compare-versions 22.04 le $(VERSION) && echo 1 || echo 0) + .PHONY: all clean distclean install uninstall update vendor all: $(BINARY) $(LIBRARY) $(PKGCONFIG) @@ -59,9 +62,6 @@ endif install: install -Dm0755 "$(BINARY)" "$(DESTDIR)$(bindir)/$(BIN)" install -Dm0755 "data/$(BIN).sh" "$(DESTDIR)$(libdir)/$(BIN)/upgrade.sh" - install -Dm0644 "$(HEADER)" "$(DESTDIR)$(includedir)/$(PACKAGE).h" - install -Dm0644 "$(LIBRARY)" "$(DESTDIR)$(libdir)/$(LIB)" - install -Dm0644 "$(PKGCONFIG)" "$(DESTDIR)$(libdir)/pkgconfig/$(PACKAGE).pc" install -Dm0644 "data/$(BIN)-init.service" "$(DESTDIR)$(libdir)/systemd/system/$(BIN)-init.service" install -Dm0644 "data/$(BIN).conf" "$(DESTDIR)$(sysconfdir)/dbus-1/system.d/$(BIN).conf" install -Dm0644 "data/$(BIN).service" "$(DESTDIR)$(libdir)/systemd/system/$(BIN).service" @@ -69,15 +69,24 @@ install: install -Dm0644 "data/$(NOTIFY).service" "$(DESTDIR)$(libdir)/systemd/user/$(NOTIFY).service" install -Dm0644 "data/$(NOTIFY).timer" "$(DESTDIR)$(libdir)/systemd/user/$(NOTIFY).timer" install -Dm0644 "data/$(STARTUP_DESKTOP)" "$(DESTDIR)/etc/xdg/autostart/$(STARTUP_DESKTOP)" +ifeq ($(ENABLE_GTK_LIB),1) + install -Dm0644 "$(HEADER)" "$(DESTDIR)$(includedir)/$(PACKAGE).h" + install -Dm0644 "$(LIBRARY)" "$(DESTDIR)$(libdir)/$(LIB)" + install -Dm0644 "$(PKGCONFIG)" "$(DESTDIR)$(libdir)/pkgconfig/$(PACKAGE).pc" +endif $(BINARY): extract-vendor cargo build $(ARGS) -p pop-upgrade $(LIBRARY): extract-vendor +ifeq ($(ENABLE_GTK_LIB),1) cargo build $(ARGS) -p pop-upgrade-gtk-ffi +endif $(PKGCONFIG): +ifeq ($(ENABLE_GTK_LIB),1) echo "libdir=$(libdir)" > "$@.partial" echo "includedir=$(includedir)" >> "$@.partial" cat "$(PKGCONFIG).stub" >> "$@.partial" mv "$@.partial" "$@" +endif diff --git a/daemon/src/release/repos.rs b/daemon/src/release/repos.rs index 50dd0eba..3e536f30 100644 --- a/daemon/src/release/repos.rs +++ b/daemon/src/release/repos.rs @@ -341,16 +341,18 @@ fn ubuntu_uri() -> &'static str { } fn system_sources(release: &str) -> String { + let uri = + if cfg!(target_arch = "aarch64") { ubuntu_uri() } else { "apt.pop-os.org/ubuntu" }; format!( r#"X-Repolib-Name: Pop_OS System Sources Enabled: yes Types: deb deb-src -URIs: http://apt.pop-os.org/ubuntu +URIs: http://{1} Suites: {0} {0}-security {0}-updates {0}-backports Components: main restricted universe multiverse -X-Repolib-Default-Mirror: http://apt.pop-os.org/ubuntu +X-Repolib-Default-Mirror: http://{1} "#, - release + release, uri ) } diff --git a/debian/libpop-upgrade-gtk-dev.install b/debian/libpop-upgrade-gtk-dev.install deleted file mode 100644 index 11822e7f..00000000 --- a/debian/libpop-upgrade-gtk-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/include/ -/usr/lib/pkgconfig/ \ No newline at end of file diff --git a/debian/libpop-upgrade-gtk.install b/debian/libpop-upgrade-gtk.install deleted file mode 100644 index eec3c068..00000000 --- a/debian/libpop-upgrade-gtk.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/libpop_upgrade_gtk.so \ No newline at end of file diff --git a/debian/rules b/debian/rules index 8f249f2e..2c202169 100755 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,9 @@ export VENDOR ?= 1 CLEAN ?= 1 +VERSION=$(shell lsb_release -rs) +ENABLE_GTK_LIB=$(shell dpkg --compare-versions 22.04 le $(VERSION) && echo 1 || echo 0) + %: dh $@ --with=systemd @@ -22,3 +25,12 @@ override_dh_installinit: override_dh_systemd_start: dh_systemd_start -r + +override_dh_install: + dh_install +ifeq ($(ENABLE_GTK_LIB),1) + mkdir -p debian/libpop-upgrade-gtk/usr/lib debian/libpop-upgrade-gtk-dev/usr debian/libpop-upgrade-gtk-dev/usr + install debian/tmp/usr/lib/libpop_upgrade_gtk.so debian/libpop-upgrade-gtk/usr/lib/libpop_upgrade_gtk.so + install debian/tmp/usr/include/pop_upgrade_gtk.h debian/libpop-upgrade-gtk-dev/usr/pop_upgrade_gtk.h + install debian/tmp/usr/lib/pkgconfig/pop_upgrade_gtk.pc debian/libpop-upgrade-gtk-dev/usr/pop_upgrade_gtk.pc +endif