Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
@ 2022-11-22 18:51 paper42
  2022-11-22 20:01 ` Duncaen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: paper42 @ 2022-11-22 18:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

There is a new pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages decentralize-shlibs
https://github.com/void-linux/void-packages/pull/40698

[NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
shlibs are now in individual packages and not in a centralized
common/shlibs file.

The third optional column was used to restrict the shlib to a specific
arch which is now not required, the shlibs list can be easily modified
with shell code just like any other variable.

## TODO
* how much slower is this? xbps-query -o is slow when a lot of packages
  are installed
* adjust pkglint rules
* add a pkglint rule that checks that an shlib actually exists in the
  pkg
* currently every shlib has to be on its own line which can easily break
  with += and there can not be a whitespace at the beginning of the line
* one limitation is that the package template can not be fully sourced,
  so it's not possible to for example have different shlibs when an
  option is enabled, but that was not possible now either

This is currently just an experiment, building opendoas is known to work with these changes.

A patch file from https://github.com/void-linux/void-packages/pull/40698.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-decentralize-shlibs-40698.patch --]
[-- Type: text/x-diff, Size: 6378 bytes --]

From c0cab241feecc73dad191fe1b49c476ee32bf13b Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:33:18 +0100
Subject: [PATCH 1/4] common/hooks: move provided shlibs to templates

shlibs are now in individual packages and not in a centralized
common/shlibs file.

The third optional column was used to restrict the shlib to a specific
arch which is now not required, the shlibs list can be easily modified
with shell code just like any other variable.

TODO:
* how much slower is this? xbps-query -o is slow when a lot of packages
  are installed
* adjust pkglint rules
* add a pkglint rule that checks that an shlib actually exists in the
  pkg
* currently every shlib has to be on its own line which can easily break
  with += and there can not be a whitespace at the beginning of the line
* one limitation is that the package template can not be fully sourced,
  so it's not possible to for example have different shlibs when an
  option is enabled, but that was not possible now either
---
 .../hooks/pre-pkg/04-generate-runtime-deps.sh | 25 ++++++++++++++-----
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index eb19ebfe7081..b42bb862f797 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -46,15 +46,13 @@ store_pkgdestdir_rundeps() {
 }
 
 hook() {
-    local depsftmp f lf j mapshlibs sorequires _curdep elfmagic
+    local depsftmp f lf j sorequires _curdep elfmagic
 
     # Disable trap on ERR, xbps-uhelper cmd might return error... but not something
     # to be worried about because if there are broken shlibs this hook returns
     # error via msg_error().
     trap - ERR
 
-    mapshlibs=$XBPS_COMMONDIR/shlibs
-
     if [ -n "$noverifyrdeps" ]; then
         store_pkgdestdir_rundeps
         return 0
@@ -91,10 +89,25 @@ hook() {
     # above, the mapping is done thru the common/shlibs file.
     #
     for f in ${verify_deps}; do
-        unset _f j rdep _rdep rdepcnt soname _pkgname _rdepver found
+        unset _f j rdep rdepver _rdep rdepcurrent rdepcnt soname _pkgname _rdepver found
         _f=$(echo "$f"|sed -E 's|\+|\\+|g')
-        rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2)"
-        rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2|wc -l)"
+        # get rdep pkgname in current version
+        rdepcurrent="$(xbps-query -o "/usr/lib/${_f}" | cut -d: -f1)"
+        # extract just pkgname
+        rdepname="$($XBPS_UHELPER_CMD getpkgname "$rdepcurrent")"
+        # look into the template of the rdep to figure out which version
+        # should be used for the shlib dependency
+        shlibs=$(
+            shlibs=
+            source_file $XBPS_SRCPKGDIR/$rdepname/template
+            if type ${rdepname}_package >/dev/null 2>&1; then
+                ${rdepname}_package
+            fi
+            echo "$shlibs"
+        );
+        rdepver="$(echo $shlibs | grep -E "^${_f}[[:blank:]]+.*$" | cut -d ' ' -f2)"
+        rdep="${rdepname}-${rdepver}"
+        rdepcnt=1 # FIXME
         if [ -z "$rdep" ]; then
             # Ignore libs by current pkg
             soname=$(find ${PKGDESTDIR} -name "$f")

From cd1c5c4712fe6f04d5f28cd8f399ad14963b1226 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:41:41 +0100
Subject: [PATCH 2/4] glibc: add shlibs to the package

---
 srcpkgs/glibc/template | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..43a55a9955c6 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -56,6 +56,42 @@ lib32symlinks="ld-linux.so.2"
 archs="~*-musl"
 nopie=yes
 
+shlibs="
+libc.so.6 ${version}_1
+libm.so.6 ${version}_1
+libpthread.so.0 ${version}_1
+librt.so.1 ${version}_1
+libdl.so.2 ${version}_1
+ld-linux-armhf.so.3 ${version}_1
+libresolv.so.2 ${version}_1
+libanl.so.1 ${version}_1
+libthread_db.so.1 ${version}_1
+libutil.so.1 ${version}_1
+libnsl.so.1 ${version}_1
+libnss_db.so.2 ${version}_1
+libnss_files.so.2 ${version}_1
+libnss_compat.so.2 ${version}_1
+libnss_dns.so.2 ${version}_1
+libnss_hesiod.so.2 ${version}_1
+libcrypt.so.1 ${version}_1
+libBrokenLocale.so.1 ${version}_1
+libmemusage.so ${version}_1
+libSegFault.so ${version}_1
+libpcprofile.so ${version}_1
+libcidn.so.1 ${version}_1
+libmvec.so.1 ${version}_1
+"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64) shlibs+="ld-linux-x86-64.so.2 ${version}_1" ;;
+	i686) shlibs+="ld-linux.so.2 ${version}_1" ;;
+	armv5tel) shlibs+="ld-linux.so.3 ${version}_1" ;;
+	aarch64) shlibs+="ld-linux-aarch64.so.1 ${version}_1" ;;
+	ppc64) shlibs+="ld64.so.2 ${version}_1" ;;
+	mips) shlibs+="ld.so.1 ${version}_1" ;;
+	ppc) shlibs+="ld.so.1 ${version}_1" ;;
+esac
+
 do_configure() {
 	mkdir build
 	cd build

From 429048e563cd274c17430646e99161ecedb965b6 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:41:57 +0100
Subject: [PATCH 3/4] musl: add shlibs to the package

---
 srcpkgs/musl/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..7ad671d170c5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -17,6 +17,8 @@ checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
 nostrip_files="libc.so"
 shlib_provides="libc.so"
 
+shlibs="libc.so 1.1.24_7"
+
 post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie ${FILESDIR}/getent.c -o getent
 	$CC $CFLAGS $LDFLAGS -fpie ${FILESDIR}/getconf.c -o getconf

From 09d49300d71ef94441c3e5eafcf7e622b1dd921f Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:42:09 +0100
Subject: [PATCH 4/4] pam: add shlibs to the package

---
 srcpkgs/pam/template | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/srcpkgs/pam/template b/srcpkgs/pam/template
index 70d87f00af90..a1a91e60e55b 100644
--- a/srcpkgs/pam/template
+++ b/srcpkgs/pam/template
@@ -56,6 +56,9 @@ pam-devel_package() {
 	}
 }
 pam-libs_package() {
+	shlibs="libpam.so.0 1.1.6_3
+	 libpamc.so.0 1.1.6_3
+	 libpam_misc.so.0 1.1.6_3"
 	short_desc+=" - runtime libraries"
 	pkg_install() {
 		vmove "usr/lib/*.so.*"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
@ 2022-11-22 20:01 ` Duncaen
  2022-11-23  0:27 ` classabbyamp
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2022-11-22 20:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/40698#issuecomment-1324177837

Comment:
`xbps-query -p shlib-provides -s 'libfoo.so.1.0'` will be faster.

I don't like that it has to source/parse the template file too much, I wonder if it would make sense to just add the minimum version to the shlib-provides metadata.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
  2022-11-22 20:01 ` Duncaen
