diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libwandio | |
Diffstat (limited to 'vcpkg/ports/libwandio')
| -rw-r--r-- | vcpkg/ports/libwandio/configure.lib.patch | 98 | ||||
| -rw-r--r-- | vcpkg/ports/libwandio/configure.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libwandio/curl.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/libwandio/openssl.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/libwandio/portfile.cmake | 43 | ||||
| -rw-r--r-- | vcpkg/ports/libwandio/vcpkg.json | 18 |
6 files changed, 217 insertions, 0 deletions
diff --git a/vcpkg/ports/libwandio/configure.lib.patch b/vcpkg/ports/libwandio/configure.lib.patch new file mode 100644 index 0000000..5c0527f --- /dev/null +++ b/vcpkg/ports/libwandio/configure.lib.patch @@ -0,0 +1,98 @@ +diff --git a/configure.ac b/configure.ac +index 428e66a..21e39db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -110,10 +110,10 @@ AC_CHECK_SIZEOF([long int]) + AC_CHECK_HEADERS(stddef.h inttypes.h sys/prctl.h) + + # Checks for various "optional" libraries +-AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0) ++AC_SEARCH_LIBS(pthread_create, [pthreadGC pthreadVC pthread], have_pthread=1, have_pthread=0) + + if test "$have_pthread" = 1; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lpthread" ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_pthread_create" + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported]) + fi + +@@ -126,12 +126,12 @@ AC_ARG_WITH([bzip2], + + AS_IF([test "x$with_bzip2" != "xno"], + [ +- AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no) ++ AC_SEARCH_LIBS(BZ2_bzDecompressInit, [bz2 bz2d bzip2 bzip2d], have_bzip=yes, have_bzip=no) + ], [have_bzip=no]) + + AS_IF([test "x$have_bzip" = "xyes"], [ +- if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lbz2" ++ if test "$ac_cv_search_BZ2_bzDecompressInit" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_BZ2_bzDecompressInit" + fi + with_bzip2=yes + AC_DEFINE(HAVE_LIBBZ2, 1, "Compiled with bzip2 support")], +@@ -147,12 +147,12 @@ AC_ARG_WITH([zlib], + + AS_IF([test "x$with_zlib" != "xno"], + [ +- AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no) ++ AC_SEARCH_LIBS(deflate, [z zlib zlibd zd], have_zlib=yes, have_zlib=no) + ], [have_zlib=no]) + + AS_IF([test "x$have_zlib" = "xyes"], [ +- if test "$ac_cv_lib_z_deflate" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lz" ++ if test "$ac_cv_search_deflate" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_deflate" + fi + AC_DEFINE(HAVE_LIBZ, 1, "Compiled with zlib support") + with_zlib=yes], +@@ -191,12 +191,12 @@ AC_ARG_WITH([lzma], + + AS_IF([test "x$with_lzma" != "xno"], + [ +- AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no) ++ AC_SEARCH_LIBS(lzma_free, [lzma], have_lzma=yes, have_lzma=no) + ], [have_lzma=no]) + + AS_IF([test "x$have_lzma" = "xyes"], [ +- if test "$ac_cv_lib_lzma_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzma" ++ if test "$ac_cv_search_lzma_free" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_lzma_free" + fi + AC_DEFINE(HAVE_LIBLZMA, 1, "Compiled with lzma support") + with_lzma=yes], +@@ -257,25 +257,25 @@ AC_ARG_WITH([lz4], + + AS_IF([test "x$with_lz4" != "xno"], + [ +- AC_CHECK_LIB(lz4, LZ4F_createDecompressionContext, have_lz4f=yes, have_lz4f=no) ++ AC_SEARCH_LIBS(LZ4F_createDecompressionContext, [lz4 lz4d], have_lz4f=yes, have_lz4f=no) + ], [have_lz4f=no]) + + AS_IF([test "x$have_lz4f" = "xyes"], [ +- if test "$ac_cv_lib_lz4_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4" ++ if test "$ac_cv_search_LZ4F_createDecompressionContext" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4F_createDecompressionContext" + fi + AC_DEFINE(HAVE_LIBLZ4F, 1, "Compiled with lz4 frame support") +- AC_CHECK_LIB(lz4, LZ4F_getVersion, have_lz4_173=yes, have_lz4_173=no) ++ AC_SEARCH_LIBS(LZ4F_getVersion, [lz4 lz4d], have_lz4_173=yes, have_lz4_173=no) + if test "x$have_lz4_173" = "xyes"; then + AC_DEFINE(HAVE_LIBLZ4_MOVABLE, 1, "If defined then liblz4 does NOT have the ERROR_srcPtr_wrong bug") + fi + with_lz4=frameapi], + [ + AC_DEFINE(HAVE_LIBLZ4F, 0, "Compiled with lz4 frame support") +- AC_CHECK_LIB(lz4, LZ4_decompress_safe_continue, have_lz4s=yes, have_lz4s=no) ++ AC_SEARCH_LIBS(LZ4_decompress_safe_continue, [lz4 lz4d], have_lz4s=yes, have_lz4s=no) + AS_IF([test "x$have_lz4s" = "xyes"], [ +- if test "$ac_cv_lib_lz4_code" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4" ++ if test "$ac_cv_search_LZ4_decompress_safe_continue" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4_decompress_safe_continue" + fi + AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support") + with_lz4=streamapi diff --git a/vcpkg/ports/libwandio/configure.patch b/vcpkg/ports/libwandio/configure.patch new file mode 100644 index 0000000..929662d --- /dev/null +++ b/vcpkg/ports/libwandio/configure.patch @@ -0,0 +1,14 @@ +diff --git a/configure.ac b/configure.ac +index e250c0c31..0465120ba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -83,7 +83,7 @@ ADD_INCLS="" + ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib"
+ LIBWANDIO_LIBS=""
+
+-CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1"
++CFLAGS="$CFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX"
+-CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1" ++CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX"
+
+ # Check for -fvisibility
diff --git a/vcpkg/ports/libwandio/curl.patch b/vcpkg/ports/libwandio/curl.patch new file mode 100644 index 0000000..326700e --- /dev/null +++ b/vcpkg/ports/libwandio/curl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac
+index 4579fbb3d..f6be008c8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
+ AS_IF([test "x$with_http" != "xno"],
+ [
+ # we need curl_easy_pause which was added in 7.18.0
+- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d libcurl libcurl-d], have_curl=yes, have_curl=no, [-lCrypt32 -lWldap32 -lWs2_32 -ladvapi32])
++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
+ ], [have_curl=no])
+
+ AS_IF([test "x$have_curl" = "xyes"], [
+- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
+- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lCrypt32 -lWldap32 -lWs2_32 -ladvapi32 $ac_cv_search_curl_easy_pause"
++ LIBS="$LIBS"
+ fi
+ AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
+ with_http=yes],
diff --git a/vcpkg/ports/libwandio/openssl.patch b/vcpkg/ports/libwandio/openssl.patch new file mode 100644 index 0000000..586cdfa --- /dev/null +++ b/vcpkg/ports/libwandio/openssl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac
+index 4579fbb3d..f6be008c8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
+ AS_IF([test "x$with_http" != "xno"],
+ [
+ # we need curl_easy_pause which was added in 7.18.0
+- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl])
++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
+ ], [have_curl=no])
+
+ AS_IF([test "x$have_curl" = "xyes"], [
+- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
+- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
++ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
+ fi
+ AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
+ with_http=yes],
diff --git a/vcpkg/ports/libwandio/portfile.cmake b/vcpkg/ports/libwandio/portfile.cmake new file mode 100644 index 0000000..26b6357 --- /dev/null +++ b/vcpkg/ports/libwandio/portfile.cmake @@ -0,0 +1,43 @@ +if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+ set(PATCHES curl.patch)
+ #TODO: Still does not work. Requires proper "signal" support and "unistd"
+else()
+ set(PATCHES openssl.patch) # needed if curl is using openssl
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO wanduow/wandio
+ REF ${VERSION}
+ SHA512 931bdfe91c8923de52217873d5a12568bcac97b2ab7e4e50f48cd9999d7b3887175885c3f56250b0cd822584bbf4a9262b017ab57ed599ddd288abda1fad9885
+ HEAD_REF master
+ PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed.
+ configure.patch
+ ${PATCHES}
+)
+
+if (VCPKG_TARGET_IS_ANDROID)
+ list(APPEND OPTIONS ac_cv_func_malloc_0_nonnull=yes)
+ list(APPEND OPTIONS ac_cv_func_realloc_0_nonnull=yes)
+endif()
+
+vcpkg_configure_make(
+ AUTOCONFIG
+ SOURCE_PATH ${SOURCE_PATH}
+ COPY_SOURCE
+ OPTIONS
+ ${OPTIONS}
+)
+vcpkg_install_make()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+vcpkg_copy_pdbs()
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/vcpkg/ports/libwandio/vcpkg.json b/vcpkg/ports/libwandio/vcpkg.json new file mode 100644 index 0000000..bcc7650 --- /dev/null +++ b/vcpkg/ports/libwandio/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "libwandio", + "version": "4.2.6-1", + "description": "C library for simple and efficient file IO.", + "homepage": "https://github.com/wanduow/wandio", + "license": "LGPL-3.0-only", + "supports": "!windows", + "dependencies": [ + "bzip2", + "curl", + "liblzma", + "lz4", + "lzo", + "pthread", + "zlib", + "zstd" + ] +} |