[138022] trunk/dports/graphics/netpbm

ryandesign at macports.org ryandesign at macports.org
Thu Jun 25 18:54:57 PDT 2015


Revision: 138022
          https://trac.macports.org/changeset/138022
Author:   ryandesign at macports.org
Date:     2015-06-25 18:54:57 -0700 (Thu, 25 Jun 2015)
Log Message:
-----------
netpbm: update to 10.70.07; move library, headers, and related files to new libnetpbm subport; no longer install manweb or its url files because we had never configured it to work properly and real manpages will be installed later

Modified Paths:
--------------
    trunk/dports/graphics/netpbm/Portfile

Added Paths:
-----------
    trunk/dports/graphics/netpbm/files/manweb.conf.in
    trunk/dports/graphics/netpbm/files/patch-libnetpbm-GNUmakefile.diff
    trunk/dports/graphics/netpbm/files/patch-manweb.diff
    trunk/dports/graphics/netpbm/files/patch-netpbm-GNUmakefile.diff

Modified: trunk/dports/graphics/netpbm/Portfile
===================================================================
--- trunk/dports/graphics/netpbm/Portfile	2015-06-26 01:51:15 UTC (rev 138021)
+++ trunk/dports/graphics/netpbm/Portfile	2015-06-26 01:54:57 UTC (rev 138022)
@@ -2,11 +2,10 @@
 # $Id$
 
 PortSystem          1.0
-PortGroup           conflicts_build 1.0
 
 name                netpbm
-version             10.70.06
-svn.revision        2528
+version             10.70.07
+svn.revision        2557
 categories          graphics
 platforms           darwin freebsd linux
 maintainers         ryandesign openmaintainer
@@ -22,16 +21,6 @@
 
 homepage            http://netpbm.sourceforge.net/
 
-depends_build       path:bin/perl:perl5
-
-depends_lib         port:jasper \
-                    port:jbigkit \
-                    port:jpeg \
-                    port:libpng \
-                    port:libxml2 \
-                    port:tiff \
-                    port:zlib
-
 fetch.type          svn
 svn.url             https://svn.code.sf.net/p/netpbm/code/advanced/
 worksrcdir          advanced
@@ -42,8 +31,6 @@
                     patch-test-Execute-Tests.diff \
                     patch-test-ppmdim.test.diff
 
-conflicts_build     ${name}
-
 variant universal {}
 
 configure.cflags-append -fno-common
@@ -75,11 +62,12 @@
 LDRELOC = ${ldreloc}
 LDSHLIB = ${ldshlib}
 LINKER_CAN_DO_EXPLICIT_LIBRARY = ${linker_can_do_explicit_library}
+NETPBMLIB_RUNTIME_PATH = ${prefix}/lib
 NETPBMLIBTYPE = ${netpbmlibtype}
 NETPBMLIBSUFFIX = ${netpbmlibsuffix}
 PKGMANDIR = share/man
 PNGLIB = -lpng
-RGB_DB_PATH = ${prefix}/share/netpbm/rgb.txt
+RGB_DB_PATH = ${prefix}/share/${name}/rgb.txt
 TIFFLIB = -ltiff
 WANT_SSE = ${want_sse}
 WANT_X11 = ${want_x11}
@@ -89,11 +77,12 @@
 }
 
 platform darwin {
-    set ldshlib "\$(LDFLAGS) -dynamiclib -install_name ${prefix}/lib/libnetpbm.\$(MAJ).dylib -compatibility_version \$(MAJ) -current_version \$(MAJ).\$(MIN).\$(NETPBM_POINT_RELEASE)"
+    set ldshlib {$(LDFLAGS) -dynamiclib -install_name $(NETPBMLIB_RUNTIME_PATH)/libnetpbm.$(MAJ).$(NETPBMLIBSUFFIX) -compatibility_version $(MAJ) -current_version $(MAJ).$(MIN).$(NETPBM_POINT_RELEASE)}
     set netpbmlibtype dylib
     set netpbmlibsuffix dylib
 }
 
+# Non-Darwin platforms are untested.
 platform linux {
     set ldreloc {ld --reloc}
     set linker_can_do_explicit_library Y
@@ -109,63 +98,175 @@
 }
 
 build.args          messages=yes
-build.target
 build.type          gnu
 
-set pkgdir          ${workpath}/package
+set pkgtargets      {}
 
+# The tests can only be run after things have been destrooted ("packaged").
 post-build {
-    system -W ${worksrcpath} "${build.cmd} package pkgdir=${pkgdir}"
-    delete ${pkgdir}/bin/doc.url
+    system -W ${worksrcpath} "${build.cmd} ${pkgtargets} pkgdir=${destroot}${prefix}"
 }
 
