diff --git a/PKGBUILD b/PKGBUILD index 76ded2b..72b4b7f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,22 +9,24 @@ pkgdesc="A network programming library written in C++" arch=('x86_64') url="https://github.com/apenwarr/wvstreams/" license=('LGPL') -depends=('zlib' 'pam' 'xplc' 'openssl' 'readline') +depends=('zlib' 'pam' 'openssl' 'readline') source=(https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wvstreams/wvstreams-$pkgver.tar.gz wvstreams-4.6.1-glibc212.patch wvstreams-4.6.1-gcc47.patch wvstreams-4.6.1-gcc10.patch wvstreams_openssl1.1.patch openssl-buildfix.patch - gcc-6.patch) + gcc-6.patch + wvstreams-4.6.1-parallel-make.patch + ) sha256sums=('8403f5fbf83aa9ac0c6ce15d97fd85607488152aa84e007b7d0621b8ebc07633' '278c73140b963daa8aae85dfbba4917e2963e72c187bbb97b6252a5a70f54bc2' '7b83dad8e3931686962823a7008af0034a430f35e1eb617f5c8137141e14ccdd' '25aa17989936479a095837a354e0f0727f7a6fa393967a86f2e67e310a72e944' 'e1294644eb44c3d58789f2aca51fa28d15af799bd1b7bc2ff2583c41c74efae5' '57b55ed6a2a6aa8abef00711d9e03bed664f2c4357404cd38ae778f8b3b97482' - '1f750516825dc8c3ef7de980b90dadf22c5132eab828a5dd634fa2a88624b6d9') -options=('!makeflags') + '1f750516825dc8c3ef7de980b90dadf22c5132eab828a5dd634fa2a88624b6d9' + '488f265874ee4c5e722fd26a0c426c172fe4685f283cff11bfd53d8c7d74e299') prepare() { cd ${pkgname}-${pkgver} @@ -35,9 +37,13 @@ prepare() { patch -p1 -i "$srcdir/gcc-6.patch" patch -p1 -i "$srcdir/wvstreams-4.6.1-gcc10.patch" # Gentoo patch patch -p1 -i "$srcdir/wvstreams_openssl1.1.patch" # Debian patch + patch -p1 -i "$srcdir/wvstreams-4.6.1-parallel-make.patch" # Gentoo patch + sed -i 's/_BSD_SOURCE/_DEFAULT_SOURCE/' wvrules.mk } build() { + CXXFLAGS+=' -ffat-lto-objects' + CFLAGS+=' -ffat-lto-objects' cd ${pkgname}-${pkgver} ./configure --prefix=/usr \ @@ -49,7 +55,7 @@ build() { --with-openssl \ --without-tcl \ --without-qt - make COPTS="$CFLAGS -ffat-lto-objects -fPIC" CXXOPTS="$CXXFLAGS -ffat-lto-objects -fPIC -fpermissive -fno-tree-dce -fno-optimize-sibling-calls" VERBOSE=1 + make VERBOSE=1 } package() { diff --git a/wvstreams-4.6.1-parallel-make.patch b/wvstreams-4.6.1-parallel-make.patch new file mode 100644 index 0000000..688178c --- /dev/null +++ b/wvstreams-4.6.1-parallel-make.patch @@ -0,0 +1,56 @@ +--- a/Makefile ++++ b/Makefile +@@ -131,12 +131,19 @@ + # libwvstreams: stream/event handling library + # + TARGETS += libwvstreams.so +-TARGETS += crypto/tests/ssltest ipstreams/tests/unixtest ++TARGETS += crypto/tests/ssltest ++crypto/tests/ssltest: $(LIBWVSTREAMS) ++ ++TARGETS += ipstreams/tests/unixtest ++ipstreams/tests/unixtest: $(LIBWVSTREAMS) ++ + TARGETS += crypto/tests/printcert ++crypto/tests/printcert: $(LIBWVSTREAMS) + + ifndef _MACOS + ifneq ("$(with_readline)", "no") + TARGETS += ipstreams/tests/wsd ++ ipstreams/tests/wsd: $(LIBWVSTREAMS) + ipstreams/tests/wsd-LIBS += -lreadline + else + TEST_SKIP_OBJS += ipstreams/tests/wsd +@@ -179,7 +186,11 @@ + # + ifneq ("$(with_dbus)", "no") + TARGETS += libwvdbus.so +- TARGETS += dbus/tests/wvdbus dbus/tests/wvdbusd ++ TARGETS += dbus/tests/wvdbus ++ dbus/tests/wvdbus: $(LIBWVDBUS) ++ ++ TARGETS += dbus/tests/wvdbusd ++ dbus/tests/wvdbusd: $(LIBWVDBUS) + TESTS += $(call tests_cc,dbus/tests) + libwvdbus_OBJS += $(call objects,dbus) + libwvdbus.so: $(libwvdbus_OBJS) $(LIBWVSTREAMS) +--- a/wvrules-posix.mk ++++ b/wvrules-posix.mk +@@ -85,12 +85,15 @@ + $(AR) s $1 + endef + +-CC: FORCE ++CC: + @CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ + $(WVSTREAMS)/gen-cc CC c + +-CXX: FORCE ++CXX: + @CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ + $(WVSTREAMS)/gen-cc CXX cc + ++#All files must depend on the above two rules. This is a godawful hack. ++$(shell find -type f '(' -name '*.c' -o -name '*.cc' ')' ): CC CXX ++ + wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS)