Skip to content

Commit

Permalink
libpamac-aur: Fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jung <[email protected]>
  • Loading branch information
ptr1337 committed Sep 3, 2024
1 parent 6b885d0 commit 9bb66ad
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 13 deletions.
6 changes: 3 additions & 3 deletions libpamac-aur/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ pkgbase = libpamac-aur
options = !emptydirs
options = !strip
backup = etc/pamac.conf
source = libpamac-11.6.4-3.tar.gz::https://gitlab.manjaro.org/applications/libpamac/-/archive/dff0d861a492e0dcbfb03b134cf737e627315d52/libpamac-dff0d861a492e0dcbfb03b134cf737e627315d52.tar.gz
source = libpamac-11.6.4-3.tar.gz::https://gitlab.manjaro.org/applications/libpamac/-/archive/9108cba3ae01c60c198e996a4956474a66597a7b/libpamac-9108cba3ae01c60c198e996a4956474a66597a7b.tar.gz
source = fix-appstream-data.sh
source = fix-appstream-data.hook
source = https://github.com/vnepogodin/my-patches/raw/develop/libpamac/0001-add-arches-from-pacman-func-call.patch
sha256sums = 965ea2c39b3999bb0ac5ec75da150d43fdd35deb02c0c113deef84e96ee636de
sha256sums = f5aabfc5b1972f444bd527d23ee33c927e4bec9fedf2e947aff3aa997afbee07
sha256sums = 6e0c25f0fcb0076ce78845b037e32925fcc3f1cd1670062c48ed35f564a10244
sha256sums = c2b943318a01ba1f3dabbf32e48e6a6f4b4b774e167ab86c6bfee31aa4a3424c
sha256sums = b5236af02c25cd7de4b2c9c2d0f064dac3c2f54da5cc72bf72fc6236a34bd9c4
sha256sums = 23862d7ba3507670cbdd00b949c453bf8b8f2bb876cbd5943b2ceb60cc13cc6f

pkgname = libpamac-aur
48 changes: 48 additions & 0 deletions libpamac-aur/0001-add-arches-from-pacman-func-call.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 336229b96f79ff241e6033a7c71706d5d971e4e0 Mon Sep 17 00:00:00 2001
From: Vladislav Nepogodin <[email protected]>
Date: Sun, 18 Dec 2022 02:31:30 +0400
Subject: [PATCH] add arches from pacman func call

