index : packages | |
Archlinux32 package modifications | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2025-03-23 16:12:32 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2025-03-23 16:12:32 +0100 |
commit | 16b9979c9c27f7561fc0cd588eaf72785223c24d (patch) | |
tree | 3d962c26ae0ceda09f0dd528c5dfaec9aff079b8 /build-support/pacman-static | |
parent | 88c052a933c5c72be1dd29a2ba2c4315bd666387 (diff) |
diff --git a/build-support/pacman-static/PKGBUILD b/build-support/pacman-static/PKGBUILD index 9a2f0ca0..fab98f4b 100644 --- a/build-support/pacman-static/PKGBUILD +++ b/build-support/pacman-static/PKGBUILD @@ -354,52 +354,10 @@ package() { "${pkgdir}"/usr/lib/pacman/lib/pkgconfig/*.pc \ "${pkgdir}"/usr/lib/pacman/bin/* } -# upstream git revision: 1a52f2e1d641587a1514c99b96d839368076288d - -depends+=(archlinux32-keyring) - -# fail if upstream changes makepkg.conf or pacman.conf -for ((i=0; i<${#sha256sums[@]}; i++)); do - # pacman.conf - if [ "${sha256sums[${i}]}" = 'bc80e9d0439caddd29b99a69b5060b5589cad2398c23abc5b2b8b990fae6ad8c' ]; then - sha256sums[${i}]='3e482ca4e98386679cec02b51e32c6a13caf3dee365a850567547f616a69408f' - fi - # makepkg.conf - if [ "${sha256sums[${i}]}" = 'd99c1f9608362fff9ab3a2ca0a3096a317927b42a6725bc86599da6849c9c67c' ]; then - sha256sums[${i}]='82e963060a02c9a04cf5296bb4c5e732d3c3d0666d221ddaf2b3367989b9d894' - fi - # rust.conf (for now keep the upstream one) -done - -if [ ! "${CARCH}" = "i686" ]; then - # patch architecture where needed - eval "$( - declare -f package | \ - sed ' - /install.*makepkg.conf/ a \ - sed -i "s@i686@'"${CARCH}"'@g; /^CHOST/ s/pentium4-/i686-/" "$pkgdir/etc/makepkg.conf" - ' - )" -fi # patch pacman for automatic architecture detection (applied in wildcard patch above) source+=('replace-i686-by-pentium4-when-architecture-is-auto.patch') -sha256sums+=('6a7906bd28a57cbcff58d856ffefbbb9096a163aaff79913b4fac69d75d0028a') - -# not supported on i486 -fcf-protection -# LTO currently no available on i486 -if [ "${CARCH}" = "i486" ]; then - eval "$( - { - declare -f package || \ - printf 'package() {\n}\n' - } \ - | sed ' - $i sed -i "s/-fcf-protection//g" "$pkgdir/etc/makepkg.conf" - $i sed -i "s/LTOFLAGS.*/LTOFLAGS=\\\"-fno-lto\\\"/" "$pkgdir/etc/makepkg.conf" - ' - )" -fi +sha512sums+=('c1a23b64f7d27ee70724415e8aa274494ceff441f5f1547f2f7ce365f1d8416b95b85275653531f259381bdef0fdd903e22f961a10c3ebaea8d0965bdaa06508') # If this still applies, it only does for i486: # (while not having Python, it's not working on any CARCH) @@ -427,10 +385,10 @@ fi # use muon instead of meson, no python (and meson needs python) makedepends=(${makedepends[@]//meson/}) -makedepends+=(muon-meson) +makedepends+=(muon-meson ninja) source+=(pacman-trailing-slash-muon.patch) -sha256sums+=(f295ff9967d38117bb5a29237716abb997197c69d8d2eeb449db49b85582be02) +sha512sums+=(2a657849a5b8879abf731ffd6ee1eb2b69502e03444010dc0e398427a40e86aa4383fcff7bd6d08abd67386b7945c093f56c64202f9867fd5dfb65c5bc6d0b3f) eval "$( declare -f build | \ @@ -448,11 +406,11 @@ eval "$( ' declare -f package | \ sed ' - /meson install/ i \ + /ninja install/ i \ cd $srcdir/pacman/build - /meson install/ a \ + /ninja install/ a \ cd .. - s/DESTDIR="$pkgdir" meson install -C build/muon install -d "$pkgdir"/ + s/.*ninja install.*/muon install -d "$pkgdir"/ ' )" diff --git a/build-support/pacman-static/pacman-trailing-slash-muon.patch b/build-support/pacman-static/pacman-trailing-slash-muon.patch new file mode 100644 index 00000000..4b3c393f --- /dev/null +++ b/build-support/pacman-static/pacman-trailing-slash-muon.patch @@ -0,0 +1,22 @@ +diff -rauN pacman-orig/meson.build pacman-trailing-slash-muon-patch/meson.build +--- pacman-orig/meson.build 2025-03-20 17:46:34.979754357 +0100 ++++ pacman-trailing-slash-muon-patch/meson.build 2025-03-20 17:47:38.620712716 +0100 +@@ -68,13 +68,13 @@ + conf.set_quoted('SCRIPTLET_SHELL', get_option('scriptlet-shell')) + conf.set_quoted('LDCONFIG', LDCONFIG) + conf.set_quoted('LIB_VERSION', libalpm_version) +-conf.set_quoted('SYSHOOKDIR', join_paths(DATAROOTDIR, 'libalpm/hooks/')) ++conf.set_quoted('SYSHOOKDIR', join_paths(DATAROOTDIR, 'libalpm/hooks/') + '/') + conf.set_quoted('CONFFILE', join_paths(SYSCONFDIR, 'pacman.conf')) +-conf.set_quoted('DBPATH', join_paths(LOCALSTATEDIR, 'lib/pacman/')) +-conf.set_quoted('GPGDIR', join_paths(SYSCONFDIR, 'pacman.d/gnupg/')) ++conf.set_quoted('DBPATH', join_paths(LOCALSTATEDIR, 'lib/pacman/') + '/') ++conf.set_quoted('GPGDIR', join_paths(SYSCONFDIR, 'pacman.d/gnupg/') + '/') + conf.set_quoted('LOGFILE', join_paths(LOCALSTATEDIR, 'log/pacman.log')) +-conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/')) +-conf.set_quoted('HOOKDIR', join_paths(SYSCONFDIR, 'pacman.d/hooks/')) ++conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/') +'/') ++conf.set_quoted('HOOKDIR', join_paths(SYSCONFDIR, 'pacman.d/hooks/') + '/') + conf.set_quoted('ROOTDIR', ROOTDIR) + + libintl = dependency('', required: false) diff --git a/build-support/pacman-static/replace-i686-by-pentium4-when-architecture-is-auto.patch b/build-support/pacman-static/replace-i686-by-pentium4-when-architecture-is-auto.patch new file mode 100644 index 00000000..5ad0592e --- /dev/null +++ b/build-support/pacman-static/replace-i686-by-pentium4-when-architecture-is-auto.patch @@ -0,0 +1,104 @@ +diff --git a/src/pacman/conf.c b/src/pacman/conf.c +index 0f0c2cfb..23744328 100644 +--- a/src/pacman/conf.c ++++ b/src/pacman/conf.c +@@ -18,6 +18,7 @@ + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + ++#include <cpuid.h> + #include <errno.h> + #include <limits.h> + #include <locale.h> /* setlocale */ +@@ -401,6 +402,12 @@ int config_add_architecture(char *arch) + char *newarch; + uname(&un); + newarch = strdup(un.machine); ++ if(strcmp(newarch, "i686") == 0) { ++ unsigned int eax, ebx, ecx, edx; ++ __get_cpuid(1, &eax, &ebx, &ecx, &edx); ++ if (edx & bit_SSE2) ++ newarch = strdup("pentium4"); ++ } + free(arch); + arch = newarch; + } +diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c +index 7e810127..b5bd2a37 100644 +--- a/src/pacman/pacman.c ++++ b/src/pacman/pacman.c +@@ -26,6 +26,7 @@ + + #include <stdlib.h> /* atoi */ + #include <stdio.h> ++#include <cpuid.h> + #include <ctype.h> /* isspace */ + #include <limits.h> + #include <getopt.h> +@@ -274,8 +275,19 @@ static void setuseragent(void) + int len; + + uname(&un); ++ char machine[9]; ++ strncpy(machine, un.machine, sizeof machine); ++ machine[sizeof machine-1] = '\0'; ++ if(strcmp(machine, "i686") == 0) { ++ int eax, ebx, ecx, edx; ++ __get_cpuid(1, &eax, &ebx, &ecx, &edx); ++ if (edx & bit_SSE2) { ++ strncpy(machine, "pentium4", sizeof machine); ++ machine[sizeof machine-1] = '\0'; ++ } ++ } + len = snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s", +- PACKAGE_VERSION, un.sysname, un.machine, alpm_version()); ++ PACKAGE_VERSION, un.sysname, machine, alpm_version()); + if(len >= 100) { + pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n")); + } +diff --git a/test/pacman/tests/upgrade082.py b/test/pacman/tests/upgrade082.py +index 0bdbdf71..8c30ec32 100644 +--- a/test/pacman/tests/upgrade082.py ++++ b/test/pacman/tests/upgrade082.py +@@ -3,6 +3,18 @@ + import os + machine = os.uname()[4] + ++if machine == 'i686': ++ import re ++ fo = open('/proc/cpuinfo') ++ for line in fo: ++ name_value = [s.strip() for s in line.split(':', 1)] ++ if len(name_value) != 2: ++ continue ++ name, value = name_value ++ if name == "flags": ++ if re.match(r'.*?\bsse2\b', value) is not None: ++ machine = 'pentium4' ++ + p = pmpkg("dummy") + p.files = ["bin/dummy", + "usr/man/man1/dummy.1"] +diff --git a/test/pacman/tests/upgrade083.py b/test/pacman/tests/upgrade083.py +index 097ae02c..7195e35b 100644 +--- a/test/pacman/tests/upgrade083.py ++++ b/test/pacman/tests/upgrade083.py +@@ -3,6 +3,18 @@ + import os + machine = os.uname()[4] + ++if machine == 'i686': ++ import re ++ fo = open('/proc/cpuinfo') ++ for line in fo: ++ name_value = [s.strip() for s in line.split(':', 1)] ++ if len(name_value) != 2: ++ continue ++ name, value = name_value ++ if name == "flags": ++ if re.match(r'.*?\bsse2\b', value) is not None: ++ machine = 'pentium4' ++ + p = pmpkg("dummy") + p.files = ["bin/dummy", + "usr/man/man1/dummy.1"] |