Github messages for voidlinux
 help / color / mirror / Atom feed
From: ericonr <ericonr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC][WIP] Update gcompat to 0.9.0, add spotify to musl, use dynamic musl-obstack
Date: Tue, 07 Jul 2020 22:53:36 +0200	[thread overview]
Message-ID: <20200707205336.aQsuGWr8Y5GK7i3JMcYMyj0So0bnN-f_RoAXw7eKU5g@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23432@inbox.vuxu.org>

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

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

https://github.com/ericonr/void-packages gcompat
https://github.com/void-linux/void-packages/pull/23432

[RFC][WIP] Update gcompat to 0.9.0, add spotify to musl, use dynamic musl-obstack
Okay, so this is a biggie PR, and I do need help for making some decisions.

- So, basically, `gcompat` can do Spotify now, on Adélie. I am working on debugging it on Void, because it isn't working completely yet. If I can't get it working soon, I will leave the spotify commit out of this one.
- I enabled `obstack` in `gcompat`, by enabling the dynamic lib in `musl-obstack`. This completely fixes #22616, which needed obstack and `__strftime_l` symbols (the latter was fixed by gcompat itself).
- I split `musl-obstack-devel`.
- I switched package dependencies to `musl-obstack-devel`, but they ended up depending on the dynamic version of obstack. Is this bad? Is there some way to solve this? Perhaps two devel sub packages, one for dynamic and one for static linking?

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

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

From 7d87d050261f5a07268ea772e02b3e0c87c1b02a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:26:32 -0300
Subject: [PATCH 1/9] musl-obstack: ship dynamic lib, split devel.

---
 common/shlibs                 |  1 +
 srcpkgs/musl-obstack-devel    |  1 +
 srcpkgs/musl-obstack/template | 16 +++++++++++++---
 3 files changed, 15 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/musl-obstack-devel

diff --git a/common/shlibs b/common/shlibs
index 86ee9fcb734..31272a3530a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3978,3 +3978,4 @@ libsepol.so.1 libsepol-3.0_1
 libfrrcares.so.0 libfrr-7.3.1_1
 libhugetlbfs.so.0 libhugetlbfs-2.22_1
 libdolphinvcs.so.5 dolphin-plugins-20.04.2_1
+libobstack.so.0 musl-obstack-1.1_4
diff --git a/srcpkgs/musl-obstack-devel b/srcpkgs/musl-obstack-devel
new file mode 120000
index 00000000000..e21ca66cded
--- /dev/null
+++ b/srcpkgs/musl-obstack-devel
@@ -0,0 +1 @@
+musl-obstack
\ No newline at end of file
diff --git a/srcpkgs/musl-obstack/template b/srcpkgs/musl-obstack/template
index 2cd2ddf2efc..4e8bee6afec 100644
--- a/srcpkgs/musl-obstack/template
+++ b/srcpkgs/musl-obstack/template
@@ -1,16 +1,15 @@
 # Template file for 'musl-obstack'
 pkgname=musl-obstack
 version=1.1
-revision=3
+revision=4
 archs="*-musl"
 build_style=gnu-configure
-configure_args="--disable-shared"
 hostmakedepends="automake libtool"
 short_desc="Implementation of obstack for musl libc"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/void-linux/musl-obstack"
-distfiles="https://github.com/void-linux/${pkgname}/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz"
+distfiles="${homepage}/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=52a216613e7d55e8725e43d017bb2d49a4b1ffa1e06da472f03c7f9875df7d0d
 
 CFLAGS="-fPIC"
@@ -22,3 +21,14 @@ pre_configure() {
 post_install() {
 	vinstall ${pkgname}.pc 644 usr/lib/pkgconfig
 }
+
+musl-obstack-devel_package() {
+	depends="${sourcepkg}-${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/libobstack.a
+		vmove usr/lib/libobstack.so
+		vmove usr/lib/pkgconfig
+	}
+}

