aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/cgicc
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/cgicc')
-rw-r--r--vcpkg/ports/cgicc/CMakeLists.txt121
-rw-r--r--vcpkg/ports/cgicc/fix-define.patch22
-rw-r--r--vcpkg/ports/cgicc/fix-static-build.patch15
-rw-r--r--vcpkg/ports/cgicc/portfile.cmake39
-rw-r--r--vcpkg/ports/cgicc/vcpkg.json14
5 files changed, 211 insertions, 0 deletions
diff --git a/vcpkg/ports/cgicc/CMakeLists.txt b/vcpkg/ports/cgicc/CMakeLists.txt
new file mode 100644
index 0000000..8a74f6b
--- /dev/null
+++ b/vcpkg/ports/cgicc/CMakeLists.txt
@@ -0,0 +1,121 @@
+
+cmake_minimum_required (VERSION 3.8)
+project (cgicc)
+include (CheckIncludeFiles)
+include(CheckSymbolExists)
+include (CheckCXXSourceCompiles)
+
+set (VERSION "3.2.19")
+execute_process (COMMAND hostname OUTPUT_VARIABLE HOST OUTPUT_STRIP_TRAILING_WHITESPACE)
+check_include_files (dlfcn.h HAVE_DLFCN_H)
+check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
+check_include_files (inttypes.h HAVE_INTTYPES_H)
+check_include_files (memory.h HAVE_MEMORY_H)
+
+check_cxx_source_compiles ("
+ namespace test { }
+ int main(int, char**) {
+ using namespace ::test;
+}" HAVE_NAMESPACES)
+check_include_files (stdint.h HAVE_STDINT_H)
+check_include_files (stdlib.h HAVE_STDLIB_H)
+set (CMAKE_REQUIRED_FLAGS "-DHAVE_NAMESPACES")
+check_cxx_source_compiles ("
+ #include <list>
+ #include <deque>
+ #ifdef HAVE_NAMESPACES
+ using namespace std;
+#endif
+int
+main ()
+{
+list<int> x; x.push_back(5);
+list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;
+ ;
+ return 0;
+}" HAVE_STL)
+check_include_files (strings.h HAVE_STRINGS_H)
+check_include_files (string.h HAVE_STRING_H)
+check_include_files (sys/stat.h HAVE_SYS_STAT_H)
+check_include_files (sys/time.h HAVE_SYS_TIME_H)
+check_include_files (sys/types.h HAVE_SYS_TYPES_H)
+check_include_files (sys/utsname.h HAVE_SYS_UTSNAME_H)
+check_symbol_exists (uname sys/utsname.h HAVE_UNAME)
+check_include_files (unistd.h HAVE_UNISTD_H)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cgicc/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cgicc/CgiDefs.h.in ${CMAKE_CURRENT_BINARY_DIR}/CgiDefs.h @ONLY)
+add_definitions (-DHAVE_CONFIG_H)
+set (cgicc_SOURCES
+ cgicc/CgiEnvironment.cpp
+ cgicc/CgiInput.cpp
+ cgicc/CgiUtils.cpp
+ cgicc/Cgicc.cpp
+ cgicc/FormEntry.cpp
+ cgicc/FormFile.cpp
+ cgicc/HTMLAttribute.cpp
+ cgicc/HTMLAttributeList.cpp
+ cgicc/HTMLDoctype.cpp
+ cgicc/HTMLElement.cpp
+ cgicc/HTMLElementList.cpp
+ cgicc/HTTPContentHeader.cpp
+ cgicc/HTTPCookie.cpp
+ cgicc/HTTPHTMLHeader.cpp
+ cgicc/HTTPHeader.cpp
+ cgicc/HTTPPlainHeader.cpp
+ cgicc/HTTPRedirectHeader.cpp
+ cgicc/HTTPResponseHeader.cpp
+ cgicc/HTTPStatusHeader.cpp
+ cgicc/HTTPXHTMLHeader.cpp
+ cgicc/MStreamable.cpp
+ cgicc/XHTMLDoctype.cpp
+cgicc/XMLPI.cpp)
+set (cgicc_HEADERS
+ cgicc/Cgicc.h
+ cgicc/CgiEnvironment.h
+ cgicc/CgiInput.h
+ cgicc/CgiUtils.h
+ cgicc/FormEntry.h
+ cgicc/FormFile.h
+ cgicc/HTMLAtomicElement.h
+ cgicc/HTMLAttribute.h
+ cgicc/HTMLAttributeList.h
+ cgicc/HTMLBooleanElement.h
+ cgicc/HTMLClasses.h
+ cgicc/HTMLDoctype.h
+ cgicc/HTMLElement.h
+ cgicc/HTMLElementList.h
+ cgicc/HTTPContentHeader.h
+ cgicc/HTTPCookie.h
+ cgicc/HTTPHeader.h
+ cgicc/HTTPHTMLHeader.h
+ cgicc/HTTPPlainHeader.h
+ cgicc/HTTPRedirectHeader.h
+ cgicc/HTTPResponseHeader.h
+ cgicc/HTTPStatusHeader.h
+ cgicc/HTTPXHTMLHeader.h
+ cgicc/MStreamable.h
+ cgicc/XHTMLDoctype.h
+ cgicc/XMLDeclaration.h
+ cgicc/XMLPI.h
+ ${CMAKE_CURRENT_BINARY_DIR}/CgiDefs.h
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h
+)
+
+include_directories (. ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+add_library (cgicc ${cgicc_SOURCES} ${cgicc_HEADERS})
+
+if (BUILD_SHARED_LIBS)
+ add_definitions(-DCGICC_EXPORTS)
+else()
+ add_definitions(-DCGICC_STATIC)
+endif()
+
+install(TARGETS cgicc
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES ${cgicc_HEADERS} DESTINATION include/cgicc)
+endif()
diff --git a/vcpkg/ports/cgicc/fix-define.patch b/vcpkg/ports/cgicc/fix-define.patch
new file mode 100644
index 0000000..2c3f9bc
--- /dev/null
+++ b/vcpkg/ports/cgicc/fix-define.patch
@@ -0,0 +1,22 @@
+diff --git a/cgicc/config.h.in b/cgicc/config.h.in
+index 6870cc2..ee7b5b4 100644
+--- a/cgicc/config.h.in
++++ b/cgicc/config.h.in
+@@ -76,7 +76,7 @@
+ #undef HAVE__BOOL
+
+ /* The host system cgicc was configured for */
+-#undef HOST
++#cmakedefine HOST "@HOST@"
+
+ /* Define to the sub-directory where libtool stores uninstalled libraries. */
+ #undef LT_OBJDIR
+@@ -106,7 +106,7 @@
+ #undef STDC_HEADERS
+
+ /* Version number of package */
+-#undef VERSION
++#cmakedefine VERSION "@VERSION@"
+
+ /* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
diff --git a/vcpkg/ports/cgicc/fix-static-build.patch b/vcpkg/ports/cgicc/fix-static-build.patch
new file mode 100644
index 0000000..4bd2179
--- /dev/null
+++ b/vcpkg/ports/cgicc/fix-static-build.patch
@@ -0,0 +1,15 @@
+diff --git a/cgicc/CgiDefs.h.in b/cgicc/CgiDefs.h.in
+index 71b70ad..3793cd8 100644
+--- a/cgicc/CgiDefs.h.in
++++ b/cgicc/CgiDefs.h.in
+@@ -47,7 +47,9 @@
+ #ifdef WIN32
+
+ // export library symbols
+-# ifdef CGICC_EXPORTS
++# ifdef CGICC_STATIC
++# define CGICC_API
++# elif defined(CGICC_EXPORTS)
+ # define CGICC_API __declspec(dllexport)
+ # else
+ # define CGICC_API __declspec(dllimport)
diff --git a/vcpkg/ports/cgicc/portfile.cmake b/vcpkg/ports/cgicc/portfile.cmake
new file mode 100644
index 0000000..f417dc3
--- /dev/null
+++ b/vcpkg/ports/cgicc/portfile.cmake
@@ -0,0 +1,39 @@
+vcpkg_download_distfile(ARCHIVE
+ URLS
+ "https://ftpmirror.gnu.org/cgicc/cgicc-${VERSION}.tar.gz"
+ "https://ftp.gnu.org/gnu/cgicc/cgicc-${VERSION}.tar.gz"
+ "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/cgicc/cgicc-${VERSION}.tar.gz"
+ FILENAME "cgicc-${VERSION}.tar.gz"
+ SHA512 e57b8f30b26b29008bcf1ffc3b2d272bdbd77848fb02e24912b6182ae90923d5933b9d204c556ac922a389f73ced465065b6e2202fc0c3d008e0e6038e7c8052
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ fix-define.patch
+ fix-static-build.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCMAKE_CXX_STANDARD=11 # 17 removes std::unary_function
+ OPTIONS_DEBUG
+ -DDISABLE_INSTALL_HEADERS=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+file(READ "${CURRENT_PACKAGES_DIR}/include/cgicc/CgiDefs.h" CGI_H)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ string(REPLACE "# ifdef CGICC_STATIC" "# if 0" CGI_H "${CGI_H}")
+else()
+ string(REPLACE "# ifdef CGICC_STATIC" "# if 1" CGI_H "${CGI_H}")
+endif()
+file(WRITE "${CURRENT_PACKAGES_DIR}/include/cgicc/CgiDefs.h" "${CGI_H}")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.DOC")
diff --git a/vcpkg/ports/cgicc/vcpkg.json b/vcpkg/ports/cgicc/vcpkg.json
new file mode 100644
index 0000000..c1bfc42
--- /dev/null
+++ b/vcpkg/ports/cgicc/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "cgicc",
+ "version": "3.2.20",
+ "port-version": 2,
+ "description": "GNU Cgicc is an ANSI C++ compliant class library that greatly simplifies the creation of CGI applications for the World Wide Web",
+ "homepage": "https://www.gnu.org/software/cgicc/",
+ "license": "LGPL-2.1-or-later",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}