From 45d04bb41174ce25d56242908e91a6bbb62c033e871d20be90c72a1f1a0901b7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 23 Jun 2012 20:02:28 +0000 Subject: [PATCH] Resolve compile failure due to -Werror on openSUSE_12.2 OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/putty?expand=0&rev=4 --- putty-01-werror.diff | 91 +++++++++++++++++++++++++++++++++++++++ putty-02-remove-gtk1.diff | 17 ++++++++ putty.spec | 8 +++- 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 putty-01-werror.diff create mode 100644 putty-02-remove-gtk1.diff diff --git a/putty-01-werror.diff b/putty-01-werror.diff new file mode 100644 index 0000000..ce610fd --- /dev/null +++ b/putty-01-werror.diff @@ -0,0 +1,91 @@ +--- + macosx/Makefile | 2 +- + mkfiles.pl | 6 +++--- + unix/Makefile.gtk | 2 +- + unix/Makefile.ux | 2 +- + unix/configure.ac | 2 +- + 5 files changed, 7 insertions(+), 7 deletions(-) + +Index: putty-0.62/macosx/Makefile +=================================================================== +--- putty-0.62.orig/macosx/Makefile ++++ putty-0.62/macosx/Makefile +@@ -104,7 +104,7 @@ + # + CC = $(TOOLPATH)gcc + +-CFLAGS = -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ ++CFLAGS = -O2 -Wall -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ + -I../macosx/ + MLDFLAGS = -framework Cocoa + ULDFLAGS = +Index: putty-0.62/mkfiles.pl +=================================================================== +--- putty-0.62.orig/mkfiles.pl ++++ putty-0.62/mkfiles.pl +@@ -960,7 +960,7 @@ if (defined $makefiles{'gtk'}) { + "\n". + "unexport CFLAGS # work around a weird issue with krb5-config\n". + "\n". +- &splitline("CFLAGS = -O2 -Wall -Werror -g " . ++ &splitline("CFLAGS = -O2 -Wall -g " . + (join " ", map {"-I$dirpfx$_"} @srcdirs) . + " \$(shell \$(GTK_CONFIG) --cflags)"). + " -D _FILE_OFFSET_BITS=64\n". +@@ -1039,7 +1039,7 @@ if (defined $makefiles{'unix'}) { + "\n". + "unexport CFLAGS # work around a weird issue with krb5-config\n". + "\n". +- &splitline("CFLAGS = -O2 -Wall -Werror -g " . ++ &splitline("CFLAGS = -O2 -Wall -g " . + (join " ", map {"-I$dirpfx$_"} @srcdirs)). + " -D _FILE_OFFSET_BITS=64\n". + "ULDFLAGS = \$(LDFLAGS)\n". +@@ -1236,7 +1236,7 @@ if (defined $makefiles{'osx'}) { + print + "CC = \$(TOOLPATH)gcc\n". + "\n". +- &splitline("CFLAGS = -O2 -Wall -Werror -g " . ++ &splitline("CFLAGS = -O2 -Wall -g " . + (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". + "MLDFLAGS = -framework Cocoa\n". + "ULDFLAGS =\n". +Index: putty-0.62/unix/Makefile.gtk +=================================================================== +--- putty-0.62.orig/unix/Makefile.gtk ++++ putty-0.62/unix/Makefile.gtk +@@ -119,7 +119,7 @@ GTK_CONFIG = sh -c 'pkg-config gtk+-2.0 + + unexport CFLAGS # work around a weird issue with krb5-config + +-CFLAGS = -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ ++CFLAGS = -O2 -Wall -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ + -I../macosx/ $(shell $(GTK_CONFIG) --cflags) -D _FILE_OFFSET_BITS=64 + XLDFLAGS = $(LDFLAGS) $(shell $(GTK_CONFIG) --libs) + ULDFLAGS = $(LDFLAGS) +Index: putty-0.62/unix/Makefile.ux +=================================================================== +--- putty-0.62.orig/unix/Makefile.ux ++++ putty-0.62/unix/Makefile.ux +@@ -111,7 +111,7 @@ CC = $(TOOLPATH)cc + + unexport CFLAGS # work around a weird issue with krb5-config + +-CFLAGS = -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ ++CFLAGS = -O2 -Wall -g -I.././ -I../charset/ -I../windows/ -I../unix/ \ + -I../macosx/ -D _FILE_OFFSET_BITS=64 + ULDFLAGS = $(LDFLAGS) + INSTALL=install +Index: putty-0.62/unix/configure.ac +=================================================================== +--- putty-0.62.orig/unix/configure.ac ++++ putty-0.62/unix/configure.ac +@@ -11,7 +11,7 @@ AC_CONFIG_HEADERS([uxconfig.h:uxconfig.i + AC_PROG_INSTALL + AC_PROG_CC + if test "X$GCC" = Xyes; then +- PUTTYCFLAGS="-Wall -Werror" ++ PUTTYCFLAGS="-Wall" + else + PUTTYCFLAGS="" + fi diff --git a/putty-02-remove-gtk1.diff b/putty-02-remove-gtk1.diff new file mode 100644 index 0000000..4bdad43 --- /dev/null +++ b/putty-02-remove-gtk1.diff @@ -0,0 +1,17 @@ +--- + unix/configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: putty-0.62/unix/configure.ac +=================================================================== +--- putty-0.62.orig/unix/configure.ac ++++ putty-0.62/unix/configure.ac +@@ -32,7 +32,7 @@ AC_CHECK_HEADERS([utmpx.h sys/select.h], + #include ]) + + # Look for both GTK 1 and GTK 2. +-AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none]) ++gtk=none + AM_PATH_GTK_2_0([2.0.0], [gtk=2], []) + if test "$gtk" = "none"; then + all_targets="all-cli" diff --git a/putty.spec b/putty.spec index a706206..67acbc3 100644 --- a/putty.spec +++ b/putty.spec @@ -7,8 +7,10 @@ License: MIT URL: http://www.chiark.greenend.org.uk/~sgtatham/putty/ Source: %name-%version.tar.bz2 +Patch1: putty-01-werror.diff +Patch2: putty-02-remove-gtk1.diff BuildRoot: %_tmppath/%name-%version-build -BuildRequires: gtk2-devel +BuildRequires: autoconf, automake, krb5-devel, gtk2-devel %description PuTTY is a terminal emulator application which can act as a client @@ -16,10 +18,12 @@ for the SSH, Telnet, rlogin, and raw TCP computing protocols and as a serial console client. %prep -%setup +%setup -q +%patch -P 1 -P 2 -p1 %build pushd unix/; +autoreconf -fi; %configure make %{?_smp_mflags}; popd;