From ec078c020cc9d9ae8b3ede04d2a0a389e4b0a2a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 17:45:20 -0300
Subject: [PATCH 2/9] gcompat: update to 0.9.0.

Add musl-obstack dependency.
---
 .../gcompat/patches/ppc-libc_start_main.patch | 67 -------------------
 srcpkgs/gcompat/template                      | 10 +--
 2 files changed, 6 insertions(+), 71 deletions(-)
 delete mode 100644 srcpkgs/gcompat/patches/ppc-libc_start_main.patch

diff --git a/srcpkgs/gcompat/patches/ppc-libc_start_main.patch b/srcpkgs/gcompat/patches/ppc-libc_start_main.patch
deleted file mode 100644
index 518292745f7..00000000000
--- a/srcpkgs/gcompat/patches/ppc-libc_start_main.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From d30e49d10cefeb2748373127e1d1aba1184f653d Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 10 Nov 2019 15:32:28 +0100
-Subject: [PATCH 1/1] internal: add a wrapper for __libc_start_main for
- PowerPC(64(le))
-
-This is necessary because the musl and glibc function signatures
-differ significantly.
----
- libgcompat/internal.c | 41 +++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 41 insertions(+)
-
-diff --git a/libgcompat/internal.c b/libgcompat/internal.c
-index 450c5e4..53ac429 100644
---- libgcompat/internal.c
-+++ libgcompat/internal.c
-@@ -2,6 +2,47 @@
- #include <stdio.h>
- #include <stdlib.h>
- 
-+#if defined(__powerpc__)
-+
-+/* On PowerPC as well as ppc64, we need to fix up __libc_start_main as the
-+ * glibc and musl versions have wildly different signatures, which would
-+ * result in the arguments to __libc_start_main being completely wrong.
-+ *
-+ * Using dlsym in this context is mildly questionable as this is before
-+ * the full initialization has been done, but there is no better way.
-+ */
-+
-+#include <dlfcn.h>
-+
-+struct startup_info {
-+	void *sda_base;
-+	void *f_main;
-+	void *f_init;
-+	void *f_fini;
-+};
-+
-+typedef int (*start_main_t)(void *mf, int argc, char **argv);
-+
-+/*
-+ * ref: https://git.musl-libc.org/cgit/musl/tree/crt/crt1.c?id=90251cf
-+ * ref: https://git.musl-libc.org/cgit/musl/tree/src/env/__libc_start_main.c?id=90251cf#n71
-+ * ref: https://github.com/bminor/glibc/blob/5cb226d/sysdeps/unix/sysv/linux/powerpc/libc-start.c#L36
-+ */
-+int __libc_start_main(void *argc, void *argv, void *ev, void *auxv, void *fini,
-+                      struct startup_info *si, long *p)
-+{
-+	(void)argc;
-+	(void)argv;
-+	(void)ev;
-+	(void)auxv;
-+	(void)fini;
-+	/* argc/argv from the stack, main from startup_info */
-+	start_main_t mainf = (start_main_t)dlsym(RTLD_NEXT, "__libc_start_main");
-+	return mainf(si->f_main, *p, (void *)(p + 1));
-+}
-+
-+#endif /* defined(__powerpc__) */
-+
- void GCOMPAT__panic(const char *fmt, ...)
- {
- 	va_list va;
--- 
-2.23.0
-
diff --git a/srcpkgs/gcompat/template b/srcpkgs/gcompat/template
index 237f97bd5e9..b2c1e9f8230 100644
--- a/srcpkgs/gcompat/template
+++ b/srcpkgs/gcompat/template
@@ -1,14 +1,16 @@
 # Template file for 'gcompat'
 pkgname=gcompat
-version=0.4.0
+version=0.9.0
 revision=1
 build_style=gnu-makefile
+hostmakedepends="pkg-config"
+makedepends="musl-obstack-devel"
 short_desc="Compatibility layer to allow running glibc binaries on musl systems"
 maintainer="Daniel James <djames@orcadian.net>"
 license="ISC"
 homepage="https://code.foxkit.us/adelie/gcompat"
 distfiles="https://distfiles.AdelieLinux.org/source/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=9903fac7b70de3ba7736ae2987fa00bbafff7bfcf6a9c88731c292dff19e44e2
+checksum=4555d045d7d2831d11b907719005c5dfbc77642c32f8c0172d40883026ffaf53
 
 build_options="libucontext"
 desc_option_libucontext="Build with ucontext support via libucontext"
@@ -43,10 +45,10 @@ esac
 
 make_build_args="LINKER_PATH=/usr/lib/${_musl} LOADER_NAME=${_glibc}
  LIBGCOMPAT_PATH=/usr/lib/libgcompat.so.0 LOADER_PATH=/usr/lib/${LOADER_NAME}
- WITH_OBSTACK=no"
+ WITH_OBSTACK=musl-obstack"
 make_install_args="LINKER_PATH=/usr/lib/${_musl} LOADER_NAME=${_glibc}
  LIBGCOMPAT_PATH=/usr/lib/libgcompat.so.0 LOADER_PATH=/usr/lib/${LOADER_NAME}
- WITH_OBSTACK=no"
+ WITH_OBSTACK=musl-obstack"
 
 if [ "$build_option_libucontext" ]; then
 	makedepends+=" libucontext-devel"

From b53212b3249a08b7c3035b7b0ddd03858247357c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:34:12 -0300
Subject: [PATCH 3/9] reiserfsprogs: use musl-obstack-devel.

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

diff --git a/srcpkgs/reiserfsprogs/template b/srcpkgs/reiserfsprogs/template
index 121b03a95a4..0df0b6261a6 100644
--- a/srcpkgs/reiserfsprogs/template
+++ b/srcpkgs/reiserfsprogs/template
@@ -14,7 +14,7 @@ checksum=0e95b67fa7746a3c2d59145e9b9c2feb4a6be52853e83b497b182eae508e62e3
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl)
-		makedepends+=" musl-obstack"
+		makedepends+=" musl-obstack-devel"
 		LDFLAGS="-lobstack"
 	;;
 esac

