summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-12-17 17:25:01 +0000
committerRichard Hughes <richard@hughsie.com>2017-12-17 17:25:01 +0000
commit042434fc5a2e8a1d60e6309c627e27515954bd08 (patch)
tree8d73925af98c606b79f87abfdf0bde4b6230e6c7
parent6b940d967be1df460fbc60fa24925080abd6393b (diff)
downloadappstream-glib-wip/hughsie/new-style-meson-args.tar.gz
Do not use an 'enable' prefix for meson argumentswip/hughsie/new-style-meson-args
-rw-r--r--.travis.yml6
-rw-r--r--README.md57
-rw-r--r--client/meson.build2
-rwxr-xr-xconfigure36
-rwxr-xr-xcontrib/ci/build_and_test.sh4
-rw-r--r--contrib/libappstream-glib.spec.in6
-rw-r--r--data/meson.build6
-rw-r--r--data/tests/meson.build2
-rw-r--r--docs/meson.build2
-rw-r--r--libappstream-builder/meson.build12
-rw-r--r--libappstream-builder/plugins/meson.build2
-rw-r--r--libappstream-glib/meson.build6
-rw-r--r--meson.build14
-rw-r--r--meson_options.txt18
14 files changed, 84 insertions, 89 deletions
diff --git a/.travis.yml b/.travis.yml
index af284c0..be15307 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,6 @@ before_script:
- docker build -t appstream-glib-debian-stretch -f contrib/ci/Dockerfile-debian-stretch .
script:
- - docker run -t -v `pwd`:/build appstream-glib-fedora-25 ./contrib/ci/build_and_test.sh -Denable-rpm=true -Denable-dep11=false
- # ideally Denable-dep11=true but meson is too old
- - docker run -t -v `pwd`:/build appstream-glib-debian-stretch ./contrib/ci/build_and_test.sh -Denable-rpm=false -Denable-dep11=false
+ - docker run -t -v `pwd`:/build appstream-glib-fedora-25 ./contrib/ci/build_and_test.sh -Drpm=true -Ddep11=false
+ # ideally Ddep11=true but meson is too old
+ - docker run -t -v `pwd`:/build appstream-glib-debian-stretch ./contrib/ci/build_and_test.sh -Drpm=false -Ddep11=false
diff --git a/README.md b/README.md
index bd2d4ca..0887408 100644
--- a/README.md
+++ b/README.md
@@ -25,13 +25,14 @@ To install the libappstream-glib library you either need to install the
`libappstream-glib` package from your distributor, or you can build a local
copy. To do the latter just do:
- dnf install automake autoconf libtool glib-devel docbook-utils \
- gtk-doc gobject-introspection-devel rpm-devel \
- gtk3-devel sqlite-devel libsoup-devel gettext-devel \
- libarchive-devel libyaml-devel
- ./autogen.sh
- make
- make install
+ dnf install docbook-utils gcab gettext-devel glib-devel \
+ gobject-introspection-devel gperf gtk-doc gtk3-devel \
+ libarchive-devel libgcab-devel libsoup-devel \
+ libstemmer-devel libuuid-devel libyaml-devel \
+ meson rpm-devel sqlite-devel
+ mkdir build && cd build
+ meson .. --prefix=/opt -Dbuilder=false
+ ninja
Hacking
-------
@@ -56,7 +57,7 @@ and any new translations will be merged back to the project source code.
Please use [https://www.transifex.com/projects/p/appstream-glib/](https://www.transifex.com/projects/p/appstream-glib/) to contribute translations,
rather than sending pull requests.
-appstream-builder
+AppStream-Builder
=================
appstream-builder is a tool that allows us to create AppStream metadata from a
@@ -77,23 +78,26 @@ What this tool does:
merged into single applications. This is how fonts are collected.
* The `AsbApplication` objects are serialized to XML and written to a
compressed archive.
- * Any application icons or screenshots referenced are written to a .tar archive
-.
+ * Any application icons or screenshots referenced are written to a .tar archive.
Getting Started
------------
+---------------
To run appstream-builder you either need to install the package containing the
binary and data files, or you can build a local copy. To do the latter just do:
- dnf install automake autoconf libtool rpm-devel \
- gtk3-devel sqlite-devel libsoup-devel
- ./autogen.sh
- make
+ dnf install docbook-utils gcab gettext-devel glib-devel \
+ gobject-introspection-devel gperf gtk-doc gtk3-devel \
+ libarchive-devel libgcab-devel libsoup-devel \
+ libstemmer-devel libuuid-devel libyaml-devel \
+ meson rpm-devel sqlite-devel rpm-devel
+ mkdir build && cd build
+ meson .. --prefix=/opt -Dbuilder=true
+ ninja
To actually run the extractor you can do:
- ./appstream-builder --verbose \
+ ./client/appstream-builder --verbose \
--max-threads=8 \
--log-dir=/tmp/logs \
--packages-dir=/mnt/archive/Megarpms/21/Packages \
@@ -128,28 +132,18 @@ them with the rest of the metadata you ship (e.g. in the same directory as
/tmp/asb-md/appstream-icons.tar.gz \
/path/to/repodata/
-For Fedora 20 and 21, you have to actually install these files, so you can do
-something like this in the megarpms-release.spec file:
+You can then do something like this in the megarpms-release.spec file:
Source1: http://www.megarpms.org/temp/megarpms-20.xml.gz
Source2: http://www.megarpms.org/temp/megarpms-20-icons.tar.gz
%install
- mkdir -p %{buildroot}%{_datadir}/app-info/xmls
- cp %{SOURCE1} %{buildroot}%{_datadir}/app-info/xmls
- mkdir -p %{buildroot}%{_datadir}/app-info/icons/megarpms-20
- tar xvzf %{SOURCE2}
- cd -
-
-or, if your distro ships a new enough libappstream-glib:
-
- %install
DESTDIR=%{buildroot} appstream-util install %{SOURCE1} %{SOURCE2}
This ensures that gnome-software can access both data files when starting up.
What is an application
------------
+----------------------
Applications are defined in the context of AppStream as such:
@@ -159,7 +153,7 @@ amer.c)
and includes an AppData file
Guidelines for applications
------------
+---------------------------
These guidelines explain how we filter applications from a package set.
@@ -202,7 +196,8 @@ The current rules of inclusion are thus:
* Desktop files **SHOULD** include translations
Guidelines for fonts
------------
+--------------------
+
* Fonts **MUST** have a valid MetaInfo file installed to /usr/share/appdata
* Fonts packaged in multiple packages **SHOULD** have multiple MetaInfo files
* Fonts families **SHOULD** only have one description section
@@ -211,6 +206,6 @@ nds>`
* MetaInfo files **SHOULD** include translations where possible
License
-----
+-------
LGPLv2+
diff --git a/client/meson.build b/client/meson.build
index 57b6b2f..d520508 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -1,6 +1,6 @@
as_util_cargs = ['-DG_LOG_DOMAIN="As"']
-if get_option('enable-builder')
+if get_option('builder')
appstream_builder = executable(
'appstream-builder',
sources : 'as-builder.c',
diff --git a/configure b/configure
index 3b5cc84..d03c964 100755
--- a/configure
+++ b/configure
@@ -67,24 +67,24 @@ while (($# > 0)); do
--libdir) read_arg libdir "$@" || shift;;
--mandir) read_arg mandir "$@" || shift;;
--includedir) read_arg includedir "$@" || shift;;
- --enable-gtk-doc) enable_docs='-Denable-gtk-doc=true';;
- --disable-gtk-doc) enable_docs='-Denable-gtk-doc=false';;
- --enable-stemmer) enable_stemmer='-Denable-stemmer=true';;
- --disable-stemmer) enable_stemmer='-Denable-stemmer=false';;
- --enable-dep11) enable_dep11='-Denable-dep11=true';;
- --disable-dep11) enable_dep11='-Denable-dep11=false';;
- --enable-man) enable_man='-Denable-man=true';;
- --disable-man) enable_man='-Denable-man=false';;
- --enable-rpm) enable_rpm='-Denable-rpm=true';;
- --disable-rpm) enable_rpm='-Denable-rpm=false';;
- --enable-alpm) enable_alpm='-Denable-alpm=true';;
- --disable-alpm) enable_alpm='-Denable-alpm=false';;
- --enable-builder) enable_builder='-Denable-builder=true';;
- --disable-builder) enable_builder='-Denable-builder=false';;
- --enable-fonts) enable_fonts='-Denable-fonts=true';;
- --disable-fonts) enable_fonts='-Denable-fonts=false';;
- --enable-introspection) enable_introspection='';;
- --disable-introspection) enable_introspection='-Ddisable_introspection=true';;
+ --enable-gtk-doc) enable_docs='-Dgtk-doc=true';;
+ --disable-gtk-doc) enable_docs='-Dgtk-doc=false';;
+ --enable-stemmer) enable_stemmer='-Dstemmer=true';;
+ --disable-stemmer) enable_stemmer='-Dstemmer=false';;
+ --enable-dep11) enable_dep11='-Ddep11=true';;
+ --disable-dep11) enable_dep11='-Ddep11=false';;
+ --enable-man) enable_man='-Dman=true';;
+ --disable-man) enable_man='-Dman=false';;
+ --enable-rpm) enable_rpm='-Drpm=true';;
+ --disable-rpm) enable_rpm='-Drpm=false';;
+ --enable-alpm) enable_alpm='-Dalpm=true';;
+ --disable-alpm) enable_alpm='-Dalpm=false';;
+ --enable-builder) enable_builder='-Dbuilder=true';;
+ --disable-builder) enable_builder='-Dbuilder=false';;
+ --enable-fonts) enable_fonts='-Dfonts=true';;
+ --disable-fonts) enable_fonts='-Dfonts=false';;
+ --enable-introspection) enable_introspection='-Dintrospection=true';;
+ --disable-introspection) enable_introspection='-Dintrospection=false';;
*) echo -e "\e[1;33mINFO\e[0m: Ignoring unknown option '$1'";;
esac
shift
diff --git a/contrib/ci/build_and_test.sh b/contrib/ci/build_and_test.sh
index 6200f62..a5a4388 100755
--- a/contrib/ci/build_and_test.sh
+++ b/contrib/ci/build_and_test.sh
@@ -4,8 +4,8 @@ set -e
mkdir -p build && cd build
rm * -rf
meson .. \
- -Denable-gtk-doc=true \
- -Denable-stemmer=true $@
+ -Dgtk-doc=true \
+ -Dstemmer=true $@
ninja -v
ninja test -v
DESTDIR=/tmp/install-ninja ninja install
diff --git a/contrib/libappstream-glib.spec.in b/contrib/libappstream-glib.spec.in
index 97e38bd..335d73c 100644
--- a/contrib/libappstream-glib.spec.in
+++ b/contrib/libappstream-glib.spec.in
@@ -87,9 +87,9 @@ GLib headers and libraries for appstream-builder.
%build
%meson \
- -Denable-gtk-doc=true \
- -Denable-stemmer=true \
- -Denable-dep11=false
+ -Dgtk-doc=true \
+ -Dstemmer=true \
+ -Ddep11=false
%meson_build
%install
diff --git a/data/meson.build b/data/meson.build
index ccc3273..42e0346 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -5,7 +5,7 @@ install_data('appdata-xml.m4', install_dir : 'share/aclocal')
install_data('appstream-xml.m4', install_dir : 'share/aclocal')
install_data('appstream-util', install_dir : 'share/bash-completion/completions')
-if get_option('enable-builder')
+if get_option('builder')
install_data('appstream-builder', install_dir : 'share/bash-completion/completions')
endif
@@ -13,7 +13,7 @@ install_data('appdata.its', install_dir : 'share/gettext/its')
install_data('appdata.loc', install_dir : 'share/gettext/its')
xsltproc = find_program('xsltproc', required : false)
-if get_option('enable-man') and xsltproc.found()
+if get_option('man') and xsltproc.found()
custom_target('appstream-util-man',
input: 'appstream-util.xml',
output: 'appstream-util.1',
@@ -50,7 +50,7 @@ if get_option('enable-man') and xsltproc.found()
'@INPUT@'
]
)
- if get_option('enable-builder')
+ if get_option('builder')
custom_target('appstream-builder-man',
input: 'appstream-builder.xml',
output: 'appstream-builder.1',
diff --git a/data/tests/meson.build b/data/tests/meson.build
index c4b87b0..2803c34 100644
--- a/data/tests/meson.build
+++ b/data/tests/meson.build
@@ -1,4 +1,4 @@
-if get_option('enable-builder')
+if get_option('builder')
firmware200 = custom_target('firmware-2.0.0',
output : 'colorhug-als-2.0.0.cab',
input : [
diff --git a/docs/meson.build b/docs/meson.build
index 7827d92..70ba8a9 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,3 +1,3 @@
-if get_option('enable-gtk-doc')
+if get_option('gtk-doc')
subdir('api')
endif
diff --git a/libappstream-builder/meson.build b/libappstream-builder/meson.build
index 55f0868..b59cc56 100644
--- a/libappstream-builder/meson.build
+++ b/libappstream-builder/meson.build
@@ -13,15 +13,15 @@ deps = [
soup,
]
-if get_option('enable-dep11')
+if get_option('dep11')
deps = deps + [yaml]
endif
-if get_option('enable-rpm')
+if get_option('rpm')
deps = deps + [rpm]
endif
-if get_option('enable-alpm')
+if get_option('alpm')
deps = deps + [alpm]
endif
@@ -44,11 +44,11 @@ sources = [
'asb-plugin-loader.c',
]
-if get_option('enable-rpm')
+if get_option('rpm')
sources = sources + ['asb-package-rpm.c']
endif
-if get_option('enable-alpm')
+if get_option('alpm')
sources = sources + ['asb-package-alpm.c']
endif
@@ -128,7 +128,7 @@ asbuilder_introspection_srcs = [
'asb-task.h',
]
-if get_option('enable-introspection')
+if get_option('introspection')
asglib_gir_dep = declare_dependency(sources: asglib_gir)
gnome.generate_gir(asbuilder,
diff --git a/libappstream-builder/plugins/meson.build b/libappstream-builder/plugins/meson.build
index b36729e..542f92f 100644
--- a/libappstream-builder/plugins/meson.build
+++ b/libappstream-builder/plugins/meson.build
@@ -86,7 +86,7 @@ shared_module(
install_dir : plugindir,
)
-if get_option('enable-fonts')
+if get_option('fonts')
shared_module(
'asb_plugin_font',
sources : 'asb-plugin-font.c',
diff --git a/libappstream-glib/meson.build b/libappstream-glib/meson.build
index 04bb50a..7eb1183 100644
--- a/libappstream-glib/meson.build
+++ b/libappstream-glib/meson.build
@@ -14,11 +14,11 @@ deps = [
uuid,
]
-if get_option('enable-dep11')
+if get_option('dep11')
deps += yaml
endif
-if get_option('enable-stemmer')
+if get_option('stemmer')
deps += stemmer
endif
@@ -211,7 +211,7 @@ introspection_sources = [
'as-utils.h',
]
-if get_option('enable-introspection')
+if get_option('introspection')
asglib_gir = gnome.generate_gir(asglib,
sources : introspection_sources,
nsversion : '1.0',
diff --git a/meson.build b/meson.build
index 0ab3a85..4eb7255 100644
--- a/meson.build
+++ b/meson.build
@@ -67,19 +67,19 @@ if libgcab.found()
endif
# builder (default enabled)
-if get_option('enable-builder')
+if get_option('builder')
gtk = dependency('gtk+-3.0')
gmodule = dependency('gmodule-2.0')
gcab = find_program('gcab')
- if get_option('enable-rpm')
+ if get_option('rpm')
rpm = dependency('rpm')
conf.set('HAVE_RPM', 1)
endif
- if get_option('enable-alpm')
+ if get_option('alpm')
alpm = dependency('libalpm')
conf.set('HAVE_ALPM', 1)
endif
- if get_option('enable-fonts')
+ if get_option('fonts')
gdk = dependency('gdk-3.0')
conf.set('HAVE_FONTS', 1)
freetype = dependency('freetype2', version : '>= 9.10.0')
@@ -88,13 +88,13 @@ if get_option('enable-builder')
endif
# support loading yaml files
-if get_option('enable-dep11')
+if get_option('dep11')
yaml = dependency('yaml-0.1')
conf.set('AS_BUILD_DEP11', 1)
endif
# support stemming of search tokens
-if get_option('enable-stemmer')
+if get_option('stemmer')
cc = meson.get_compiler('c')
stemmer = cc.find_library('stemmer')
conf.set('HAVE_LIBSTEMMER', 1)
@@ -124,7 +124,7 @@ subdir('data')
subdir('docs')
subdir('po')
-if get_option('enable-builder')
+if get_option('builder')
# depends on data
subdir('libappstream-builder')
endif
diff --git a/meson_options.txt b/meson_options.txt
index b2d971a..518ed89 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,9 +1,9 @@
-option('enable-dep11', type : 'boolean', value : true, description : 'enable DEP-11')
-option('enable-builder', type : 'boolean', value : true, description : 'enable AppStream builder')
-option('enable-rpm', type : 'boolean', value : true, description : 'enable RPM support')
-option('enable-alpm', type : 'boolean', value : false, description : 'enable ALPM support')
-option('enable-fonts', type : 'boolean', value : true, description : 'enable font support')
-option('enable-stemmer', type : 'boolean', value : true, description : 'enable stemmer support')
-option('enable-man', type : 'boolean', value : true, description : 'generate man pages')
-option('enable-gtk-doc', type : 'boolean', value : false, description : 'generate API reference')
-option('enable-introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
+option('dep11', type : 'boolean', value : true, description : 'enable DEP-11')
+option('builder', type : 'boolean', value : true, description : 'enable AppStream builder')
+option('rpm', type : 'boolean', value : true, description : 'enable RPM support')
+option('alpm', type : 'boolean', value : false, description : 'enable ALPM support')
+option('fonts', type : 'boolean', value : true, description : 'enable font support')
+option('stemmer', type : 'boolean', value : true, description : 'enable stemmer support')
+option('man', type : 'boolean', value : true, description : 'generate man pages')
+option('gtk-doc', type : 'boolean', value : false, description : 'generate API reference')
+option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')