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/liburing | |
Diffstat (limited to 'vcpkg/ports/liburing')
| -rw-r--r-- | vcpkg/ports/liburing/disable-tests-and-examples.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/liburing/fix-configure.patch | 36 | ||||
| -rw-r--r-- | vcpkg/ports/liburing/portfile.cmake | 53 | ||||
| -rw-r--r-- | vcpkg/ports/liburing/vcpkg.json | 8 |
4 files changed, 110 insertions, 0 deletions
diff --git a/vcpkg/ports/liburing/disable-tests-and-examples.patch b/vcpkg/ports/liburing/disable-tests-and-examples.patch new file mode 100644 index 0000000..827d80e --- /dev/null +++ b/vcpkg/ports/liburing/disable-tests-and-examples.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 686be4f..28d0a7f 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,8 +8,6 @@ default: all + + all: + @$(MAKE) -C src +- @$(MAKE) -C test +- @$(MAKE) -C examples + + library: + @$(MAKE) -C src diff --git a/vcpkg/ports/liburing/fix-configure.patch b/vcpkg/ports/liburing/fix-configure.patch new file mode 100644 index 0000000..e567a95 --- /dev/null +++ b/vcpkg/ports/liburing/fix-configure.patch @@ -0,0 +1,36 @@ +diff --git a/configure b/configure +index 4794306..76e6334 100755 +--- a/configure ++++ b/configure +@@ -20,7 +20,7 @@ for opt do + ;; + --mandir=*) mandir="$optarg" + ;; +- --datadir=*) datadir="$optarg" ++ --datarootdir=*) datadir="$optarg" + ;; + --cc=*) cc="$optarg" + ;; +@@ -30,10 +30,12 @@ for opt do + ;; + --enable-sanitizer) use_sanitizer=yes + ;; ++ --enable-shared) ENABLE_SHARED=1 ++ ;; ++ --enable-static) ENABLE_SHARED=0 ++ ;; + *) + echo "ERROR: unknown option $opt" +- echo "Try '$0 --help' for more information" +- exit 1 + ;; + esac + done +@@ -133,6 +135,7 @@ echo "# Automatically generated by configure - do not modify" > $config_host_mak + printf "# Configured with:" >> $config_host_mak + printf " '%s'" "$0" "$@" >> $config_host_mak + echo >> $config_host_mak ++echo "ENABLE_SHARED=${ENABLE_SHARED}" >> $config_host_mak + + do_cxx() { + # Run the compiler, capturing its output to the log. diff --git a/vcpkg/ports/liburing/portfile.cmake b/vcpkg/ports/liburing/portfile.cmake new file mode 100644 index 0000000..9a5145d --- /dev/null +++ b/vcpkg/ports/liburing/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO axboe/liburing + REF "liburing-${VERSION}" + SHA512 ccd40be43d4ea046c63d949cfddd9adb0fda531e3ae4ee17d4639b82a11eda966d8a2afd280b4e6b45f907ea1d53bbd432bfd8ae7a015609e86555a766fc850f + HEAD_REF master + PATCHES + fix-configure.patch # ignore unsupported options, handle ENABLE_SHARED + disable-tests-and-examples.patch +) + +# https://github.com/axboe/liburing/blob/liburing-2.8/src/Makefile#L13 +set(ENV{CFLAGS} "$ENV{CFLAGS} -O3 -Wall -Wextra -fno-stack-protector") + +# without this calls to `realpath ${prefix}` inside the build system fail for the debug build if this is the first +# library to be installed +file(MAKE_DIRECTORY "${CURRENT_INSTALLED_DIR}/debug") + +# note: check ${SOURCE_PATH}/liburing.spec before updating configure options +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + COPY_SOURCE + DETERMINE_BUILD_TRIPLET + OPTIONS + [[--libdevdir=\${prefix}/lib]] # must match libdir +) +vcpkg_install_make() +vcpkg_fixup_pkgconfig() + +# note: {SOURCE_PATH}/src/Makefile makes liburing.so from liburing.a. +# For dynamic, remove intermediate file liburing.a when install is finished. +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/liburing.a" + "${CURRENT_PACKAGES_DIR}/lib/liburing.a" + ) +endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/man") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}/man2") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}/man3") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}/man7") + +# Cf. README +vcpkg_install_copyright(COMMENT [[ +All software contained from liburing is dual licensed LGPL and MIT, see +COPYING and LICENSE, except for a header coming from the kernel which is +dual licensed GPL with a Linux-syscall-note exception and MIT, see +COPYING.GPL and <https://spdx.org/licenses/Linux-syscall-note.html>. +]] + FILE_LIST + "${SOURCE_PATH}/LICENSE" + "${SOURCE_PATH}/COPYING" + "${SOURCE_PATH}/COPYING.GPL" +) diff --git a/vcpkg/ports/liburing/vcpkg.json b/vcpkg/ports/liburing/vcpkg.json new file mode 100644 index 0000000..c0f3d4f --- /dev/null +++ b/vcpkg/ports/liburing/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "liburing", + "version": "2.12", + "description": "Linux-native io_uring I/O access library", + "homepage": "https://github.com/axboe/liburing", + "license": "(MIT OR LGPL-2.1) AND (MIT OR GPL-2.0 WITH Linux-syscall-note)", + "supports": "linux" +} |