[94113] trunk/dports/math/liblinear

hum at macports.org hum at macports.org
Sat Jun 9 06:26:43 PDT 2012


Revision: 94113
          https://trac.macports.org/changeset/94113
Author:   hum at macports.org
Date:     2012-06-09 06:26:43 -0700 (Sat, 09 Jun 2012)
Log Message:
-----------
liblinear: update to 1.91; add universal variant; do not build liblinear.a and liblinear.{version}.dylib; install additional documents to ${prefix}/share/liblinear; install python scripts; add python* varinats.

Modified Paths:
--------------
    trunk/dports/math/liblinear/Portfile
    trunk/dports/math/liblinear/files/patch-Makefile.diff

Modified: trunk/dports/math/liblinear/Portfile
===================================================================
--- trunk/dports/math/liblinear/Portfile	2012-06-09 12:27:19 UTC (rev 94112)
+++ trunk/dports/math/liblinear/Portfile	2012-06-09 13:26:43 UTC (rev 94113)
@@ -4,12 +4,9 @@
 PortSystem          1.0
 
 name                liblinear
-version             1.8
-
+version             1.91
 categories          math
 maintainers         hum openmaintainer
-license             BSD
-platforms           darwin
 
 description         A simple package for solving large-scale regularized linear classification.
 
@@ -20,36 +17,78 @@
                     logistic regression.
 
 homepage            http://www.csie.ntu.edu.tw/~cjlin/liblinear/
+platforms           darwin
+license             BSD
+
 master_sites        ${homepage}
+checksums           rmd160  f99420a6ff51002a6a93584ce0a46e795d4054c5 \
+                    sha256  e70336d346df5f718310c93a73ab9be7f43657143c456c6542cc6566c4085856
 
-checksums           sha1    26f4a47ed1546996eaac21f5282e1cc42b59a623 \
-                    rmd160  7f97f336709c1418550bc60013b9daf99a507c07
-
 patchfiles          patch-Makefile.diff
 
 use_configure       no
 
-# /usr/bin/ranlib: archive member: liblinear.a(blas.a) fat file for cputype (16777223) cpusubtype (3) is not an object file (bad magic number)
-universal_variant   no
+variant universal {}
 
-set libver          ${version}.0
 build.target        all
-build.args          CC="${configure.cc} ${configure.cc_archflags}" \
-                    CXX="${configure.cxx} ${configure.cxx_archflags}" \
-                    PREFIX=${prefix} \
-                    VERSION=${libver}
+build.args          CC="${configure.cc}   ${configure.cflags}   [get_canonical_archflags]" \
+                    CXX="${configure.cxx} ${configure.cxxflags} [get_canonical_archflags cxx]" \
+                    PREFIX=${prefix}
 
+set liblinear_dir   ${prefix}/share/${name}
+
 destroot {
     xinstall -m 755 -W ${worksrcpath} train predict ${destroot}${prefix}/bin
-    xinstall -m 644 -W ${worksrcpath} liblinear.a liblinear.${libver}.dylib ${destroot}${prefix}/lib
+    xinstall -m 644 -W ${worksrcpath} liblinear.dylib ${destroot}${prefix}/lib
     xinstall -m 644 -W ${worksrcpath} linear.h tron.h ${destroot}${prefix}/include
 
-    ln -sf ${name}.${libver}.dylib ${destroot}${prefix}/lib/${name}.dylib
+    xinstall -m 755 -d ${destroot}${liblinear_dir}
+    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README heart_scale \
+        ${destroot}${liblinear_dir}
 
-    set docs ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${docs}
-    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README heart_scale ${docs}
+    # install python interface.
+    xinstall -m 755 -d ${destroot}${liblinear_dir}/python
+    xinstall -m 644 -W ${worksrcpath}/python README liblinear.py liblinearutil.py \
+        ${destroot}${liblinear_dir}/python
 }
 
+variant python24 description {Install Python 2.4 interface} {
+    depends_lib-append  port:python24
+    post-destroot { install_py 2.4 }
+}
+
+variant python25 description {Install Python 2.5 interface} {
+    depends_lib-append  port:python25
+    post-destroot { install_py 2.5 }
+}
+
+variant python26 description {Install Python 2.6 interface} {
+    depends_lib-append  port:python26
+    post-destroot { install_py 2.6 }
+}
+
+variant python27 description {Install Python 2.7 interface} {
+    depends_lib-append  port:python27
+    post-destroot { install_py 2.7 }
+}
+
+variant python31 description {Install Python 3.1 interface} {
+    depends_lib-append  port:python31
+    post-destroot { install_py 3.1 }
+}
+
+variant python32 description {Install Python 3.2 interface} {
+    depends_lib-append  port:python32
+    post-destroot { install_py 3.2 }
+}
+
+proc install_py {branch} {
+    global frameworks_dir destroot worksrcpath
+    set py_prefix  ${frameworks_dir}/Python.framework/Versions/${branch}
+    set dir        ${destroot}${py_prefix}/lib/python${branch}/site-packages
+    xinstall -m 755 -d ${dir}
+    xinstall -m 644 -W ${worksrcpath}/python liblinear.py liblinearutil.py ${dir}
+}            
+
 livecheck.type          regex
 livecheck.regex         {Version *([0-9.]+) *}