---
src/alpm_config.vala | 9 ++++++++-
vapi/libalpm.vapi | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/alpm_config.vala b/src/alpm_config.vala
index 94ba59a..c29fac5 100644
--- a/src/alpm_config.vala
+++ b/src/alpm_config.vala
@@ -288,9 +288,16 @@ internal class AlpmConfig {
} else if (key == "LogFile") {
logfile = val;
} else if (key == "Architecture") {
+ Alpm.Errno error = 0;
+ Alpm.Handle tmp_handle = new Alpm.Handle ("/", "/var/lib/pacman/", out error);
foreach (unowned string arch in val.split (" ")) {
if (arch == "auto") {
- architectures.add (Posix.utsname ().machine);
+ Alpm.List<unowned string> physical_arches = tmp_handle.get_physical_architectures();
+ while (physical_arches != null) {
+ unowned string physical_arch = physical_arches.data;
+ architectures.add (physical_arch);
+ physical_arches.next ();
+ }
} else {
architectures.add (arch);
}
diff --git a/vapi/libalpm.vapi b/vapi/libalpm.vapi
index 6cd14e3..a8d7e60 100644
--- a/vapi/libalpm.vapi
+++ b/vapi/libalpm.vapi
@@ -74,6 +74,8 @@ namespace Alpm {
[CCode (cname = "alpm_option_get_architectures")] get;
[CCode (cname = "alpm_option_set_architectures")] set;
}
+ [CCode (cname = "alpm_option_get_physical_architectures")]
+ public Alpm.List<unowned string> get_physical_architectures();
[CCode (cname = "alpm_option_add_architecture")]
public int add_architecture(string path);
[CCode (cname = "alpm_option_remove_architecture")]
--
2.39.0

8 changes: 4 additions & 4 deletions libpamac-aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pkgver=11.6.4
pkgrel=3
_pkgfixver=$pkgver

_commit='dff0d861a492e0dcbfb03b134cf737e627315d52'
sha256sums=('965ea2c39b3999bb0ac5ec75da150d43fdd35deb02c0c113deef84e96ee636de'
_commit='9108cba3ae01c60c198e996a4956474a66597a7b'
sha256sums=('f5aabfc5b1972f444bd527d23ee33c927e4bec9fedf2e947aff3aa997afbee07'
'6e0c25f0fcb0076ce78845b037e32925fcc3f1cd1670062c48ed35f564a10244'
'c2b943318a01ba1f3dabbf32e48e6a6f4b4b774e167ab86c6bfee31aa4a3424c'
'b5236af02c25cd7de4b2c9c2d0f064dac3c2f54da5cc72bf72fc6236a34bd9c4'
'23862d7ba3507670cbdd00b949c453bf8b8f2bb876cbd5943b2ceb60cc13cc6f')

pkgdesc="Pamac package manager library based on libalpm"
Expand All @@ -31,7 +31,7 @@ options=(!emptydirs !strip)
install=pamac.install
source=("libpamac-$pkgver-$pkgrel.tar.gz::$url/-/archive/$_commit/libpamac-$_commit.tar.gz"
fix-appstream-data.sh fix-appstream-data.hook
"https://github.com/vnepogodin/my-patches/raw/develop/libpamac/0001-add-arches-from-pacman-func-call.patch")
https://github.com/vnepogodin/my-patches/raw/develop/libpamac/0001-add-arches-from-pacman-func-call.patch)

define_meson=''
if [ "${ENABLE_FLATPAK}" = 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion libpamac-aur/fix-appstream-data.hook
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/share/app-info/xmls/*.xml.gz
Target = usr/share/swcatalog/xmls/*.xml.gz

# attention: hook name before: update-appstream-cache.hook

Expand Down
18 changes: 13 additions & 5 deletions libpamac-aur/pamac.install
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,30 @@ restore_conf() {
}

post_install() {
# remove file (#28, #29)
[[ -e /var/tmp/pamac/dbs/sync/refresh_timestamp ]] && rm -f /var/tmp/pamac/dbs/sync/refresh_timestamp
# enable flatpak repo
if [ -f /usr/bin/flatpak ]; then
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
fi
fi
# enable systemd timers
mkdir -p /etc/systemd/system/timers.target.wants
ln -sf /usr/lib/systemd/system/pamac-cleancache.timer /etc/systemd/system/timers.target.wants/pamac-cleancache.timer
# ln -sf /usr/lib/systemd/system/pamac-mirrorlist.timer /etc/systemd/system/timers.target.wants/pamac-mirrorlist.timer
# polkit agent
printf '==> An authentication agent is required\n'
printf ' Cinnamon, Deepin, GNOME, GNOME Flashback, KDE, LXDE, LXQt, MATE and Xfce\n'
printf ' have an authentication agent already.\n'
printf ' See https://wiki.archlinux.org/index.php/Polkit#Authentication_agents\n'
printf ' for other desktop environments.\n'
# restore old conf
restore_conf
}

post_upgrade() {
# enable flatpak repo
if [ -f /usr/bin/flatpak ]; then
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
fi
# remove file (#28, #29)
[[ -e /var/tmp/pamac/dbs/sync/refresh_timestamp ]] && rm -f /var/tmp/pamac/dbs/sync/refresh_timestamp

# restore old conf
if [ "$(vercmp $2 7.3.5-3)" -lt 0 ]; then
restore_conf
Expand Down

0 comments on commit 9bb66ad

Please sign in to comment.