Allow building with deprecated GTK+ symbols

Commit 76b6ce8 added a downstream patch to remove the use of the
deprecated stock items. This however added new strings that the current
avahi tarball doesn't ship translations for, and as such we shouldn't do
it downstream.

Instead, just allow the deprecated GTK+ symbols. The deprecated API and
-Werror should never have been enabled in the tarball builds in the
first place.

https://bugzilla.redhat.com/show_bug.cgi?id=1001676
This commit is contained in:
Kalev Lember 2013-09-21 17:50:11 +02:00
parent 8a6e2baefe
commit b3f4de05e3
4 changed files with 29 additions and 71 deletions

View File

@ -1,49 +0,0 @@
diff -up avahi-0.6.31/avahi-ui/avahi-ui.c.gtk3 avahi-0.6.31/avahi-ui/avahi-ui.c
--- avahi-0.6.31/avahi-ui/avahi-ui.c.gtk3 2011-02-18 12:04:10.251546734 -0600
+++ avahi-0.6.31/avahi-ui/avahi-ui.c 2013-09-19 12:06:45.103980125 -0500
@@ -1032,8 +1032,8 @@ static void domain_button_clicked(GtkBut
gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(p->domain_progress_bar), 0.1);
gtk_box_pack_end(GTK_BOX(vbox2), p->domain_progress_bar, FALSE, FALSE, 0);
- gtk_dialog_add_button(GTK_DIALOG(p->domain_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- p->domain_ok_button = GTK_WIDGET(gtk_dialog_add_button(GTK_DIALOG(p->domain_dialog), GTK_STOCK_OK, GTK_RESPONSE_ACCEPT));
+ gtk_dialog_add_button(GTK_DIALOG(p->domain_dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
+ p->domain_ok_button = GTK_WIDGET(gtk_dialog_add_button(GTK_DIALOG(p->domain_dialog), _("_OK"), GTK_RESPONSE_ACCEPT));
gtk_dialog_set_default_response(GTK_DIALOG(p->domain_dialog), GTK_RESPONSE_ACCEPT);
gtk_widget_set_sensitive(p->domain_ok_button, is_valid_domain_suffix(gtk_entry_get_text(GTK_ENTRY(p->domain_entry))));
@@ -1164,7 +1164,7 @@ static void aui_service_dialog_init(AuiS
gtk_box_pack_end(GTK_BOX(vbox2), p->service_progress_bar, FALSE, FALSE, 0);
p->domain_button = gtk_button_new_with_mnemonic(_("_Domain..."));
- gtk_button_set_image(GTK_BUTTON(p->domain_button), gtk_image_new_from_stock(GTK_STOCK_NETWORK, GTK_ICON_SIZE_BUTTON));
+ gtk_button_set_image(GTK_BUTTON(p->domain_button), gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_BUTTON));
g_signal_connect(p->domain_button, "clicked", G_CALLBACK(domain_button_clicked), d);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, FALSE, TRUE, 0);
gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, TRUE);
diff -up avahi-0.6.31/avahi-ui/bssh.c.gtk3 avahi-0.6.31/avahi-ui/bssh.c
--- avahi-0.6.31/avahi-ui/bssh.c.gtk3 2010-08-25 19:51:39.023153001 -0500
+++ avahi-0.6.31/avahi-ui/bssh.c 2013-09-19 12:14:00.264372035 -0500
@@ -146,19 +146,19 @@ int main(int argc, char*argv[]) {
break;
case COMMAND_SHELL:
- d = aui_service_dialog_new(_("Choose Shell Server"), NULL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CONNECT, GTK_RESPONSE_ACCEPT, NULL);
+ d = aui_service_dialog_new(_("Choose Shell Server"), NULL, _("_Cancel"), GTK_RESPONSE_CANCEL, gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_BUTTON), GTK_RESPONSE_ACCEPT, NULL);
aui_service_dialog_set_browse_service_types(AUI_SERVICE_DIALOG(d), "_rfb._tcp", "_ssh._tcp", NULL);
aui_service_dialog_set_service_type_name(AUI_SERVICE_DIALOG(d), "_rfb._tcp", _("Desktop"));
aui_service_dialog_set_service_type_name(AUI_SERVICE_DIALOG(d), "_ssh._tcp", _("Terminal"));
break;
case COMMAND_VNC:
- d = aui_service_dialog_new(_("Choose VNC server"), NULL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CONNECT, GTK_RESPONSE_ACCEPT, NULL);
+ d = aui_service_dialog_new(_("Choose VNC server"), NULL, _("_Cancel"), GTK_RESPONSE_CANCEL, gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_BUTTON), GTK_RESPONSE_ACCEPT, NULL);
aui_service_dialog_set_browse_service_types(AUI_SERVICE_DIALOG(d), "_rfb._tcp", NULL);
break;
case COMMAND_SSH:
- d = aui_service_dialog_new(_("Choose SSH server"), NULL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CONNECT, GTK_RESPONSE_ACCEPT, NULL);
+ d = aui_service_dialog_new(_("Choose SSH server"), NULL, _("_Cancel"), GTK_RESPONSE_CANCEL, gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_BUTTON), GTK_RESPONSE_ACCEPT, NULL);
aui_service_dialog_set_browse_service_types(AUI_SERVICE_DIALOG(d), "_ssh._tcp", NULL);
break;
}

