Skip to content

Commit

Permalink
ftp/curl: Convert REINPLACE_CMD to patch files
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Apr 9, 2023
1 parent 5c8fac9 commit c312e7f
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 25 deletions.
11 changes: 0 additions & 11 deletions ftp/curl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,6 @@ IGNORE= only supports TLS-SRP with either OpenSSL or GnuTLS
IGNORE= only supports LDAPS with SSL
.endif

.if ${PORT_OPTIONS:MGSSAPI_BASE} && exists(${LOCALBASE}/lib/libkrb5support.so)
BROKEN= The GSSAPI_BASE option is selected, but you have krb5 installed. \
This is incompatible. In order to build, either select GSSAPI_MIT, \
or temporarily deinstall krb5 to build curl, or build in poudriere
.endif

post-patch:
@${REINPLACE_CMD} -e '/^SUBDIRS = / s|$$| docs scripts|; /^DIST_SUBDIRS = / s| docs scripts||; /cd docs &&/d' ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|\(flags_dbg_off=\)".*"|\1""|; s|\(flags_opt_off=\)".*"|\1""|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|include <gssapi.h>|include <gssapi/gssapi.h>|' ${WRKSRC}/lib/urldata.h

post-install:
${INSTALL_DATA} ${WRKSRC}/docs/libcurl/libcurl.m4 ${STAGEDIR}${PREFIX}/share/aclocal/

Expand Down
36 changes: 36 additions & 0 deletions ftp/curl/files/patch-Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--- Makefile.in.orig 2023-03-20 13:54:32 UTC
+++ Makefile.in
@@ -684,7 +684,7 @@ CLEANFILES = $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) $(V
$(VC14_30_LIBVCXPROJ) $(VC14_30_SRCVCXPROJ)

bin_SCRIPTS = curl-config
-SUBDIRS = lib src
+SUBDIRS = lib src docs scripts
DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
@@ -1695,10 +1695,8 @@ dist-hook:
done)

html:
- cd docs && $(MAKE) html

pdf:
- cd docs && $(MAKE) pdf

check: test examples check-docs

@@ -1785,13 +1783,11 @@ cygwinbin:
# We extend the standard install with a custom hook:
install-data-hook:
(cd include && $(MAKE) install)
- (cd docs && $(MAKE) install)
(cd docs/libcurl && $(MAKE) install)

# We extend the standard uninstall with a custom hook:
uninstall-hook:
(cd include && $(MAKE) uninstall)
- (cd docs && $(MAKE) uninstall)
(cd docs/libcurl && $(MAKE) uninstall)

ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl
104 changes: 96 additions & 8 deletions ftp/curl/files/patch-configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- configure.orig 2021-09-13 14:46:32 UTC
--- configure.orig 2023-03-20 11:39:06 UTC
+++ configure
@@ -4161,9 +4161,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be
@@ -4179,9 +4179,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be
-I*)
xc_bad_var_ldflags=yes
;;
Expand All @@ -14,7 +14,7 @@
esac
done
if test $xc_bad_var_ldflags = yes; then
@@ -4233,9 +4234,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use
@@ -4251,9 +4252,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use
xc_bad_var_cflags=no
for xc_word in $CFLAGS; do
case "$xc_word" in
Expand All @@ -28,7 +28,95 @@
-U*)
xc_bad_var_cflags=yes
;;
@@ -18092,6 +18094,8 @@ printf "%s\n" "$honor_optimize_option" >&6; }
@@ -17387,7 +17389,7 @@ printf "%s\n" "$as_me: WARNING: failed to figure out c
flags_dbg_yes="unknown"
flags_opt_all="unknown"
flags_opt_yes="unknown"
- flags_opt_off="unknown"
+ flags_opt_off=""
#
flags_prefer_cppflags="no"
#
@@ -17492,7 +17494,7 @@ printf "%s\n" "yes" >&6; }
flags_dbg_yes="-g2"
flags_opt_all="-O -O0 -O1 -O2 -O3 -O4"
flags_opt_yes="-O1"
- flags_opt_off="-O0"
+ flags_opt_off=""
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -17553,7 +17555,7 @@ printf "%s\n" "yes" >&6; }
flags_dbg_yes="-g"
flags_opt_all="-O +O0 +O1 +O2 +O3 +O4"
flags_opt_yes="+O2"
- flags_opt_off="+O0"
+ flags_opt_off=""
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -17621,7 +17623,7 @@ printf "%s\n" "yes" >&6; }
flags_opt_all="$flags_opt_all -qoptimize=4"
flags_opt_all="$flags_opt_all -qoptimize=5"
flags_opt_yes="-O2"
- flags_opt_off="-qnooptimize"
+ flags_opt_off=""
flags_prefer_cppflags="yes"
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -17730,13 +17732,13 @@ rm -f conftest.err conftest.i conftest.$ac_ext
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
flags_opt_yes="-O2"
- flags_opt_off="-O0"
+ flags_opt_off=""
else
compiler_id="INTEL_WINDOWS_C"
flags_dbg_yes="/Zi /Oy-"
flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-"
flags_opt_yes="/O2"
- flags_opt_off="/Od"
+ flags_opt_off=""
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -17865,7 +17867,7 @@ printf "%s\n" "no" >&6; }
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4"
flags_opt_yes="-O2"
- flags_opt_off="-O0"
+ flags_opt_off=""
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -17931,7 +17933,7 @@ printf "%s\n" "yes" >&6; }
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -O3 -Os -Og -Ofast"
flags_opt_yes="-O2"
- flags_opt_off="-O0"
+ flags_opt_off=""

