mandir1 = join_paths(datadir, 'man', 'man1')
podir = join_paths(meson.source_root(), 'po')
+scriptsdir = join_paths(meson.source_root(), 'scripts')
summary({'gq_appdir': gq_appdir,
'gq_bindir': gq_helpdir,
add_project_arguments('-DGETTEXT_PACKAGE="geeqie"', language:'c')
i18n.gettext(meson.project_name(), args : ['--keyword=N_', '--from-code=UTF-8'])
+
+# Create the list of translators for the About - Credits dialog
+po_sources = files([
+ 'ar.po',
+ 'be.po',
+ 'bg.po',
+ 'ca.po',
+ 'cs.po',
+ 'da.po',
+ 'de.po',
+ 'el.po',
+ 'en_GB.po',
+ 'eo.po',
+ 'es.po',
+ 'et.po',
+ 'eu.po',
+ 'fi.po',
+ 'fr.po',
+ 'hu.po',
+ 'id.po',
+ 'it.po',
+ 'ja.po',
+ 'ko.po',
+ 'nb.po',
+ 'nl.po',
+ 'pl.po',
+ 'pt_BR.po',
+ 'ro.po',
+ 'ru.po',
+ 'sk.po',
+ 'sl.po',
+ 'sr@latin.po',
+ 'sr.po',
+ 'sv.po',
+ 'th.po',
+ 'tlh.po',
+ 'tr.po',
+ 'uk.po',
+ 'vi.po',
+ 'zh_CN.po',
+ 'zh_TW.po'
+])
+
+po_source_list = ''
+foreach name : po_sources
+ po_source_list = po_source_list + meson.source_root() + '/' + '@0@'.format(name) + '\n'
+endforeach
+
+translators_sh = join_paths(scriptsdir, 'translators.sh')
+
+translator_resources = custom_target('translator_resources',
+ input : ['locales.txt', 'translators.gresource.xml'],
+ output : ['translators.h', 'translators.c'],
+ command : [translators_sh, '@PRIVATE_DIR@', po_source_list, meson.current_build_dir() , '@INPUT0@', '@INPUT1@'])
+
+project_sources += translator_resources
<gresources>
<gresource prefix="/org/geeqie/credits">
- <file>authors</file>
<file>translators</file>
</gresource>
</gresources>
#**********************************************************************
## @file
-## @brief Generate a list of people who have made commits to the repository.
+## @brief Generate lists of people who have made commits to the repository.
##
-## This list will be displayed in the About - Credits dialog.
+## The lists will be displayed in the About - Credits dialog.
##
+## $1 Meson PRIVATE_DIR \n
+## $2 Meson current_build_dir \n
+## $3 running_from_git - "true" or "false" \n
+## $4 gresource.xml \n
+##
+
+mkdir -p "$1"
-if [ "$2" = "running_from_git" ]
+if [ "$3" = "true" ]
then
git log --pretty=format:"%an <%ae>" | sed 's/<>//' | sort | uniq --count | sort --general-numeric-sort --reverse --stable --key 1,1 | cut --characters 1-8 --complement > "$1"/authors
printf "\n\0" >> "$1"/authors
else
printf "List of authors not available\n\0" > "$1"/authors
fi
+
+glib-compile-resources --generate-header --sourcedir="$1" --target="$2"/authors.h "$4"
+glib-compile-resources --generate-source --sourcedir="$1" --target="$2"/authors.c "$4"
#**********************************************************************
## @file
-## @brief Generate a list of people who have contributed translations.
+## @brief Generate lists of people who have made commits to the repository.
##
-## This list will be displayed in the About - Credits dialog.
+## The lists will be displayed in the About - Credits dialog.
##
-## It is expected that the .po files have a list of translators preceded
-## by the line "# Translators:" and terminated by a line containing only "#"
+## $1 Meson PRIVATE_DIR \n
+## $2 po source list \n
+## $3 Meson current_build_dir \n
+## $4 locales.txt \n
+## $5 gresource.xml \n
##
+## It is expected that the .po files have a list of translators in the form: \n
+## \# Translators: \n
+## \# translator1_name <translator1 email> \n
+## \# translator2_name <translator2 email> \n
+## \#
-for file in "$1"/po/*.po
+mkdir -p "$1"
+
+printf %s "$2" | while read -r file
do
base=$(basename "$file")
locale=${base%.po}
- awk '$1 == "'"$locale"'" {print $0}' locales.txt
- awk '$2 ~/Translators:/ {
+
+ printf "\n"
+ awk '$1 == "'"$locale"'" {print $0}' "$4"
+ awk '$0 ~/Translators:/ {
while (1) {
getline $0
if ($0 == "#") {
exit
}
else {
- print substr($0, 3)
+ print $0
}
}
-
print $0
}' "$file"
- printf "\n"
-done > "$2"/translators
-printf "\n\0" >> "$2"/translators
+done > "$1"/translators
+printf "\n\0" >> "$1"/translators
+
+glib-compile-resources --generate-header --sourcedir="$1" --target="$3"/translators.h "$5"
+glib-compile-resources --generate-source --sourcedir="$1" --target="$3"/translators.c "$5"
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ /*
+ * Copyright (C) 2023 The Geeqie Team
+ *
+ * Author: Colin Clark
+ *
+ * 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 of the License, 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+-->
+
+<gresources>
+ <gresource prefix="/org/geeqie/credits">
+ <file>authors</file>
+ </gresource>
+</gresources>
--- /dev/null
+# This file is a part of Geeqie project (https://www.geeqie.org/).
+# Copyright (C) 2008 - 2022 The Geeqie Team
+#
+# 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 of the License, 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
+#
+
+authors_sh = join_paths(scriptsdir, 'authors.sh')
+
+authors_resources = custom_target('authors_resources',
+ input : 'authors.gresource.xml',
+ output : ['authors.h', 'authors.c'],
+ command : [authors_sh, '@PRIVATE_DIR@', meson.current_build_dir() , running_from_git.to_string(), '@INPUT@'])
+
+project_sources += authors_resources
+++ /dev/null
-# This file is a part of Geeqie project (https://www.geeqie.org/).
-# Copyright (C) 2008 - 2022 The Geeqie Team
-#
-# 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 of the License, 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
-#
-
-if running_from_git
- run_command(find_program('authors.sh'), meson.current_build_dir(), 'running_from_git', check : false)
-else
- run_command(find_program('authors.sh'), meson.current_build_dir(), '', check : false)
-endif
-
-run_command(find_program('translators.sh'), meson.source_root(), meson.current_build_dir(), check : false)
-
-message(meson.current_build_dir())
-source_string = '--sourcedir=' + meson.current_build_dir()
-
-target_string = '--target=' + meson.current_build_dir() + '/credits.h'
-credits_resources_h = custom_target('credits_resources_h',
- input : 'credits.gresource.xml',
- output : 'credits.h',
- command : [glib_compile_resources, '--generate-header', source_string,target_string, '@INPUT@'])
-
-target_string = '--target=' + meson.current_build_dir() + '/credits.c'
-credits_resources_c = custom_target('credits_resources_c',
- input : 'credits.gresource.xml',
- output : 'credits.c',
- command : [glib_compile_resources, '--generate-source', target_string, source_string, '@INPUT@'])
-
-project_sources += credits_resources_h
-project_sources += credits_resources_c
project_sources += main_sources
+subdir('authors')
subdir('icons')
subdir('pan-view')
subdir('view-file')
-subdir('credits')
gqmarshal = gnome.genmarshal('gq-marshal', prefix : 'gq_marshal', sources : 'gq-marshal.list')
project_sources += gqmarshal[0]
#include "bar-keywords.h"
#include "cache.h"
-#include "credits.h"
-#include "credits.c"
+//~ #include "authors.h"
+//~ #include "authors.c"
+//~ #include "translators.h"
+//~ #include "translators.c"
#include "editors.h"
#include "filedata.h"
#include "filefilter.h"
}
g_free(timezone_path);
- credits_resource = credits_get_resource();
-
authors_path = g_build_filename(GQ_RESOURCE_PATH_CREDITS, "authors", NULL);
- in_stream_authors = g_resource_open_stream(credits_resource, authors_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+ in_stream_authors = g_resources_open_stream(authors_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
data_stream = g_data_input_stream_new(in_stream_authors);
translators_path = g_build_filename(GQ_RESOURCE_PATH_CREDITS, "translators", NULL);
- g_resource_get_info(credits_resource, translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, &size, &flags, NULL);
+ g_resources_get_info(translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, &size, &flags, NULL);
- in_stream_translators = g_resource_open_stream(credits_resource, translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+ in_stream_translators = g_resources_open_stream(translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
translators = static_cast<gchar *>(g_malloc0(size));
g_input_stream_read_all(in_stream_translators, translators, size, &bytes_read, NULL, NULL);
g_input_stream_close(in_stream_translators, NULL, NULL);