[99380] trunk/dports/archivers

ryandesign at macports.org ryandesign at macports.org
Sun Nov 4 01:14:51 PST 2012


Revision: 99380
          http://trac.macports.org//changeset/99380
Author:   ryandesign at macports.org
Date:     2012-11-04 01:14:50 -0800 (Sun, 04 Nov 2012)
Log Message:
-----------
unrar: integrate libunrar as a subport, thereby updating it to 4.2.4; fix libunrar.dylib install_name; presumably fix install on non-Darwin OSes; for main unrar port, installs_libs no; maintainers krischik openmaintainer as standalone libunrar port was

Modified Paths:
--------------
    trunk/dports/archivers/unrar/Portfile

Added Paths:
-----------
    trunk/dports/archivers/unrar/files/patch-dll.hpp.diff
    trunk/dports/archivers/unrar/files/patch-dylib.diff
    trunk/dports/archivers/unrar/files/patch-makefile.unix.diff

Removed Paths:
-------------
    trunk/dports/archivers/libunrar/
    trunk/dports/archivers/unrar/files/patch-makefile.unix.diff

Modified: trunk/dports/archivers/unrar/Portfile
===================================================================
--- trunk/dports/archivers/unrar/Portfile	2012-11-04 06:29:42 UTC (rev 99379)
+++ trunk/dports/archivers/unrar/Portfile	2012-11-04 09:14:50 UTC (rev 99380)
@@ -9,7 +9,7 @@
 categories      archivers
 license         Restrictive/Distributable
 platforms       darwin freebsd
-maintainers     nomaintainer
+maintainers             krischik openmaintainer
 description     Extract, view & test RAR archives
 
 long_description \
@@ -24,7 +24,8 @@
 checksums           rmd160  53a590ed2a71be86a0a7abfe9c37ddc8dc869800 \
                     sha256  9432bf798e5f7123f3060f37b75b7c07f36f0091305f46473dcae9154f8cd686
 
-patchfiles      patch-makefile.unix.diff
+patchfiles              patch-dll.hpp.diff \
+                        patch-makefile.unix.diff
 
 worksrcdir      ${name}
 
@@ -36,20 +37,62 @@
     configure.cxx "ccache ${configure.cxx}"
 }
 
-build.env-append    CXX="[join ${configure.cxx}]" \
-                    CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
-                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
+build.args              -f makefile.unix \
+                        CXX="[join ${configure.cxx}]"
 
-build.args      -f makefile.unix
+# The makefile misuses the DESTDIR variable as if it were PREFIX. We need it at
+# build time so the library gets the correct install_name.
+build.args-append       DESTDIR=${prefix}
 
