Changed the "before" file from configure.ac.bak to configure.ac.orig. Sorry for the spam.

On 3/21/21 12:18 PM, Brennan Vincent wrote:
Thanks for the feedback. I had not realized that some systems are still on GCC 3.x. I've patched that flag out in configure.ac.

New patch attached.

On 3/21/21 11:56 AM, Klemens Nanni wrote:
On Sun, Mar 21, 2021 at 11:01:54AM -0400, Brennan Vincent wrote:
Attaching a patch that follows these suggestions.

My ports tree is a checkout of the https://github.com/openbsd/ports mirror, so I've used git format-patch to create the patch. I'm a porting beginner so
please let me know if there's a better way to send patches.
The Makefile looks all good, thank you.
Just indent with tabs not spaces like the rest of the file, please.


diff --git a/x11/xsel/patches/patch-configure b/x11/xsel/patches/patch-configure
deleted file mode 100644
index 7ee76777a43..00000000000
--- a/x11/xsel/patches/patch-configure
+++ /dev/null
@@ -1,15 +0,0 @@
-$OpenBSD: patch-configure,v 1.2 2014/07/07 08:22:52 sthen Exp $
-
--Wdeclaration-after-statement is gcc 4-only.
-
---- configure.orig    Mon Mar 24 15:27:33 2008
-+++ configure    Mon Jul  7 09:22:18 2014
-@@ -5880,7 +5880,7 @@ fi
-
- # Error out on compile warnings
- if test "x$ac_cv_c_compiler_gnu" = xyes ; then
--  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused" -+  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wno-unused"
These flags are still used.

Were they removed to support building on GCC 3.x platforms?
If so -and I think there are some- you'd have to still remove them, I guess.

- fi
-
- # Checks for header files.
>From 62bc611d95d8b44eeddf51488fa7fb264d674d21 Mon Sep 17 00:00:00 2001
From: Brennan Vincent <bren...@umanwizard.com>
Date: Sun, 21 Mar 2021 10:57:51 -0400
Subject: [PATCH] Update to latest commit from Github to fix various bugs.
 Remove patches which are no longer necessary.

---
 x11/xsel/Makefile                   | 14 +++++---
 x11/xsel/distinfo                   |  4 +--
 x11/xsel/patches/patch-configure    | 15 ---------
 x11/xsel/patches/patch-configure_ac | 11 ++++++
 x11/xsel/patches/patch-xsel_c       | 52 -----------------------------
 5 files changed, 23 insertions(+), 73 deletions(-)
 delete mode 100644 x11/xsel/patches/patch-configure
 create mode 100644 x11/xsel/patches/patch-configure_ac
 delete mode 100644 x11/xsel/patches/patch-xsel_c

diff --git a/x11/xsel/Makefile b/x11/xsel/Makefile
index f68ff697609..c08753437c3 100644
--- a/x11/xsel/Makefile
+++ b/x11/xsel/Makefile
@@ -2,20 +2,26 @@
 
 COMMENT=	command-line program for managing X selection contents
 
-DISTNAME=	xsel-1.2.0
-REVISION=	2
+V=		1.2.0.20210321
+DISTNAME=	xsel-${V}
 CATEGORIES=	x11
 HOMEPAGE=	http://www.vergenet.net/~conrad/software/xsel/
 
+GH_ACCOUNT=	kfish
+GH_PROJECT=	xsel
+GH_COMMIT=	062e6d373537c60829fa9b5dcddbcd942986b3c3
+
 # BSD-style
 PERMIT_PACKAGE=	Yes
 
 WANTLIB=	X11 c
 
-MASTER_SITES=	http://www.vergenet.net/~conrad/software/xsel/download/
 
 SEPARATE_BUILD=	Yes
-CONFIGURE_STYLE=gnu
+CONFIGURE_STYLE=autoreconf
 CONFIGURE_ENV=	LDFLAGS="-L${X11BASE}/lib"
 
+AUTOCONF_VERSION=2.69
+AUTOMAKE_VERSION=1.16
+
 .include <bsd.port.mk>
