1 ################################################################################
3 # pygtk.cygclass - functions for building PyGTK and Gnome-Python packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****h* Cygclasses/pygtk.cygclass
28 # The PyGTK project provides a series of bindings for the GTK+ and GNOME
29 # libraries. APIs are defined in .defs files, from which C binding code
30 # is generated with PYGTK_CODEGEN. These bindings allow full-featured
31 # GNOME programs to be written in the Python language.
33 # This package provides definitions and functions for building PyGTK bindings.
35 # These bindings are limited to both GTK+ 2 and Python 2, both of which are
36 # in long-term maintenance mode. For support of GTK+ 3 and/or Python 3,
37 # GObject Introspection (python*-gi plus girepository-* packages) must be used
38 # instead. Therefore, these bindings are considered obsolete.
40 # gnome.org.cygclass (unless mate.cygclass has been inherit()ed), python.cygclass
43 warning "pygtk.cygclass: pygtk bindings are limited to got gtk+2 and python2 and considered obsolete."
47 # for packages which provide pygtk bindings together with the C lib.
50 gnome-python|nautilus-python)
51 pygtk_mod=${PN/-python}
54 gnome-python-desktop|gnome-python-extras)
55 pygtk_mod=${PN/-python-/ }
59 pygtk_mod="gstreamer 0.10"
63 pygtk_mod=${PN#python-}
64 ORIG_PN=${ORIG_PN:-${PN}}
67 pygtk_mod=${PN#python-}
68 ORIG_PN=${ORIG_PN:-py${pygtk_mod%2*}}
72 inherited mate || inherit gnome.org
75 #****d* pygtk.cygclass/PYGTK_INCLUDEDIR
77 # Directory containing PyGTK C headers.
79 PYGTK_INCLUDEDIR="/usr/include/pygtk-2.0"
81 #****d* pygtk.cygclass/PYGTK_LIBDIR
83 # Installation path for PyGTK bindings.
85 PYGTK_LIBDIR="${PYTHON_SITELIB}/gtk-2.0"
87 #****d* pygtk.cygclass/PYGTK_DATADIR
89 # Installation path for *.defs and *-arg-types.py API files.
91 PYGTK_DATADIR="/usr/share/pygtk/2.0"
93 #****d* pygtk.cygclass/PYGTK_CODEGEN
95 # Absolute path to the PyGTK C code generator.
97 if check_prog pygobject-codegen-2.0
99 export PYGTK_CODEGEN="/usr/bin/pygobject-codegen-2.0"
102 #****o* pygtk.cygclass/CATEGORY (pygtk)
106 #****o* pygtk.cygclass/SUMMARY (pygtk)
108 SUMMARY="Python ${pygtk_mod} bindings"
110 #****o* pygtk.cygclass/HOMEPAGE (pygtk)
112 HOMEPAGE="https://pygobject.readthedocs.io/"
117 #****C* pygtk.cygclass/pygtk_compile
119 # pygtk_compile [OPTIONS]
121 # Configures the package with cygconf, passing any arguments it receives,
122 # then compiles the package with cygmake.
127 gnome2_configure "${@}"
131 cygmake LIBS="-no-undefined ${LIBPYTHON}"
134 #****o* pygtk.cygclass/src_compile (pygtk)
140 ACLOCAL_FLAGS='-I m4'
153 readonly -f pygtk_compile