libgweather: make cross-compilable again

- Make gobject introspection optional
- Fix homepage
This commit is contained in:
maxice8 2018-07-30 13:54:25 -03:00 committed by Enno Boland
parent b8e9fdba75
commit daf4cb5f61
2 changed files with 136 additions and 8 deletions

View file

@ -0,0 +1,127 @@
Source: maxice8
Upstream: not upstreamable in this condition, feel free to tidy it up and send it
Reason: allows cross-compilation
--- libgweather/meson.build
+++ libgweather/meson.build
@@ -65,26 +65,28 @@ lib_libgweather = shared_library('gweather-3',
install: true,
)
-gweather_gir = gnome.generate_gir(lib_libgweather,
- sources: introspection_sources,
- dependencies: deps_libgweather,
- nsversion: '3.0',
- namespace: 'GWeather',
- includes: ['GObject-2.0', 'Gtk-3.0'],
- symbol_prefix: 'gweather',
- identifier_prefix: 'GWeather',
- export_packages: 'gweather-3.0',
- header: 'libgweather/gweather.h',
- extra_args: ['--warn-all'],
- install: true,
-)
-
-libgweather_dep = declare_dependency(
- sources: [gweather_enum_types[1], gweather_gir],
- dependencies: deps_libgweather,
- link_with: lib_libgweather,
- include_directories: root_inc,
-)
+if get_option('enable_gir')
+ gweather_gir = gnome.generate_gir(lib_libgweather,
+ sources: introspection_sources,
+ dependencies: deps_libgweather,
+ nsversion: '3.0',
+ namespace: 'GWeather',
+ includes: ['GObject-2.0', 'Gtk-3.0'],
+ symbol_prefix: 'gweather',
+ identifier_prefix: 'GWeather',
+ export_packages: 'gweather-3.0',
+ header: 'libgweather/gweather.h',
+ extra_args: ['--warn-all'],
+ install: true,
+ )
+
+ libgweather_dep = declare_dependency(
+ sources: [gweather_enum_types[1], gweather_gir],
+ dependencies: deps_libgweather,
+ link_with: lib_libgweather,
+ include_directories: root_inc,
+ )
+endif
if enable_vala
gnome.generate_vapi('gweather-3.0',
@@ -97,31 +99,33 @@ endif
test_cargs = ['-DTEST_SRCDIR="@0@/"'.format(meson.current_source_dir())]
-executable('test_locations',
- ['test_locations.c'],
- c_args: test_cargs,
- dependencies: libgweather_dep,
- install: false)
-executable('test_locations_utc',
- ['test_locations_utc.c'],
- c_args: test_cargs,
- dependencies: libgweather_dep,
- install: false)
-
-exe = executable('test_libgweather',
- ['test_libgweather.c'],
- c_args: test_cargs,
- dependencies: libgweather_dep,
- install: false)
-test('test_named_timezones', exe)
-
-executable('test_metar',
- ['test_metar.c', gweather_c_sources],
- c_args: test_cargs,
- dependencies: libgweather_dep,
- install: false)
-executable('test_sun_moon',
- ['test_sun_moon.c', 'weather-sun.c', 'weather-moon.c'],
- c_args: test_cargs,
- dependencies: libgweather_dep,
- install: false)
+if get_option('test')
+ executable('test_locations',
+ ['test_locations.c'],
+ c_args: test_cargs,
+ dependencies: libgweather_dep,
+ install: false)
+ executable('test_locations_utc',
+ ['test_locations_utc.c'],
+ c_args: test_cargs,
+ dependencies: libgweather_dep,
+ install: false)
+
+ exe = executable('test_libgweather',
+ ['test_libgweather.c'],
+ c_args: test_cargs,
+ dependencies: libgweather_dep,
+ install: false)
+ test('test_named_timezones', exe)
+
+ executable('test_metar',
+ ['test_metar.c', gweather_c_sources],
+ c_args: test_cargs,
+ dependencies: libgweather_dep,
+ install: false)
+ executable('test_sun_moon',
+ ['test_sun_moon.c', 'weather-sun.c', 'weather-moon.c'],
+ c_args: test_cargs,
+ dependencies: libgweather_dep,
+ install: false)
+endif
--- meson_options.txt
+++ meson_options.txt
@@ -8,3 +8,7 @@ option('enable_vala', type: 'combo', choices : ['true', 'false', 'auto'], value
description: 'Install vala bindings')
option('gtk_doc', type: 'boolean', value: false,
description: 'Whether to generate the API reference')
+option('enable_gir', type: 'boolean', value: false,
+ description: 'Whether to generate gobject introspection data')
+option('test', type: 'boolean', value: false,
+ description: 'Whether to build test executables')

View file

@ -1,25 +1,26 @@
# Template file for 'libgweather'
pkgname=libgweather
version=3.28.2
revision=1
revision=2
build_style=meson
configure_args="-Denable_vala=$(vopt_if gir true false)
configure_args="-Denable_vala=$(vopt_if vala true false)
-Denable_gir=$(vopt_if gir true false) -Dtest=false
-Dzoneinfo_dir=/usr/share/zoneinfo"
hostmakedepends="glib-devel gobject-introspection intltool pkg-config
$(vopt_if gir vala-devel)"
hostmakedepends="glib-devel $(vopt_if gir gobject-introspection)
intltool pkg-config $(vopt_if vala vala-devel)"
makedepends="geocode-glib-devel gtk+3-devel libsoup-gnome-devel"
checkdepends="tzdata"
short_desc="GNOME Weather information access library"
maintainer="Enno Boland <gottox@voidlinux.eu>"
license="LGPL-2.1-or-later"
homepage="http://www.gnome.org/"
homepage="https://wiki.gnome.org/Projects/LibGWeather"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
checksum=081ce81653afc614e12641c97a8dd9577c524528c63772407ae2dbcde12bde75
nocross="requires gobject-introspection"
build_options="gir"
build_options="gir vala"
desc_option_vala="Generate bindings for vala"
if [ -z "$CROSS_BUILD" ]; then
build_options_default="gir"
build_options_default="gir vala"
fi
libgweather-devel_package() {