diff --git a/x11/xsel/distinfo b/x11/xsel/distinfo
index 9001d2654cc..f1a64622615 100644
--- a/x11/xsel/distinfo
+++ b/x11/xsel/distinfo
@@ -1,2 +1,2 @@
-SHA256 (xsel-1.2.0.tar.gz) = uSfOCNyC9MMBQCI5WbkM9l4QdvAAzpXlIEGewy9bFBw=
-SIZE (xsel-1.2.0.tar.gz) = 169155
+SHA256 (xsel-1.2.0.20210321-062e6d37.tar.gz) = /bbOutWP4waggDGs54epLE9Oi3W4Nt0zlY0UCmZrH5E=
+SIZE (xsel-1.2.0.20210321-062e6d37.tar.gz) = 51364
diff --git a/x11/xsel/patches/patch-configure b/x11/xsel/patches/patch-configure
deleted file mode 100644
index 7ee76777a43..00000000000
--- a/x11/xsel/patches/patch-configure
+++ /dev/null
@@ -1,15 +0,0 @@
-$OpenBSD: patch-configure,v 1.2 2014/07/07 08:22:52 sthen Exp $
-
--Wdeclaration-after-statement is gcc 4-only.
-
---- configure.orig	Mon Mar 24 15:27:33 2008
-+++ configure	Mon Jul  7 09:22:18 2014
-@@ -5880,7 +5880,7 @@ fi
- 
- # Error out on compile warnings
- if test "x$ac_cv_c_compiler_gnu" = xyes ; then
--  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused"
-+  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wno-unused"
- fi
- 
- # Checks for header files.
diff --git a/x11/xsel/patches/patch-configure_ac b/x11/xsel/patches/patch-configure_ac
new file mode 100644
index 00000000000..eaf90193351
--- /dev/null
+++ b/x11/xsel/patches/patch-configure_ac
@@ -0,0 +1,11 @@
+--- configure.ac.orig	Sun Mar 21 12:12:14 2021
++++ configure.ac	Sun Mar 21 12:12:23 2021
+@@ -24,7 +24,7 @@
+ dnl Add some useful warnings if we have gcc.
+ dnl changequote(,)dnl
+ if test "x$ac_cv_prog_gcc" = xyes ; then
+-  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused"
++  CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wno-unused"
+ fi
+ dnl changequote([,])dnl
+ 
diff --git a/x11/xsel/patches/patch-xsel_c b/x11/xsel/patches/patch-xsel_c
deleted file mode 100644
index 0a6b2018bc6..00000000000
--- a/x11/xsel/patches/patch-xsel_c
+++ /dev/null
@@ -1,52 +0,0 @@
-$OpenBSD: patch-xsel_c,v 1.2 2014/07/07 08:25:16 sthen Exp $
-
-- Format "32" properties use "long", not "int", even on LP64 platforms.
-- ensure NUM_TARGETS does not exceed MAX_NUM_TARGETS.
-- plug a memory leak in handle_targets()
-
---- xsel.c.orig	Mon Jun 30 00:10:19 2014
-+++ xsel.c	Mon Jun 30 00:20:50 2014
-@@ -15,6 +15,7 @@
- #include "config.h"
- #endif
- 
-+#include <assert.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdarg.h>
-@@ -1300,14 +1301,16 @@ handle_targets (Display * display, Window requestor, A
-                 Atom selection, Time time, MultTrack * mparent)
- {
-   Atom * targets_cpy;
-+  HandleResult r;
- 
-   targets_cpy = malloc (sizeof (supported_targets));
-   memcpy (targets_cpy, supported_targets, sizeof (supported_targets));
- 
--  return
--    change_property (display, requestor, property, XA_ATOM, 32,
-+  r = change_property (display, requestor, property, XA_ATOM, 32,
-                      PropModeReplace, (unsigned char *)targets_cpy,
-                      NUM_TARGETS, selection, time, mparent);
-+  free(targets_cpy);
-+  return r;
- }
- 
- /*
-@@ -2078,7 +2081,6 @@ main(int argc, char *argv[])
- 
-   /* Get the NULL atom */
-   null_atom = XInternAtom (display, "NULL", False);
--  NUM_TARGETS++;
- 
-   /* Get the TEXT atom */
-   text_atom = XInternAtom (display, "TEXT", False);
-@@ -2096,6 +2098,8 @@ main(int argc, char *argv[])
- 
-   supported_targets[s++] = XA_STRING;
-   NUM_TARGETS++;
-+
-+  assert(NUM_TARGETS <= MAX_NUM_TARGETS);
- 
-   /* Get the COMPOUND_TEXT atom.
-    * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but
-- 
2.31.0

Reply via email to