From 36517edbfcb932beddf97fa6e6e408cfbae77b15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:34:40 -0300
Subject: [PATCH 4/9] perl-Proc-ProcessTable: use musl-obstack-devel.

---
 srcpkgs/perl-Proc-ProcessTable/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/perl-Proc-ProcessTable/template b/srcpkgs/perl-Proc-ProcessTable/template
index 58c07f2cb22..aad0248969d 100644
--- a/srcpkgs/perl-Proc-ProcessTable/template
+++ b/srcpkgs/perl-Proc-ProcessTable/template
@@ -15,5 +15,5 @@ distfiles="${CPAN_SITE}/Proc/Proc-ProcessTable-${version}.tar.gz"
 checksum=f8cc5054d78c35a0ce39fb75430b4ef402e2a99013d2ec37e7997f316594606c
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) makedepends+=" musl-obstack" ;;
+	*-musl) makedepends+=" musl-obstack-devel" ;;
 esac

From 6fb9945d2800228506285d7f0f5ab841c4d3ebea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:35:00 -0300
Subject: [PATCH 5/9] pahole: use musl-obstack-devel.

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

diff --git a/srcpkgs/pahole/template b/srcpkgs/pahole/template
index e504d3479f7..085eee87032 100644
--- a/srcpkgs/pahole/template
+++ b/srcpkgs/pahole/template
@@ -16,7 +16,7 @@ checksum="51e35041ce43ed08922037a1ee9e415aff1590e0d8d7cbe3e2b003f388db0a8a
  a616ba2ea72d00b4022689b17f4a78365379e3040d0f1a66d28eba52c528e480"
 
 case $XBPS_TARGET_MACHINE in
