source: trunk/dports/graphics/freeimage/Portfile @ 91344

Last change on this file since 91344 was 91344, checked in by cal@…, 5 years ago

freeimage: Install freeimageplus (nomaintainer)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# -*- 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
2# $Id: Portfile 91344 2012-03-30 12:56:34Z cal@macports.org $
3
4PortSystem          1.0
5
6name                freeimage
7version             3.15.0
8revision            2
9license             {FreeImage-1.0 GPL-2}
10categories          graphics
11platforms           macosx
12
13maintainers         nomaintainer
14
15description         Library for FreeImage, a dependency-less graphics library
16long_description    FreeImage is a library for developers who would like to \
17                    support most popular graphics image formats. Some \
18                    highlights are: extremely simple in use, not limited to \
19                    the local PC (unique FreeImageIO) and Plugin driven!
20
21homepage            http://freeimage.sourceforge.net/
22master_sites        sourceforge
23distname            FreeImage[strsed ${version} {g/\.//}]
24use_zip             yes
25worksrcdir          FreeImage
26
27checksums           md5     3b4f08e4985b269beb29a2fced1ef888 \
28                    sha1    ec2faa01d1b312aab68d77afe62861759c790100 \
29                    rmd160  5d309d0d8335129d00d6b5455613c89a419ebcac
30
31set VERLIBNAME libfreeimage.[lindex [split ${version} .] 0].dylib
32
33post-patch {
34    # Libraries extension is ".dylib" on Darwin, not ".so"
35    reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu \
36        ${worksrcpath}/Makefile.fip
37
38    # A dot separates the library name from its version on Darwin
39    reinplace /^SHAREDLIB/s/-/./ ${worksrcpath}/Makefile.gnu \
40        ${worksrcpath}/Makefile.fip
41
42    # Use libtool(1) instead of ar(1)
43    reinplace {s/\$(AR) r/libtool -o/} ${worksrcpath}/Makefile.gnu \
44        ${worksrcpath}/Makefile.fip
45
46    # Do not force installation as root
47    reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu \
48        ${worksrcpath}/Makefile.fip
49   
50    # Darwin requires different arguments to build dynamic libraries
51    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 \
52        ${worksrcpath}/Makefile.fip
53
54    # Darwin does not have a command ldconfig
55    reinplace "s|ldconfig||g" ${worksrcpath}/Makefile.gnu
56    # FreeImagePlus doesn't use ldconfig
57}
58
59use_configure       no
60
61variant universal {}
62if {[variant_isset universal]} {
63    set archflags ${configure.universal_cflags}
64} else {
65    set archflags ${configure.cc_archflags}
66}
67
68build.args          -f Makefile.gnu \
69                    PREFIX=${prefix} \
70                    VERLIBNAME=${VERLIBNAME} \
71                    CC="${configure.cc} ${configure.cflags} ${archflags}" \
72                    CXX="${configure.cxx} ${configure.cxxflags} ${archflags}" \
73                    LDFLAGS="${configure.ldflags}"
74
75post-build {
76    # build FreeImagePlus
77    system -W ${worksrcpath} "${build.cmd} -f Makefile.fip \
78        PREFIX=${prefix} \
79        VERLIBNAME=${VERLIBNAME} \
80        CC='${configure.cc} ${configure.cflags} ${archflags}' \
81        CXX='${configure.cxx} ${configure.cxxflags} ${archflags}' \
82        LDFLAGS='${configure.ldflags}'"
83}
84
85destroot.args       -f Makefile.gnu \
86                    INCDIR=${destroot}${prefix}/include \
87                    INSTALLDIR=${destroot}${prefix}/lib \
88                    PREFIX=${prefix} \
89                    VERLIBNAME=${VERLIBNAME}
90
91post-destroot {
92    # install FreeImagePlus
93    system -W ${worksrcpath} "${destroot.cmd} -f Makefile.fip install \
94        VERLIBNAME=${VERLIBNAME} \
95        CC='${configure.cc} ${configure.cflags} ${archflags}' \
96        CXX='${configure.cxx} ${configure.cxxflags} ${archflags}' \
97        LDFLAGS='${configure.ldflags}' \
98        INCDIR='${destroot}${prefix}/include' \
99        INSTALLDIR='${destroot}${prefix}/lib'"
100
101    set docdir ${prefix}/share/doc/${name}
102    xinstall -d ${destroot}${docdir}
103    xinstall -m 644 -W ${worksrcpath} Whatsnew.txt license-fi.txt \
104        license-gpl.txt ${destroot}${docdir}
105    copy ${worksrcpath}/Examples ${destroot}${docdir}/examples
106}
107
108test.run            yes
109test.cmd            ./testAPI
110test.dir            ${worksrcpath}/TestAPI
111test.target
112
113pre-test {
114    # Use correct compiler and flags when compiling test
115    reinplace "s:g++:${configure.cxx} ${configure.cxxflags} ${archflags}:" ${test.dir}/Makefile
116
117    # Build the test
118    system "make -C ${test.dir}"
119}
120
121livecheck.type      regex
122livecheck.regex     {FreeImage (\d+(?:\.\d+)*) released}
Note: See TracBrowser for help on using the repository browser.