Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: declarative split library and development file
@ 2020-05-07 16:10 sgn
  2020-05-07 20:35 ` Vaelatern
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: sgn @ 2020-05-07 16:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages build-help-split-devel
https://github.com/void-linux/void-packages/pull/21721

xbps-src: declarative split library and development file
@void-linux/pkg-committers 

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-build-help-split-devel-21721.patch --]
[-- Type: text/x-diff, Size: 7751 bytes --]

From 08e79dcd87d3cd94bbd143c91ac3f5a5be3f94c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Thu, 7 May 2020 21:57:41 +0700
Subject: [PATCH 1/5] do-pkg: source all files in setup-subpkg

---
 common/hooks/do-pkg/00-gen-pkg.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh
index e6285b6e4ff..6cc6a317bb4 100644
--- a/common/hooks/do-pkg/00-gen-pkg.sh
+++ b/common/hooks/do-pkg/00-gen-pkg.sh
@@ -141,7 +141,9 @@ hook() {
 		fi
 	done
 	if [ -z "$found_dbg_subpkg" -a -d "${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/${pkgname}-dbg-${version}" ]; then
-		source ${XBPS_COMMONDIR}/environment/setup-subpkg/subpkg.sh
+		for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
+		    source_file "$f"
+		done
 		repo=$XBPS_REPOSITORY/debug
 		_pkgver=${pkgname}-dbg-${version}_${revision}
 		_desc="${short_desc} (debug files)"
@@ -154,7 +156,9 @@ hook() {
 		return
 	fi
 	if [ -d "${XBPS_DESTDIR}/${pkgname}-32bit-${version}" ]; then
-		source ${XBPS_COMMONDIR}/environment/setup-subpkg/subpkg.sh
+		for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
+		    source_file "$f"
+		done
 		if [ -n "$repository" ]; then
 			repo=$XBPS_REPOSITORY/multilib/$repository
 		else

From ea128b27d97fb8da3e912d07966147d7c6118585 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Thu, 7 May 2020 21:55:40 +0700
Subject: [PATCH 2/5] setup: support split development declaratively

---
 common/environment/setup/vsplit.sh | 73 ++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 common/environment/setup/vsplit.sh

diff --git a/common/environment/setup/vsplit.sh b/common/environment/setup/vsplit.sh
new file mode 100644
index 00000000000..63a8e93cb99
--- /dev/null
+++ b/common/environment/setup/vsplit.sh
@@ -0,0 +1,73 @@
+# Helper function to split library & development files
+
+vsplit_lib() {
+	# libpkg and lib_short_desc will be reused for devel package
+	libpkg="${1:-lib${pkgname}}"
+	lib_short_desc="${2:-$short_desc - runtime library}"
+	local _lib_depends_line _lib_shlib_line
+	if [ -n "$3" ]; then
+		_lib_depends_line="depends='$3'"
+	fi
+	if [ -n "$lib_shlib_provides" ]; then
+		_lib_shlib_line="shlib_provides='$lib_shlib_provides'"
+	fi
+	eval "
+	${libpkg}_package() {
+		$_lib_depends_line
+		$_lib_shlib_line
+		short_desc='${lib_short_desc}'
+		pkg_install() {
+			vmove 'usr/lib/*.so.*'
+			if command -v lib_post_install >/dev/null 2>&1; then
+				lib_post_install
+			fi
+			if command -v ${libpkg}_post_install >/dev/null 2>&1; then
+				${libpkg}_post_install
+			fi
+		}
+	}
+	"
+}
+
+vsplit_devel() {
+	local _basepkg="${libpkg:-${pkgname}}"
+	local _develpkg="${1:-${_basepkg}-devel}"
+	local _base_short_desc="${lib_short_desc:-$short_desc}"
+	local _devel_short_desc="${2:-${_base_short_desc} - development files}"
+	local _devel_depends="${3:-$makedepends ${_basepkg}>=${version}_${revision}}"
+	eval "
+	${_develpkg}_package() {
+		depends='$_devel_depends'
+		short_desc='${devel_short_desc:-${_base_short_desc} - development files}'
+		pkg_install() {
+			for d in usr/include \\
+				usr/lib/pkgconfig usr/share/pkgconfig \\
+				usr/share/vala usr/share/gir-1.0 \\
+				usr/share/man/man2 usr/share/man/man3 \\
+				usr/share/aclocal usr/share/sgml \\
+				usr/share/cmake usr/lib/cmake \\
+				usr/share/gtk-doc usr/lib/qt5/mkspecs
+			do
+				if [ -d \"\$DESTDIR/\$d\" ]; then
+					vmove \"\$d\"
+				fi
+			done
+			for f in \"\$DESTDIR/usr/lib/\"*.so \\
+				\"\$DESTDIR/usr/lib/\"*.a \\
+				\"\$DESTDIR/usr/bin/\"*-config \\
+				\"\$DESTDIR/usr/share/man/man1/\"*-config.1*
+			do
+				if [ -f \"\$f\" ]; then
+					vmove \"\${f#\$DESTDIR}\"
+				fi
+			done
+			if command -v devel_post_install >/dev/null 2>&1; then
+				devel_post_install
+			fi
+			if command -v ${_develpkg}_post_install >/dev/null 2>&1; then
+				${_develpkg}_post_install
+			fi
+		}
+	}
+	"
+}

From 20b28c3137258e72f4a13be07a31ba796d857ddd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Thu, 7 May 2020 23:01:48 +0700
Subject: [PATCH 3/5] curl: use automatic library and development split

---
 srcpkgs/curl/template | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/curl/template b/srcpkgs/curl/template
index d4432ebaa7d..0b13d520971 100644
--- a/srcpkgs/curl/template
+++ b/srcpkgs/curl/template
@@ -22,6 +22,7 @@ changelog="https://curl.haxx.se/changes.html#${version//./_}"
 distfiles="${homepage}/download/${pkgname}-${version}.tar.bz2"
 checksum=a50bfe62ad67a24f8b12dd7fd655ac43a0f0299f86ec45b11354f25fbb5829d0
 patch_args="-Np1"
+lib_shlib_provides="libcurl-gnutls.so.4"
 build_options="gnutls gssapi ldap rtmp ssh ssl"
 build_options_default="ssh ssl"
 vopt_conflict ssl gnutls
@@ -36,26 +37,9 @@ post_install() {
 	vlicense COPYING
 }
 
-libcurl_package() {
-	short_desc="Multiprotocol file transfer library"
-	shlib_provides="libcurl-gnutls.so.4"
-	pkg_install() {
-		vmove "usr/lib/*.so.*"
-		ln -sf libcurl.so.4.6.0 ${PKGDESTDIR}/usr/lib/libcurl-gnutls.so.4
-	}
+lib_post_install() {
+	ln -sf libcurl.so.4.6.0 ${PKGDESTDIR}/usr/lib/libcurl-gnutls.so.4
 }
 
-libcurl-devel_package() {
-	depends="${makedepends} libcurl>=${version}_${revision}"
-	short_desc="Multiprotocol file transfer library - development files"
-	pkg_install() {
-		vmove usr/bin/curl-config
-		vmove "usr/share/man/man1/curl-config*"
-		vmove usr/share/man/man3
-		vmove usr/share/aclocal
-		vmove usr/include
-		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
-		vmove usr/lib/pkgconfig
-	}
-}
+vsplit_lib "" "Multiprotocol file transfer library"
+vsplit_devel

From 98b7ccd3a64ef5b22080293f78e10cfc17a1cfb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Thu, 7 May 2020 23:07:22 +0700
Subject: [PATCH 4/5] notmuch: use automatic library and development split

---
 srcpkgs/notmuch/template | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/srcpkgs/notmuch/template b/srcpkgs/notmuch/template
index 2c898538069..b2f1f9a1291 100644
--- a/srcpkgs/notmuch/template
+++ b/srcpkgs/notmuch/template
@@ -55,21 +55,8 @@ post_install() {
 	rm -f ${DESTDIR}/usr/share/applications/mimeinfo.cache
 }
 
-libnotmuch_package() {
-	short_desc+=" - runtime library"
-	pkg_install() {
-		vmove usr/lib/*.so.*
-	}
-}
-
-libnotmuch-devel_package() {
-	short_desc+=" - development files"
-	depends="libnotmuch-${version}_${revision}"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/*.so
-	}
-}
+vsplit_lib
+vsplit_devel "" "" "libnotmuch-${version}_${revision}"
 
 notmuch-emacs_package() {
 	archs=noarch

From b8a6fa88cc87c0cb5b9ed458f713b9bcf0a6d55d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Thu, 7 May 2020 23:09:34 +0700
Subject: [PATCH 5/5] libuv: use automatic library and development split

---
 srcpkgs/libuv/template | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/srcpkgs/libuv/template b/srcpkgs/libuv/template
index 00561caff83..65b906d857e 100644
--- a/srcpkgs/libuv/template
+++ b/srcpkgs/libuv/template
@@ -22,13 +22,4 @@ post_install() {
 	vlicense LICENSE
 }
 
-libuv-devel_package() {
-	depends="libuv>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
-	}
-}
+vsplit_devel

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
@ 2020-05-07 20:35 ` Vaelatern
  2020-05-08  0:17 ` q66
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Vaelatern @ 2020-05-07 20:35 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625483175

Comment:
I don't really like this. We currently don't have any other examples of magic where we create magic packagtes (other than -dbg, which is just a build option, and -32bit, same).

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
  2020-05-07 20:35 ` Vaelatern
