aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/http-parser/CMakeLists.txt22
-rw-r--r--ports/http-parser/CONTROL3
-rw-r--r--ports/http-parser/portfile.cmake29
3 files changed, 54 insertions, 0 deletions
diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt
new file mode 100644
index 000000000..021b1842f
--- /dev/null
+++ b/ports/http-parser/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required (VERSION 2.6)
+project (http-parser)
+
+set(PUBLIC_HDRS
+ http_parser.h
+)
+set(PRIVATE_HDRS
+)
+set(SRCS
+ http_parser.c
+)
+
+add_library(http_parser STATIC ${SRCS} ${PUBLIC_HDRS} ${PRIAVTE_HDRS})
+
+if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
+ install(TARGETS http_parser
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" )
+endif()
+
+if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
+ install(FILES ${PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
+endif() \ No newline at end of file
diff --git a/ports/http-parser/CONTROL b/ports/http-parser/CONTROL
new file mode 100644
index 000000000..41d234d26
--- /dev/null
+++ b/ports/http-parser/CONTROL
@@ -0,0 +1,3 @@
+Source: http-parser
+Version: 2.7.1
+Description: HTTP Parser. \ No newline at end of file
diff --git a/ports/http-parser/portfile.cmake b/ports/http-parser/portfile.cmake
new file mode 100644
index 000000000..728293eed
--- /dev/null
+++ b/ports/http-parser/portfile.cmake
@@ -0,0 +1,29 @@
+# Common Ambient Variables:
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# TARGET_TRIPLET is the current triplet (x86-windows, etc)
+# PORT is the current port name (zlib, etc)
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+#
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/http-parser-2.7.1)
+vcpkg_download_distfile(ARCHIVE_FILE
+ URLS "https://github.com/nodejs/http-parser/archive/v2.7.1.zip"
+ FILENAME "http-parser-2.7.1.zip"
+ SHA512 9fb8b855ba7edb47628c91ac062d7ffce9c4bb8d6b8237d861d7926af989fb3e354c113821bdab1b8ac910f5f1064ca1339947aa20d56f6806b919b0cd6b6eae
+)
+vcpkg_extract_source_archive(${ARCHIVE_FILE})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS_DEBUG
+ -DSKIP_INSTALL_HEADERS=ON
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/http-parser)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/http-parser/LICENSE-MIT ${CURRENT_PACKAGES_DIR}/share/http-parser/copyright) \ No newline at end of file