-	*-musl) makedepends+=" musl-obstack argp-standalone"
+	*-musl) makedepends+=" musl-obstack-devel argp-standalone"
 esac
 
 pre_patch() {

From 2defe97c6b1681f96083dde87d849e04cca951b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:35:12 -0300
Subject: [PATCH 6/9] hidrd: use musl-obstack-devel.

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

diff --git a/srcpkgs/hidrd/template b/srcpkgs/hidrd/template
index 1bb75b98a0c..c9aac4e7f0c 100644
--- a/srcpkgs/hidrd/template
+++ b/srcpkgs/hidrd/template
@@ -14,7 +14,7 @@ checksum=0147993dedb3066873d22fab1dc3aafec78d8c5783d168cccc43126f0fc3b307
 case $XBPS_TARGET_MACHINE in
 	*-musl)
 		configure_args+=' LIBS=-lobstack'
-		makedepends+=" musl-obstack"
+		makedepends+=" musl-obstack-devel"
 		;;
 esac
 

From 1c95ea7ec47b0a0dc8feef0995cb7039bac48128 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:35:23 -0300
Subject: [PATCH 7/9] elfutils: use musl-obstack-devel.

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

diff --git a/srcpkgs/elfutils/template b/srcpkgs/elfutils/template
index ed40864be48..4a0f4c757ce 100644
--- a/srcpkgs/elfutils/template
+++ b/srcpkgs/elfutils/template
@@ -16,7 +16,7 @@ checksum=b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d
 CFLAGS="-Wno-error -Wno-error=null-dereference"
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) makedepends+=" argp-standalone musl-fts-devel musl-obstack" ;;
+	*-musl) makedepends+=" argp-standalone musl-fts-devel musl-obstack-devel" ;;
 esac
 
 if [ "$CROSS_BUILD" ]; then

From 19f9960d5f4e2415d2b90daf046a88b0d401b69f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 20:35:46 -0300
Subject: [PATCH 8/9] cronie: use musl-obstack-devel.

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

