git: 8211b7acf5f1 - main - databases/kyototycoon: Convert REINPLACE_CMD to patch files

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 18 May 2025 03:36:50 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8211b7acf5f167e44893b02e7f513138131eb95c

commit 8211b7acf5f167e44893b02e7f513138131eb95c
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-05-18 03:15:33 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-05-18 03:15:33 +0000

    databases/kyototycoon: Convert REINPLACE_CMD to patch files
    
    - Remove REINPLACE_ARGS
---
 databases/kyototycoon/Makefile                     |  4 ----
 databases/kyototycoon/files/patch-configure        | 22 ++++++++++++++++++++--
 databases/kyototycoon/files/patch-doc-spex.html    | 11 +++++++++++
 databases/kyototycoon/files/patch-example-Makefile | 11 +++++++++++
 4 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/databases/kyototycoon/Makefile b/databases/kyototycoon/Makefile
index 924e439b2052..b7b505e66191 100644
--- a/databases/kyototycoon/Makefile
+++ b/databases/kyototycoon/Makefile
@@ -21,7 +21,6 @@ CPPFLAGS+=	-fPIC
 GNU_CONFIGURE=	yes
 INSTALL_TARGET=	install-strip
 MAKE_ARGS=	PCDIR=${PREFIX}/libdata/pkgconfig
-REINPLACE_ARGS=	-i ''
 TEST_TARGET=	check
 USE_CXXSTD=	gnu++98
 USE_LDCONFIG=	yes
@@ -55,9 +54,6 @@ LZO_CONFIGURE_OFF=	ac_cv_lib_lzo2_main=no
 LZO_CONFIGURE_ON=	ac_cv_lib_lzo2_main=yes
 LZO_LIB_DEPENDS=	liblzo2.so:archivers/lzo2
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|-lstdc++ ||g' ${WRKSRC}/configure ${WRKSRC}/doc/spex.html ${WRKSRC}/example/Makefile
-
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libkyototycoon.so ${STAGEDIR}${PREFIX}/libexec/*.so
 
diff --git a/databases/kyototycoon/files/patch-configure b/databases/kyototycoon/files/patch-configure
index 2ac536c3a2ea..ad1c1a719508 100644
--- a/databases/kyototycoon/files/patch-configure
+++ b/databases/kyototycoon/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig	2020-03-19 09:12:04 UTC
+--- configure.orig	2012-05-02 13:04:11 UTC
 +++ configure
-@@ -3389,10 +3389,10 @@ fi
+@@ -3389,10 +3389,10 @@ then
  if test "$enable_opt" != "no"
  then
    printf 'checking for CPU optimization availability... '
@@ -14,3 +14,21 @@
      printf 'yes\n'
    else
      printf 'no\n'
+@@ -3729,7 +3729,7 @@ else
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lstdc++  $LIBS"
++LIBS="$LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -3758,7 +3758,7 @@ _ACEOF
+ #define HAVE_LIBSTDC__ 1
+ _ACEOF
+ 
+-  LIBS="-lstdc++ $LIBS"
++  LIBS="$LIBS"
+ 
+ fi
+ 
diff --git a/databases/kyototycoon/files/patch-doc-spex.html b/databases/kyototycoon/files/patch-doc-spex.html
new file mode 100644
index 000000000000..3332e501815c
--- /dev/null
+++ b/databases/kyototycoon/files/patch-doc-spex.html
@@ -0,0 +1,11 @@
+--- doc/spex.html.orig	2012-05-24 17:44:23 UTC
++++ doc/spex.html
+@@ -160,7 +160,7 @@
+ <p>Kyoto Tycoon provides API of the C++ language and it is available by programs conforming to the C++03 standard.  As the header files of Kyoto Tycoon are provided as `<code>ktutil.h</code>', `<code>ktremotedb.h</code>', and so on, applications should include one or more of them accordingly to use the API.  As the library is provided as `<code>libkyototycoon.a</code>' and `<code>libkyototycoon.so</code>' and they depends on underlying system libraries, linker options corresponding to them are required by the build command.  The typical build command is the following.</p>
+ 
+ <pre>$ g++ -I/usr/local/include example.cc -o example \
+-  -L/usr/local/lib -lkyototycoon -lkyotocabinet -lz -lstdc++ \
++  -L/usr/local/lib -lkyototycoon -lkyotocabinet -lz \
+   -lresolv -lnsl -ldl -lrt -lpthread -lm -lc
+ </pre>
+ 
diff --git a/databases/kyototycoon/files/patch-example-Makefile b/databases/kyototycoon/files/patch-example-Makefile
new file mode 100644
index 000000000000..ae9276e598c2
--- /dev/null
+++ b/databases/kyototycoon/files/patch-example-Makefile
@@ -0,0 +1,11 @@
+--- example/Makefile.orig	2010-10-21 15:38:49 UTC
++++ example/Makefile
+@@ -19,7 +19,7 @@ LDFLAGS =
+ CFLAGS = -I. -I.. -Wall -ansi -pedantic -fsigned-char -O2
+ CXXFLAGS = -I. -I.. -Wall -fsigned-char -O2
+ LDFLAGS =
+-LIBS = -L. -L.. -lkyototycoon -lkyotocabinet -lstdc++ -lz -lrt -lpthread -lm -lc
++LIBS = -L. -L.. -lkyototycoon -lkyotocabinet -lz -lrt -lpthread -lm -lc
+ LDENV = LD_RUN_PATH=/lib:/usr/lib:$(HOME)/lib:/usr/local/lib:.:..
+ RUNENV = LD_LIBRARY_PATH=/lib:/usr/lib:$(HOME)/lib:/usr/local/lib:.:..
+