databases/kyotocabinet: Convert REINPLACE_CMD to patch files

This commit is contained in:
Po-Chuan Hsieh 2025-05-18 11:15:31 +08:00
parent 1a47edb3b4
commit 45a58b5c33
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
4 changed files with 81 additions and 10 deletions

View File

@ -20,21 +20,11 @@ CPPFLAGS+= -fPIC
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
MAKE_ARGS= PCDIR=${PREFIX}/libdata/pkgconfig
REINPLACE_ARGS= -i ''
TEST_TARGET= check
USE_LDCONFIG= yes
OPTIONS_DEFINE= DOCS
post-patch:
@${REINPLACE_CMD} -e 's|-lstdc++ ||g' ${WRKSRC}/configure ${WRKSRC}/doc/spex.html ${WRKSRC}/example/Makefile ${WRKSRC}/lab/kcdict/Makefile
@${REINPLACE_CMD} -e 's|-g0 -O2||g' \
${PATCH_WRKSRC}/configure
@${REINPLACE_CMD} -e 's|-march=native||g' \
${PATCH_WRKSRC}/configure
@${REINPLACE_CMD} -e 's|-m64 ||g' \
${PATCH_WRKSRC}/configure
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libkyotocabinet.so

View File

@ -0,0 +1,59 @@
--- configure.orig 2023-04-13 18:15:33 UTC
+++ configure
@@ -2139,8 +2139,8 @@ MYPCFILES="kyotocabinet.pc"
MYPCFILES="kyotocabinet.pc"
# Building flags
-MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g0 -O2"
-MYCXXFLAGS="-Wall -fPIC -fsigned-char -g0 -O2"
+MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char"
+MYCXXFLAGS="-Wall -fPIC -fsigned-char"
MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -I/usr/local/include"
MYCPPFLAGS="$MYCPPFLAGS -DNDEBUG -D_GNU_SOURCE=1"
MYCPPFLAGS="$MYCPPFLAGS -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D__EXTENSIONS__"
@@ -4007,10 +4007,10 @@ printf 'checking for 64-bit availability... '
# System-depending optimization
printf 'checking for 64-bit availability... '
-if printf 'int main(void) {return 0;}' | $CC -xc -m64 -o config.tmp - >config.tmp 2>&1
+if printf 'int main(void) {return 0;}' | $CC -xc -o config.tmp - >config.tmp 2>&1
then
- MYCFLAGS="-m64 $MYCFLAGS"
- MYCXXFLAGS="-m64 $MYCXXFLAGS"
+ MYCFLAGS="$MYCFLAGS"
+ MYCXXFLAGS="$MYCXXFLAGS"
printf 'yes\n'
else
printf 'no\n'
@@ -4018,10 +4018,10 @@ then
if test "$enable_opt" != "no"
then
printf 'checking for CPU optimization availability... '
- if printf 'int main(void) {return 0;}' | $CC -xc -march=native -o config.tmp - >config.tmp 2>&1
+ if printf 'int main(void) {return 0;}' | $CC -xc -o config.tmp - >config.tmp 2>&1
then
- MYCFLAGS="-march=native $MYCFLAGS"
- MYCXXFLAGS="-march=native $MYCXXFLAGS"
+ MYCFLAGS="$MYCFLAGS"
+ MYCXXFLAGS="$MYCXXFLAGS"
printf 'yes\n'
else
printf 'no\n'
@@ -4231,7 +4231,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. */
@@ -4260,7 +4260,7 @@ _ACEOF
#define HAVE_LIBSTDC__ 1
_ACEOF
- LIBS="-lstdc++ $LIBS"
+ LIBS="$LIBS"
fi

View File

@ -0,0 +1,11 @@
--- doc/spex.html.orig 2012-05-24 11:32:01 UTC
+++ doc/spex.html
@@ -257,7 +257,7 @@
<p>Kyoto Cabinet provides API of the C++ language and it is available by programs conforming to the C++03 standard. As the header files of Kyoto Cabinet are provided as `<code>kcutil.h</code>', `<code>kchashdb.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>libkyotocabinet.a</code>' and `<code>libkyotocabinet.so</code>' and they depends on `<code>libz.so</code>', `<code>libstdc++.so</code>', `<code>librt.so</code>', `<code>libpthread.so</code>', `<code>libm.so</code>', and `<code>libc.so</code>', 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 -lkyotocabinet -lz -lstdc++ -lrt -lpthread -lm -lc
+ -L/usr/local/lib -lkyotocabinet -lz -lrt -lpthread -lm -lc
</pre>
<h3 id="installation_windows">For Windows</h3>

View File

@ -0,0 +1,11 @@
--- example/Makefile.orig 2011-02-05 14:17:43 UTC
+++ example/Makefile
@@ -20,7 +20,7 @@ LDFLAGS =
CFLAGS = -I. -I.. -Wall -ansi -pedantic -fsigned-char -O2
CXXFLAGS = -I. -I.. -Wall -fsigned-char -O2
LDFLAGS =
-LIBS = -L. -L.. -lkyotocabinet -lstdc++ -lz -lrt -lpthread -lm -lc
+LIBS = -L. -L.. -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:.:..