pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/unifi unifi: honor LDFLAGS
details: https://anonhg.NetBSD.org/pkgsrc/rev/f69f72d47453
branches: trunk
changeset: 457002:f69f72d47453
user: wiz <wiz%pkgsrc.org@localhost>
date: Fri Aug 13 17:25:06 2021 +0000
description:
unifi: honor LDFLAGS
Fixes RELRO build.
While here, switch to a WRKSRC that avoids having to use '..' in paths,
and clean some pkglint.
diffstat:
net/unifi/Makefile | 29 ++++++------
net/unifi/distinfo | 6 +-
net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile | 28 ++++++++++++
net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common | 15 ++++++
net/unifi/patches/patch-snappy-java_Makefile | 17 -------
net/unifi/patches/patch-snappy-java_Makefile.common | 15 ------
6 files changed, 60 insertions(+), 50 deletions(-)
diffs (187 lines):
diff -r c283310d6f26 -r f69f72d47453 net/unifi/Makefile
--- a/net/unifi/Makefile Fri Aug 13 15:41:32 2021 +0000
+++ b/net/unifi/Makefile Fri Aug 13 17:25:06 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2021/08/13 14:45:53 abs Exp $
+# $NetBSD: Makefile,v 1.26 2021/08/13 17:25:06 wiz Exp $
# Update to 6.2 (wip) is on hold pending reports that the greater
# Unifi world thinks it is stable enough. -- gdt, 2021-06-01
@@ -52,7 +52,7 @@
PKGSRC_MAKE_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
USE_LANGUAGES= c c++ # for snappy JNI library
USE_TOOLS+= gmake pax
-WRKSRC= ${WRKDIR}/UniFi
+WRKSRC= ${WRKDIR}
# Upstream documents 3.4.15, but 3.4.4 actually works. Avoid mongodb4 because it
# has a problematic license.
@@ -67,7 +67,6 @@
PKG_GROUPS_VARS= UNIFI_GROUP
PKG_GROUPS= ${UNIFI_GROUP}
PKG_USERS= ${UNIFI_USER}:${UNIFI_GROUP}
-RELRO_SUPPORTED= no
.for d in data logs run work
OWN_DIRS_PERMS+= ${PREFIX}/unifi/${d} ${UNIFI_USER} ${UNIFI_GROUP} 0700
@@ -77,7 +76,7 @@
post-extract:
# drop executable bit
- find ${WRKSRC} -type f -print0 | xargs -0 chmod -x
+ find ${WRKSRC}/UniFi -type f -print0 | xargs -0 chmod -x
mkdir ${WRKDIR}/${SNAPPY_JAVA}/target
ln -s ${WRKDIR}/${SNAPPY} ${WRKDIR}/${SNAPPY_JAVA}/target
# drop platform specific binaries
@@ -87,32 +86,32 @@
.if (${OPSYS} != "Linux")
rm -rf ${WRKDIR}/UniFi/lib/native/Linux
.else
-.if (${MACHINE_ARCH} != "aarch64")
+. if (${MACHINE_ARCH} != "aarch64")
rm -rf ${WRKDIR}/UniFi/lib/native/Linux/aarch64
-.endif
-.if (${MACHINE_ARCH} != "armv7")
+. endif
+. if (${MACHINE_ARCH} != "armv7")
rm -rf ${WRKDIR}/UniFi/lib/native/Linux/armv7
-.endif
-.if (${MACHINE_ARCH} != "x86_64")
+. endif
+. if (${MACHINE_ARCH} != "x86_64")
rm -rf ${WRKDIR}/UniFi/lib/native/Linux/x86_64
-.endif
+. endif
.endif
.if (${OPSYS} != "Darwin")
rm -rf ${WRKDIR}/UniFi/lib/native/Mac
.else
-.if (${MACHINE_ARCH} != "x86_64")
+. if (${MACHINE_ARCH} != "x86_64")
rm -rf ${WRKDIR}/UniFi/lib/native/Mac/x86_64
-.endif
+. endif
.endif
do-build:
# bundled mongod is a linux binary; replace with symlink to native binary
- rm -f ${WRKSRC}/bin/mongod
- ln -s ${PREFIX}/bin/mongod ${WRKSRC}/bin/mongod
+ rm -f ${WRKSRC}/UniFi/bin/mongod
+ ln -s ${PREFIX}/bin/mongod ${WRKSRC}/UniFi/bin/mongod
cd ${WRKDIR}/${SNAPPY_JAVA} && ${BUILD_MAKE_CMD} native
do-install:
- cd ${WRKSRC} && pax -rw . ${DESTDIR}${PREFIX}/unifi
+ cd ${WRKSRC}/UniFi && pax -rw . ${DESTDIR}${PREFIX}/unifi
${INSTALL_LIB} ${WRKDIR}/${SNAPPY_JAVA}/target/snappy-1.0.5-Default/libsnappyjava.so ${DESTDIR}${PREFIX}/unifi/lib
.include "../../mk/java-vm.mk"
diff -r c283310d6f26 -r f69f72d47453 net/unifi/distinfo
--- a/net/unifi/distinfo Fri Aug 13 15:41:32 2021 +0000
+++ b/net/unifi/distinfo Fri Aug 13 17:25:06 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.15 2021/05/31 17:11:34 gdt Exp $
+$NetBSD: distinfo,v 1.16 2021/08/13 17:25:06 wiz Exp $
SHA1 (snappy-1.0.5.tar.gz) = 3a3df859cf33f78f8e945c3f67f28685f0f38bb1
RMD160 (snappy-1.0.5.tar.gz) = c9dec9a8a2faac7bf85b79bcf82f8080713103aa
@@ -12,5 +12,5 @@
RMD160 (unifi-6.0.45.zip) = e4164f50128391157389eda7e10a3b9c4e75b025
SHA512 (unifi-6.0.45.zip) = 6b2aebf33b6e2114a2b274ce332e2bd88a30406e3a21bc66dc0eddee3ee27ee2e4d3948dea73ff85289cbc2ed0e4f2b646e095091c54120f718b5fb2f0b35943
Size (unifi-6.0.45.zip) = 147691229 bytes
-SHA1 (patch-snappy-java_Makefile) = ce9e30d266787890e82675cfaa2603ae4709eaab
-SHA1 (patch-snappy-java_Makefile.common) = ba9e39d1bc6e34e2fa4704831ba51feccfbb0638
+SHA1 (patch-snappy-java-1.0.5.4_Makefile) = 86a4ab3075cef0ac6475dee253efa98a91915b12
+SHA1 (patch-snappy-java-1.0.5.4_Makefile.common) = d574d053351d2fcd55b7846f4de0fe3fa77e821e
diff -r c283310d6f26 -r f69f72d47453 net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile Fri Aug 13 17:25:06 2021 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-snappy-java-1.0.5.4_Makefile,v 1.1 2021/08/13 17:25:06 wiz Exp $
+
+It tries to download a distfile with curl. We manage this manually.
+
+Honor LDFLAGS.
+
+--- snappy-java-1.0.5.4/Makefile.orig 2014-07-04 05:20:00.000000000 +0000
++++ snappy-java-1.0.5.4/Makefile
+@@ -20,9 +20,7 @@ $(SNAPPY_ARCHIVE):
+ @mkdir -p $(@D)
+ curl -o$@ http://snappy.googlecode.com/files/snappy-$(VERSION).tar.gz
+
+-$(SNAPPY_UNPACKED): $(SNAPPY_ARCHIVE)
+- tar xvfz $< -C $(TARGET)
+- touch $@
++$(SNAPPY_UNPACKED):
+
+ jni-header: $(SRC)/org/xerial/snappy/SnappyNative.h
+
+@@ -50,7 +48,7 @@ $(SNAPPY_OUT)/SnappyNative.o : $(SRC)/or
+
+
+ $(SNAPPY_OUT)/$(LIBNAME): $(SNAPPY_OBJ)
+- $(CXX) $(CXXFLAGS) -o $@ $+ $(LINKFLAGS)
++ $(CXX) $(CXXFLAGS) -o $@ $+ $(LINKFLAGS) $(LDFLAGS)
+ $(STRIP) $@
+
+ clean-native:
diff -r c283310d6f26 -r f69f72d47453 net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common Fri Aug 13 17:25:06 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-snappy-java-1.0.5.4_Makefile.common,v 1.1 2021/08/13 17:25:06 wiz Exp $
+
+Don't produce a broken shared library.
+
+--- snappy-java-1.0.5.4/Makefile.common.orig 2014-07-04 05:20:00.000000000 +0000
++++ snappy-java-1.0.5.4/Makefile.common
+@@ -54,7 +54,7 @@ CROSS_PREFIX :=
+ Default_CXX := $(CROSS_PREFIX)g++
+ Default_STRIP := $(CROSS_PREFIX)strip
+ Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
+-Default_LINKFLAGS := -shared -static
++Default_LINKFLAGS := -shared
+ Default_LIBNAME := libsnappyjava.so
+ Default_SNAPPY_FLAGS :=
+
diff -r c283310d6f26 -r f69f72d47453 net/unifi/patches/patch-snappy-java_Makefile
--- a/net/unifi/patches/patch-snappy-java_Makefile Fri Aug 13 15:41:32 2021 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-$NetBSD: patch-snappy-java_Makefile,v 1.1 2017/06/24 14:16:37 tnn Exp $
-
-It tries to download a distfile with curl. We manage this manually.
-
---- ../snappy-java-1.0.5.4/Makefile.orig 2014-07-04 05:20:00.000000000 +0000
-+++ ../snappy-java-1.0.5.4/Makefile
-@@ -20,9 +20,7 @@ $(SNAPPY_ARCHIVE):
- @mkdir -p $(@D)
- curl -o$@ http://snappy.googlecode.com/files/snappy-$(VERSION).tar.gz
-
--$(SNAPPY_UNPACKED): $(SNAPPY_ARCHIVE)
-- tar xvfz $< -C $(TARGET)
-- touch $@
-+$(SNAPPY_UNPACKED):
-
- jni-header: $(SRC)/org/xerial/snappy/SnappyNative.h
-
diff -r c283310d6f26 -r f69f72d47453 net/unifi/patches/patch-snappy-java_Makefile.common
--- a/net/unifi/patches/patch-snappy-java_Makefile.common Fri Aug 13 15:41:32 2021 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-$NetBSD: patch-snappy-java_Makefile.common,v 1.1 2017/06/24 14:16:37 tnn Exp $
-
-Don't produce a broken shared library.
-
---- ../snappy-java-1.0.5.4/Makefile.common.orig 2014-07-04 05:20:00.000000000 +0000
-+++ ../snappy-java-1.0.5.4/Makefile.common
-@@ -54,7 +54,7 @@ CROSS_PREFIX :=
- Default_CXX := $(CROSS_PREFIX)g++
- Default_STRIP := $(CROSS_PREFIX)strip
- Default_CXXFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
--Default_LINKFLAGS := -shared -static
-+Default_LINKFLAGS := -shared
- Default_LIBNAME := libsnappyjava.so
- Default_SNAPPY_FLAGS :=
-
Home |
Main Index |
Thread Index |
Old Index