Ticket #33153: Portfile

File Portfile, 2.5 KB (added by mnot@…, 13 years ago)

Revised portfile

Line 
1# $Id$
2
3PortSystem       1.0
4PortGroup        python 1.0
5
6name             py-exiv2
7version          0.3.2
8maintainers      mnot openmaintainer
9
10description      Python binding to exiv2 (image metadata manipulation)
11long_description Python bindings to Exiv2, a C++ library \
12                 which allows you to manipulate EXIF and IPTC image metadata.               
13categories-append    graphics
14platforms        darwin
15license          GPL-2+
16
17homepage         http://tilloy.net/dev/pyexiv2/
18master_sites     http://launchpad.net/pyexiv2/0.3.x/${version}/+download/
19distname         pyexiv2-${version}
20
21checksums        sha256 0abc117c6afa71f54266cb91979a5227f60361db1fcfdb68ae9615398d7a2127 \
22                 rmd160 cbc53e6f45b0f4251b90bfb6ffab8c659463ac5d \
23                 md5    9c0377ca4cf7d5ceeee994af0b5536ae
24
25platforms        darwin
26python.versions 27
27use_bzip2        yes
28extract.suffix   .tar.bz2
29
30if {$subport != $name} {
31
32  depends_lib-append    port:exiv2 \
33                        port:boost
34
35  if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
36    depends_lib-delete port:boost
37    pre-configure {
38        ui_error "
39  ****
40  **** ${name} requires port boost installed with variant +python.
41  **** Please do the following then try installing ${name} again:
42  ****
43  ****     sudo port install boost +python${python.version}
44  ****
45
46  "
47        return -code error "incompatible boost installation"
48    }
49  }
50
51  depends_build       port:scons       
52  use_configure       no
53  build.cmd           CXXFLAGS="-I${prefix}/include" \
54                      LDFLAGS="-L${prefix}/lib -lpython${python.branch}" \
55                      scons
56  build.target        lib
57  build.args          PREFIX=${prefix}
58  use_parallel_build  no
59
60
61  ### scons seems to want to rebuild things during destroot...
62  destroot.env        CXXFLAGS="-I${prefix}/include" \
63                      LDFLAGS="-L${prefix}/lib -lpython${python.branch}"
64  destroot.cmd        scons
65  destroot.destdir    DESTDIR=${destroot}
66  destroot.target     install
67  destroot.args       --debug=explain
68  destroot.keepdirs   ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/
69
70  ### scons creates a .dylib; we need a .so
71  post-destroot {
72    file copy ${worksrcpath}/build/libexiv2python.dylib \
73              ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/libexiv2python.so
74  }
75
76}
77