[91344] trunk/dports/graphics/freeimage/Portfile
Ryan Schmidt
ryandesign at macports.org
Fri Mar 30 20:10:16 PDT 2012
On Mar 30, 2012, at 07:56, cal at macports.org wrote:
> Revision: 91344
> https://trac.macports.org/changeset/91344
> Author: cal at macports.org
> Date: 2012-03-30 05:56:34 -0700 (Fri, 30 Mar 2012)
> Log Message:
> -----------
> freeimage: Install freeimageplus (nomaintainer)
With the way you've had to basically run the patch, build and destroot tasks a second time each in order to do this, it feels like maybe this would be an ideal opportunity to use a subport instead. I don't know the freeimage software however. Presumably, since the port didn't have freeimageplus before this change, there are uses that don't require freeimageplus. Does changing this to a subport sound ok? If so I can give it a try.
> Modified Paths:
> --------------
> trunk/dports/graphics/freeimage/Portfile
>
> Modified: trunk/dports/graphics/freeimage/Portfile
> ===================================================================
> --- trunk/dports/graphics/freeimage/Portfile 2012-03-30 12:47:46 UTC (rev 91343)
> +++ trunk/dports/graphics/freeimage/Portfile 2012-03-30 12:56:34 UTC (rev 91344)
> @@ -5,7 +5,7 @@
>
> name freeimage
> version 3.15.0
> -revision 1
> +revision 2
> license {FreeImage-1.0 GPL-2}
> categories graphics
> platforms macosx
> @@ -32,22 +32,28 @@
>
> post-patch {
> # Libraries extension is ".dylib" on Darwin, not ".so"
> - reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu
> + reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu \
> + ${worksrcpath}/Makefile.fip
>
> - # A dash separate the library name from its version on Darwin
> - reinplace /^SHAREDLIB/s/-/./ ${worksrcpath}/Makefile.gnu
> + # A dot separates the library name from its version on Darwin
> + reinplace /^SHAREDLIB/s/-/./ ${worksrcpath}/Makefile.gnu \
> + ${worksrcpath}/Makefile.fip
>
> # Use libtool(1) instead of ar(1)
> - reinplace {s/\$(AR) r/libtool -o/} ${worksrcpath}/Makefile.gnu
> + reinplace {s/\$(AR) r/libtool -o/} ${worksrcpath}/Makefile.gnu \
> + ${worksrcpath}/Makefile.fip
>
> # Do not force installation as root
> - reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu
> + reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu \
> + ${worksrcpath}/Makefile.fip
>
> # Darwin requires different arguments to build dynamic libraries
> - reinplace "s|-Wl,-soname,\$(VERLIBNAME)|-dynamiclib -install_name \$(PREFIX)/lib/\$(VERLIBNAME) -compatibility_version \$(VER_MAJOR) -current_version \$(VER_MAJOR).\$(VER_MINOR)|g" ${worksrcpath}/Makefile.gnu
> + reinplace "s|-Wl,-soname,\$(VERLIBNAME)|-dynamiclib -install_name \$(PREFIX)/lib/\$(VERLIBNAME) -compatibility_version \$(VER_MAJOR) -current_version \$(VER_MAJOR).\$(VER_MINOR)|g" ${worksrcpath}/Makefile.gnu \
> + ${worksrcpath}/Makefile.fip
>
> # Darwin does not have a command ldconfig
> reinplace "s|ldconfig||g" ${worksrcpath}/Makefile.gnu
> + # FreeImagePlus doesn't use ldconfig
> }
>
> use_configure no
> @@ -66,6 +72,16 @@
> CXX="${configure.cxx} ${configure.cxxflags} ${archflags}" \
> LDFLAGS="${configure.ldflags}"
>
> +post-build {
> + # build FreeImagePlus
> + system -W ${worksrcpath} "${build.cmd} -f Makefile.fip \
> + PREFIX=${prefix} \
> + VERLIBNAME=${VERLIBNAME} \
> + CC='${configure.cc} ${configure.cflags} ${archflags}' \
> + CXX='${configure.cxx} ${configure.cxxflags} ${archflags}' \
> + LDFLAGS='${configure.ldflags}'"
> +}
> +
> destroot.args -f Makefile.gnu \
> INCDIR=${destroot}${prefix}/include \
> INSTALLDIR=${destroot}${prefix}/lib \
> @@ -73,6 +89,15 @@
> VERLIBNAME=${VERLIBNAME}
>
> post-destroot {
> + # install FreeImagePlus
> + system -W ${worksrcpath} "${destroot.cmd} -f Makefile.fip install \
> + VERLIBNAME=${VERLIBNAME} \
> + CC='${configure.cc} ${configure.cflags} ${archflags}' \
> + CXX='${configure.cxx} ${configure.cxxflags} ${archflags}' \
> + LDFLAGS='${configure.ldflags}' \
> + INCDIR='${destroot}${prefix}/include' \
> + INSTALLDIR='${destroot}${prefix}/lib'"
> +
More information about the macports-dev
mailing list