pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/unifi



Module Name:    pkgsrc
Committed By:   wiz
Date:           Fri Aug 13 17:25:06 UTC 2021

Modified Files:
        pkgsrc/net/unifi: Makefile distinfo
Added Files:
        pkgsrc/net/unifi/patches: patch-snappy-java-1.0.5.4_Makefile
            patch-snappy-java-1.0.5.4_Makefile.common
Removed Files:
        pkgsrc/net/unifi/patches: patch-snappy-java_Makefile
            patch-snappy-java_Makefile.common

Log Message:
unifi: honor LDFLAGS

Fixes RELRO build.

While here, switch to a WRKSRC that avoids having to use '..' in paths,
and clean some pkglint.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 pkgsrc/net/unifi/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/net/unifi/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile \
    pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common
cvs rdiff -u -r1.1 -r0 pkgsrc/net/unifi/patches/patch-snappy-java_Makefile \
    pkgsrc/net/unifi/patches/patch-snappy-java_Makefile.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/unifi/Makefile
diff -u pkgsrc/net/unifi/Makefile:1.25 pkgsrc/net/unifi/Makefile:1.26
--- pkgsrc/net/unifi/Makefile:1.25      Fri Aug 13 14:45:53 2021
+++ pkgsrc/net/unifi/Makefile   Fri Aug 13 17:25:06 2021
@@ -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 @@ PKG_JVMS_ACCEPTED=    openjdk8
 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_USERS_VARS=               UNIFI_USER
 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 @@ OWN_DIRS_PERMS+=      ${PREFIX}/unifi/${d} ${
 
 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 @@ post-extract:
 .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"

Index: pkgsrc/net/unifi/distinfo
diff -u pkgsrc/net/unifi/distinfo:1.15 pkgsrc/net/unifi/distinfo:1.16
--- pkgsrc/net/unifi/distinfo:1.15      Mon May 31 17:11:34 2021
+++ pkgsrc/net/unifi/distinfo   Fri Aug 13 17:25:06 2021
@@ -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 @@ SHA1 (unifi-6.0.45.zip) = 9ced99ee6d7749
 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

Added files:

Index: pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile
diff -u /dev/null pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile:1.1
--- /dev/null   Fri Aug 13 17:25:07 2021
+++ pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile Fri Aug 13 17:25:06 2021
@@ -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: 
Index: pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common
diff -u /dev/null pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common:1.1
--- /dev/null   Fri Aug 13 17:25:07 2021
+++ pkgsrc/net/unifi/patches/patch-snappy-java-1.0.5.4_Makefile.common  Fri Aug 13 17:25:06 2021
@@ -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 := 
+ 



Home | Main Index | Thread Index | Old Index