diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-06-20 14:52:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-20 14:52:54 -0700 |
| commit | 1bebd8d40d60f5958abe8fe5015125407fabc07c (patch) | |
| tree | bd8b8d519564822c515640c85471f4109491f1ec | |
| parent | befe2531f620471e1b2c5562c9994420e03c008a (diff) | |
| parent | b29b05ed8cd1a850a86010dd16cd1d7e0558134d (diff) | |
| download | vcpkg-1bebd8d40d60f5958abe8fe5015125407fabc07c.tar.gz vcpkg-1bebd8d40d60f5958abe8fe5015125407fabc07c.zip | |
Merge pull request #1318 from codicodi/utf8proc
[utf8proc] new port
| -rw-r--r-- | ports/utf8proc/CONTROL | 3 | ||||
| -rw-r--r-- | ports/utf8proc/fix-buildsystem.patch | 48 | ||||
| -rw-r--r-- | ports/utf8proc/portfile.cmake | 28 |
3 files changed, 79 insertions, 0 deletions
diff --git a/ports/utf8proc/CONTROL b/ports/utf8proc/CONTROL new file mode 100644 index 000000000..1dcbbbef1 --- /dev/null +++ b/ports/utf8proc/CONTROL @@ -0,0 +1,3 @@ +Source: utf8proc +Version: 2.1.0 +Description: Clean C library for processing UTF-8 Unicode data. diff --git a/ports/utf8proc/fix-buildsystem.patch b/ports/utf8proc/fix-buildsystem.patch new file mode 100644 index 000000000..17af16c9b --- /dev/null +++ b/ports/utf8proc/fix-buildsystem.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be676ba..7a2b6d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,9 +13,9 @@ set(SO_MAJOR 2) + set(SO_MINOR 1) + set(SO_PATCH 0) + +-add_definitions ( +- -DUTF8PROC_EXPORTS +-) ++if(BUILD_SHARED_LIBS) ++ add_definitions(-DUTF8PROC_EXPORTS -DUTF8PROC_SHARED) ++endif() + + if (NOT MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall") +@@ -31,3 +31,10 @@ set_target_properties (utf8proc PROPERTIES + VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}" + SOVERSION ${SO_MAJOR} + ) ++ ++install(TARGETS utf8proc ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++ ++install(FILES utf8proc.h DESTINATION include) +diff --git a/utf8proc.h b/utf8proc.h +index edf46d4..7b3f11a 100644 +--- a/utf8proc.h ++++ b/utf8proc.h +@@ -120,13 +120,13 @@ typedef bool utf8proc_bool; + #endif + #include <limits.h> + +-#ifdef _WIN32 ++#if defined _WIN32 && defined UTF8PROC_SHARED + # ifdef UTF8PROC_EXPORTS + # define UTF8PROC_DLLEXPORT __declspec(dllexport) + # else + # define UTF8PROC_DLLEXPORT __declspec(dllimport) + # endif +-#elif __GNUC__ >= 4 ++#elif __GNUC__ >= 4 && defined UTF8PROC_SHARED + # define UTF8PROC_DLLEXPORT __attribute__ ((visibility("default"))) + #else + # define UTF8PROC_DLLEXPORT diff --git a/ports/utf8proc/portfile.cmake b/ports/utf8proc/portfile.cmake new file mode 100644 index 000000000..64244ec03 --- /dev/null +++ b/ports/utf8proc/portfile.cmake @@ -0,0 +1,28 @@ +include(vcpkg_common_functions) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO JuliaLang/utf8proc + REF v2.1.0 + SHA512 72b7f377fa6a62018d3eeab8723a27e25db3d1f794ae0bf21fff62ec1a7439bec52e7c93d2a00c218de6ff518097fb4a7a87c56e61ba8c98e689aa8f7171c812) + +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(READ ${CURRENT_PACKAGES_DIR}/include/utf8proc.h UTF8PROC_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + string(REPLACE "defined UTF8PROC_SHARED" "0" UTF8PROC_H "${UTF8PROC_H}") +else() + string(REPLACE "defined UTF8PROC_SHARED" "1" UTF8PROC_H "${UTF8PROC_H}") +endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/utf8proc.h "${UTF8PROC_H}") + +file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/utf8proc) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/utf8proc/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/utf8proc/copyright) |
