Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-15 11:15:43 +0200
committerErich Eckner <git@eckner.net>2019-05-15 11:15:43 +0200
commit2bc3cd728f07326f68bcb0ed2feff004dbb1f9e4 (patch)
treeb2db060b6819f2f3107d4a5d92142339cecf16bc /core
parent075be5b19a39062f08c952142edba1d828236263 (diff)
core/pacman: include our patches for simultanously installing the dependencies in makepkg and for mangling "i686" to "pentium4" when "Architecture = auto" is set in pacman's config
Diffstat (limited to 'core')
-rw-r--r--core/pacman/PKGBUILD10
-rw-r--r--core/pacman/install-dependencies-simultanously.patch28
-rw-r--r--core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch86
3 files changed, 124 insertions, 0 deletions
diff --git a/core/pacman/PKGBUILD b/core/pacman/PKGBUILD
index f75db89a..db947008 100644
--- a/core/pacman/PKGBUILD
+++ b/core/pacman/PKGBUILD
@@ -22,3 +22,13 @@ if [ ! "${CARCH}" = "i686" ]; then
'
)"
fi
+
+source+=('install-dependencies-simultanously.patch'
+ 'replace-i686-by-pentium4-when-architecture-is-auto.patch')
+sha256sums+=('95052e786da0ae8cc2378c0fc6ec38d433680f4d022f7f0f9cb5a5ad283abd83'
+ 'e8d5f8979c4dfab49e7ac058846f2454b865c1da451e086c23e61034fd820c19')
+prepare() {
+ cd "$pkgname-$pkgver"
+ patch -p1 -i ../install-dependencies-simultanously.patch
+ patch -p1 -i ../replace-i686-by-pentium4-when-architecture-is-auto.patch
+}
diff --git a/core/pacman/install-dependencies-simultanously.patch b/core/pacman/install-dependencies-simultanously.patch
new file mode 100644
index 00000000..07e0e404
--- /dev/null
+++ b/core/pacman/install-dependencies-simultanously.patch
@@ -0,0 +1,28 @@
+diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
+index 4d9948ec..eb2a19ba 100644
+--- a/scripts/makepkg.sh.in
++++ b/scripts/makepkg.sh.in
+@@ -1398,18 +1398,18 @@ else
+ fi
+ deperr=0
+
+- msg "$(gettext "Checking runtime dependencies...")"
+- resolve_deps ${depends[@]} || deperr=1
+-
+ if (( RMDEPS && INSTALL )); then
++ msg "$(gettext "Checking runtime dependencies...")"
++ resolve_deps ${depends[@]} || deperr=1
++
+ original_pkglist=($(run_pacman -Qq)) # required by remove_dep
+ fi
+
+ msg "$(gettext "Checking buildtime dependencies...")"
+ if (( CHECKFUNC )); then
+- resolve_deps "${makedepends[@]}" "${checkdepends[@]}" || deperr=1
++ resolve_deps "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}" || deperr=1
+ else
+- resolve_deps "${makedepends[@]}" || deperr=1
++ resolve_deps "${depends[@]}" "${makedepends[@]}" || deperr=1
+ fi
+
+ if (( RMDEPS )); then
diff --git a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
new file mode 100644
index 00000000..32030586
--- /dev/null
+++ b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
@@ -0,0 +1,86 @@
+diff --git a/src/pacman/conf.c b/src/pacman/conf.c
+index 2d8518c4..2e7fac88 100644
+--- a/src/pacman/conf.c
++++ b/src/pacman/conf.c
+@@ -308,6 +308,11 @@ int config_set_arch(const char *arch)
+ struct utsname un;
+ uname(&un);
+ config->arch = strdup(un.machine);
++ if(strcmp(config->arch, "i686") == 0) {
++ __builtin_cpu_init();
++ if (__builtin_cpu_supports("sse2"))
++ config->arch = strdup("pentium4");
++ }
+ } else {
+ config->arch = strdup(arch);
+ }
+diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
+index 3bb622e6..34aace6c 100644
+--- a/src/pacman/pacman.c
++++ b/src/pacman/pacman.c
+@@ -274,8 +274,18 @@ 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) {
++ __builtin_cpu_init();
++ if (__builtin_cpu_supports("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"]