Modified: trunk/dports/math/liblinear/files/patch-Makefile.diff
===================================================================
--- trunk/dports/math/liblinear/files/patch-Makefile.diff	2012-06-09 12:27:19 UTC (rev 94112)
+++ trunk/dports/math/liblinear/files/patch-Makefile.diff	2012-06-09 13:26:43 UTC (rev 94113)
@@ -1,28 +1,50 @@
---- Makefile.orig	2010-06-14 18:04:03.000000000 +0900
-+++ Makefile	2011-06-10 23:22:40.000000000 +0900
-@@ -5,7 +5,7 @@
- SHVER = 1
- #LIBS = -lblas
- 
--all: train predict
-+all: train predict liblinear.a liblinear.dylib
- 
- lib: linear.o tron.o blas/blas.a
- 	$(CXX) -shared -dynamiclib linear.o tron.o blas/blas.a -o liblinear.so.$(SHVER)
-@@ -25,7 +25,16 @@
- blas/blas.a:
- 	cd blas; make OPTFLAGS='$(CFLAGS)' CC='$(CC)';
- 
-+liblinear.a: linear.o tron.o blas/blas.a
-+	ar rc liblinear.a linear.o tron.o blas/blas.a
-+	ranlib liblinear.a
-+liblinear.dylib: linear.o tron.o blas/blas.a
-+	$(CXX) $(CFLAGS) -dynamiclib -install_name $(PREFIX)/lib/liblinear.dylib \
-+                         -current_version $(VERSION) \
-+                         -compatibility_version $(VERSION) \
-+                         -o liblinear.$(VERSION).dylib linear.o tron.o blas/blas.a
- clean:
- 	cd blas;	make clean
- 	cd matlab;	make clean
- 	rm -f *~ tron.o linear.o train predict liblinear.so.$(SHVER)
-+	rm -f *.a *.dylib
+*** Makefile.orig	Thu Apr 12 03:38:27 2012
+--- Makefile	Sat Jun  9 21:12:44 2012
+***************
+*** 6,20 ****
+  OS = $(shell uname)
+  #LIBS = -lblas
+  
+! all: train predict
+  
+  lib: linear.o tron.o blas/blas.a
+  	if [ "$(OS)" = "Darwin" ]; then \
+! 		SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \
+  	else \
+! 		SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear.so.$(SHVER)"; \
+  	fi; \
+! 	$(CXX) $${SHARED_LIB_FLAG} linear.o tron.o blas/blas.a -o liblinear.so.$(SHVER)
+  
+  train: tron.o linear.o train.c blas/blas.a
+  	$(CXX) $(CFLAGS) -o train train.c tron.o linear.o $(LIBS)
+--- 6,24 ----
+  OS = $(shell uname)
+  #LIBS = -lblas
+  
+! PREFIX ?= /usr/local
+! 
+! all: train predict lib
+  
+  lib: linear.o tron.o blas/blas.a
+  	if [ "$(OS)" = "Darwin" ]; then \
+! 		LIBEXT=".dylib"; \
+! 		SHARED_LIB_FLAG="-dynamiclib -install_name $(PREFIX)/lib/liblinear$${LIBEXT}"; \
+  	else \
+! 		LIBEXT=".so.$(SHVER)"; \
+! 		SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear$${LIBEXT}"; \
+  	fi; \
+! 	$(CXX) $${SHARED_LIB_FLAG} linear.o tron.o blas/blas.a -o liblinear$${LIBEXT}
+  
+  train: tron.o linear.o train.c blas/blas.a
+  	$(CXX) $(CFLAGS) -o train train.c tron.o linear.o $(LIBS)
+***************
+*** 34,37 ****
+  clean:
+  	make -C blas clean
+  	make -C matlab clean
+! 	rm -f *~ tron.o linear.o train predict liblinear.so.$(SHVER)
+--- 38,41 ----
+  clean:
+  	make -C blas clean
+  	make -C matlab clean
+! 	rm -f *~ tron.o linear.o train predict liblinear.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120609/f229da0b/attachment-0001.html>


More information about the macports-changes mailing list