source: trunk/dports/devel/gtk-osx-application/Portfile

Last change on this file was 138229, checked in by elelay@…, 2 years ago

gtk-osx-application: replaced by {py27-,}gtk-osx-application-{common-,}gtk{2,3}

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 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 138229 2015-07-02 18:59:53Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup       active_variants 1.1
6
7name            gtk-osx-application
8conflicts       ige-mac-integration
9version         2.0.8
10license         LGPL-2.1
11set branch      [join [lrange [split ${version} .] 0 1] .]
12categories      devel
13maintainers     elelay openmaintainer
14
15description     Mac OS X menu bar integration library for GTK2 quartz
16
17long_description \
18                A simple library whose purpose is to \
19                allow GTK quartz applications to integrate with \
20                the Mac OS X menu bar. Requires gtk2 or gtk3 and its \
21                dependencies to be built with variant +quartz
22
23homepage        https://wiki.gnome.org/Projects/GTK%2B/OSX/Integration
24
25platforms       darwin
26
27set myname      gtk-mac-integration
28master_sites    gnome:sources/gtk-mac-integration/${branch}/
29distname        ${myname}-${version}
30use_xz          yes
31
32# sha256 from upstream, rmd160 computed locally
33checksums       sha256    74fce9dbc5efe4e3d07a20b24796be1b1d6c3ac10a0ee6b1f1d685c809071b79 \
34                rmd160    53fd44172a3fa076e4401b6aac1adb10b76a5b7c
35
36
37depends_build   port:pkgconfig
38
39set gtk_version gtk2
40
41pre-configure {
42
43  if {${name} eq ${subport}} {
44    ui_error "
45The gtk-osx-application port has been replaced by 'gtk-osx-application-gtk2'
46and 'gtk-osx-application-gtk3'.
47Please `sudo port deactivate gtk-osx-application`
48followed by `sudo port upgrade -u outdated` or another command to update.
49Then if all works as intended `sudo port uninstall gtk-osx-application`
50"
51    return -code error
52  }
53
54  if {![active_variants $gtk_version quartz ""]} {
55    ui_error "
56${subport} is meant to be used only in a GTK quartz
57development environment but your version of GTK does not
58support quartz.  Please make sure that port $gtk_version and all its
59dependencies are built with variants +quartz and try again.
60"
61    error "$gtk_version +quartz not installed."
62  }
63}
64
65# py27-gtk-osx-application-gtk3 is not needed (only gir matters).
66# If a python gtk3 program requires gtk-osx-application, add
67#    depends_lib-append port:gtk-osx-application-gtk3 \
68#                       port:py27-gobject3
69
70subport py27-gtk-osx-application-gtk2 {
71    set gtk_version gtk2
72
73    depends_lib-append port:py27-pygtk \
74                       port:gtk-osx-application-gtk2
75   
76    set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.7
77
78    configure.python            ${python_prefix}/bin/python2.7
79    configure.env-append        PYGTK_CODEGEN=${python_prefix}/bin/pygtk-codegen-2.0
80    configure.env-append        PYGOBJECT_CODEGEN=${python_prefix}/bin/pygobject-codegen-2.0
81    configure.pkg_config_path   ${python_prefix}/lib/pkgconfig/
82    configure.pre_args          --prefix=${python_prefix}
83
84
85    configure.args-append --with-gtk2 --without-gtk3 --disable-introspection
86
87    # enable-python defaults to all, but it must be set to
88    # 'yes' otherwise pygtk bindings are not built.
89    # By the way, I had no success configuring with --python=all
90    # as per README (configure rejected the option).
91    # So no gir for gtk2 variant
92    configure.args-append --enable-python=yes
93   
94    post-destroot {
95        delete ${destroot}${prefix}/include
96        delete ${destroot}${prefix}/lib
97        delete ${destroot}${prefix}/share
98    }
99}
100
101subport gtk-osx-application-gtk3 {
102    set gtk_version gtk3
103   
104    depends_lib-append port:gtk3 \
105                       path:include/gtkmacintegration/gtk-mac-bundle.h:gtk-osx-application-common-gtk3
106
107   
108    # force gtk version
109    configure.args-append --with-gtk3 --without-gtk2
110
111    configure.args-append --enable-python=no
112
113    post-destroot {
114        delete ${destroot}${prefix}/include
115        delete ${destroot}${prefix}/lib/pkgconfig/gtk-mac-integration.pc
116        delete ${destroot}${prefix}/share/strings
117    }
118}
119
120subport gtk-osx-application-common-gtk3 {
121    set gtk_version gtk3
122   
123    depends_lib-append port:gtk3
124
125   
126    # force gtk version
127    configure.args-append --with-gtk3 --without-gtk2
128
129    configure.args-append --enable-python=no
130
131    post-destroot {
132        delete ${destroot}${prefix}/lib
133        delete ${destroot}${prefix}/share/gir-1.0
134    }
135}
136
137subport gtk-osx-application-gtk2 {
138    set gtk_version gtk2
139
140    depends_lib-append port:gtk2 \
141                       path:include/gtkmacintegration/gtk-mac-bundle.h:gtk-osx-application-common-gtk2
142
143    # force gtk version to 2.0
144    configure.args-append --with-gtk2 --without-gtk3  --disable-introspection
145
146    configure.args-append --enable-python=no
147
148    post-destroot {
149        delete ${destroot}${prefix}/include
150        delete ${destroot}${prefix}/lib/pkgconfig/gtk-mac-integration.pc
151        delete ${destroot}${prefix}/share/strings
152    }
153}
154
155subport gtk-osx-application-common-gtk2 {
156    set gtk_version gtk2
157
158    depends_lib-append port:gtk2
159
160    # force gtk version to 2.0
161    configure.args-append --with-gtk2 --without-gtk3 --disable-introspection
162
163    configure.args-append --enable-python=no
164
165    post-destroot {
166        delete ${destroot}${prefix}/lib
167    }
168}
169
170configure.ccache        no
171configure.cmd-append    --libdir=${prefix}/lib --includedir=${prefix}/include
172
173patchfiles-append       patch-bindings-python-gtkmacintegration-Makefile-in.diff \
174                        patch-bindings-python-gtk_osxapplication-Makefile-in.diff
175
176livecheck.type          gnome
177livecheck.name          ${myname}
Note: See TracBrowser for help on using the repository browser.