@ 2022-11-23  0:27 ` classabbyamp
  2022-11-23  0:29 ` classabbyamp
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-11-23  0:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/40698#issuecomment-1324399652

Comment:
> * currently every shlib has to be on its own line which can easily break  with += and there can not be a whitespace at the beginning of the line

I think this could be solved by using some special char between each shlibname and version. `:` may not be a good idea if that's wanted for epoch later, but maybe `=` could work, e.g.:

```sh
shlibs="libfoo.so.1=1.1_2
 libbar.so.3=1.0_1"
 ```

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
  2022-11-22 20:01 ` Duncaen
  2022-11-23  0:27 ` classabbyamp
@ 2022-11-23  0:29 ` classabbyamp
  2022-11-23  0:32 ` classabbyamp
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-11-23  0:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/40698#issuecomment-1324399652

Comment:
> * currently every shlib has to be on its own line which can easily break  with += and there can not be a whitespace at the beginning of the line

I think this could be solved by using some special char between each shlibname and version. `:` may not be a good idea if that's wanted for epoch later, but maybe `=` could work, e.g.:

```sh
shlibs="libfoo.so.1=1.1_2
 libbar.so.3=1.0_1"
 ```

or maybe `=>` or `>=` or `>` could make sense

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
                   ` (2 preceding siblings ...)
  2022-11-23  0:29 ` classabbyamp