View File

@ -0,0 +1,22 @@
--- avahi-0.6.31/avahi-ui/Makefile.am.orig 2013-09-21 16:47:28.677659361 +0200
+++ avahi-0.6.31/avahi-ui/Makefile.am 2013-09-21 16:47:34.852520537 +0200
@@ -15,7 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
-AM_CFLAGS=-I$(top_srcdir) -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1
+AM_CFLAGS=-I$(top_srcdir)
# This cool debug trap works on i386/gcc only
AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
--- avahi-0.6.31/configure.ac.orig 2013-09-21 16:46:43.750669413 +0200
+++ avahi-0.6.31/configure.ac 2013-09-21 16:47:02.566246400 +0200
@@ -92,7 +92,7 @@
AC_MSG_CHECKING([whether stack-smashing protection is available])
ssp_old_cflags="$CFLAGS"
ssp_old_ldflags="$LDFLAGS"
- CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
+ CFLAGS="$CFLAGS -fstack-protector-all -fPIC"
LDFLAGS="$LDFLAGS -Wl,-z,defs"
cat confdefs.h > conftest.c
cat >>conftest.c <<_ACEOF

View File

@ -1,13 +0,0 @@
diff -up avahi-0.6.31/configure.ac.no_Werror avahi-0.6.31/configure.ac
--- avahi-0.6.31/configure.ac.no_Werror 2012-02-14 15:44:25.484742099 -0600
+++ avahi-0.6.31/configure.ac 2013-09-20 22:12:40.021968172 -0500
@@ -92,7 +92,7 @@ if test x"$enable_ssp" = x"yes"; then
AC_MSG_CHECKING([whether stack-smashing protection is available])
ssp_old_cflags="$CFLAGS"
ssp_old_ldflags="$LDFLAGS"
- CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
+ CFLAGS="$CFLAGS -fstack-protector-all -fPIC"
LDFLAGS="$LDFLAGS -Wl,-z,defs"
cat confdefs.h > conftest.c
cat >>conftest.c <<_ACEOF
diff -up avahi-0.6.31/configure.no_Werror avahi-0.6.31/configure

View File

@ -64,10 +64,8 @@ Requires(post): systemd-sysv
Source0: http://avahi.org/download/%{name}-%{version}.tar.gz
Patch0: avahi-0.6.30-mono-libdir.patch
# Fix/workaround gtkstock.h deprecation
Patch1: avahi-0.6.31-gtkstock_deprecated.patch
# drop -Werror
Patch2: avahi-0.6.31-no_Werror.patch
# Disable -Werror and remove G*_DISABLE_DEPRECATED definitions
Patch1: avahi-0.6.31-no-deprecations.patch
%description
Avahi is a system which facilitates service discovery on
@ -313,12 +311,9 @@ fashion with mDNS.
%prep
%setup -q
%patch0 -p1 -b .mono-libdir
%if 0%{?fedora} > 20
%patch1 -p1 -b .gtkstock_deprecated
%endif
%patch2 -p1 -b .no_Werror
%patch1 -p1 -b .no_deprecations
# patch2 requires autogen
# patch1 requires autogen
NOCONFIGURE=1 ./autogen.sh
%build
@ -628,6 +623,9 @@ getent passwd avahi-autoipd >/dev/null 2>&1 || useradd \
%endif
%changelog
* Sat Sep 21 2013 Kalev Lember <kalevlember@gmail.com> - 0.6.31-18
- Allow building with deprecated GTK+ symbols (#1001676)
* Fri Sep 20 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.6.31-17
- -libs: %%doc README LICENSE
- drop some explicit -devel deps, rely on automatic pkgconfig deps