Skip to content

Commit

Permalink
Revert "pacman: Update to 6.1.0"
Browse files Browse the repository at this point in the history
This reverts commit 7edf29e.
  • Loading branch information
MehdiChinoune committed May 7, 2024
1 parent bacfcdc commit 2673230
Show file tree
Hide file tree
Showing 46 changed files with 911 additions and 618 deletions.
6 changes: 3 additions & 3 deletions pacman/0001-makepkg-clean-up-more-things.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 2c898ec90c926510f23350c2780de99a7fad53b6 Mon Sep 17 00:00:00 2001
From bf8bd9828cf3e4efedbaa9a367e94de0e3361d30 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:24:16 +0100
Subject: [PATCH 01/N] makepkg: clean up more things
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 01/N] makepkg: clean up more things
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2c36681..44025e6 100644
index f799c8f..fca9b2c 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -137,7 +137,7 @@ clean_up() {
Expand All @@ -20,7 +20,7 @@ index 2c36681..44025e6 100644
if [[ -n $pkgbase ]]; then
local fullver=$(get_full_version)
# Can't do this unless the BUILDSCRIPT has been sourced.
@@ -846,6 +846,11 @@ restore_package_variables() {
@@ -939,6 +939,11 @@ restore_package_variables() {

run_single_packaging() {
local pkgdir="$pkgdirbase/$pkgname"
Expand Down
24 changes: 24 additions & 0 deletions pacman/0002-makepkg-bash-v4-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 1fbb46db545fad72daab79d769f19a4ae4cea6e3 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:24:42 +0100
Subject: [PATCH 02/N] makepkg: bash v4 compat

I think this is from a time when we only had bash v4 which didn't support "-f"
and can be dropped
---
scripts/makepkg.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index fca9b2c..5549f07 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -440,7 +440,7 @@ run_function() {

$pkgfunc &>"$logpipe"

- wait -f $teepid
+ wait $teepid
rm "$logpipe"
else
"$pkgfunc"
76 changes: 76 additions & 0 deletions pacman/0003-makepkg-find_libdepends-port-to-Windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
From 261911e634510c2b5390cf67d5067fca8f18a2a3 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:29:47 +0100
Subject: [PATCH 03/N] makepkg: find_libdepends: port to Windows

---
scripts/makepkg.sh.in | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5549f07..048d90d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -468,7 +468,7 @@ find_libdepends() {

sodepends=0
for d in "${depends[@]}"; do
- if [[ $d = *.so ]]; then
+ if [[ $d = *.dll ]]; then
sodepends=1
break
fi
@@ -479,28 +479,33 @@ find_libdepends() {
return 0
fi

- local libdeps filename soarch sofile soname soversion
+ local libdeps filename soarch sofile soname
declare -A libdeps

while IFS= read -rd '' filename; do
- # get architecture of the file; if soarch is empty it's not an ELF binary
- soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p')
+ # get architecture of the file; if soarch is empty it's not an binary
+ soarch=$(LANG=en_US.UTF-8 LC_ALL=C objdump -a "$filename" | sed -n 's/.*file format.*pei-\(i386\|x86-64\)/\1/p')
[[ -n "$soarch" ]] || continue
+ case "$soarch" in
+ i386)
+ soarch=i686
+ ;;
+ x86-64)
+ soarch=x86_64
+ ;;
+ esac

# process all libraries needed by the binary
- for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p')
+ for sofile in $(LC_ALL=C objdump -x "$filename" 2>/dev/null | sed -nr 's/.*DLL Name: (.*).*/\1/p')
do
- # extract the library name: libfoo.so
- soname="${sofile%.so?(+(.+([0-9])))}".so
- # extract the major version: 1
- soversion="${sofile##*\.so\.}"
+ soname=${sofile}

if [[ ${libdeps[$soname]} ]]; then
- if [[ ${libdeps[$soname]} != *${soversion}-${soarch}* ]]; then
- libdeps[$soname]+=" ${soversion}-${soarch}"
+ if [[ ${libdeps[$soname]} != *${soarch}* ]]; then
+ libdeps[$soname]+=" ${soarch}"
fi
else
- libdeps[$soname]="${soversion}-${soarch}"
+ libdeps[$soname]="${soarch}"
fi
done
done < <(find "$pkgdir" -type f -perm -u+x -print0)
@@ -508,7 +513,7 @@ find_libdepends() {
local libdepends v
for d in "${depends[@]}"; do
case "$d" in
- *.so)
+ *.dll)
if [[ ${libdeps[$d]} ]]; then
for v in ${libdeps[$d]}; do
libdepends+=("$d=$v")
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
From a4a50b45d8e599c966a0f257cad5cf88ea010c5d Mon Sep 17 00:00:00 2001
From c8025392f733b5b28687a8b468191354cd037415 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:30:09 +0100
Subject: [PATCH 02/N] makepkg: build env export
Subject: [PATCH 04/N] makepkg: build env export

this should be moved to the other exports really..
---
scripts/makepkg.sh.in | 3 +++
1 file changed, 3 insertions(+)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 44025e6..6d65902 100644
index 048d90d..2a85702 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1343,6 +1343,9 @@ fi
mkdir -p "$srcdir"
@@ -1425,6 +1425,9 @@ mkdir -p "$srcdir"
chmod a-s "$srcdir"
cd_safe "$srcdir"

+export MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX
+export DXSDK_DIR ACLOCAL_PATH PKG_CONFIG_PATH
Expand Down
58 changes: 58 additions & 0 deletions pacman/0005-makepkg-find_libprovides-port-to-Windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From e17f32548b02f143ec175dedd3130fdeee101787 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:30:23 +0100
Subject: [PATCH 05/N] makepkg: find_libprovides: port to Windows

---
scripts/makepkg.sh.in | 35 ++++++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2a85702..6384c35 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -539,30 +539,23 @@ find_libprovides() {
missing=0
versioned_provides=()
case "$p" in
- *.so)
- mapfile -t filename < <(find "$pkgdir" -type f -name $p\* | LC_ALL=C sort)
+ *.dll)
+ mapfile -t filename < <(find "$pkgdir" -type f -name $p)
if [[ $filename ]]; then
# packages may provide multiple versions of the same library
for fn in "${filename[@]}"; do
- # check if we really have a shared object
- if LC_ALL=C readelf -h "$fn" 2>/dev/null | grep -q '.*Type:.*DYN (Shared object file).*'; then
- # get the string binaries link to (e.g. libfoo.so.1.2 -> libfoo.so.1)
- local sofile=$(LC_ALL=C readelf -d "$fn" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
- if [[ -z "$sofile" ]]; then
- warning "$(gettext "Library listed in %s is not versioned: %s")" "'provides'" "$p"
- continue
- fi
-
- # get the library architecture (32 or 64 bit)
- local soarch=$(LC_ALL=C readelf -h "$fn" | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p')
-
- # extract the library major version
- local soversion="${sofile##*\.so\.}"
-
- versioned_provides+=("${p}=${soversion}-${soarch}")
- else
- warning "$(gettext "Library listed in %s is not a shared object: %s")" "'provides'" "$p"
- fi
+ # get the library architecture (32 or 64 bit)
+ local soarch=$(LC_ALL=C objdump -a "$fn" | sed -n 's/.*file format.*pei-\(i386\|x86-64\)/\1/p')
+ case "$soarch" in
+ i386)
+ soarch=i686
+ ;;
+ x86-64)
+ soarch=x86_64
+ ;;
+ esac
+
+ versioned_provides+=("${p}=${soarch}")
done
else
missing=1
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
From 2e757c243eef7f6a8c4befdbbb38b2737f35abad Mon Sep 17 00:00:00 2001
From 6a848dc26eb97a74ce01694d066dcb6eab335aa3 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:30:40 +0100
Subject: [PATCH 03/N] fill_progress
Subject: [PATCH 06/N] fill_progress

---
src/pacman/callback.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 76527e4..5d2de3f 100644
index 75c74f8..2f07512 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -152,8 +152,11 @@ static int64_t get_update_timediff(int first_call)
/* refactored from cb_trans_progress */
static void fill_progress(const int percent, const int proglen)
@@ -153,8 +153,11 @@ static int64_t get_update_timediff(int first_call)
static void fill_progress(const int bar_percent, const int disp_percent,
const int proglen)
{
- /* 8 = 1 space + 1 [ + 1 ] + 5 for percent */
- const int hashlen = proglen > 8 ? proglen - 8 : 0;
Expand All @@ -22,6 +22,6 @@ index 76527e4..5d2de3f 100644
+ * work properly on most windows terminals.
+ */
+ const int hashlen = proglen > 9 ? proglen - 9 : 0;
const int hash = percent * hashlen / 100;
const int hash = bar_percent * hashlen / 100;
static int lasthash = 0, mouth = 0;
int i;

8 changes: 4 additions & 4 deletions pacman/0004-test-fixes.patch → pacman/0007-test-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 0d6fcafb95f85d7c40b0127840a1a6736fd14d9e Mon Sep 17 00:00:00 2001
From 4c61f9081840055b4c0ca1840e6a45d287b9a21d Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 28 Feb 2023 20:30:50 +0100
Subject: [PATCH 04/N] test fixes
Subject: [PATCH 07/N] test fixes

---
test/pacman/pmtest.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index f5f033f..da2041b 100644
index 94b0930..bc4f2e3 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -297,8 +297,10 @@ def run(self, pacman):
@@ -294,8 +294,10 @@ def run(self, pacman):
# Change to the tmp dir before running pacman, so that local package
# archives are made available more easily.
time_start = time.time()
Expand Down

0 comments on commit 2673230

Please sign in to comment.