aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2016-12-12 13:23:01 -0800
committerGitHub <noreply@github.com>2016-12-12 13:23:01 -0800
commit5d0a88259a398774d7bdbbdaea7855958804b633 (patch)
treeff00a17be5802369393a4fea13aee30961872810
parenta9b76857183090e9081cf61c7d0d52cfd41ede0a (diff)
parentf62ad96c9ab7f09c80c42a95fee3dfd160fa825c (diff)
downloadvcpkg-5d0a88259a398774d7bdbbdaea7855958804b633.tar.gz
vcpkg-5d0a88259a398774d7bdbbdaea7855958804b633.zip
Merge pull request #409 from ab-acx/http-parser
Adding http-parser library
-rw-r--r--ports/http-parser/CMakeLists.txt17
-rw-r--r--ports/http-parser/CONTROL3
-rw-r--r--ports/http-parser/portfile.cmake29
3 files changed, 49 insertions, 0 deletions
diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt
new file mode 100644
index 000000000..6e9067a04
--- /dev/null
+++ b/ports/http-parser/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required (VERSION 3.4)
+project (http-parser)
+
+if (BUILD_SHARED_LIBS)
+ SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
+add_library(http_parser http_parser.c http_parser.h)
+
+install(TARGETS http_parser
+ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
+)
+
+if (NOT SKIP_INSTALL_HEADERS)
+ install(FILES http_parser.h 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