sortix-mirror/ports/libcurl/libcurl.patch
Jonas 'Sortie' Termansen 9588b0d3db Add ports to the Sortix repository.
This change imports the ports collection from the former porttix and srctix
repositories and converts them to port(5) files with metadata pointing to
the upstream release tarballs with patches checked into this repository.
Ports are now developed and versioned along with the operating system and
are automatically built per the PACKAGES environment variable. The patches
are licensed under the same license as the relevant ports.

Tix has gained support for the new port(5) format. tix-port(8) is the new
high level ports build even point that handles downloading pstream releases
into the new mirror cache directory, applying the patches, building the port
with the lower-level tix-build(8), and finally installing the binary
package. The new tix-vars(8) program parses port(5) files and the new
tix-rmdiff(8) program produces input for tix-rmpatch(8).

The old doc/ directory is discontinued in favor of manual pages documenting
the new ports system.

The obsolete porttix-create(8) and srctix-create(8) programs are removed.
2022-06-13 22:29:53 +02:00

234 lines
7.1 KiB
Diff

diff -Paur --no-dereference -- libcurl.upstream/configure libcurl/configure
--- libcurl.upstream/configure
+++ libcurl/configure
@@ -20065,9 +20065,7 @@
fi
-if test "$HAVE_GETHOSTBYNAME" != "1"; then
- as_fn_error $? "couldn't find libraries for gethostbyname()" "$LINENO" 5
-fi
+# PATCH: gethostbyname is not actually needed.
curl_includes_winsock2="\
@@ -33676,11 +33674,8 @@
int main (void)
{
-#ifdef h_errno
+ /* PATCH: h_errno has nothing to do with getaddrinfo */
return 0;
-#else
- force compilation error
-#endif
}
@@ -45798,107 +45793,9 @@
-## ---------------------------------- ##
-## Start of distclean amending code ##
-## ---------------------------------- ##
-
-for xc_subdir in lib src tests/unit tests/server tests/libtest docs/examples
-do
-
-if test ! -f "$xc_subdir/Makefile"; then
- echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2
- exit 1
-fi
-
-# Fetch dependency tracking file list from Makefile include lines.
-
-xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null`
-xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"`
-
-# --disable-dependency-tracking might have been used, consequently
-# there is nothing to amend without a dependency tracking file list.
-
-if test $xc_cnt_words -gt 0; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: amending $xc_subdir/Makefile" >&5
-$as_echo "$as_me: amending $xc_subdir/Makefile" >&6;}
-
-# Build Makefile specific patch hunk.
-
-xc_p="$xc_subdir/xc_patch.tmp"
-
-xc_rm_depfiles=`echo "$xc_inc_lines" \
- | $SED 's%include% -rm -f%' 2>/dev/null`
-
-xc_dep_subdirs=`echo "$xc_inc_lines" \
- | $SED 's%include[ ][ ]*%%' 2>/dev/null \
- | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \
- | sort | uniq`
-
-echo "$xc_rm_depfiles" >$xc_p
-
-for xc_dep_dir in $xc_dep_subdirs; do
- echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p
- echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p
- echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p
- echo "${xc_tab}fi" >>$xc_p
-done
-
-# Build Makefile patching sed scripts.
-
-xc_s1="$xc_subdir/xc_script_1.tmp"
-xc_s2="$xc_subdir/xc_script_2.tmp"
-xc_s3="$xc_subdir/xc_script_3.tmp"
-
-cat >$xc_s1 <<\_EOT
-/^distclean[ ]*:/,/^[^ ][^ ]*:/{
- s/^.*(DEPDIR)/___xc_depdir_line___/
-}
-/^maintainer-clean[ ]*:/,/^[^ ][^ ]*:/{
- s/^.*(DEPDIR)/___xc_depdir_line___/
-}
-_EOT
-
-cat >$xc_s2 <<\_EOT
-/___xc_depdir_line___$/{
- N
- /___xc_depdir_line___$/D
-}
-_EOT
-
-cat >$xc_s3 <<_EOT
-/^___xc_depdir_line___/{
- r $xc_p
- d
-}
-_EOT
-
-# Apply patch to Makefile and cleanup.
-
-$SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1"
-$SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2"
-$SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3"
-
-if test -f "$xc_subdir/Makefile.tmp3"; then
- mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile"
-fi
-
-test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1"
-test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2"
-test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3"
-
-test -f "$xc_p" && rm -f "$xc_p"
-test -f "$xc_s1" && rm -f "$xc_s1"
-test -f "$xc_s2" && rm -f "$xc_s2"
-test -f "$xc_s3" && rm -f "$xc_s3"
-
-fi
-
-done
-
-## -------------------------------- ##
-## End of distclean amending code ##
-## -------------------------------- ##
+# PATCH: Removed cursed distclean patching logic that somehow produces distclean
+# targets for me with hundreds of thousands of duplicate rm -f commands.
+# The build seems to work fine without it.
diff -Paur --no-dereference -- libcurl.upstream/docs/Makefile.in libcurl/docs/Makefile.in
--- libcurl.upstream/docs/Makefile.in
+++ libcurl/docs/Makefile.in
@@ -461,10 +461,10 @@
# but distribute it (using the relative file name) in the next variable
man_MANS = $(abs_builddir)/curl.1
noinst_man_MANS = curl.1 mk-ca-bundle.1
-dist_man_MANS = curl-config.1
-GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html
-PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf
-MANDISTPAGES = curl.1.dist curl-config.1.dist
+dist_man_MANS =
+GENHTMLPAGES = curl.html mk-ca-bundle.html
+PDFPAGES = curl.pdf mk-ca-bundle.pdf
+MANDISTPAGES = curl.1.dist
HTMLPAGES = $(GENHTMLPAGES) index.html
# Build targets in this file (.) before cmdline-opts to ensure that
diff -Paur --no-dereference -- libcurl.upstream/include/curl/curl.h libcurl/include/curl/curl.h
--- libcurl.upstream/include/curl/curl.h
+++ libcurl/include/curl/curl.h
@@ -68,16 +68,7 @@
#endif
#endif
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on systems that are known to
- require it! */
-#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
- defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
- defined(__CYGWIN__) || \
- (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
-#endif
#if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
diff -Paur --no-dereference -- libcurl.upstream/lib/curl_addrinfo.h libcurl/lib/curl_addrinfo.h
--- libcurl.upstream/lib/curl_addrinfo.h
+++ libcurl/lib/curl_addrinfo.h
@@ -71,6 +71,16 @@
Curl_addrinfo **result);
#endif
+#if defined(__sortix__)
+struct hostent
+{
+ char* h_name;
+ char** h_aliases;
+ int h_addrtype;
+ int h_length;
+ char** h_addr_list;
+};
+#endif
Curl_addrinfo *
Curl_he2ai(const struct hostent *he, int port);
diff -Paur --no-dereference -- libcurl.upstream/lib/mprintf.c libcurl/lib/mprintf.c
--- libcurl.upstream/lib/mprintf.c
+++ libcurl/lib/mprintf.c
@@ -946,7 +946,7 @@
/* NOTE NOTE NOTE!! Not all sprintf implementations return number of
output characters */
- (sprintf)(work, formatbuf, p->data.dnum);
+ (snprintf)(work, sizeof(work), formatbuf, p->data.dnum);
DEBUGASSERT(strlen(work) <= sizeof(work));
for(fptr = work; *fptr; fptr++)
OUTCHAR(*fptr);
diff -Paur --no-dereference -- libcurl.upstream/Makefile.in libcurl/Makefile.in
--- libcurl.upstream/Makefile.in
+++ libcurl/Makefile.in
@@ -652,7 +652,7 @@
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \
$(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ)
-bin_SCRIPTS = curl-config
+bin_SCRIPTS =
SUBDIRS = lib src
DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
pkgconfigdir = $(libdir)/pkgconfig
@@ -1285,6 +1285,12 @@
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
+ -rm -f docs/cmdline-opts/Makefile
+ -rm -rf docs/examples/.deps
+ -rm -f docs/examples/Makefile
+ -rm -f docs/libcurl/Makefile
+ -rm -f docs/libcurl/opts/Makefile
+ -rm -f docs/Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags