Ticket #40021: Portfile.2

File Portfile.2, 5.3 KB (added by dbevans (David B. Evans), 11 years ago)

Amended Portfile

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 102041 2013-01-26 08:27:23Z elelay@macports.org $
3
4PortSystem 1.0
5
6name            gtk-osx-application
7version         2.0.1
8set branch      [join [lrange [split ${version} .] 0 1] .]
9categories      devel
10maintainers     elelay openmaintainer
11
12description     Mac OS X menu bar integration library for GTK2 quartz
13
14long_description \
15                A simple library whose purpose is to \
16                allow GTK2 quartz applications to integrate with \
17                the Mac OS X menu bar. Requires gtk2 and its \
18                dependencies to be built with variants +no_x11 +quartz
19
20homepage        http://live.gnome.org/GTK%2B/OSX/Integration
21master_sites    sourceforge:project/gtk-osx/GTK-OSX%20Build/
22
23platforms       darwin
24
25master_sites    gnome:sources/gtk-mac-integration/${branch}/
26distname        gtk-mac-integration-${version}
27use_xz          yes
28
29checksums       md5     45a4d217d0a7d6f3d4f974f99ec50c29 \
30                sha1    9d939a2e4fb6c0ab4fe3d544ac712a152451249a \
31                rmd160  67b4c9bff4aaab9efcbc4042b452e8a79c038828
32
33depends_build   port:pkgconfig
34
35if {[variant_isset gtk3]} {
36    pre-configure {
37        if {![file exists ${prefix}/lib/pkgconfig/gdk-quartz-3.0.pc]} {
38            ui_error "
39
40****
41**** gtk-osx-application is meant to be used only in a GTK3 quartz
42**** development environment but your version of GTK3 does not
43**** support quartz.  Please make sure that port gtk3 and all its
44**** dependencies are built with variants +no_x11 +quartz and try again.
45****
46"
47            error "gtk2 +no_x11 +quartz not installed."
48        }
49    }
50} else {
51    pre-configure {
52        if {![file exists ${prefix}/lib/pkgconfig/gdk-quartz-2.0.pc]} {
53            ui_error "
54
55****
56**** gtk-osx-application is meant to be used only in a GTK2 quartz
57**** development environment but your version of GTK2 does not
58**** support quartz.  Please make sure that port gtk2 and all its
59**** dependencies are built with variants +no_x11 +quartz and try again.
60****
61"
62            error "gtk2 +no_x11 +quartz not installed."
63        }
64    }
65}
66
67variant python25 conflicts python26 description {Use Python 2.5} {
68    # no gtk3 code because gtk3 + python25 not supported
69    depends_lib-append port:py25-pygtk
70    set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.5
71
72    configure.python            ${python_prefix}/bin/python2.5
73    configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
74    configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
75    configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
76    configure.pre_args          --prefix=${python_prefix}
77}
78
79variant python26 conflicts python25 description {Use Python 2.6} {
80
81    if {[variant_isset gtk3]} {
82
83        depends_lib-append port:py26-gobject3
84
85        # don't bother configuring python because it's not needed (only gir matters)
86
87    } else {
88
89        depends_lib-append port:py26-pygtk
90        set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.6
91
92        configure.python            ${python_prefix}/bin/python2.6
93        configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
94        configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
95        configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
96        configure.pre_args           --prefix=${python_prefix}
97
98    }
99
100}
101
102variant python27 conflicts python26 conflicts python25 description {Use Python 2.7} {
103
104    if {[variant_isset gtk3]} {
105
106        depends_lib-append port:py27-gobject3
107
108        # don't bother configuring python because it's not needed (only gir matters)
109
110    } else {
111
112        depends_lib-append port:py27-pygtk
113       
114        set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.7
115
116        configure.python            ${python_prefix}/bin/python2.7
117        configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
118        configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
119        configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
120        configure.pre_args          --prefix=${python_prefix}
121
122    }
123
124}
125
126variant no_python description {Don't build python bindings, don't require any python} {
127}
128
129if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python27] && ![variant_isset no_python]} {
130    default_variants +python27
131}
132
133
134# gtk3 conflicts with python25 because PyGObject3 is not compatible with python 2.5
135variant gtk3 conflicts python25 description {Use gtk3} {
136   
137    depends_lib-append port:gtk3
138   
139    # force gtk version
140    configure.args-append --with-gtk=gtk+-3.0
141
142    # to put strings folder in /opt/local/share, not in python Framework share
143    configure.args-append --datadir=${prefix}/share
144
145}
146
147if {![variant_isset gtk3]} {
148    # force gtk version to 2.0
149    configure.args-append --with-gtk=gtk+-2.0
150}
151
152configure.ccache        no
153configure.cmd-append    --libdir=${prefix}/lib --includedir=${prefix}/include
154
155patchfiles-append       patch-bindings-python-gtkmacintegration-Makefile-in.diff \
156                        patch-bindings-python-gtk_osxapplication-Makefile-in.diff \
157                        patch-cocoa-menu-item-c.diff