aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libmicrohttpd
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libmicrohttpd
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libmicrohttpd')
-rw-r--r--vcpkg/ports/libmicrohttpd/portfile.cmake60
-rw-r--r--vcpkg/ports/libmicrohttpd/remove_pdb_install.patch15
-rw-r--r--vcpkg/ports/libmicrohttpd/vcpkg.json29
3 files changed, 104 insertions, 0 deletions
diff --git a/vcpkg/ports/libmicrohttpd/portfile.cmake b/vcpkg/ports/libmicrohttpd/portfile.cmake
new file mode 100644
index 0000000..4d5844b
--- /dev/null
+++ b/vcpkg/ports/libmicrohttpd/portfile.cmake
@@ -0,0 +1,60 @@
+vcpkg_download_distfile(ARCHIVE
+ URLS
+ "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${VERSION}.tar.gz"
+ "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${VERSION}.tar.gz"
+ FILENAME "libmicrohttpd-${VERSION}.tar.gz"
+ SHA512 c99b8b93cae5feee8debcc5667ee3ff043412a84b30696fe852e6c138f3c890bb43c8fcd7199f1d2f809d522fef159e83b607c743d6cf3401a57050fbdf9b5c1
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES remove_pdb_install.patch
+)
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(CFG_SUFFIX "dll")
+ else()
+ set(CFG_SUFFIX "static")
+ endif()
+
+ vcpkg_msbuild_install(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PROJECT_SUBPATH w32/VS-Any-Version/libmicrohttpd.vcxproj
+ RELEASE_CONFIGURATION "Release-${CFG_SUFFIX}"
+ DEBUG_CONFIGURATION "Debug-${CFG_SUFFIX}"
+ )
+
+ file(GLOB MICROHTTPD_HEADERS "${SOURCE_PATH}/src/include/microhttpd.h")
+ file(COPY ${MICROHTTPD_HEADERS} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
+else()
+ vcpkg_list(SET config_args)
+ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(ENV{LIBS} "$ENV{LIBS} -framework Foundation -framework AppKit") # TODO: Get this from the extracted cmake vars somehow
+ endif()
+ if("https" IN_LIST FEATURES)
+ vcpkg_list(APPEND config_args "--enable-https")
+ else()
+ vcpkg_list(APPEND config_args "--disable-https")
+ endif()
+
+ vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ --disable-doc
+ --disable-nls
+ --disable-examples
+ --disable-curl
+ ${config_args}
+ OPTIONS_DEBUG --enable-asserts
+ OPTIONS_RELEASE --disable-asserts
+ )
+
+ vcpkg_install_make()
+ vcpkg_fixup_pkgconfig()
+
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/libmicrohttpd/remove_pdb_install.patch b/vcpkg/ports/libmicrohttpd/remove_pdb_install.patch
new file mode 100644
index 0000000..9b5e4eb
--- /dev/null
+++ b/vcpkg/ports/libmicrohttpd/remove_pdb_install.patch
@@ -0,0 +1,15 @@
+diff --git a/w32/common/libmicrohttpd-build-settings.props b/w32/common/libmicrohttpd-build-settings.props
+index 97d84a87f..8ffcb19c4 100644
+--- a/w32/common/libmicrohttpd-build-settings.props
++++ b/w32/common/libmicrohttpd-build-settings.props
+@@ -37,10 +37,6 @@
+ <Lib>
+ <AdditionalDependencies>Ws2_32.lib</AdditionalDependencies>
+ </Lib>
+- <PostBuildEvent>
+- <Command>xcopy /F /I /Y "$(IntermediateOutputPath)$(TargetName).pdb" "$(OutputPath)"</Command>
+- <Message>Copy .pdb to output directory</Message>
+- </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(ConfigurationType)'=='DynamicLibrary'">
+ <ClCompile>
diff --git a/vcpkg/ports/libmicrohttpd/vcpkg.json b/vcpkg/ports/libmicrohttpd/vcpkg.json
new file mode 100644
index 0000000..9cbd8c9
--- /dev/null
+++ b/vcpkg/ports/libmicrohttpd/vcpkg.json
@@ -0,0 +1,29 @@
+{
+ "name": "libmicrohttpd",
+ "version": "1.0.1",
+ "port-version": 2,
+ "description": "GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application",
+ "homepage": "https://www.gnu.org/software/libmicrohttpd/",
+ "license": "LGPL-2.1-or-later",
+ "supports": "!((arm & windows) | uwp)",
+ "dependencies": [
+ {
+ "name": "gettext",
+ "platform": "!windows"
+ },
+ {
+ "name": "vcpkg-msbuild",
+ "host": true,
+ "platform": "windows & !mingw"
+ }
+ ],
+ "features": {
+ "https": {
+ "description": "Enable HTTPS protocol support",
+ "supports": "!windows | mingw",
+ "dependencies": [
+ "libgnutls"
+ ]
+ }
+ }
+}