aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libcorrect
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libcorrect')
-rw-r--r--vcpkg/ports/libcorrect/fix-ninja.patch54
-rw-r--r--vcpkg/ports/libcorrect/portfile.cmake13
-rw-r--r--vcpkg/ports/libcorrect/vcpkg.json17
3 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/libcorrect/fix-ninja.patch b/vcpkg/ports/libcorrect/fix-ninja.patch
new file mode 100644
index 0000000..adaa243
--- /dev/null
+++ b/vcpkg/ports/libcorrect/fix-ninja.patch
@@ -0,0 +1,54 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2e8e07e..1e8355d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,8 +31,6 @@ else()
+ endif()
+ endif(MSVC)
+
+-find_library(FEC fec)
+-CHECK_LIBRARY_EXISTS(FEC dotprod "" HAVE_LIBFEC)
+
+ if(NOT CMAKE_CROSSCOMPILING)
+ # Check if host machine can compile with SSE 4.1 intrinsic
+@@ -72,12 +70,13 @@ if(HAVE_SSE)
+ else()
+ set(correct_obj_files $<TARGET_OBJECTS:correct-reed-solomon> $<TARGET_OBJECTS:correct-convolutional>)
+ endif()
+-add_library(correct SHARED ${correct_obj_files})
+-add_library(correct_static ${correct_obj_files})
+-set_target_properties(correct_static PROPERTIES OUTPUT_NAME "correct")
++if (BUILD_SHARED_LIBS)
++ add_library(correct SHARED ${correct_obj_files})
++else()
++ add_library(correct ${correct_obj_files})
++endif()
+ if(HAVE_SSE)
+ target_compile_definitions(correct PUBLIC HAVE_SSE=1)
+- target_compile_definitions(correct_static PUBLIC HAVE_SSE=1)
+ endif()
+
+ add_subdirectory(util)
+@@ -85,18 +84,8 @@ add_subdirectory(tests)
+ add_subdirectory(tools)
+ # add_subdirectory(benchmarks)
+
+-install(TARGETS correct correct_static
+- DESTINATION lib)
++install(TARGETS correct
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
+ install(FILES ${INSTALL_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
+-
+-add_library(fec_shim_static EXCLUDE_FROM_ALL src/fec_shim.c ${correct_obj_files})
+-set_target_properties(fec_shim_static PROPERTIES OUTPUT_NAME "fec")
+-add_library(fec_shim_shared SHARED EXCLUDE_FROM_ALL src/fec_shim.c ${correct_obj_files})
+-set_target_properties(fec_shim_shared PROPERTIES OUTPUT_NAME "fec")
+-add_custom_target(fec-shim-h COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/include/fec_shim.h ${PROJECT_BINARY_DIR}/include/fec.h)
+-add_custom_target(shim DEPENDS fec_shim_static fec_shim_shared fec-shim-h)
+-
+-install(TARGETS fec_shim_static fec_shim_shared
+- DESTINATION lib
+- OPTIONAL)
+-install(FILES ${PROJECT_BINARY_DIR}/include/fec.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include" OPTIONAL)
diff --git a/vcpkg/ports/libcorrect/portfile.cmake b/vcpkg/ports/libcorrect/portfile.cmake
new file mode 100644
index 0000000..f4f44f7
--- /dev/null
+++ b/vcpkg/ports/libcorrect/portfile.cmake
@@ -0,0 +1,13 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO quiet/libcorrect
+ REF f5a28c74fba7a99736fe49d3a5243eca29517ae9
+ SHA512 1367834c2a081e007b3eeeacb5bbe912617cce97cbd19d43193078f352fef103a54f030ef61a2def4ab7517476cf6be5d6a1736e43ae84913fe84a56340b69ce
+ HEAD_REF master
+ PATCHES fix-ninja.patch
+)
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
+vcpkg_cmake_install()
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
diff --git a/vcpkg/ports/libcorrect/vcpkg.json b/vcpkg/ports/libcorrect/vcpkg.json
new file mode 100644
index 0000000..2a0b966
--- /dev/null
+++ b/vcpkg/ports/libcorrect/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "libcorrect",
+ "version-date": "2018-10-11",
+ "description": "libcorrect is a library for Forward Error Correction",
+ "homepage": "https://github.com/quiet/libcorrect",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}