1 ################################################################################
3 # ruby-gnome2.cygclass - functions for building Ruby GNOME 2.x bindings
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 #****ih* Cygclasses/ruby-gnome2.cygclass
26 # [RUBY_GNOME2_MODULES="..."]
29 # The Ruby-GNOME project provides Ruby bindings for the GLib, GTK+, and GNOME
30 # libraries, allowing full-fledged GNOME programs to be written in the Ruby
31 # programming language. Source packages are based on the Ruby extconf.rb
32 # system with some additions to handle the unique requirements of inter-module
33 # dependencies and pkg-config usage. A few third-party modules are also
34 # available which use the same system to bind libraries not yet covered by
35 # the Ruby-GNOME project.
37 # This cygclass builds both official and third-party Ruby-GNOME2 binding packages.
39 # Ruby-GNOME packages may now be built from gems with rubygem.cygclass.
40 # Therefore, this cygclass is deprecated and may be removed in the future.
47 __ruby_gnome2_get_module_dir() {
52 error "$FUNCNAME: too many arguments"
56 atk|pango|gnomevfs|gtkglext|gtkhtml2|gtkmozembed|gtksourceview|\
57 gtksourceview2|poppler|vte|libgda|goocanvas)
59 glib2|gtk2|libglade2|bonobo2|bonoboui2|libart2|gnomecanvas2|gconf2|\
60 gnome2|gnomeprint2|gnomeprintui2|rsvg2)
79 #****iv* ruby-gnome2.cygclass/RUBY_GNOME2_MODULES
81 # When building the official ruby-gnome2-all source package, RUBY_GNOME2_MODULES
82 # must be set to a whitespace-separated list of binding modules to be built.
83 # Third-party packages are assumed to contain a single binding to be built.
88 if ! defined RUBY_GNOME2_MODULES
90 error "ruby-gnome2: RUBY_GNOME2_MODULES undefined"
93 for _mod in ${RUBY_GNOME2_MODULES}
95 rbg2_dir+="$(__ruby_gnome2_get_module_dir ${_mod}) "
98 ORIG_PN="ruby-gnome2-all"
101 # external package, be sure to override SRC_URI
103 ORIG_PN=${ORIG_PN:-${PN}}
104 RUBY_GNOME2_MODULES=${rbg2_pn}
108 #****io* ruby-gnome2.cygclass/CATEGORY (ruby-gnome2)
112 #****io* ruby-gnome2.cygclass/SUMMARY (ruby-gnome2)
114 SUMMARY="Ruby ${rbg2_pn} bindings"
116 #****io* ruby-gnome2.cygclass/HOMEPAGE (ruby-gnome2)
118 HOMEPAGE="https://ruby-gnome2.osdn.jp/"
123 #****io* ruby-gnome2.cygclass/SRC_URI (ruby-gnome2)
125 # Download location of the Ruby-GNOME2 source package.
127 #****io* ruby-gnome2.cygclass/SVN_URI (ruby-gnome2)
129 # Location of the Ruby-GNOME2 Subversion repository.
131 #****io* ruby-gnome2.cygclass/SVN_REV (ruby-gnome2)
133 # If PV is of the form major.minor.micro.rev, a Subversion snapshot will
134 # be assumed, svn.cygclass will be inherit()ed, and the fourth (rev) component
135 # of PV defined as SVN_REV.
140 SVN_URI="http://ruby-gnome2.svn.sourceforge.net/svnroot/ruby-gnome2/ruby-gnome2/trunk/${rbg2_dir}"
144 http://ruby-gnome2.svn.sourceforge.net/viewvc/*checkout*/ruby-gnome2/ruby-gnome2/trunk/extconf.rb
145 http://ruby-gnome2.svn.sourceforge.net/viewvc/*checkout*/ruby-gnome2/ruby-gnome2/trunk/exec_make.rb
150 SRC_URI="mirror://sourceforge/ruby-gnome2/${ORIG_PN}-${PV/_/-}.tar.gz"
151 SRC_DIR="${ORIG_PN}-${PV/_/-}"
153 *) error "Unknown package version: ${PV}" ;;
156 # WARNING: CAIRO_PATH is supposed to be the ruby-cairo builddir, not
157 # the installed RUBY_VENDORARCH, so this will create a bogus -L flag no
158 # matter what. We compensate by correctly defining LOCAL_LIBS below.
160 # However, be sure that all extconf.rb have_func() calls come BEFORE any
161 # add_depend_package() calls, otherwise the tests will give false negatives
162 # due to linker errors (e.g. unable to find -lruby-cairo).
163 export CAIRO_PATH="${RUBY_VENDORARCH}"
165 #****io* ruby-gnome2.cygclass/MAKEOPTS (ruby-gnome2)
167 # The Ruby-GNOME2 source packages do not support parallel make.
171 #****io* ruby-gnome2.cygclass/DEPS_PATH (ruby-gnome2)
173 # Ruby-GNOME2 modules are unique that they are not only linked against the C
174 # libraries which they bind, but also expose an API to bindings higher up in
175 # the stack which link against them as well. Therefore, DEPS_PATH is set to
176 # catch these inter-module link dependencies.
178 DEPS_PATH="${RUBY_VENDORARCH}"
180 #****iC* ruby-gnome2.cygclass/ruby_gnome2_compile
183 # ruby_gnome2_compile
185 # Configures and compiles the Ruby-GNOME2 bindings specified in
186 # RUBY_GNOME2_MODULES, then generates RI documentation for those bindings.
188 ruby_gnome2_compile() {
191 ${RUBY} extconf.rb --vendor ${rbg2_dir} || error "extconf.rb failed"
193 cygmake cflags="${CFLAGS} ${CPPFLAGS}" LOCAL_LIBS="-L${RUBY_VENDORARCH}"
199 rdoc --force-update --ri --op ${d}/rdoc ${d}/src
201 rdoc --force-update --ri --op ${d}/rdoc ${d}
206 #****iI* ruby-gnome2.cygclass/ruby_gnome2_install
209 # ruby_gnome2_install
211 # Installs the Ruby-GNOME2 bindings specified in RUBY_GNOME2_MODULES, as
212 # well as import libraries for those bindings whose API is used by other
213 # bindings. RI documentation is then installed per the definition of
216 ruby_gnome2_install() {
221 for mod in ${RUBY_GNOME2_MODULES}
223 d=$(__ruby_gnome2_get_module_dir ${mod})
226 cairo|glib2|atk|pango|gtk2|libart2)
227 insinto ${RUBY_VENDORARCH}
228 doins $(find ${d}/ -name '*.so' | sed -e 's|\(.*\)/\(.*\)\.so|\1/libruby-\2.a|')
233 dodoc ${S}/${d}/{COPYING.LIB,ChangeLog,README}
241 for docmod in ${RDOC_MODULE}
245 dodir ${RI_SITEDIR}/${docmod}
246 cp -r ${docmod}/* ${D}${RI_SITEDIR}/${docmod}/
255 #****io* ruby-gnome2.cygclass/src_compile (ruby-gnome2)
264 #****io* ruby-gnome2.cygclass/src_install (ruby-gnome2)
272 readonly -f __ruby_gnome2_get_module_dir ruby_gnome2_compile ruby_gnome2_install