From d0a34c92b6b76ba024eb5aab701f140112f3d78e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Oct 2022 01:21:57 +0300 Subject: [PATCH 23/23] Move metainfo.xml creation from configure to a script See osdn #45616 Signed-off-by: Marko Lindqvist --- Makefile.am | 2 +- bootstrap/Makefile.am | 33 ++++++++++++++++---------- bootstrap/generate_metainfos.sh | 41 +++++++++++++++++++++++++++++++++ configure.ac | 12 +--------- 4 files changed, 64 insertions(+), 24 deletions(-) create mode 100755 bootstrap/generate_metainfos.sh diff --git a/Makefile.am b/Makefile.am index c6ddcccc34..623b3dab20 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ else DSUBDIRS = endif -SUBDIRS = gen_headers $(DSUBDIRS) dependencies utility common tests windows $(SSUBDIRS) $(CSUBDIRS) translations doc tools lua bootstrap +SUBDIRS = gen_headers translations bootstrap $(DSUBDIRS) dependencies utility common tests windows $(SSUBDIRS) $(CSUBDIRS) doc tools lua docs = \ ABOUT-NLS \ diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am index 3e876b2883..f0d8b76dde 100644 --- a/bootstrap/Makefile.am +++ b/bootstrap/Makefile.am @@ -1,5 +1,17 @@ ## Process this file with automake to produce Makefile.in +METAINFO_FILES = \ + org.freeciv.gtk3.metainfo.xml.in \ + org.freeciv.gtk322.metainfo.xml.in \ + org.freeciv.gtk4.metainfo.xml.in \ + org.freeciv.sdl2.metainfo.xml.in \ + org.freeciv.qt.metainfo.xml.in \ + org.freeciv.server.metainfo.xml.in \ + org.freeciv.mp.gtk3.metainfo.xml.in \ + org.freeciv.mp.gtk4.metainfo.xml.in \ + org.freeciv.mp.qt.metainfo.xml.in \ + org.freeciv.ruledit.metainfo.xml.in + ## Automake should distribute config.rpath automatically - and new ## versions probably do. We still support versions that do not, so ## it's in the list below. @@ -14,6 +26,7 @@ EXTRA_DIST = freeciv.project \ generate_gitrev.sh \ generate_langstat.sh \ generate_meson_run.sh \ + generate_metainfos.sh \ langstat_core.txt \ langstat_nations.txt \ langstat_ruledit.txt \ @@ -27,16 +40,7 @@ EXTRA_DIST = freeciv.project \ org.freeciv.mp.gtk4.desktop.in \ org.freeciv.mp.qt.desktop.in \ org.freeciv.ruledit.desktop.in \ - org.freeciv.gtk3.metainfo.xml.in \ - org.freeciv.gtk322.metainfo.xml.in \ - org.freeciv.gtk4.metainfo.xml.in \ - org.freeciv.sdl2.metainfo.xml.in \ - org.freeciv.qt.metainfo.xml.in \ - org.freeciv.server.metainfo.xml.in \ - org.freeciv.mp.gtk3.metainfo.xml.in \ - org.freeciv.mp.gtk4.metainfo.xml.in \ - org.freeciv.mp.qt.metainfo.xml.in \ - org.freeciv.ruledit.metainfo.xml.in \ + $(METAINFO_FILES) \ config.rpath \ Makerules.mk \ langnames.txt @@ -50,6 +54,11 @@ langstat_nations.txt: langstat_ruledit.txt: "$(top_srcdir)/bootstrap/generate_langstat.sh" ruledit "$(top_srcdir)" "$(top_builddir)/bootstrap" -.PHONY: langstat_core.txt langstat_nations.txt langstat_ruledit.txt +metainfo_stamp: $(METAINFO_FILES) + "$(top_srcdir)/bootstrap/generate_metainfos.sh" "$(top_builddir)" + +.PHONY: langstat_core.txt langstat_nations.txt langstat_ruledit.txt metainfo_stamp + +all-local: metainfo_stamp -MAINTAINERCLEANFILES = langstat_core.txt langstat_nations.txt langstat_ruledit.txt +MAINTAINERCLEANFILES = langstat_core.txt langstat_nations.txt langstat_ruledit.txt metainfo_stamp diff --git a/bootstrap/generate_metainfos.sh b/bootstrap/generate_metainfos.sh new file mode 100755 index 0000000000..3d82886004 --- /dev/null +++ b/bootstrap/generate_metainfos.sh @@ -0,0 +1,41 @@ +#!/bin/bash -e +#/*********************************************************************** +# Freeciv - Copyright (C) 2022 The Freeciv project +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +#***********************************************************************/ + +if test "$1" = "-h" || test "$1" = "--help" || test "$1" = "" ; then + echo "Usage: $(basename $0) " + exit +fi + +export BDIR="$(cd ${1} ; pwd)" + +cd "$(dirname $0)" + +# $1 - Base filename +# $2 - Target directory +function create_metainfo_xml() +{ + cp "${1}.metainfo.xml.in" "${BDIR}/${2}/${1}.metainfo.xml" +} + +create_metainfo_xml "org.freeciv.server" "server" +create_metainfo_xml "org.freeciv.gtk3" "client" +create_metainfo_xml "org.freeciv.gtk322" "client" +create_metainfo_xml "org.freeciv.gtk4" "client" +create_metainfo_xml "org.freeciv.qt" "client" +create_metainfo_xml "org.freeciv.sdl2" "client" +create_metainfo_xml "org.freeciv.mp.gtk3" "tools/fcmp" +create_metainfo_xml "org.freeciv.mp.gtk4" "tools/fcmp" +create_metainfo_xml "org.freeciv.mp.qt" "tools/fcmp" +create_metainfo_xml "org.freeciv.ruledit" "tools/ruledit" diff --git a/configure.ac b/configure.ac index 916d33928e..70da5b9d62 100644 --- a/configure.ac +++ b/configure.ac @@ -1910,17 +1910,7 @@ AC_CONFIG_FILES([Makefile tools/fcmp/org.freeciv.mp.gtk3.desktop:bootstrap/org.freeciv.mp.gtk3.desktop.in tools/fcmp/org.freeciv.mp.gtk4.desktop:bootstrap/org.freeciv.mp.gtk4.desktop.in tools/fcmp/org.freeciv.mp.qt.desktop:bootstrap/org.freeciv.mp.qt.desktop.in - tools/ruledit/org.freeciv.ruledit.desktop:bootstrap/org.freeciv.ruledit.desktop.in - client/org.freeciv.gtk3.metainfo.xml:bootstrap/org.freeciv.gtk3.metainfo.xml.in - client/org.freeciv.gtk322.metainfo.xml:bootstrap/org.freeciv.gtk322.metainfo.xml.in - client/org.freeciv.gtk4.metainfo.xml:bootstrap/org.freeciv.gtk4.metainfo.xml.in - client/org.freeciv.sdl2.metainfo.xml:bootstrap/org.freeciv.sdl2.metainfo.xml.in - client/org.freeciv.qt.metainfo.xml:bootstrap/org.freeciv.qt.metainfo.xml.in - server/org.freeciv.server.metainfo.xml:bootstrap/org.freeciv.server.metainfo.xml.in - tools/fcmp/org.freeciv.mp.gtk3.metainfo.xml:bootstrap/org.freeciv.mp.gtk3.metainfo.xml.in - tools/fcmp/org.freeciv.mp.gtk4.metainfo.xml:bootstrap/org.freeciv.mp.gtk4.metainfo.xml.in - tools/fcmp/org.freeciv.mp.qt.metainfo.xml:bootstrap/org.freeciv.mp.qt.metainfo.xml.in - tools/ruledit/org.freeciv.ruledit.metainfo.xml:bootstrap/org.freeciv.ruledit.metainfo.xml.in]) + tools/ruledit/org.freeciv.ruledit.desktop:bootstrap/org.freeciv.ruledit.desktop.in]) AC_CONFIG_FILES([fcgui:bootstrap/fcgui.in], [chmod +x fcgui]) AC_CONFIG_FILES([fcser:bootstrap/fcser.in], [chmod +x fcser]) AC_CONFIG_FILES([fcruleup:bootstrap/fcruleup.in], [chmod +x fcruleup]) -- 2.35.1