diff --git a/ports/pfultz2-linq/CONTROL b/ports/pfultz2-linq/CONTROL new file mode 100644 index 00000000000000..3cd309de4e61ea --- /dev/null +++ b/ports/pfultz2-linq/CONTROL @@ -0,0 +1,4 @@ +Source: pfultz2-linq +Version: 2018-02-08 +Description: Linq for list comprehension in C++ +Build-Depends: boost-fusion, boost-iterator, boost-mpl, boost-optional, boost-preprocessor, boost-range, boost-static-assert, boost-type-traits, boost-unordered, boost-utility diff --git a/ports/pfultz2-linq/fix-cmake.patch b/ports/pfultz2-linq/fix-cmake.patch new file mode 100644 index 00000000000000..da6838a8bcdbaa --- /dev/null +++ b/ports/pfultz2-linq/fix-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 34ae7c7..dd35281 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,5 @@ + cmake_minimum_required(VERSION 3.0) +-project(linq) +- +-enable_testing() ++project(linq CXX) + + find_package(Boost) + +@@ -37,6 +35,10 @@ install(FILES + install(FILES linq.h DESTINATION include) + install(DIRECTORY linq DESTINATION include) + +-add_executable(linq-test test.cpp) +-target_link_libraries(linq-test linq ${Boost_test_LIBRARY_RELEASE}) +-add_test(NAME linq-test COMMAND linq-test) ++include(CTest) ++ ++if (BUILD_TESTING) ++ add_executable(linq-test test.cpp) ++ target_link_libraries(linq-test linq ${Boost_test_LIBRARY_RELEASE}) ++ add_test(NAME linq-test COMMAND linq-test) ++endif (BUILD_TESTING) diff --git a/ports/pfultz2-linq/portfile.cmake b/ports/pfultz2-linq/portfile.cmake new file mode 100644 index 00000000000000..fe03a89dfbc775 --- /dev/null +++ b/ports/pfultz2-linq/portfile.cmake @@ -0,0 +1,32 @@ +# header-only library + +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pfultz2/Linq + REF 51e45d25faa95f945d0bf515f214feed4401e542 + SHA512 128973f79f1cc1f63b5ad4501cc3247352559de382c2ab2fc8fb2df90f8926e373db3469414a2e3816f27fb606c1139a25e94b4e5203201e7ab0320b4b004b4d + HEAD_REF master + PATCHES + fix-cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/linq TARGET_PATH share/linq) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +# CMake integration test +vcpkg_test_cmake(PACKAGE_NAME linq)