!3 rebuild and sovle compile error

From: @tanyulong2021 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
This commit is contained in:
openeuler-ci-bot 2022-07-18 01:32:40 +00:00 committed by Gitee
commit 149d9bf6c8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 12 deletions

29
gcolor2-0.4-gcc10.patch Normal file
View File

@ -0,0 +1,29 @@
diff -ru gcolor2-0.4.orig/src/callbacks.c gcolor2-0.4/src/callbacks.c
--- gcolor2-0.4.orig/src/callbacks.c 2005-07-12 14:06:12.000000000 -0400
+++ gcolor2-0.4/src/callbacks.c 2020-04-27 10:06:57.988405153 -0400
@@ -12,6 +12,9 @@
#include <string.h>
#include <glib/gprintf.h>
+GtkWidget *gcolor2;
+GtkWidget *menu;
+GdkColor colorvalue;
GtkWidget *savedialog;
gchar *colorname;
static GtkWidget *aboutdialog = NULL;
diff -ru gcolor2-0.4.orig/src/callbacks.h gcolor2-0.4/src/callbacks.h
--- gcolor2-0.4.orig/src/callbacks.h 2005-07-11 19:18:59.000000000 -0400
+++ gcolor2-0.4/src/callbacks.h 2020-04-27 10:05:55.157028236 -0400
@@ -41,9 +41,9 @@
"\302\267 Usability / user interface enhancements\n" \
"\302\267 Code cleanup"
-GtkWidget *gcolor2;
-GtkWidget *menu;
-GdkColor colorvalue;
+extern GtkWidget *gcolor2;
+extern GtkWidget *menu;
+extern GdkColor colorvalue;
enum
{

View File

@ -1,6 +1,6 @@
Name: gcolor2
Version: 0.4
Release: 17%{?dist}
Release: 18
Summary: A simple color selector for GTK+2
License: GPLv2
@ -13,33 +13,34 @@ Patch0: %{name}-0.4-missing-includes.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=716100
# bugs.debian.org/cgi-bin/bugreport.cgi?bug=634606
Patch1: %{name}-0.4-ftbfs.patch
# fix for default -fno-common in GCC10
Patch2: %{name}-0.4-gcc10.patch
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: gtk2-devel perl(XML::Parser) desktop-file-utils
BuildRequires: gtk2-devel
BuildRequires: make
BuildRequires: perl-interpreter
BuildRequires: perl(XML::Parser)
%description
gcolor2 is a simple color selector that was originally based on gcolor,
ported to use GTK+2, and now has a completely new UI.
%prep
%setup -q
%patch0 -p1 -b .missing
%patch1 -p1 -b .ftbfs
%autosetup -p1
# make sure path to icon is correct
sed -i 's!/usr/share!%{_datadir}!' %{SOURCE1}
%build
%configure
make %{?_smp_mflags}
%make_build
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL="install -p"
desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications \
%{SOURCE1}
%make_install
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
@ -50,6 +51,8 @@ desktop-file-install \
%{_datadir}/applications/%{name}.desktop
%changelog
* Mon Jun 13 2022 tanyulong <tanyulong@kylinos.cn> - 0.4-18
- rebuild and solve compile error
* Thu Jan 31 2019 iSoft <isoft@isoft-linux.com> - 0.4-17
- Rebuilt by iSoft for iSoft