OLDCPPFLAGS=$CPPFLAGS
# CPPPFLAG comes from CURL_CPP_P
@@ -18190,7 +18192,7 @@ printf "%s\n" "yes" >&6; }
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast"
flags_opt_yes="-O2"
- flags_opt_off="-O0"
+ flags_opt_off=""
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -18298,7 +18300,7 @@ printf "%s\n" "yes" >&6; }
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast"
flags_opt_yes="-O2"
- flags_opt_off="-O0"
+ flags_opt_off=""
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -18831,6 +18833,8 @@ printf "%s\n" "$honor_optimize_option" >&6; }
#
if test "$honor_optimize_option" = "yes"; then

Expand All @@ -37,15 +125,15 @@
ac_var_stripped=""
for word1 in $tmp_CFLAGS; do
ac_var_strip_word="no"
@@ -18122,6 +18126,7 @@ printf "%s\n" "$honor_optimize_option" >&6; }
@@ -18861,6 +18865,7 @@ printf "%s\n" "$honor_optimize_option" >&6; }
done
tmp_CPPFLAGS="$ac_var_stripped"
squeeze tmp_CPPFLAGS
+fi

if test "$want_optimize" = "yes"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer enabling options" >&5
@@ -29490,31 +29495,31 @@ printf "%s\n" "found" >&6; }
@@ -29941,31 +29946,31 @@ printf "%s\n" "found" >&6; }
;;
off)
LIB_RTMP="-lrtmp"
Expand Down Expand Up @@ -86,7 +174,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

@@ -46199,9 +46204,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be
@@ -45632,9 +45637,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be
-I*)
xc_bad_var_ldflags=yes
;;
Expand All @@ -100,7 +188,7 @@
esac
done
if test $xc_bad_var_ldflags = yes; then
@@ -46271,9 +46277,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use
@@ -45704,9 +45710,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use
xc_bad_var_cflags=no
for xc_word in $CFLAGS; do
case "$xc_word" in
Expand Down
11 changes: 11 additions & 0 deletions ftp/curl/files/patch-lib-urldata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- lib/urldata.h.orig 2023-03-20 13:49:04 UTC
+++ lib/urldata.h
@@ -179,7 +179,7 @@ typedef CURLcode (*Curl_datastream)(struct Curl_easy *
# elif defined HAVE_GSSAPI_GSSAPI_H
# include <gssapi/gssapi.h>
# else
-# include <gssapi.h>
+# include <gssapi/gssapi.h>
# endif
# ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
# include <gssapi/gssapi_generic.h>
6 changes: 3 additions & 3 deletions ftp/curl/files/patch-scripts-Makefile.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- scripts/Makefile.in.orig 2021-07-19 12:47:18 UTC
--- scripts/Makefile.in.orig 2023-03-20 11:39:06 UTC
+++ scripts/Makefile.in
@@ -578,7 +578,7 @@ uninstall-am:
@@ -592,7 +592,7 @@ uninstall-am:
.PRECIOUS: Makefile


Expand All @@ -9,7 +9,7 @@

$(ZSH_COMPLETION_FUNCTION_FILENAME): completion.pl
@CROSSCOMPILING_TRUE@ @echo "NOTICE: we can't generate zsh completion when cross-compiling!"
@@ -593,9 +593,7 @@ $(FISH_COMPLETION_FUNCTION_FILENAME): completion.pl
@@ -607,9 +607,7 @@ $(FISH_COMPLETION_FUNCTION_FILENAME): completion.pl
install-data-local:
@CROSSCOMPILING_TRUE@ @echo "NOTICE: we can't install zsh completion when cross-compiling!"
@CROSSCOMPILING_FALSE@ $(MKDIR_P) $(DESTDIR)$(ZSH_FUNCTIONS_DIR)
Expand Down
6 changes: 3 additions & 3 deletions ftp/curl/files/patch-src-tool_operate.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- src/tool_operate.c.orig 2021-07-19 07:19:57 UTC
--- src/tool_operate.c.orig 2023-03-20 11:38:42 UTC
+++ src/tool_operate.c
@@ -995,20 +995,7 @@ static CURLcode single_transfer(struct GlobalConfig *g
@@ -1106,20 +1106,7 @@ static CURLcode single_transfer(struct GlobalConfig *g
DEBUGASSERT(!outs->filename);
}

Expand All @@ -22,7 +22,7 @@
#ifdef __VMS
/* open file for output, forcing VMS output format into stream
mode which is needed for stat() call above to always work. */
@@ -1025,6 +1012,19 @@ static CURLcode single_transfer(struct GlobalConfig *g
@@ -1136,6 +1123,19 @@ static CURLcode single_transfer(struct GlobalConfig *g
}
outs->fopened = TRUE;
outs->stream = file;
Expand Down

0 comments on commit c312e7f

Please sign in to comment.