Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] dracut: dynamic link against libfts on musl
@ 2019-11-08 11:53 voidlinux-github
  2019-11-08 22:37 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: voidlinux-github @ 2019-11-08 11:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/zdtcd/void-packages dracut-dynamic-link-libfts
https://github.com/void-linux/void-packages/pull/16229

dracut: dynamic link against libfts on musl
Static link against libfts is BSD-violation if we don't ship their
license.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dracut-dynamic-link-libfts-16229.patch --]
[-- Type: text/x-diff, Size: 4052 bytes --]

From 592515ba2adffe2711bd314de95f8f187c1ab607 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Fri, 8 Nov 2019 18:49:13 +0700
Subject: [PATCH] dracut: dynamic link against libfts on musl

Static link against libfts is BSD-violation if we don't ship their
license.
---
 ...find-cflags-and-libs-for-fts-on-musl.patch | 96 +++++++++++++++++++
 srcpkgs/dracut/template                       |  8 +-
 2 files changed, 97 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/dracut/patches/0001-configure-find-cflags-and-libs-for-fts-on-musl.patch

diff --git a/srcpkgs/dracut/patches/0001-configure-find-cflags-and-libs-for-fts-on-musl.patch b/srcpkgs/dracut/patches/0001-configure-find-cflags-and-libs-for-fts-on-musl.patch
new file mode 100644
index 00000000000..a57a443dc1d
--- /dev/null
+++ b/srcpkgs/dracut/patches/0001-configure-find-cflags-and-libs-for-fts-on-musl.patch
@@ -0,0 +1,96 @@
+From 5ac43335bbf7620a04146130bcf37e4f17cd5a8e Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Wed, 6 Nov 2019 18:35:12 +0700
+Subject: [PATCH 1/3] configure: find cflags and libs for fts on musl
+
+Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
+---
+ Makefile  |  2 +-
+ configure | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+), 1 deletion(-)
+
+diff --git Makefile Makefile
+index 31545899..f9b42b96 100644
+--- Makefile
++++ Makefile
+@@ -62,7 +62,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
+ install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
+ 
+ install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
+-	$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
++	$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
+ 
+ logtee: logtee.c
+ 	$(CC) $(LDFLAGS) -o $@ $<
+diff --git configure configure
+index b55fb609..3f724ef2 100755
+--- configure
++++ configure
+@@ -7,6 +7,7 @@ prefix=/usr
+ 
+ enable_documentation=yes
+ 
++CC="${CC:-cc}"
+ PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
+ 
+ # Little helper function for reading args from the commandline.
+@@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
+     exit 1
+ fi
+ 
++cat <<EOF >conftest.c
++#include <fts.h>
++int main() {
++	return 0;
++}
++EOF
++
++${CC} $CFLAGS $LDFLAGS conftest.c >/dev/null 2>&1
++ret=$?
++rm -f conftest.c a.out
++
++# musl doesn't have fts.h included
++if test $ret -ne 0; then
++	echo "dracut needs fts development files." >&2
++	exit 1
++fi
++
++cat <<EOF >conftest.c
++#include <fts.h>
++int main(void) {
++	fts_open(0, 0, 0);
++	return 0;
++}
++EOF
++
++found=no
++for lib in "-lc" "-lfts"; do
++	${CC} $CFLAGS -Wl,$lib $LDFLAGS conftest.c >/dev/null 2>&1
++	ret=$?
++	if test $ret -eq 0; then
++		FTS_LIBS="$lib"
++		found=yes
++		break;
++	fi
++done
++rm -f conftest.c a.out
++
++if test $found = no; then
++	echo "dracut couldn't find usable fts library" >&2
++	exit 1
++fi
++
+ cat > Makefile.inc.$$ <<EOF
+ prefix ?= ${prefix}
+ libdir ?= ${libdir:-${prefix}/lib}
+@@ -68,6 +111,7 @@ enable_documentation ?= ${enable_documentation:-yes}
+ bindir ?= ${bindir:-${prefix}/bin}
+ KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
+ KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
++FTS_LIBS ?= ${FTS_LIBS}
+ EOF
+ 
+ {
+-- 
+2.24.0.9.g35b3684e14
+
diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template
index f5e420eb6bd..568d219b54e 100644
--- a/srcpkgs/dracut/template
+++ b/srcpkgs/dracut/template
@@ -1,7 +1,7 @@
 # Template file for 'dracut'
 pkgname=dracut
 version=049
-revision=3
+revision=4
 build_style=configure
 configure_args="--prefix=/usr --sysconfdir=/etc"
 conf_files="/etc/dracut.conf"
@@ -25,12 +25,6 @@ case "$XBPS_TARGET_MACHINE" in
 	;;
 esac
 
-do_build() {
-	case "$XBPS_TARGET_MACHINE" in
-		*-musl) make ${makejobs} LDLIBS="${XBPS_CROSS_BASE}/usr/lib/libfts.a";;
-	esac
-}
-
 do_check() {
 	# Requires the distfile to be a git repository
 	:

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

end of thread, other threads:[~2019-11-09 18:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 11:53 [PR PATCH] dracut: dynamic link against libfts on musl voidlinux-github
2019-11-08 22:37 ` [PR PATCH] [Updated] " voidlinux-github
2019-11-08 23:53 ` voidlinux-github
2019-11-09 18:50 ` [PR PATCH] [Merged]: " voidlinux-github

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