# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name netpbm version 10.76.00 svn.revision 2830 categories graphics platforms darwin freebsd linux maintainers ryandesign openmaintainer license {BSD GPL-2 IJG Permissive} description Image manipulation long_description A whole bunch of utilities for primitive manipulation \ of graphic images. Wide array of converters from one \ graphics format to another, e.g. from g3 fax format to \ jpeg. Many basic graphics editing tools such as \ magnifying and cropping. homepage http://netpbm.sourceforge.net/ fetch.type svn svn.url https://svn.code.sf.net/p/netpbm/code/advanced/ worksrcdir advanced patchfiles patch-converter-other-giftopnm.c-strcaseeq.diff \ patch-lib-Makefile.diff \ patch-other-pamx-Makefile.diff variant universal {} configure.cflags-append -fno-common set jasperlib -ljasper set ldreloc NONE set ldshlib {-shared -Wl,-soname,$(SONAME)} set linker_can_do_explicit_library N set netpbmlibtype unixshared set netpbmlibsuffix so set want_sse N set want_x11 N configure { # The netpbm configure script is interactive, and appends its results to # the config.mk file; doc/INSTALL recommends packagers do that manually. copy -force ${worksrcpath}/config.mk.in ${worksrcpath}/config.mk set configmk [open ${worksrcpath}/config.mk a] puts ${configmk} " CC = ${configure.cc} CFLAGS = ${configure.cflags} ${configure.cppflags} [get_canonical_archflags cc] CFLAGS_CONFIG = \$(CFLAGS) JASPERHDR_DIR = ${prefix}/include JASPERLIB = ${jasperlib} JBIGHDR_DIR = ${prefix}/include JBIGLIB = -ljbig JPEGLIB = -ljpeg LDFLAGS = ${configure.ldflags} [get_canonical_archflags ld] 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/${name}/rgb.txt TIFFLIB = -ltiff WANT_SSE = ${want_sse} WANT_X11 = ${want_x11} ZLIB = -lz " close ${configmk} } platform darwin { 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 } platform freebsd { depends_build-append port:libtool patchfiles-append patch-libopt.c.diff set jasperlib ${prefix}/lib/libjasper.la set ldshlib "${prefix}/lib/glibtool --mode=link gcc" } build.args messages=yes build.type gnu set pkgtargets {} # The tests can only be run after things have been destrooted ("packaged"). post-build { system -W ${worksrcpath} "${build.cmd} ${pkgtargets} pkgdir=${destroot}${prefix}" } destroot { move ${destroot}${prefix}/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} } if {${subport} eq ${name}} { installs_libs no # 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} } 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 build.cmd ${prefix}/bin/gmake pre-configure { set fl [open "| ${configure.cc} --version"] 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}\"." return -code error "incompatible gcc version" } } }