diff --git a/mate-calc.spec b/mate-calc.spec index 517bb98..28d113f 100644 --- a/mate-calc.spec +++ b/mate-calc.spec @@ -1,11 +1,16 @@ Name: mate-calc Version: 1.24.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: MATE Desktop calculator License: GPLv2+ URL: http://mate-desktop.org Source0: http://pub.mate-desktop.org/releases/1.24/%{name}-%{version}.tar.xz +# https://github.com/mate-desktop/mate-calc/pull/130 +Patch1: mate-calc_0001-Read-authors-updated-from-mate-calc.about.patch +# https://github.com/mate-desktop/mate-calc/pull/137 +Patch2: mate-calc_0003-mate-calc.desktop-Do-not-collect-the-translation-for.patch + BuildRequires: gtk3-devel BuildRequires: libxml2-devel BuildRequires: mate-common @@ -21,6 +26,9 @@ It uses a multiple precision package to do its arithmetic to give a high degree %prep %autosetup -p1 +# Patch 1 +NOCONFIGURE=1 ./autogen.sh + %build %configure --disable-schemas-compile @@ -50,6 +58,11 @@ desktop-file-install \ %changelog +* Sun Mar 15 2020 Wolfgang Ulbrich - 1.24.0-2 +- add some upstream patches +- update authors in about +- fix pt and pt_BR language menu issues + * Mon Feb 10 2020 Wolfgang Ulbrich - 1.24.0-1 - update to 1.24.0 diff --git a/mate-calc_0001-Read-authors-updated-from-mate-calc.about.patch b/mate-calc_0001-Read-authors-updated-from-mate-calc.about.patch new file mode 100644 index 0000000..9e6e618 --- /dev/null +++ b/mate-calc_0001-Read-authors-updated-from-mate-calc.about.patch @@ -0,0 +1,190 @@ +From b8752ab875f61a43492a3177d249fa883cacdb84 Mon Sep 17 00:00:00 2001 +From: rbuj +Date: Sat, 15 Feb 2020 17:34:52 -0500 +Subject: [PATCH] Read authors (updated) from mate-calc.about + +--- + src/Makefile.am | 1 + + src/mate-calc.about | 2 + + src/math-window.c | 36 +++++++++++--- + src/org.mate.calculator.gresource.xml | 1 + + update-authors.pl | 71 +++++++++++++++++++++++++++ + 5 files changed, 104 insertions(+), 7 deletions(-) + create mode 100644 src/mate-calc.about + create mode 100755 update-authors.pl + +diff --git a/src/Makefile.am b/src/Makefile.am +index b6690a1..df5fccd 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -190,6 +190,7 @@ EXTRA_DIST = \ + buttons-basic.ui \ + buttons-financial.ui \ + buttons-programming.ui \ ++ mate-calc.about \ + mp-enums.c.template \ + mp-enums.h.template \ + org.mate.calculator.gresource.xml \ +diff --git a/src/mate-calc.about b/src/mate-calc.about +new file mode 100644 +index 0000000..ba1664a +--- /dev/null ++++ b/src/mate-calc.about +@@ -0,0 +1,2 @@ ++[About] ++Authors=Abel McClendon ;Adam Erdman ;Alexander von Gluck IV ;Alexei Sorokin ;Allan Nordhøy ;Christopher Fujino ;Clement Lefebvre ;Friedel Wolff ;JP Cimalando ;Klaus Niederkrüger ;Laszlo Boros ;Laurent Napias ;Marcel Dijkstra ;Mark Thomas ;Martin Wimpress ;Michael Terry ;Mike Gabriel ;Nikolay Martynov ;Pablo Barciela ;Perberos ;Piotr Drąg ;Rich Burridge ;Robert Ancell ;Robert Buj ;Sander Sweers ;Scott Balneaves ;Sorokin Alexei ;Stefan Tauner ;Stefano Karapetsas ;Stephen Krauth ;Steve Zesch ;Victor Kareh ;Vlad Orlov ;Wolfgang Ulbrich ;Wu Xiaotian ; +diff --git a/src/math-window.c b/src/math-window.c +index ca31f4e..9030893 100644 +--- a/src/math-window.c ++++ b/src/math-window.c +@@ -221,15 +221,11 @@ static void help_cb(GtkWidget *widget, MathWindow *window) + } + } + ++#define ABOUT_GROUP "About" ++#define EMAILIFY(string) (g_strdelimit ((string), "%", '@')) ++ + static void about_cb(GtkWidget* widget, MathWindow* window) + { +- const char* authors[] = { +- "Rich Burridge ", +- "Robert Ancell ", +- "Klaus Niederkrüger ", +- NULL +- }; +- + const char* documenters[] = { + N_("Sun Microsystems"), + N_("MATE Documentation Team"), +@@ -252,6 +248,31 @@ static void about_cb(GtkWidget* widget, MathWindow* window) + }; + + char *license_trans = g_strjoin ("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL); ++ ++ GKeyFile *key_file; ++ GBytes *bytes; ++ const guint8 *data; ++ gsize data_len; ++ GError *error = NULL; ++ char **authors; ++ gsize n_authors = 0, i; ++ ++ bytes = g_resources_lookup_data ("/org/mate/calculator/ui/mate-calc.about", G_RESOURCE_LOOKUP_FLAGS_NONE, &error); ++ g_assert_no_error (error); ++ ++ data = g_bytes_get_data (bytes, &data_len); ++ key_file = g_key_file_new (); ++ g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error); ++ g_assert_no_error (error); ++ ++ authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL); ++ ++ g_key_file_free (key_file); ++ g_bytes_unref (bytes); ++ ++ for (i = 0; i < n_authors; ++i) ++ authors[i] = EMAILIFY (authors[i]); ++ + const char **p; + + for (p = documenters; *p; ++p) +@@ -274,6 +295,7 @@ static void about_cb(GtkWidget* widget, MathWindow* window) + "logo-icon-name", "accessories-calculator", + NULL); + ++ g_strfreev (authors); + g_free (license_trans); + } + +diff --git a/src/org.mate.calculator.gresource.xml b/src/org.mate.calculator.gresource.xml +index c31c1ba..6766402 100644 +--- a/src/org.mate.calculator.gresource.xml ++++ b/src/org.mate.calculator.gresource.xml +@@ -21,6 +21,7 @@ + buttons-basic.ui + buttons-financial.ui + buttons-programming.ui ++ mate-calc.about + preferences.ui + + +diff --git a/update-authors.pl b/update-authors.pl +new file mode 100755 +index 0000000..4d5ede1 +--- /dev/null ++++ b/update-authors.pl +@@ -0,0 +1,71 @@ ++#!/usr/bin/perl ++=pod ++ ++ update-authors.pl is part of mate-calc. ++ ++ mate-calc 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. ++ ++ mate-calc 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 mate-calc. If not, see . ++ ++=cut ++use strict; ++use warnings; ++ ++sub ReplaceAuthors { ++ my @authors = @_; ++ $_ eq 'Alexander ' and $_ = 'Alexander Ovchinnikov ' for @authors; ++ $_ eq 'bl0ckeduser ' and $_ = 'Gabriel Cormier-Affleck ' for @authors; ++ $_ eq 'Glorf ' and $_ = 'Michał Bień ' for @authors; ++ $_ eq 'hekel ' and $_ = 'Adam Erdman ' for @authors; ++ $_ eq 'infirit ' and $_ = 'Sander Sweers ' for @authors; ++ $_ eq 'Jason Crain ' and $_ = 'Jason Crain ' for @authors; ++ $_ eq 'José Aliste ' and $_ = 'José Aliste ' for @authors; ++ $_ eq 'leigh123linux ' and $_ = 'Leigh Scott ' for @authors; ++ $_ eq 'lyokha ' and $_ = 'Alexey Radkov ' for @authors; ++ $_ eq 'Martin Wimpress ' and $_ = 'Martin Wimpress ' for @authors; ++ $_ eq 'monsta ' and $_ = 'Vlad Orlov ' for @authors; ++ $_ eq 'Monsta ' and $_ = 'Vlad Orlov ' for @authors; ++ $_ eq 'oz123 ' and $_ = 'Oz N Tiram ' for @authors; ++ $_ eq 'Piiit ' and $_ = 'Peter Moser ' for @authors; ++ $_ eq 'rootavish ' and $_ = 'Avishkar Gupta ' for @authors; ++ $_ eq 'rootavish ' and $_ = 'Avishkar Gupta ' for @authors; ++ $_ eq 'raveit ' and $_ = 'Wolfgang Ulbrich ' for @authors; ++ $_ eq 'raveit65 ' and $_ = 'Wolfgang Ulbrich ' for @authors; ++ $_ eq 'raveit65 ' and $_ = 'Wolfgang Ulbrich ' for @authors; ++ $_ eq 'rbuj ' and $_ = 'Robert Buj ' for @authors; ++ $_ eq 'Scott Balneaves ' and $_ = 'Scott Balneaves ' for @authors; ++ $_ eq 'Wolfgang Ulbrich ' and $_ = 'Wolfgang Ulbrich ' for @authors; ++ return @authors; ++} ++ ++sub GetCurrentAuthors { ++ my @authors; ++ open(FILE,"src/mate-calc.about") or die "Can't open src/mate-calc.about""; ++ while () { ++ if (/^Authors=*(.+)$/) { ++ @authors=split(";",$1); ++ } ++ } ++ close FILE; ++ return ReplaceAuthors(@authors); ++} ++ ++sub GetNewAuthors { ++ my @authors = `git log --pretty="%an <%ae>" --since "2012-01-01" -- . "_.h" "_.c" | sort | uniq | sed 's/@/%/g' | sed '/^mate-i18n.*/d'`; ++ chomp @authors; ++ return ReplaceAuthors(@authors); ++} ++ ++my @A = GetCurrentAuthors; ++my @B = GetNewAuthors; ++my @merged = sort { $a cmp $b } keys %{{map {($_ => 1)} (@A, @B)}}; ++print join(';',@merged) . ';'; +-- +2.21.1 + diff --git a/mate-calc_0003-mate-calc.desktop-Do-not-collect-the-translation-for.patch b/mate-calc_0003-mate-calc.desktop-Do-not-collect-the-translation-for.patch new file mode 100644 index 0000000..ebcd470 --- /dev/null +++ b/mate-calc_0003-mate-calc.desktop-Do-not-collect-the-translation-for.patch @@ -0,0 +1,26 @@ +From 7d146957869380f15b7b61f402983201922137c4 Mon Sep 17 00:00:00 2001 +From: rbuj +Date: Mon, 2 Mar 2020 08:53:51 +0100 +Subject: [PATCH 3/3] mate-calc.desktop: Do not collect the translation for + Icon + +--- + data/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index 80db344..f12b6da 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -11,7 +11,7 @@ Utilitiesdir = $(datadir)/applications + Utilities_in_files = mate-calc.desktop.in + Utilities_DATA = $(Utilities_in_files:.desktop.in=.desktop) + $(Utilities_DATA): $(Utilities_in_files) +- $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ ++ $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Name --keyword=GenericName --keyword=Comment --keyword=Keywords --template $< -d $(top_srcdir)/po -o $@ + + man1_MANS = mate-calc.1 mate-calc-cmd.1 + +-- +2.21.1 +