-destroot {
-	set docdir ${prefix}/share/doc/${name}
+pre-build {
+    build.args-append   CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
+                        LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
+}
 
-	xinstall -d ${destroot}${docdir}
-	xinstall ${worksrcpath}/${name} ${destroot}${prefix}/bin
-	xinstall -m 0644 -W ${worksrcpath} license.txt readme.txt ${destroot}${docdir}
+post-destroot {
+    set docdir ${prefix}/share/doc/${subport}
+    xinstall -d ${destroot}${docdir}
+    xinstall -m 644 -W ${worksrcpath} license.txt readme.txt ${destroot}${docdir}
 }
 
-livecheck.type  regex
-livecheck.url   ${homepage}rar_add.htm
-livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
+platform darwin {
+    patchfiles-append   patch-dylib.diff
+}
+
+if {${name} == ${subport}} {
+    installs_libs       no
+    
+    destroot {
+        xinstall ${worksrcpath}/${name} ${destroot}${prefix}/bin
+    }
+    
+    livecheck.type      regex
+    livecheck.url       ${homepage}rar_add.htm
+    livecheck.regex     ${my_name}-(\\d+(?:\\.\\d+)*)
+} else {
+    livecheck.type      none
+}
+
+subport libunrar {
+    description         unrar library
+    long_description    ${description}
+    
+    # Copied from standalone libunrar port. Why do we need these?
+    configure.cxxflags-append -DSILENT -DGUI
+    
+    # The makefile adds -fPIC to the CXXFLAGS when building the library, but we
+    # override the CXXFLAGS with our own, so we have to manually add this again.
+    configure.cxxflags-append -fPIC
+    
+    build.target        lib
+    
+    destroot {
+        xinstall -d ${destroot}${prefix}/include/unrar
+        xinstall -m 644 ${worksrcpath}/dll.hpp ${destroot}${prefix}/include/unrar
+        if {${os.platform} == "darwin"} {
+            xinstall ${worksrcpath}/libunrar.dylib ${destroot}${prefix}/lib
+        } else {
+            xinstall ${worksrcpath}/libunrar.so ${destroot}${prefix}/lib
+        }
+    }
+}

Copied: trunk/dports/archivers/unrar/files/patch-dll.hpp.diff (from rev 99375, trunk/dports/archivers/libunrar/files/patch-dll.hpp.diff)
===================================================================
--- trunk/dports/archivers/unrar/files/patch-dll.hpp.diff	                        (rev 0)
+++ trunk/dports/archivers/unrar/files/patch-dll.hpp.diff	2012-11-04 09:14:50 UTC (rev 99380)
@@ -0,0 +1,17 @@
+--- dll.hpp.orig	2012-06-09 08:21:04.000000000 -0500
++++ dll.hpp	2012-11-04 02:52:55.000000000 -0600
+@@ -30,14 +30,12 @@
+ 
+ #define RAR_DLL_VERSION       5
+ 
+-#ifdef _UNIX
+ #define CALLBACK
+ #define PASCAL
+ #define LONG long
+ #define HANDLE void *
+ #define LPARAM long
+ #define UINT unsigned int
+-#endif
+ 
+ struct RARHeaderData
+ {

Copied: trunk/dports/archivers/unrar/files/patch-dylib.diff (from rev 99375, trunk/dports/archivers/libunrar/files/patch-makefile.unix.diff)
===================================================================
--- trunk/dports/archivers/unrar/files/patch-dylib.diff	                        (rev 0)
+++ trunk/dports/archivers/unrar/files/patch-dylib.diff	2012-11-04 09:14:50 UTC (rev 99380)
@@ -0,0 +1,13 @@
+--- makefile.unix.orig	2012-05-15 00:31:03.000000000 -0500
++++ makefile.unix	2012-11-04 02:54:31.000000000 -0600
+@@ -130,8 +130,8 @@
+ lib:	WHAT=RARDLL
+ lib:	CXXFLAGS+=$(LIBFLAGS)
+ lib:	clean $(OBJECTS) $(LIB_OBJ)
+-	@rm -f libunrar.so
+-	$(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
++	@rm -f libunrar.dylib
++	$(LINK) -dynamiclib -o libunrar.dylib -install_name $(DESTDIR)/lib/libunrar.dylib $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
+ 
+ install-unrar:
+ 			install -D unrar $(DESTDIR)/bin/unrar

Deleted: trunk/dports/archivers/unrar/files/patch-makefile.unix.diff
===================================================================
--- trunk/dports/archivers/unrar/files/patch-makefile.unix.diff	2012-11-04 06:29:42 UTC (rev 99379)
+++ trunk/dports/archivers/unrar/files/patch-makefile.unix.diff	2012-11-04 09:14:50 UTC (rev 99380)
@@ -1,15 +0,0 @@
---- makefile.unix.orig	2012-06-03 13:54:22.000000000 -0500
-+++ makefile.unix	2012-06-03 13:54:33.000000000 -0500
-@@ -2,12 +2,9 @@
- # Makefile for UNIX - unrar
- 
- # Linux using GCC
--CXX=g++
--CXXFLAGS=-O2
- LIBFLAGS=-fPIC
- DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
- STRIP=strip
--DESTDIR=/usr
- 
- # Linux using LCC
- #CXX=lcc

Copied: trunk/dports/archivers/unrar/files/patch-makefile.unix.diff (from rev 99375, trunk/dports/archivers/libunrar/files/patch-makefile.unix.diff)
===================================================================
--- trunk/dports/archivers/unrar/files/patch-makefile.unix.diff	                        (rev 0)
+++ trunk/dports/archivers/unrar/files/patch-makefile.unix.diff	2012-11-04 09:14:50 UTC (rev 99380)
@@ -0,0 +1,11 @@
+--- makefile.unix.orig	2012-05-15 00:31:03.000000000 -0500
++++ makefile.unix	2012-11-04 02:52:55.000000000 -0600
+@@ -97,7 +97,7 @@
+ WHAT=UNRAR
+ 
+ UNRAR_OBJ=filestr.o recvol.o rs.o scantree.o
+-LIB_OBJ=filestr.o scantree.o dll.o
++LIB_OBJ=filestr.o recvol.o rs.o scantree.o dll.o
+ 
+ OBJECTS=rar.o strlist.o strfn.o pathfn.o savepos.o smallfn.o global.o file.o filefn.o filcreat.o \
+ 	archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o encname.o \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121104/52099e76/attachment.html>


More information about the macports-changes mailing list