-test.run            yes
-test.target         check
-test.args           pkgdir=${pkgdir} \
-                    resultdir=${workpath}/test \
-                    tmpdir=${workpath}/.tmp
-# Problem reported to developer; might be fixed after 10.70
-test.env            DYLD_LIBRARY_PATH=${pkgdir}/lib
-
 destroot {
-    delete ${destroot}${prefix}/bin ${destroot}${prefix}/share
-    copy ${pkgdir}/bin ${pkgdir}/share ${destroot}${prefix}/
-    copy ${pkgdir}/include/${name} ${destroot}${prefix}/include/
-    copy {*}[glob ${pkgdir}/lib/*] {*}[glob ${pkgdir}/link/*] ${destroot}${prefix}/lib/
+    move ${destroot}${prefix}/misc ${destroot}${prefix}/share/${name}
 
-    xinstall -d ${destroot}${prefix}/share/${name}/
-    copy {*}[glob ${pkgdir}/misc/*] ${destroot}${prefix}/share/${name}/
+    # Fix ownership of files installed during the build phase.
+    # Not using fs-traverse with file attributes, because that doesn't handle symlinks.
+    exec chown -R ${install.user}:${install.group} ${destroot}
+}
 
-    reinplace -W ${pkgdir} "/^@/d" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@BINDIR@|${prefix}/bin|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@DATADIR@|${prefix}/share/${name}|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@INCLUDEDIR@|${prefix}/include|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@LIBDIR@|${prefix}/lib|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@LINKDIR@|${prefix}/lib|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@MANDIR@|${prefix}/share/man|g" config_template pkgconfig_template
-    reinplace -W ${pkgdir} "s|@VERSION@|${version}|g" config_template pkgconfig_template
-    xinstall -m 755 ${pkgdir}/config_template ${destroot}${prefix}/bin/netpbm-config
-    xinstall -m 644 ${pkgdir}/pkgconfig_template ${destroot}${prefix}/lib/pkgconfig/netpbm.pc
+if {${subport} eq ${name}} {
+    installs_libs       no
 
-    foreach old_library {pbm pgm pnm ppm} {
-        ln -s libnetpbm.dylib ${destroot}${prefix}/lib/lib${old_library}.dylib
+    # TODO: Don't build libnetpbm again in netpbm subport.
+    # TODO: Replace pointer manpages with real manpages. See doc/USERDOC.
+
+    depends_lib-append  port:jasper \
+                        port:jbigkit \
+                        port:jpeg \
+                        port:libnetpbm \
+                        port:libpng \
+                        port:libxml2 \
+                        port:tiff \
+                        port:zlib
+
+    # Remove library from subdirs, leaving only the programs.
+    #patchfiles-append   patch-${subport}-GNUmakefile.diff
+
+    # GNUmakefile warns that parallel build dependencies are only declared correctly
+    # when using the "all" target, but the above patch is enough to change that.
+    #use_parallel_build  no
+
+    # Install programs.
+    lappend pkgtargets  install.bin
+    # Install data files.
+    lappend pkgtargets  install.data
+    # Install manpages.
+    lappend pkgtargets  install.man
+
+    test.run            yes
+    test.target         check
+    test.args           pkgdir=${destroot}${prefix} \
+                        resultdir=${workpath}/test \
+                        tmpdir=${workpath}/.tmp
+
+    post-destroot {
+        # Delete manweb files and files installed by the libnetpbm subport.
+        delete {*}[glob -directory ${destroot}${prefix} bin/manweb share/man/man1/manweb.1 share/man/man3/libnetpbm.3 share/man/man5/*.5 share/${name}/rgb.txt]
+
+        # Install documentation.
+        set docdir ${prefix}/share/doc/${subport}
+        xinstall -d ${destroot}${docdir}
+        xinstall -m 644 -W ${worksrcpath} \
+            README \
+            doc/COPYRIGHT.PATENT \
+            doc/GPL_LICENSE.txt \
+            doc/HISTORY \
+            doc/Netpbm.programming \
+            doc/USERDOC \
+            doc/copyright_summary \
+            doc/lgpl_v21.txt \
+            doc/patent_summary \
+            ${destroot}${docdir}
     }
 
-    set docdir ${prefix}/share/doc/${subport}
-    xinstall -d ${destroot}${docdir}
-    xinstall -m 644 -W ${worksrcpath} \
-        README \
-        doc/COPYRIGHT.PATENT \
-        doc/GPL_LICENSE.txt \
-        doc/HISTORY \
-        doc/Netpbm.programming \
-        doc/USERDOC \
-        doc/copyright_summary \
-        doc/lgpl_v21.txt \
-        doc/patent_summary \
-        ${destroot}${docdir}
+    variant x11 description {Build the pamx image viewer} {
+        global want_x11
+        set want_x11            Y
+        depends_build-append    port:pkgconfig
+        depends_lib-append      port:xorg-libX11
+    }
+
+    default_variants    +x11
+
+    livecheck.type      regex
+    livecheck.url       https://sourceforge.net/p/netpbm/code/HEAD/log/?path=/advanced/version.mk&limit=1
+    livecheck.regex     {(\d+(\.\d+)+)}
+} else {
+    livecheck.type      none
 }
 
+subport libnetpbm {
+    # TODO: descriptions
+
+    license             Permissive
+
+    # Remove programs from subdirs, leaving only the library.
+    #patchfiles-append   patch-${subport}-GNUmakefile.diff
+
+    # Look for manweb.conf in ${prefix}/etc instead of /etc.
+    #patchfiles-append   patch-manweb.diff
+    #post-patch {
+    #    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/manweb
+    #}
+
+    build.target        lib/all
+
+    # Install libraries and headers.
+    lappend pkgtargets  install-dev
+    # Install manweb program.
+    #lappend pkgtargets  install.bin
+    # Install rgb.txt data file.
+    lappend pkgtargets  lib/install.data
+    # Install manpage for manweb.
+    #lappend pkgtargets  install.man1
+    # Install manpages for libnetpbm and file formats.
+    lappend pkgtargets  lib/install.man
+    # Install manweb URL file for manweb.
+    #lappend pkgtargets  install.manweb
+    # Install manweb URL file for netpbm (and "doc" which gets deleted later).
+    #lappend pkgtargets  install.manwebmain
+
+    post-build {
+        # Build manweb.conf like installnetpbm.pl would.
+        #copy ${filespath}/manweb.conf.in ${build.dir}/manweb.conf
+        #reinplace "s|@PREFIX@|${prefix}|g" ${build.dir}/manweb.conf
+
+        # Build netpbm-config and netpbm.pc like installnetpbm.pl would.
+        copy ${worksrcpath}/buildtools/config_template ${build.dir}/netpbm-config
+        copy ${worksrcpath}/buildtools/pkgconfig_template ${build.dir}/netpbm.pc
+        set files [list ${build.dir}/netpbm-config ${build.dir}/netpbm.pc]
+        reinplace "/^@/d" {*}${files}
+        reinplace "s|@BINDIR@|${prefix}/bin|g" {*}${files}
+        reinplace "s|@DATADIR@|${prefix}/share/${name}|g" {*}${files}
+        reinplace "s|@INCLUDEDIR@|${prefix}/include|g" {*}${files}
+        reinplace "s|@LIBDIR@|${prefix}/lib|g" {*}${files}
+        reinplace "s|@LINKDIR@|${prefix}/lib|g" {*}${files}
+        reinplace "s|@MANDIR@|${prefix}/share/man|g" {*}${files}
+        reinplace "s|@VERSION@|${version}|g" {*}${files}
+    }
+
+    post-destroot {
+        # Don't install a data file into ${prefix}/bin; that's weird.
+        #delete ${destroot}${prefix}/bin/doc.url
+
+        # Install manweb.conf.
+        #xinstall -m 644 ${build.dir}/manweb.conf ${destroot}${prefix}/etc/
+
+        # Install netpbm-config and netpbm.pc.
+        xinstall -m 755 ${build.dir}/netpbm-config ${destroot}${prefix}/bin/
+        xinstall -m 644 ${build.dir}/netpbm.pc ${destroot}${prefix}/lib/pkgconfig/
+
+        move {*}[glob ${destroot}${prefix}/link/*] ${destroot}${prefix}/lib/
+
+        # Add symlinks for old library names that some old software still uses.
+        set new_library [file readlink ${destroot}${prefix}/lib/libnetpbm.${netpbmlibsuffix}]
+        foreach old_library {pbm pgm pnm ppm} {
+            ln -s ${new_library} ${destroot}${prefix}/lib/lib${old_library}.${netpbmlibsuffix}
+        }
+    }
+
+    pre-activate {
+        # netpbm < 10.70.07 installed libnetpbm and associated files
+        if {![catch {set installed [lindex [registry_active netpbm] 0]}]} {
+            set installed_version [lindex ${installed} 1]
+            if {[vercmp ${installed_version} 10.70.07] < 0} {
+                registry_deactivate_composite netpbm "" [list ports_nodepcheck 1]
+            }
+        }
+    }
+}
+
 # work around bug in Apple's gcc build 4061
 platform darwin 8 {
     depends_build-append port:gmake
@@ -175,21 +276,8 @@
         set data [read $fl]
         close $fl
         if {[regexp "build 4061" ${data}]} {
-            ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} does not work with gcc version \"${data}\"."
+            ui_msg "On Mac OS X ${macosx_version}, ${name} @${version} does not work with gcc version \"${data}\"."
             return -code error "incompatible gcc version"
         }
     }
 }
-
-variant x11 description {Build the pamx image viewer} {
-    global want_x11
-    set want_x11        Y
-    depends_build-append port:pkgconfig
-    depends_lib-append  port:xorg-libX11
-}
-
-default_variants    +x11
-
-livecheck.type      regex
-livecheck.url       https://sourceforge.net/p/netpbm/code/HEAD/log/?path=/advanced/version.mk&limit=1
-livecheck.regex     {(\d+(\.\d+)+)}

Added: trunk/dports/graphics/netpbm/files/manweb.conf.in
===================================================================
--- trunk/dports/graphics/netpbm/files/manweb.conf.in	                        (rev 0)
+++ trunk/dports/graphics/netpbm/files/manweb.conf.in	2015-06-26 01:54:57 UTC (rev 138022)
@@ -0,0 +1,2 @@
+#Configuration file for Manweb
+webdir=@PREFIX@/share/man/web


Property changes on: trunk/dports/graphics/netpbm/files/manweb.conf.in
___________________________________________________________________
Added: svn:eol-style
   + native

Added: trunk/dports/graphics/netpbm/files/patch-libnetpbm-GNUmakefile.diff
===================================================================
--- trunk/dports/graphics/netpbm/files/patch-libnetpbm-GNUmakefile.diff	                        (rev 0)
+++ trunk/dports/graphics/netpbm/files/patch-libnetpbm-GNUmakefile.diff	2015-06-26 01:54:57 UTC (rev 138022)
@@ -0,0 +1,11 @@
+--- GNUmakefile.orig	2015-04-16 22:17:30.000000000 -0500
++++ GNUmakefile	2015-06-21 15:49:57.000000000 -0500
+@@ -61,7 +61,7 @@
+ include $(BUILDDIR)/config.mk
+ 
+ PROG_SUBDIRS = converter analyzer editor generator other test
+-PRODUCT_SUBDIRS = lib $(PROG_SUBDIRS)
++PRODUCT_SUBDIRS = lib
+ SUPPORT_SUBDIRS = urt buildtools
+ 
+ SUBDIRS = $(PRODUCT_SUBDIRS) $(SUPPORT_SUBDIRS)

Added: trunk/dports/graphics/netpbm/files/patch-manweb.diff
===================================================================
--- trunk/dports/graphics/netpbm/files/patch-manweb.diff	                        (rev 0)
+++ trunk/dports/graphics/netpbm/files/patch-manweb.diff	2015-06-26 01:54:57 UTC (rev 138022)
@@ -0,0 +1,11 @@
+--- manweb.orig	2006-08-18 22:12:28.000000000 -0500
++++ manweb	2015-06-22 22:31:45.000000000 -0500
+@@ -316,7 +316,7 @@
+         if (defined($envVblValue)) {
+             $confFile = $envVblValue;
+         } else {
+-            $confFile = "/etc/manweb.conf";
++            $confFile = "@PREFIX@/etc/manweb.conf";
+         }
+     }
+ 

Added: trunk/dports/graphics/netpbm/files/patch-netpbm-GNUmakefile.diff
===================================================================
--- trunk/dports/graphics/netpbm/files/patch-netpbm-GNUmakefile.diff	                        (rev 0)
+++ trunk/dports/graphics/netpbm/files/patch-netpbm-GNUmakefile.diff	2015-06-26 01:54:57 UTC (rev 138022)
@@ -0,0 +1,20 @@
+--- GNUmakefile.orig	2015-04-16 22:17:30.000000000 -0500
++++ GNUmakefile	2015-06-22 23:17:31.000000000 -0500
+@@ -61,7 +61,7 @@
+ include $(BUILDDIR)/config.mk
+ 
+ PROG_SUBDIRS = converter analyzer editor generator other test
+-PRODUCT_SUBDIRS = lib $(PROG_SUBDIRS)
++PRODUCT_SUBDIRS = $(PROG_SUBDIRS)
+ SUPPORT_SUBDIRS = urt buildtools
+ 
+ SUBDIRS = $(PRODUCT_SUBDIRS) $(SUPPORT_SUBDIRS)
+@@ -103,7 +103,7 @@
+ # for the aforementioned reason for other invocations.
+ 
+ $(SUBDIRS:%=%/all) lib/util/all: pm_config.h inttypes_netpbm.h version.h
+-$(PROG_SUBDIRS:%=%/all): lib/all $(SUPPORT_SUBDIRS:%=%/all)
++$(PROG_SUBDIRS:%=%/all): $(SUPPORT_SUBDIRS:%=%/all)
+ lib/all: lib/util/all
+ 
+ .PHONY: lib/util/all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150625/710d3ce5/attachment-0001.html>


More information about the macports-changes mailing list