git: 4adb2b300ce7 - main - databases/sqsh: Fix build with FreeTDS 1.2.

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 30 Mar 2022 18:43:02 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4adb2b300ce7447c7cad200741beb9b55884d1a5

commit 4adb2b300ce7447c7cad200741beb9b55884d1a5
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-03-30 18:33:11 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2022-03-30 18:42:39 +0000

    databases/sqsh: Fix build with FreeTDS 1.2.
    
    Assume maintainership.
    
    PR:             262942
    MFH:            2022Q1
---
 databases/sqsh/Makefile                       | 10 ++++++----
 databases/sqsh/distinfo                       |  4 +++-
 databases/sqsh/files/patch-src_cmd__connect.c | 18 ++++++++++--------
 databases/sqsh/pkg-descr                      |  2 +-
 4 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/databases/sqsh/Makefile b/databases/sqsh/Makefile
index 8ee7591e525e..0833f5d592ca 100644
--- a/databases/sqsh/Makefile
+++ b/databases/sqsh/Makefile
@@ -2,18 +2,19 @@
 
 PORTNAME=	sqsh
 PORTVERSION=	2.5.16.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	databases
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION:R:R}
 
-MAINTAINER=	ports@FreeBSD.org
+PATCH_SITES=	https://raw.githubusercontent.com/netzbasis/openbsd-ports/11f6e510cbdf022a7b6c71ee125a41ba443fe927/databases/sqsh/patches/
+PATCHFILES=	patch-src_cmd_connect_c
+
+MAINTAINER=	fuz@fuz.su
 COMMENT=	Interactive tool for querying Sybase database servers
 
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BROKEN=		cmd_connect.c:1897:17: error: use of undeclared identifier 'CS_MAX_CHAR'
-
 LIB_DEPENDS=	libct.so:databases/freetds
 
 USES=		readline tar:tgz
@@ -29,6 +30,7 @@ OPTIONS_DEFINE=	X11
 OPTIONS_DEFAULT=X11
 
 X11_USES=	motif
+X11_USE=	xorg=x11,xext,xmu,xt
 X11_CONFIGURE_ON=	--with-motif --with-x
 
 post-patch:
diff --git a/databases/sqsh/distinfo b/databases/sqsh/distinfo
index a57f371e1677..5e4278b49237 100644
--- a/databases/sqsh/distinfo
+++ b/databases/sqsh/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1524247164
+TIMESTAMP = 1648655356
 SHA256 (sqsh-2.5.16.1.tgz) = d6641f365ace60225fc0fa48f82b9dbed77a4e506a0e497eb6889e096b8320f2
 SIZE (sqsh-2.5.16.1.tgz) = 623715
+SHA256 (patch-src_cmd_connect_c) = 1270ac466cacbac98952190315964cda0e8da0e955e01d14030a4091ed3ce9b7
+SIZE (patch-src_cmd_connect_c) = 1579
diff --git a/databases/sqsh/files/patch-src_cmd__connect.c b/databases/sqsh/files/patch-src_cmd__connect.c
index b2c79eee90b9..dc77a7dc194b 100644
--- a/databases/sqsh/files/patch-src_cmd__connect.c
+++ b/databases/sqsh/files/patch-src_cmd__connect.c
@@ -1,6 +1,7 @@
---- src/cmd_connect.c	2014-04-04 08:22:38
-+++ src/cmd_connect.c	2018-04-20 18:26:38
-@@ -861,6 +861,14 @@
+--- src/cmd_connect.c.orig	2014-04-04 08:22:38 UTC
++++ src/cmd_connect.c
+@@ -860,8 +860,16 @@ int cmd_connect( argc, argv )
+         /* Then we use freetds which uses enum instead of defines */
          else if (strcmp(tds_version, "7.0") == 0)
              version = CS_TDS_70;
 +        else if (strcmp(tds_version, "7.1") == 0)
@@ -12,15 +13,15 @@
 +        else if (strcmp(tds_version, "7.4") == 0)
 +            version = CS_TDS_74;
          else if (strcmp(tds_version, "8.0") == 0)
--            version = CS_TDS_80;
-+            version = CS_TDS_71; /* https://sourceforge.net/p/sqsh/discussion/365924/thread/29ae1664/#7f59/707f */
+             version = CS_TDS_71;
  #endif
          else version = CS_TDS_50; /* default version */
-@@ -1259,7 +1267,16 @@
+ 
+@@ -1258,9 +1266,18 @@ int cmd_connect( argc, argv )
+                 case CS_TDS_70:
                      env_set( g_env, "tds_version", "7.0" );
                      break;
--                case CS_TDS_80:
-+                case CS_TDS_71:
+                 case CS_TDS_71:
                      env_set( g_env, "tds_version", "8.0" );
                      break;
 +                case CS_TDS_72:
@@ -34,3 +35,4 @@
 +                    break;
  #endif
                  default:
+                     env_set( g_env, "tds_version", "unknown" );
diff --git a/databases/sqsh/pkg-descr b/databases/sqsh/pkg-descr
index e74832bc3699..9f9350a19d1c 100644
--- a/databases/sqsh/pkg-descr
+++ b/databases/sqsh/pkg-descr
@@ -1,4 +1,4 @@
 This is alternative to ancient isql - interactive
 and comfortable database query tool for Sybase.
 
-WWW: http://www.sqsh.org/
+WWW: https://sourceforge.net/projects/sqsh