@ 2022-11-23  0:32 ` classabbyamp
  2022-12-30 17:23 ` [PR PATCH] [Updated] " paper42
  2023-03-31  1:55 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-11-23  0:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/40698#issuecomment-1324399652

Comment:
> * currently every shlib has to be on its own line which can easily break  with += and there can not be a whitespace at the beginning of the line

I think this could be solved by using some special char between each shlibname and version. `:` may not be a good idea if that's wanted for epoch later, but maybe `=` could work, e.g.:

```sh
shlibs="libfoo.so.1=1.1_2
 libbar.so.3=1.0_1"
 ```

or maybe `=>` or `>=` or `>` could make sense

---

I agree with duncaen on using/adapting shlib-provides for this

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
                   ` (3 preceding siblings ...)
  2022-11-23  0:32 ` classabbyamp
@ 2022-12-30 17:23 ` paper42
  2023-03-31  1:55 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: paper42 @ 2022-12-30 17:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages decentralize-shlibs
https://github.com/void-linux/void-packages/pull/40698

[NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
shlibs are now in individual packages and not in a centralized
common/shlibs file.

The third optional column was used to restrict the shlib to a specific
arch which is now not required, the shlibs list can be easily modified
with shell code just like any other variable.

## TODO
* how much slower is this? xbps-query -o is slow when a lot of packages
  are installed
* adjust pkglint rules
* add a pkglint rule that checks that an shlib actually exists in the
  pkg
* currently every shlib has to be on its own line which can easily break
  with += and there can not be a whitespace at the beginning of the line
* one limitation is that the package template can not be fully sourced,
  so it's not possible to for example have different shlibs when an
  option is enabled, but that was not possible now either

This is currently just an experiment, building opendoas is known to work with these changes.

A patch file from https://github.com/void-linux/void-packages/pull/40698.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-decentralize-shlibs-40698.patch --]
[-- Type: text/x-diff, Size: 15027 bytes --]

From f37c64523aab80d6314faf6b7456ecec91836a12 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:33:18 +0100
Subject: [PATCH 01/10] common/hooks: move provided shlibs to templates

shlibs are now in individual packages and not in a centralized
common/shlibs file.

The third optional column was used to restrict the shlib to a specific
arch which is now not required, the shlibs list can be easily modified
with shell code just like any other variable.

TODO:
* how much slower is this? xbps-query -o is slow when a lot of packages
  are installed
* adjust pkglint rules
* add a pkglint rule that checks that an shlib actually exists in the
  pkg
* currently every shlib has to be on its own line which can easily break
  with += and there can not be a whitespace at the beginning of the line
* one limitation is that the package template can not be fully sourced,
  so it's not possible to for example have different shlibs when an
  option is enabled, but that was not possible now either
---
 .../hooks/pre-pkg/04-generate-runtime-deps.sh | 25 ++++++++++++++-----
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index a291f2ccc872..bd012e1b0ee1 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -46,15 +46,13 @@ store_pkgdestdir_rundeps() {
 }
 
 hook() {
-    local depsftmp f lf j mapshlibs sorequires _curdep elfmagic broken_shlibs verify_deps
+    local depsftmp f lf j sorequires _curdep elfmagic verify_rdeps
 
     # Disable trap on ERR, xbps-uhelper cmd might return error... but not something
     # to be worried about because if there are broken shlibs this hook returns
     # error via msg_error().
     trap - ERR
 
-    mapshlibs=$XBPS_COMMONDIR/shlibs
-
     if [ -n "$noverifyrdeps" ]; then
         store_pkgdestdir_rundeps
         return 0
@@ -95,10 +93,25 @@ hook() {
     # above, the mapping is done thru the common/shlibs file.
     #
     for f in ${verify_deps}; do
-        unset _f j rdep _rdep rdepcnt soname _pkgname _rdepver found
+        unset _f j rdep rdepver _rdep rdepcurrent rdepcnt soname _pkgname _rdepver found
         _f=$(echo "$f"|sed -E 's|\+|\\+|g')
-        rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2)"
-        rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2|wc -l)"
+        # get rdep pkgname in current version
+        rdepcurrent="$(xbps-query -o "/usr/lib/${_f}" | cut -d: -f1)"
+        # extract just pkgname
+        rdepname="$($XBPS_UHELPER_CMD getpkgname "$rdepcurrent")"
+        # look into the template of the rdep to figure out which version
+        # should be used for the shlib dependency
+        shlibs=$(
+            shlibs=
+            source_file $XBPS_SRCPKGDIR/$rdepname/template
+            if type ${rdepname}_package >/dev/null 2>&1; then
+                ${rdepname}_package
+            fi
+            echo "$shlibs"
+        );
+        rdepver="$(echo $shlibs | grep -E "^${_f}[[:blank:]]+.*$" | cut -d ' ' -f2)"
+        rdep="${rdepname}-${rdepver}"
+        rdepcnt=1 # FIXME
         if [ -z "$rdep" ]; then
             # Ignore libs by current pkg
             soname=$(find ${PKGDESTDIR} -name "$f")

From 64c6d5e73469185fdf4837d7edf9434c98de41d5 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:41:41 +0100
Subject: [PATCH 02/10] glibc: add shlibs to the package

---
 srcpkgs/glibc/template | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index 452b55c12762..7e6f06e3d863 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -59,6 +59,42 @@ if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="no point in building this for musl"
 fi
 
+shlibs="
+libc.so.6 ${version}_1
+libm.so.6 ${version}_1
+libpthread.so.0 ${version}_1
+librt.so.1 ${version}_1
+libdl.so.2 ${version}_1
+ld-linux-armhf.so.3 ${version}_1
+libresolv.so.2 ${version}_1
+libanl.so.1 ${version}_1
+libthread_db.so.1 ${version}_1
+libutil.so.1 ${version}_1
+libnsl.so.1 ${version}_1
+libnss_db.so.2 ${version}_1
+libnss_files.so.2 ${version}_1
+libnss_compat.so.2 ${version}_1
+libnss_dns.so.2 ${version}_1
+libnss_hesiod.so.2 ${version}_1
+libcrypt.so.1 ${version}_1
+libBrokenLocale.so.1 ${version}_1
+libmemusage.so ${version}_1
+libSegFault.so ${version}_1
+libpcprofile.so ${version}_1
+libcidn.so.1 ${version}_1
+libmvec.so.1 ${version}_1
+"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64) shlibs+="ld-linux-x86-64.so.2 ${version}_1" ;;
+	i686) shlibs+="ld-linux.so.2 ${version}_1" ;;
+	armv5tel) shlibs+="ld-linux.so.3 ${version}_1" ;;
+	aarch64) shlibs+="ld-linux-aarch64.so.1 ${version}_1" ;;
+	ppc64) shlibs+="ld64.so.2 ${version}_1" ;;
+	mips) shlibs+="ld.so.1 ${version}_1" ;;
+	ppc) shlibs+="ld.so.1 ${version}_1" ;;
+esac
+
 do_configure() {
 	mkdir build
 	cd build

From ccebcf0a0d76e2295c7a20de77cb9a38ac217ab6 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Tue, 22 Nov 2022 19:41:57 +0100
Subject: [PATCH 03/10] musl: add shlibs to the package

---
 srcpkgs/musl/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index afb33cd868b5..fb6bbc66fb0f 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -17,6 +17,8 @@ checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
 nostrip_files="libc.so"
 shlib_provides="libc.so"
 
+shlibs="libc.so 1.1.24_7"
+
 post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie ${FILESDIR}/getent.c -o getent
 	$CC $CFLAGS $LDFLAGS -fpie ${FILESDIR}/getconf.c -o getconf

From 268640b9a8257483c61a20803df3e7c83c089bbd Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 18:06:30 +0100
Subject: [PATCH 04/10] acl: add shlibs to the package

---
 srcpkgs/acl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/acl/template b/srcpkgs/acl/template
index 9fa74946a240..4b2aabca60c5 100644
--- a/srcpkgs/acl/template
+++ b/srcpkgs/acl/template
@@ -13,6 +13,7 @@ license="LGPL-2.1-or-later"
 homepage="https://savannah.nongnu.org/projects/acl"
 distfiles="${NONGNU_SITE}/acl/acl-${version}.tar.gz"
 checksum=760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af
+shlibs="libacl.so.1 2.2.47_1"
 
 if [ -z "$CHROOT_READY" ]; then
 	CFLAGS+=" -I${XBPS_MASTERDIR}/usr/include"

From 5198be19c3ce0e3c1bfb780f61e97fcbde188382 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 17:57:49 +0100
Subject: [PATCH 05/10] search for shlib-provides

---
 common/hooks/pre-pkg/04-generate-runtime-deps.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index bd012e1b0ee1..3d530f8ec4fe 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -96,7 +96,7 @@ hook() {
         unset _f j rdep rdepver _rdep rdepcurrent rdepcnt soname _pkgname _rdepver found
         _f=$(echo "$f"|sed -E 's|\+|\\+|g')
         # get rdep pkgname in current version
-        rdepcurrent="$(xbps-query -o "/usr/lib/${_f}" | cut -d: -f1)"
+        rdepcurrent="$($XBPS_QUERY_CMD -p shlib-provides -s "${_f}" | cut -d: -f1)"
         # extract just pkgname
         rdepname="$($XBPS_UHELPER_CMD getpkgname "$rdepcurrent")"
         # look into the template of the rdep to figure out which version

From ecba7b5bd703f7f2f104d3ce7a118764880189ca Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 17:58:54 +0100
Subject: [PATCH 06/10] fix ignoring libs from current pkg

---
 .../hooks/pre-pkg/04-generate-runtime-deps.sh | 31 ++++++++++---------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index 3d530f8ec4fe..48cd87d76e15 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -97,20 +97,23 @@ hook() {
         _f=$(echo "$f"|sed -E 's|\+|\\+|g')
         # get rdep pkgname in current version
         rdepcurrent="$($XBPS_QUERY_CMD -p shlib-provides -s "${_f}" | cut -d: -f1)"
-        # extract just pkgname
-        rdepname="$($XBPS_UHELPER_CMD getpkgname "$rdepcurrent")"
-        # look into the template of the rdep to figure out which version
-        # should be used for the shlib dependency
-        shlibs=$(
-            shlibs=
-            source_file $XBPS_SRCPKGDIR/$rdepname/template
-            if type ${rdepname}_package >/dev/null 2>&1; then
-                ${rdepname}_package
-            fi
-            echo "$shlibs"
-        );
-        rdepver="$(echo $shlibs | grep -E "^${_f}[[:blank:]]+.*$" | cut -d ' ' -f2)"
-        rdep="${rdepname}-${rdepver}"
+        rdep=
+        if [ -n "$rdepcurrent" ]; then
+            # extract just pkgname
+            rdepname="$($XBPS_UHELPER_CMD getpkgname "$rdepcurrent")"
+            # look into the template of the rdep to figure out which version
+            # should be used for the shlib dependency
+            shlibs=$(
+                shlibs=
+                source_file $XBPS_SRCPKGDIR/$rdepname/template
+                if type ${rdepname}_package >/dev/null 2>&1; then
+                    ${rdepname}_package
+                fi
+                echo "$shlibs"
+            );
+            rdepver="$(echo $shlibs | grep -E "^${_f}[[:blank:]]+.*$" | cut -d ' ' -f2)"
+            rdep="${rdepname}-${rdepver}"
+        fi
         rdepcnt=1 # FIXME
         if [ -z "$rdep" ]; then
             # Ignore libs by current pkg

From e5a1676aa2aeb0d004490c7f36a1c2b095df0e80 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 18:18:57 +0100
Subject: [PATCH 07/10] use = as the version separator

---
 common/hooks/pre-pkg/04-generate-runtime-deps.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index 48cd87d76e15..059d97d6644c 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -111,7 +111,7 @@ hook() {
                 fi
                 echo "$shlibs"
             );
-            rdepver="$(echo $shlibs | grep -E "^${_f}[[:blank:]]+.*$" | cut -d ' ' -f2)"
+            rdepver="$(echo $shlibs | grep -E "^${_f}=.*$" | cut -d '=' -f2)"
             rdep="${rdepname}-${rdepver}"
         fi
         rdepcnt=1 # FIXME

From ad42b57508e686a0968197d1321853c2230c259c Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 18:20:19 +0100
Subject: [PATCH 08/10] acl: use = as a version separator

---
 srcpkgs/acl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/acl/template b/srcpkgs/acl/template
index 4b2aabca60c5..99d3bbfc1990 100644
--- a/srcpkgs/acl/template
+++ b/srcpkgs/acl/template
@@ -13,7 +13,7 @@ license="LGPL-2.1-or-later"
 homepage="https://savannah.nongnu.org/projects/acl"
 distfiles="${NONGNU_SITE}/acl/acl-${version}.tar.gz"
 checksum=760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af
-shlibs="libacl.so.1 2.2.47_1"
+shlibs="libacl.so.1=2.2.47_1"
 
 if [ -z "$CHROOT_READY" ]; then
 	CFLAGS+=" -I${XBPS_MASTERDIR}/usr/include"

From 6254e5ce0cb4e97af113cf0172d1e59bdc0ee41d Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 18:20:28 +0100
Subject: [PATCH 09/10] glibc: use = as a version separator

---
 srcpkgs/glibc/template | 60 +++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index 7e6f06e3d863..177b67f6d7e0 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -60,39 +60,39 @@ if [ "$XBPS_TARGET_LIBC" = musl ]; then
 fi
 
 shlibs="
-libc.so.6 ${version}_1
-libm.so.6 ${version}_1
-libpthread.so.0 ${version}_1
-librt.so.1 ${version}_1
-libdl.so.2 ${version}_1
-ld-linux-armhf.so.3 ${version}_1
-libresolv.so.2 ${version}_1
-libanl.so.1 ${version}_1
-libthread_db.so.1 ${version}_1
-libutil.so.1 ${version}_1
-libnsl.so.1 ${version}_1
-libnss_db.so.2 ${version}_1
-libnss_files.so.2 ${version}_1
-libnss_compat.so.2 ${version}_1
-libnss_dns.so.2 ${version}_1
-libnss_hesiod.so.2 ${version}_1
-libcrypt.so.1 ${version}_1
-libBrokenLocale.so.1 ${version}_1
-libmemusage.so ${version}_1
-libSegFault.so ${version}_1
-libpcprofile.so ${version}_1
-libcidn.so.1 ${version}_1
-libmvec.so.1 ${version}_1
+libc.so.6=${version}_1
+libm.so.6=${version}_1
+libpthread.so.0=${version}_1
+librt.so.1=${version}_1
+libdl.so.2=${version}_1
+ld-linux-armhf.so.3=${version}_1
+libresolv.so.2=${version}_1
+libanl.so.1=${version}_1
+libthread_db.so.1=${version}_1
+libutil.so.1=${version}_1
+libnsl.so.1=${version}_1
+libnss_db.so.2=${version}_1
+libnss_files.so.2=${version}_1
+libnss_compat.so.2=${version}_1
+libnss_dns.so.2=${version}_1
+libnss_hesiod.so.2=${version}_1
+libcrypt.so.1=${version}_1
+libBrokenLocale.so.1=${version}_1
+libmemusage.so=${version}_1
+libSegFault.so=${version}_1
+libpcprofile.so=${version}_1
+libcidn.so.1=${version}_1
+libmvec.so.1=${version}_1
 "
 
 case "$XBPS_TARGET_MACHINE" in
-	x86_64) shlibs+="ld-linux-x86-64.so.2 ${version}_1" ;;
-	i686) shlibs+="ld-linux.so.2 ${version}_1" ;;
-	armv5tel) shlibs+="ld-linux.so.3 ${version}_1" ;;
-	aarch64) shlibs+="ld-linux-aarch64.so.1 ${version}_1" ;;
-	ppc64) shlibs+="ld64.so.2 ${version}_1" ;;
-	mips) shlibs+="ld.so.1 ${version}_1" ;;
-	ppc) shlibs+="ld.so.1 ${version}_1" ;;
+	x86_64) shlibs+="ld-linux-x86-64.so.2=${version}_1" ;;
+	i686) shlibs+="ld-linux.so.2=${version}_1" ;;
+	armv5tel) shlibs+="ld-linux.so.3=${version}_1" ;;
+	aarch64) shlibs+="ld-linux-aarch64.so.1=${version}_1" ;;
+	ppc64) shlibs+="ld64.so.2=${version}_1" ;;
+	mips) shlibs+="ld.so.1=${version}_1" ;;
+	ppc) shlibs+="ld.so.1=${version}_1" ;;
 esac
 
 do_configure() {

From 50495cf03661066204a906aa449290c94c228331 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 30 Dec 2022 18:20:37 +0100
Subject: [PATCH 10/10] musl: use = as a version separator

---
 srcpkgs/musl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index fb6bbc66fb0f..6aabd3a7e10a 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -17,7 +17,7 @@ checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
 nostrip_files="libc.so"
 shlib_provides="libc.so"
 
-shlibs="libc.so 1.1.24_7"
+shlibs="libc.so=1.1.24_7"
 
 post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie ${FILESDIR}/getent.c -o getent

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates
  2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
                   ` (4 preceding siblings ...)
  2022-12-30 17:23 ` [PR PATCH] [Updated] " paper42
@ 2023-03-31  1:55 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2023-03-31  1:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/40698#issuecomment-1491179146

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-31  1:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 18:51 [PR PATCH] [NOMERGE] [POC] common/hooks: move shlibs from common/shlibs to individual templates paper42
2022-11-22 20:01 ` Duncaen
2022-11-23  0:27 ` classabbyamp
2022-11-23  0:29 ` classabbyamp
2022-11-23  0:32 ` classabbyamp
2022-12-30 17:23 ` [PR PATCH] [Updated] " paper42
2023-03-31  1:55 ` github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).