[140702] trunk/dports/databases/leveldb/Portfile

mcalhoun at macports.org mcalhoun at macports.org
Wed Sep 30 08:50:24 PDT 2015


Revision: 140702
          https://trac.macports.org/changeset/140702
Author:   mcalhoun at macports.org
Date:     2015-09-30 08:50:23 -0700 (Wed, 30 Sep 2015)
Log Message:
-----------
leveldb: Update version 1.9.0 -> 1.18

Modified Paths:
--------------
    trunk/dports/databases/leveldb/Portfile

Modified: trunk/dports/databases/leveldb/Portfile
===================================================================
--- trunk/dports/databases/leveldb/Portfile	2015-09-30 14:44:45 UTC (rev 140701)
+++ trunk/dports/databases/leveldb/Portfile	2015-09-30 15:50:23 UTC (rev 140702)
@@ -2,31 +2,66 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           github 1.0
 
-name                leveldb
-version             1.9.0
+# When trying to build a universal variant, build_detect_platform script mistakenly can't find library snappy
+# The following test fails for multiple archs (see https://llvm.org/bugs/show_bug.cgi?id=15403)
+#    # Test whether Snappy library is installed
+#    # http://code.google.com/p/snappy/
+#    $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null  <<EOF
+#    #include <snappy.h>
+#    int main() {}
+#    EOF
+# We therefore use muniversal PortGroup
+PortGroup           muniversal 1.0
+
+github.setup        google leveldb 1.18 v
+
 categories          databases
 platforms           darwin
 license             BSD
 maintainers         nomaintainer
 description         A fast and lightweight key/value database library by Google
 long_description    A fast and lightweight key/value database library by Google
-homepage            http://code.google.com/p/leveldb/
-master_sites        googlecode:leveldb
 
-checksums           rmd160  6d36b6b095c131aeb24fc75ecee8a7b9b4c5ce9e \
-                    sha256  b2699b04e5aba8e98382c4955b94725d1f76bd0b5decd60c5628205b717a1d4f
+checksums           rmd160  2431505d7d1a08a88b1d10068e571a49dd43a3a0 \
+                    sha256  007b554b52fb72877bd0a31c078a9ff67b8a9b8e0f55ff641b77783cfd030a4c
 
 depends_lib         port:snappy
 use_configure       no
 
-variant universal {}
+# default optimization flags
+configure.optflags-append -O2 -DNDEBUG
 
-build.env-append CXXFLAGS="[get_canonical_archflags]" \
-                 LDFLAGS="[get_canonical_archflags]" \
-                 INSTALL_PATH=${prefix}/lib
+if { [variant_isset universal] } {
+    foreach arch ${configure.universal_archs} {
+        set merger_build_env(${arch}) "CXXFLAGS=\"-arch ${arch}\" LDFLAGS=\"-arch ${arch}\""
+    }
+} else {
+    build.env-append \
+        CXXFLAGS="[get_canonical_archflags]" \
+        LDFLAGS="[get_canonical_archflags]"
+}
 
-destroot {
-    eval file copy [glob ${worksrcpath}/libleveldb*] ${destroot}${prefix}/lib
-    file copy ${worksrcpath}/include/leveldb ${destroot}${prefix}/include
+build.env-append                          \
+    INSTALL_PATH=${prefix}/lib            \
+    CC="${configure.cc}"                  \
+    CXX="${configure.cxx}"                \
+    OPT="${configure.optflags}"
+
+build.args-append libmemenv.a
+
+# muniversal build requires Makefile
+post-extract {
+    set makefile [open ${worksrcpath}/Makefile-Install "w"]
+    puts ${makefile} {install:}
+    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/leveldb"
+    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/helpers/memenv"
+    puts ${makefile} "\t/usr/bin/install -m 0644 include/leveldb/*.h \$(DESTDIR)${prefix}/include/leveldb"
+    puts ${makefile} "\t/usr/bin/install -m 0644 helpers/memenv/memenv.h \$(DESTDIR)${prefix}/include/helpers/memenv"
+    puts ${makefile} "\t/bin/cp -R libleveldb*.dylib* \$(DESTDIR)${prefix}/lib"
+    puts ${makefile} "\t/usr/bin/install -m 0644 lib*.a \$(DESTDIR)${prefix}/lib"
+    close ${makefile}
 }
+
+destroot.args-append -f Makefile-Install
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150930/5dc2b215/attachment-0001.html>


More information about the macports-changes mailing list