On Mon, Oct 16, 2023 at 08:36:07PM +0000, Klemens Nanni wrote:
> On Mon, Oct 16, 2023 at 09:47:42PM +0200, Theo Buehler wrote:
> > For some reason ports-gcc can't find "lz4.h", so pass -I in CXXFLAGS.
> > Then there's the usual missing include thing in gtest. I should see if I
> > can upstream that...
>
> You could contain it with to avoid subtle change on clang archs, no?
>
> .if ${CHOSEN_COMPILER} == "ports-gcc"
> CXXFLAGS += -I/usr/local/include
> .endif
>
> >
> > I don't think this changes the package where it already builds, but I
> > can bump REVISION if that's preferred.
>
> Generally, I'd say bump if in doubt.
>
> On amd64, this diff tripples the *built* libsnappy.so.* in size.
> I've built twice without and twice with the diff:
>
> $ size lib*
> text data bss dec hex
> 38075 1648 40 39763 9b53 libsnappy.so.3.0.cur
> 38075 1648 40 39763 9b53 libsnappy.so.3.0.cur2
> 109844 5208 32 115084 1c18c libsnappy.so.3.0.new
> 109844 5208 32 115084 1c18c libsnappy.so.3.0.new2
sorry for missing that.
we should keep the existing CXXFLAGS, especially -O2 -pipe. This diff
no dynamic export changes and doesn't change sizees:
38075 1648 40 39763 9b53 ../build-amd64/libsnappy.so
38075 1648 40 39763 9b53 ../build-amd64/libsnappy.so.3.0
Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/snappy/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- Makefile 16 Oct 2023 20:31:13 -0000 1.19
+++ Makefile 16 Oct 2023 20:49:09 -0000
@@ -3,7 +3,7 @@ COMMENT = fast compression/decompression
GH_TAGNAME = 1.1.10
GH_PROJECT = snappy
GH_ACCOUNT = google
-REVISION = 0
+REVISION = 1
SHARED_LIBS = snappy 3.0
@@ -24,6 +24,8 @@ MODULES = devel/cmake
CONFIGURE_ARGS += -DBUILD_SHARED_LIBS=ON \
-DINSTALL_GTEST=OFF \
-DSNAPPY_BUILD_BENCHMARKS=OFF
+
+CONFIGURE_ENV += CXXFLAGS="${CXXFLAGS} -I${LOCALBASE}/include"
# expects submodule/cannot use system library
DIST_TUPLE = github google googletest
e40661d89b051e9ef4eb8a2420b74bf78b39ef41 \
Index: patches/patch-third_party_googletest_googletest_src_gtest_cc
===================================================================
RCS file: patches/patch-third_party_googletest_googletest_src_gtest_cc
diff -N patches/patch-third_party_googletest_googletest_src_gtest_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-third_party_googletest_googletest_src_gtest_cc 16 Oct
2023 20:49:09 -0000
@@ -0,0 +1,17 @@
+Fix build on sparc64:
+
+gtest.cc:5342:7:
+ error: 'raise' was not declared in this scope
+ raise(SIGTRAP);
+
+Index: third_party/googletest/googletest/src/gtest.cc
+--- third_party/googletest/googletest/src/gtest.cc.orig
++++ third_party/googletest/googletest/src/gtest.cc
+@@ -43,6 +43,7 @@
+ #include <algorithm>
+ #include <chrono> // NOLINT
+ #include <cmath>
++#include <csignal>
+ #include <cstdint>
+ #include <cstdlib>
+ #include <cstring>