diff --git a/srcpkgs/cronie/template b/srcpkgs/cronie/template
index cd00937e7f5..e3486b38f9b 100644
--- a/srcpkgs/cronie/template
+++ b/srcpkgs/cronie/template
@@ -34,7 +34,7 @@ alternatives="
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-obstack"
+	makedepends+=" musl-obstack-devel"
 fi
 
 pre_configure() {

From 9653f5af82219afa320c890419a839a7d35e0414 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 6 Jul 2020 17:45:34 -0300
Subject: [PATCH 9/9] spotify: enable musl support.

Requires gcompat and patchelf, follows instructions from
https://catfox.life/2020/07/06/live-from-adelie-streaming-spotify-on-musl/
---
 srcpkgs/spotify/INSTALL  | 18 ++++++++++++++++--
 srcpkgs/spotify/template |  8 +++++++-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/spotify/INSTALL b/srcpkgs/spotify/INSTALL
index 1cf70985dcb..6d557133403 100644
--- a/srcpkgs/spotify/INSTALL
+++ b/srcpkgs/spotify/INSTALL
@@ -1,7 +1,7 @@
 # INSTALL for 'spotify'
 # Fetching proprietary binaries at install-time
 
-_BUILDDIR="/tmp/spotify.build"
+_BUILDDIR="$(mktemp -d /tmp/spotify.build.XXXXX)"
 _LIBS=$(ldconfig -vNX -n usr/lib 2>/dev/null)
 
 linklib() {
@@ -10,8 +10,8 @@ linklib() {
 }
 
 if test "$ACTION" = "post"; then
+	# get checksum and version information
 	. usr/share/spotify/pkgdata
-	mkdir -p "$_BUILDDIR"
 	(
 		set -e
 		cd "$_BUILDDIR"
@@ -27,15 +27,29 @@ if test "$ACTION" = "post"; then
 		exit 1;
 	fi
 
+	# delete old package version
 	[ -d "/usr/share/spotify/spotify-client" ] && rm -rf usr/share/spotify/spotify-client
+
+	# copy data
 	mv -f "${_BUILDDIR}/usr/share/spotify" usr/share/spotify/spotify-client
 	for _s in 16 22 24 32 48 64 128 256 512; do
 		mkdir -p "/usr/share/icons/hicolor/${_s}x${_s}/apps"
 		ln -sf "/usr/share/spotify/spotify-client/icons/spotify-linux-${_s}.png" "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify-client.png"
 	done
+
 	mkdir -p usr/share/applications
 	ln -sf /usr/share/spotify/spotify-client/spotify.desktop usr/share/applications/spotify.desktop
+
+	# https://catfox.life/2020/07/06/live-from-adelie-streaming-spotify-on-musl/
+	if [ "$(xbps-uhelper arch)" = "x86_64-musl" ]; then
+		for _l in libm.so.6 libdl.so.2; do
+			patchelf --remove-needed "${_l}" usr/share/spotify/spotify-client/spotify
+		done
+	fi
+
 	linklib "libssl" "1.0.0"
 	linklib "libcrypto" "1.0.0"
+
+	# cleanup
 	rm -r "$_BUILDDIR"
 fi
diff --git a/srcpkgs/spotify/template b/srcpkgs/spotify/template
index d9ec603bf6a..9942f8b9f47 100644
--- a/srcpkgs/spotify/template
+++ b/srcpkgs/spotify/template
@@ -2,7 +2,7 @@
 pkgname=spotify
 version=1.1.26
 revision=1
-archs="x86_64"
+archs="x86_64*"
 create_wrksrc=yes
 build_style=fetch
 depends="binutils gtk+ nss GConf libXScrnSaver libatomic"
@@ -13,6 +13,12 @@ homepage="https://www.spotify.com"
 repository=nonfree
 _sversion=".501.gbe11e53b-15_amd64"
 _schecksum="54ba1bd91020913273c469591cedeebfa34aedc250033dde7c8b3fded94a9c71"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	# musl requires compat library and modifying the binary
+	depends+=" gcompat>=0.9.0 patchelf"
+fi
+
 do_install() {
 	vbin ${FILESDIR}/spotify
 	vmkdir usr/share/spotify

  parent reply	other threads:[~2020-07-07 20:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 23:50 [PR PATCH] [RFC] " ericonr
2020-07-06 23:54 ` [RFC][WIP] " ericonr
2020-07-07  4:59 ` [PR PATCH] [Updated] " ericonr
2020-07-07 20:48 ` kqo
2020-07-07 20:52 ` ericonr
2020-07-07 20:52 ` [PR PATCH] [Updated] " ericonr
2020-07-07 20:53 ` ericonr [this message]
2020-07-09  2:50 ` ericonr
2020-07-09  8:59 ` ericonr
2020-07-09 23:39 ` [PR PATCH] [Updated] " ericonr
2020-07-14 18:25 ` ericonr
2020-07-14 18:26 ` Update gcompat to 0.9.0, " ericonr
2020-07-15 17:03 ` ericonr
2020-07-20  4:48 ` [PR PATCH] [Updated] " ericonr
2020-07-20  4:51 ` ericonr
2020-07-28  2:58 ` ericonr
2020-07-28  3:02 ` ericonr
2020-07-28  5:11 ` pullmoll
2020-07-28  5:12 ` [PR REVIEW] " pullmoll
2020-07-28  5:16 ` pullmoll
2020-07-28  5:21 ` ericonr
2020-07-28  5:22 ` ericonr
2020-07-29 17:27 ` djames1
2020-08-08 14:23 ` [PR PATCH] [Merged]: " Johnnynator

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200707205336.aQsuGWr8Y5GK7i3JMcYMyj0So0bnN-f_RoAXw7eKU5g@z \
    --to=ericonr@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).