diff --git a/ports/cmocka/CONTROL b/ports/cmocka/CONTROL deleted file mode 100644 index 090b8ca799..0000000000 --- a/ports/cmocka/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: cmocka -Version: 1.1.5 -Port-Version: 3 -Description: An elegant unit testing framework for C with support for mock objects diff --git a/ports/cmocka/fix-uwp.patch b/ports/cmocka/fix-uwp.patch deleted file mode 100644 index cb3828b1c2..0000000000 --- a/ports/cmocka/fix-uwp.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmocka.c b/src/cmocka.c -index 6bfc831..4c1c04b 100644 ---- a/src/cmocka.c -+++ b/src/cmocka.c -@@ -3356,7 +3356,7 @@ int _run_tests(const UnitTest * const tests, const size_t number_of_tests) { - int _run_group_tests(const UnitTest * const tests, const size_t number_of_tests) - { - UnitTestFunction setup = NULL; -- const char *setup_name; -+ const char *setup_name = NULL; - size_t num_setups = 0; - UnitTestFunction teardown = NULL; - const char *teardown_name = NULL; diff --git a/ports/cmocka/portfile.cmake b/ports/cmocka/portfile.cmake index a448d3a70c..220868ebb3 100644 --- a/ports/cmocka/portfile.cmake +++ b/ports/cmocka/portfile.cmake @@ -1,28 +1,20 @@ -include(vcpkg_common_functions) - vcpkg_from_gitlab( GITLAB_URL https://gitlab.com OUT_SOURCE_PATH SOURCE_PATH REPO cmocka/cmocka - REF cmocka-1.1.5 - SHA512 4e305e500f448676be5503972c49089c51f38b47d8129add2205608ed73f9de8b911aee83c00da4ef52c0179a5b5ba0e3386f3bca839f18e7ab21787184d9990 + REF 672c5cee79eb412025c3dd8b034e611c1f119055 + SHA512 e02ffe780698ce3930aceb1b927f7d48c932c6bb251a32b1f4ab44ecb4ff6bfe5c2a6b9e2dfede49cd4cc1d68a8bb903ef1d26c28536abf3581a9d803287aa0a HEAD_REF master - PATCHES - shared-lib.patch - static-lib.patch - fix-uwp.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIB) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DWITH_CMOCKERY_SUPPORT=ON -DUNIT_TESTING=OFF -DWITH_EXAMPLES=OFF - -DBUILD_STATIC_LIB=${BUILD_STATIC_LIB} - -DWITH_STATIC_LIB=${BUILD_STATIC_LIB} + -DPICKY_DEVELOPER=OFF ) vcpkg_install_cmake() @@ -31,18 +23,6 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -file(COPY - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - -# Install usage -configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# CMake integration test -#vcpkg_test_cmake(PACKAGE_NAME ${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cmocka/shared-lib.patch b/ports/cmocka/shared-lib.patch deleted file mode 100644 index 8c2f76277b..0000000000 --- a/ports/cmocka/shared-lib.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5684685..8555169 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,7 +30,7 @@ if (WIN32) - cmocka.def - ) - endif (WIN32) -- -+if (BUILD_SHARED_LIBS) - add_library(${CMOCKA_SHARED_LIBRARY} SHARED ${cmocka_SRCS}) - - target_include_directories(${CMOCKA_SHARED_LIBRARY} -@@ -82,7 +82,7 @@ install(TARGETS - ${CMAKE_INSTALL_BINDIR} - COMPONENT - ${PROJECT_NAME}) -- -+endif (BUILD_SHARED_LIBS) - if (BUILD_STATIC_LIB) - add_library(${CMOCKA_STATIC_LIBRARY} STATIC ${cmocka_SRCS}) - diff --git a/ports/cmocka/static-lib.patch b/ports/cmocka/static-lib.patch deleted file mode 100644 index f879fe25bd..0000000000 --- a/ports/cmocka/static-lib.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 00e568e..6e3489a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -77,9 +77,17 @@ install( - - # cmake config files - if (WIN32) -+ if (BUILD_SHARED_LIBS) - set(CMOCKA_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}) -+ else() -+ set(CMOCKA_LIBRARY_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}${CMOCKA_STATIC_LIBRARY}${CMAKE_IMPORT_LIBRARY_SUFFIX}) -+ endif() - else() -+ if (BUILD_SHARED_LIBS) - set(CMOCKA_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ else() -+ set(CMOCKA_LIBRARY_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}${CMOCKA_STATIC_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}) -+ endif() - endif() - - set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE INTERNAL "") diff --git a/ports/cmocka/usage b/ports/cmocka/usage deleted file mode 100644 index 59f2a5da8b..0000000000 --- a/ports/cmocka/usage +++ /dev/null @@ -1,5 +0,0 @@ -The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: - - find_package(@PORT@ CONFIG REQUIRED) - target_include_directories(main PRIVATE ${CMOCKA_INCLUDE_DIR}) - target_link_libraries(main PRIVATE ${CMOCKA_LIBRARIES}) diff --git a/ports/cmocka/vcpkg-cmake-wrapper.cmake b/ports/cmocka/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 49b486ff83..0000000000 --- a/ports/cmocka/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,10 +0,0 @@ -_find_package(${ARGS}) - -get_filename_component(_cmocka_lib_name ${CMOCKA_LIBRARY} NAME) - -set(CMOCKA_LIBRARY - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/${_cmocka_lib_name} - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/${_cmocka_lib_name} -) - -set(CMOCKA_LIBRARIES ${CMOCKA_LIBRARY}) diff --git a/ports/cmocka/vcpkg.json b/ports/cmocka/vcpkg.json new file mode 100644 index 0000000000..d7bcbcf496 --- /dev/null +++ b/ports/cmocka/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "cmocka", + "version-string": "2020-08-01", + "description": "An elegant unit testing framework for C with support for mock objects", + "homepage": "https://cmocka.org/", + "license": "Apache-2.0" +}