From e6e62ecad3b4ba2514a25c2cdd24fefebc457e90 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 25 Nov 2019 14:44:39 +0100 Subject: [PATCH] ck: fix cross builds --- srcpkgs/ck/patches/cross.patch | 29 +++++++++++++++++++++++++++++ srcpkgs/ck/template | 9 +-------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 srcpkgs/ck/patches/cross.patch diff --git a/srcpkgs/ck/patches/cross.patch b/srcpkgs/ck/patches/cross.patch new file mode 100644 index 00000000000..c2a9c4a5287 --- /dev/null +++ b/srcpkgs/ck/patches/cross.patch @@ -0,0 +1,29 @@ +--- configure.orig ++++ configure +@@ -636,10 +636,11 @@ + } + EOF + +-$CC -o .1 .1.c +-COMPILER=`./.1 2> /dev/null` +-r=$? +-rm -f .1.c .1 ++r=1 ++case "`$CC --version`" in ++*clang*) COMPILER=clang; r=0 ;; ++*GCC*) COMPILER=gcc; r=0 ;; ++esac + + if test "$r" -ne 0; then + assert "" "update compiler" +--- src/Makefile.in.orig ++++ src/Makefile.in +@@ -25,7 +25,7 @@ + $(LD) $(LDFLAGS) -o $(TARGET_DIR)/libck.so $(OBJECTS) + + libck.a: $(OBJECTS) +- ar rcs $(TARGET_DIR)/libck.a $(OBJECTS) ++ $(AR) rcs $(TARGET_DIR)/libck.a $(OBJECTS) + + ck_array.o: $(INCLUDE_DIR)/ck_array.h $(SDIR)/ck_array.c + $(CC) $(CFLAGS) -c -o $(TARGET_DIR)/ck_array.o $(SDIR)/ck_array.c diff --git a/srcpkgs/ck/template b/srcpkgs/ck/template index 00020aa942c..f67b160c87c 100644 --- a/srcpkgs/ck/template +++ b/srcpkgs/ck/template @@ -3,20 +3,13 @@ pkgname=ck version=0.7.0 revision=1 build_style=configure -configure_args="--prefix=/usr" +configure_args="--prefix=/usr --platform=${XBPS_TARGET_MACHINE%-musl}" short_desc="Concurrency Kit C library" maintainer="Tai Chi Minh Ralph Eastwood " license="BSD-2-Clause" homepage="http://concurrencykit.org/" distfiles="https://github.com/concurrencykit/ck/archive/${version}.tar.gz" checksum=e730cb448fb0ecf9d19bf4c7efe9efc3c04dd9127311d87d8f91484742b0da24 -nocross="hand-made shellscript that doesn't take triplet-prefixed compilers into account" - -case "$XBPS_TARGET_MACHINE" in - aarch64*) configure_args+=" --enable-lse --disable-sse" ;; - x86_64*|i686*) ;; - *) configure_args+=" --disable-sse" ;; -esac post_install() { vlicense LICENSE