From 8cb53e0d83595f947abc203946d237957c36bb77 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 22 Oct 2022 03:39:32 +0300 Subject: [PATCH 29/29] Move metainfo.xml creation from configure to a script See osdn #45616 Signed-off-by: Marko Lindqvist --- bootstrap/Makefile.am | 14 ++++++++++++-- bootstrap/generate_metainfo.sh | 25 +++++++++++++++++++++++++ configure.ac | 12 +----------- 3 files changed, 38 insertions(+), 13 deletions(-) create mode 100755 bootstrap/generate_metainfo.sh diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am index de9ca55973..4fc75c30f1 100644 --- a/bootstrap/Makefile.am +++ b/bootstrap/Makefile.am @@ -16,6 +16,7 @@ EXTRA_DIST = freeciv.project \ generate_gitrev.sh \ generate_langstat.sh \ generate_meson_run.sh \ + generate_metainfo.sh \ langstat_core.txt \ langstat_nations.txt \ langstat_ruledit.txt \ @@ -94,6 +95,15 @@ 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 +$(metainfofile_DATA) : %.metainfo.xml: %.metainfo.xml.in generate_metainfo.sh + "$(top_srcdir)/bootstrap/generate_metainfo.sh" "$@" "$(top_builddir)/bootstrap" -MAINTAINERCLEANFILES = langstat_core.txt langstat_nations.txt langstat_ruledit.txt +metainfo_stamp: $(metainfofile_DATA) + +.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 metainfo_stamp + +CLEANFILES = $(metainfofile_DATA) diff --git a/bootstrap/generate_metainfo.sh b/bootstrap/generate_metainfo.sh new file mode 100755 index 0000000000..7a1e0292d0 --- /dev/null +++ b/bootstrap/generate_metainfo.sh @@ -0,0 +1,25 @@ +#!/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" = "" || test "$2" = "" ; then + echo "Usage: $(basename $0) " + exit +fi + +export BDIR="$(cd ${2} | exit 1 ; pwd)" + +cd "$(dirname $0)" + +cp "${1}.in" "${BDIR}/${1}" diff --git a/configure.ac b/configure.ac index 4fa608e29b..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 - bootstrap/org.freeciv.gtk3.metainfo.xml:bootstrap/org.freeciv.gtk3.metainfo.xml.in - bootstrap/org.freeciv.gtk322.metainfo.xml:bootstrap/org.freeciv.gtk322.metainfo.xml.in - bootstrap/org.freeciv.gtk4.metainfo.xml:bootstrap/org.freeciv.gtk4.metainfo.xml.in - bootstrap/org.freeciv.sdl2.metainfo.xml:bootstrap/org.freeciv.sdl2.metainfo.xml.in - bootstrap/org.freeciv.qt.metainfo.xml:bootstrap/org.freeciv.qt.metainfo.xml.in - bootstrap/org.freeciv.server.metainfo.xml:bootstrap/org.freeciv.server.metainfo.xml.in - bootstrap/org.freeciv.mp.gtk3.metainfo.xml:bootstrap/org.freeciv.mp.gtk3.metainfo.xml.in - bootstrap/org.freeciv.mp.gtk4.metainfo.xml:bootstrap/org.freeciv.mp.gtk4.metainfo.xml.in - bootstrap/org.freeciv.mp.qt.metainfo.xml:bootstrap/org.freeciv.mp.qt.metainfo.xml.in - bootstrap/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