@ 2020-05-08  0:17 ` q66
  2020-05-08 17:08 ` Hoshpak
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: q66 @ 2020-05-08  0:17 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625560997

Comment:
yeah i think this is no good

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
  2020-05-07 20:35 ` Vaelatern
  2020-05-08  0:17 ` q66
@ 2020-05-08 17:08 ` Hoshpak
  2020-05-08 17:10 ` Vaelatern
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Hoshpak @ 2020-05-08 17:08 UTC (permalink / raw)
  To: ml

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

New comment by Hoshpak on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625919310

Comment:
I agree. Too much magic and calling shell functions like that makes the templates harder to read and potentially also makes parsing more difficult.

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (2 preceding siblings ...)
  2020-05-08 17:08 ` Hoshpak
@ 2020-05-08 17:10 ` Vaelatern
  2020-05-08 17:12 ` Chocimier
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Vaelatern @ 2020-05-08 17:10 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625920029

Comment:
@sgn do you think this should be pursued? 

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (3 preceding siblings ...)
  2020-05-08 17:10 ` Vaelatern
@ 2020-05-08 17:12 ` Chocimier
  2020-05-08 17:12 ` Chocimier
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Chocimier @ 2020-05-08 17:12 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625920614

Comment:
One thing I found good is guessing what packages to install into -lib and -devel packages.

