Ticket #40021: Portfile

File Portfile, 4.8 KB (added by elelay (Eric Le Lay), 11 years ago)
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
35pre-configure {
36    if {![file exists ${prefix}/lib/pkgconfig/gdk-quartz-2.0.pc]} {
37        ui_error "
38
39****
40**** gtk-osx-application is meant to be used only in a GTK2 quartz
41**** development environment but your version of GTK2 does not
42**** support quartz.  Please make sure that port gtk2 and all its
43**** dependencies are built with variants +no_x11 +quartz and try again.
44****
45"
46        error "gtk2 +no_x11 +quartz not installed."
47    }
48}
49
50variant python25 conflicts python26 description {Use Python 2.5} {
51    # no gtk3 code because gtk3 + python25 not supported
52    depends_lib-append port:py25-pygtk
53    set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.5
54
55    configure.python            ${python_prefix}/bin/python2.5
56    configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
57    configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
58    configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
59    configure.pre_args          --prefix=${python_prefix}
60}
61
62variant python26 conflicts python25 description {Use Python 2.6} {
63
64    if {[variant_isset gtk3]} {
65
66        depends_lib-append port:py26-gobject3
67
68        # don't bother configuring python because it's not needed (only gir matters)
69
70    } else {
71
72        depends_lib-append port:py26-pygtk
73        set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.6
74
75        configure.python            ${python_prefix}/bin/python2.6
76        configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
77        configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
78        configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
79        configure.pre_args           --prefix=${python_prefix}
80
81    }
82
83}
84
85variant python27 conflicts python26 conflicts python25 description {Use Python 2.7} {
86
87    if {[variant_isset gtk3]} {
88
89        depends_lib-append port:py27-gobject3
90
91        # don't bother configuring python because it's not needed (only gir matters)
92
93    } else {
94
95        depends_lib-append port:py27-pygtk
96       
97        set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.7
98
99        configure.python            ${python_prefix}/bin/python2.7
100        configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
101        configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
102        configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
103        configure.pre_args          --prefix=${python_prefix}
104
105    }
106
107}
108
109variant no_python description {Don't build python bindings, don't require any python} {
110}
111
112if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python27] && ![variant_isset no_python]} {
113    default_variants +python27
114}
115
116
117# gtk3 conflicts with python25 because PyGObject3 is not compatible with python 2.5
118variant gtk3 conflicts python25 description {Use gtk3} {
119   
120    depends_lib-append port:gtk3
121   
122    # force gtk version
123    configure.args-append --with-gtk=gtk+-3.0
124
125    # to put strings folder in /opt/local/share, not in python Framework share
126    configure.args-append --datadir=${prefix}/share
127
128}
129
130if {![variant_isset gtk3]} {
131    # force gtk version to 2.0
132    configure.args-append --with-gtk=gtk+-2.0
133}
134
135configure.ccache        no
136configure.cmd-append    --libdir=${prefix}/lib --includedir=${prefix}/include
137
138patchfiles-append       patch-bindings-python-gtkmacintegration-Makefile-in.diff \
139                        patch-bindings-python-gtk_osxapplication-Makefile-in.diff \
140                        patch-cocoa-menu-item-c.diff