diff --git a/ports/ode/0001-add-static-runtime-option.patch b/ports/ode/0001-add-static-runtime-option.patch deleted file mode 100644 index 1f0d15b5643..00000000000 --- a/ports/ode/0001-add-static-runtime-option.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/build/premake4.lua b/build/premake4.lua -index c39b9b7..d1559f7 100644 ---- a/build/premake4.lua -+++ b/build/premake4.lua -@@ -150,7 +150,12 @@ - trigger = "only-double", - description = "Only use double-precision math" - } -- -+ -+ newoption { -+ trigger = "static-runtime", -+ description = "Perform a static link against the standard runtime libraries" -+ } -+ - -- always clean all of the optional components and toolsets - if _ACTION == "clean" then - _OPTIONS["with-demos"] = "" -@@ -253,7 +258,11 @@ - configuration { "vs2002 or vs2003", "*Lib" } - flags { "StaticRuntime" } - -- -+ -- optionally enable StaticRuntime -+ if _OPTIONS["static-runtime"] then -+ configuration { "*" } -+ flags { "StaticRuntime" } -+ end - - ---------------------------------------------------------------------- - -- The demo projects, automated from list above. These go first so diff --git a/ports/ode/CONTROL b/ports/ode/CONTROL index 3754de88b97..5658a5a7afa 100644 --- a/ports/ode/CONTROL +++ b/ports/ode/CONTROL @@ -1,4 +1,4 @@ Source: ode -Version: 0.15.1-3 +Version: 0.16 Homepage: https://bitbucket.org/odedevs/ode/src/default/ Description: Open Dynamics Engine diff --git a/ports/ode/portfile.cmake b/ports/ode/portfile.cmake index 729740c4517..a45777fb6a5 100644 --- a/ports/ode/portfile.cmake +++ b/ports/ode/portfile.cmake @@ -1,92 +1,27 @@ include(vcpkg_common_functions) -set(SOURCE_VERSION 0.15.1) - -vcpkg_download_distfile(ARCHIVE - URLS "https://bitbucket.org/odedevs/ode/downloads/ode-${SOURCE_VERSION}.tar.gz" - FILENAME "ode-${SOURCE_VERSION}.tar.gz" - SHA512 e30623374c8f7c45359d6d837313698ca28da7b5a2d26c7171da16ccd6f95c4a49aad731c432db6ca2911886948a2e7ea93a96ade5a1639b945a825d8ac87249 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_bitbucket( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - 0001-add-static-runtime-option.patch + REPO odedevs/ode + REF 0.16 + SHA512 6a98882aa3e6267423f745ec48f2472d330f94fa395c459e116174093ef1d479368efc0514ef04eff4e62eb7c3520a7a544fc3ed66ff2f1bd06bc13df4110581 + HEAD_REF master ) -if (TRIPLET_SYSTEM_ARCH MATCHES "arm") - message(FATAL_ERROR "ARM is currently not supported.") -elseif (TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(premake_PLATFORM "x32") - set(MSBUILD_PLATFORM "Win32") -else () - set(premake_PLATFORM ${TRIPLET_SYSTEM_ARCH}) - set(MSBUILD_PLATFORM ${TRIPLET_SYSTEM_ARCH}) -endif() - -# The build system of ode outputs its artifacts in this subdirectory -# of the source directory -set(DEBUG_ARTIFACTS_PATH ${SOURCE_PATH}/lib/Debug) -set(RELEASE_ARTIFACTS_PATH ${SOURCE_PATH}/lib/Release) - -# To avoid contamination from previous build, we clean the directory -file(REMOVE_RECURSE ${DEBUG_ARTIFACTS_PATH} ${RELEASE_ARTIFACTS_PATH}) - -# Configure the project using the embedded premake4 -message(STATUS "Configuring ${TARGET_TRIPLET}") -# Consistently with the debian package we only ship ODE built with double precision -set(premake_OPTIONS "--only-double") -# TODO: use vcpkg's libccd -list(APPEND premake_OPTIONS --with-libccd) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - list(APPEND premake_OPTIONS --only-shared) -elseif(VCPKG_LIBRARY_LINKAGE STREQUAL static) - list(APPEND premake_OPTIONS --only-static) -endif() -if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - list(APPEND premake_OPTIONS --static-runtime) -endif() -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) -vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/build/premake4.exe - --to=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - --platform=${premake_PLATFORM} - ${premake_OPTIONS} - vs2010 - WORKING_DIRECTORY ${SOURCE_PATH}/build/ - LOGNAME config-${TARGET_TRIPLET} +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DODE_WITH_DEMOS=0 -DODE_WITH_TESTS=0 ) -message(STATUS "Configuring ${TARGET_TRIPLET} done") -# Build the project using the generated msbuild solutions -vcpkg_build_msbuild(PROJECT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/ode.sln - PLATFORM ${MSBUILD_PLATFORM} - WORKING_DIRECTORY ${SOURCE_PATH}/build) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ode-0.16.0) -# Install headers -file(GLOB HEADER_FILES ${SOURCE_PATH}/include/ode/*.h) -file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ode) - -# Install libraries -file(GLOB LIB_DEBUG_FILES ${DEBUG_ARTIFACTS_PATH}/*.lib ${DEBUG_ARTIFACTS_PATH}/*.exp) -file(INSTALL ${LIB_DEBUG_FILES} - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - -if (DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(GLOB BIN_DEBUG_FILES ${DEBUG_ARTIFACTS_PATH}/*.dll ${DEBUG_ARTIFACTS_PATH}/*.pdb) - file(INSTALL ${BIN_DEBUG_FILES} - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) -endif () - -file(GLOB LIB_RELEASE_FILES ${RELEASE_ARTIFACTS_PATH}/*.lib ${RELEASE_ARTIFACTS_PATH}/*.exp) -file(INSTALL ${LIB_RELEASE_FILES} - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - -if (DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(GLOB BIN_RELEASE_FILES ${RELEASE_ARTIFACTS_PATH}/*.dll ${RELEASE_ARTIFACTS_PATH}/*.pdb) - file(INSTALL ${BIN_RELEASE_FILES} - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -endif () - -file(INSTALL ${SOURCE_PATH}/LICENSE-BSD.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)