Maybe that could be reworked as someting like `vgroupinstall devel` inside pkg_install?

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (4 preceding siblings ...)
  2020-05-08 17:12 ` Chocimier
@ 2020-05-08 17:12 ` Chocimier
  2020-05-08 17:48 ` Anachron
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Chocimier @ 2020-05-08 17:12 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625920614

Comment:
One thing I found good is guessing what files to install into -lib and -devel packages.

Maybe that could be reworked as someting like `vgroupinstall devel` inside pkg_install?

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (5 preceding siblings ...)
  2020-05-08 17:12 ` Chocimier
@ 2020-05-08 17:48 ` Anachron
  2020-05-08 17:51 ` Vaelatern
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Anachron @ 2020-05-08 17:48 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625936607

Comment:
^ couldnt xnew be updated in that case? 

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (6 preceding siblings ...)
  2020-05-08 17:48 ` Anachron
@ 2020-05-08 17:51 ` Vaelatern
  2020-05-08 19:41 ` Anachron
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Vaelatern @ 2020-05-08 17:51 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625938065

Comment:
> ^ couldnt xnew be updated in that case?

What do you mean by this question, @Anachron ? How does xnew play into regular package building, unless you mean adding a sample devel package? (and just requiring it be deleted for most packages?)

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (7 preceding siblings ...)
  2020-05-08 17:51 ` Vaelatern
@ 2020-05-08 19:41 ` Anachron
  2020-05-08 23:55 ` travankor
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Anachron @ 2020-05-08 19:41 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-625984799

Comment:
xnew already has optional subpkgs with -devel support. Isnt that sufficient for new pkgs? 

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (8 preceding siblings ...)
  2020-05-08 19:41 ` Anachron
@ 2020-05-08 23:55 ` travankor
  2020-05-09  0:59 ` sgn
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: travankor @ 2020-05-08 23:55 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-626067870

Comment:
@sgn, I think @Chocimier's suggestion is the best way to salvage the useful parts of this PR.

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (9 preceding siblings ...)
  2020-05-08 23:55 ` travankor
@ 2020-05-09  0:59 ` sgn
  2020-05-09  1:07 ` sgn
  2020-05-15 16:03 ` [PR PATCH] [Closed]: " sgn
  12 siblings, 0 replies; 14+ messages in thread
From: sgn @ 2020-05-09  0:59 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-626079279

Comment:
> One thing I found good is guessing what files to install into -lib and -devel packages.
> 
> Maybe that could be reworked as someting like `vgroupinstall devel` inside pkg_install?

Yeah, this sounds better, doesn't harm readability and reduce the repeated code for devel and libs.

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

* Re: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (10 preceding siblings ...)
  2020-05-09  0:59 ` sgn
@ 2020-05-09  1:07 ` sgn
  2020-05-15 16:03 ` [PR PATCH] [Closed]: " sgn
  12 siblings, 0 replies; 14+ messages in thread
From: sgn @ 2020-05-09  1:07 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21721#issuecomment-626080557

Comment:
> ^ couldnt xnew be updated in that case?

I think `vgroupinstall` or `vsplit` is better than update `xnew` manually remove/add file.

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

* Re: [PR PATCH] [Closed]: xbps-src: declarative split library and development file
  2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
                   ` (11 preceding siblings ...)
  2020-05-09  1:07 ` sgn
@ 2020-05-15 16:03 ` sgn
  12 siblings, 0 replies; 14+ messages in thread
From: sgn @ 2020-05-15 16:03 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

xbps-src: declarative split library and development file
https://github.com/void-linux/void-packages/pull/21721

Description:
@void-linux/pkg-committers 

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

end of thread, other threads:[~2020-05-15 16:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 16:10 [PR PATCH] xbps-src: declarative split library and development file sgn
2020-05-07 20:35 ` Vaelatern
2020-05-08  0:17 ` q66
2020-05-08 17:08 ` Hoshpak
2020-05-08 17:10 ` Vaelatern
2020-05-08 17:12 ` Chocimier
2020-05-08 17:12 ` Chocimier
2020-05-08 17:48 ` Anachron
2020-05-08 17:51 ` Vaelatern
2020-05-08 19:41 ` Anachron
2020-05-08 23:55 ` travankor
2020-05-09  0:59 ` sgn
2020-05-09  1:07 ` sgn
2020-05-15 16:03 ` [PR PATCH] [Closed]: " sgn

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).