diff --git a/ports/zimpl/libm.diff b/ports/zimpl/libm.diff new file mode 100644 index 00000000000000..6b340cc47983a2 --- /dev/null +++ b/ports/zimpl/libm.diff @@ -0,0 +1,13 @@ +diff --git a/zimpl/CMakeLists.txt b/zimpl/CMakeLists.txt +index 7cf9d85..07fa187 100644 +--- a/zimpl/CMakeLists.txt ++++ b/zimpl/CMakeLists.txt +@@ -151,6 +151,8 @@ include(CheckSymbolExists) + find_library(libm m) + if(NOT libm) + set(libm "") ++else() ++ set(libm m) + endif() + + set(libs ${libs} ${libm}) diff --git a/ports/zimpl/msvc.diff b/ports/zimpl/msvc.diff new file mode 100644 index 00000000000000..dc152d0649fb56 --- /dev/null +++ b/ports/zimpl/msvc.diff @@ -0,0 +1,48 @@ +diff --git a/zimpl/CMakeLists.txt b/zimpl/CMakeLists.txt +index 7cf9d85..85d33a7 100644 +--- a/zimpl/CMakeLists.txt ++++ b/zimpl/CMakeLists.txt +@@ -4,7 +4,7 @@ project(ZIMPL + VERSION 3.5.3 + LANGUAGES C) + +-if(CMAKE_BUILD_TYPE STREQUAL "Debug") ++if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT WIN32) + # if changing these flags, also update GCCWARN/GXXWARN in make/make.project + set(ADD_C_FLAGS -Wall -Wextra -Wno-unknown-pragmas -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-noreturn -Wmissing-declarations -fno-omit-frame-pointer) + +@@ -112,7 +112,6 @@ if(MSVC) + ) + + foreach(variable ${variables}) +- string(REGEX REPLACE "/M[T,D][ d]" "" ${variable} "${${variable}}") + # message("${variable} = ${${variable}}") + endforeach() + endif() +@@ -128,9 +127,11 @@ if(ZLIB_FOUND) + include_directories(${ZLIB_INCLUDE_DIRS}) + else() + add_definitions(-DWITHOUT_ZLIB) ++endif() + +- # look for pcre if ZLIB could not be found +- find_package(PCRE) ++if(WIN32) ++ find_package(PCRE NAMES pcre2 REQUIRED) ++ set(PCRE_LIBRARIES "$") + if(PCRE_FOUND) + add_definitions(-DWITH_PCRE) + add_definitions(-DPCRE2_STATIC) +diff --git a/zimpl/zimpl-config.cmake.in b/zimpl/zimpl-config.cmake.in +index b653f0c..946f6f2 100644 +--- a/zimpl/zimpl-config.cmake.in ++++ b/zimpl/zimpl-config.cmake.in +@@ -1,3 +1,8 @@ ++if(WIN32) ++ include(CMakeFindDependencyMacro) ++ find_dependency(pcre2) ++endif() ++ + if(NOT TARGET libzimpl) + include("${CMAKE_CURRENT_LIST_DIR}/zimpl-targets.cmake") + endif() diff --git a/ports/zimpl/portfile.cmake b/ports/zimpl/portfile.cmake new file mode 100644 index 00000000000000..03da58ee05b375 --- /dev/null +++ b/ports/zimpl/portfile.cmake @@ -0,0 +1,40 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +# The latest version of ZIMPL is included in the SCIP Optimization Suite. +set(scipoptsuite_version 8.0.4) +vcpkg_download_distfile(ARCHIVE + URLS "https://scipopt.org/download/release/scipoptsuite-${scipoptsuite_version}.tgz" + SHA512 46b56b3a4a5fcb4d6d53b5ffd9320bdf37fb55b9b8450a065312aa1e4f88863d3c563a495cf2622ef70a80132149c7b8f36cdb9a9e43906f4cfcafcb9dd6d606 + FILENAME "scipoptsuite-${scipoptsuite_version}.tgz" +) +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES + libm.diff + msvc.diff +) + +vcpkg_find_acquire_program(BISON) +vcpkg_find_acquire_program(FLEX) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}/zimpl" + OPTIONS + -DBREW=false + "-DBISON_EXECUTABLE=${BISON}" + "-DFLEX_EXECUTABLE=${FLEX}" + -DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=1 + MAYBE_UNUSED_VARIABLES + BREW +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zimpl) +vcpkg_copy_tools(TOOL_NAMES zimpl AUTO_CLEAN) + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zimpl/zimpl-config.cmake" "../../../include" "../../include") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zimpl/mmlparse2.h" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/zimpl/" "") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/zimpl/LICENSE") diff --git a/ports/zimpl/vcpkg.json b/ports/zimpl/vcpkg.json new file mode 100644 index 00000000000000..a2d2e04d97f3db --- /dev/null +++ b/ports/zimpl/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "zimpl", + "version": "3.5.3", + "description": "Zuse Institut Mathematical Programming Language", + "homepage": "http://zimpl.zib.de/", + "license": "LGPL-3.0-or-later", + "supports": "!uwp", + "dependencies": [ + "gmp", + { + "name": "pcre2", + "platform": "windows" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index f4d838227aeebc..c897724513eedd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9300,6 +9300,10 @@ "baseline": "1.0.0", "port-version": 1 }, + "zimpl": { + "baseline": "3.5.3", + "port-version": 0 + }, "zint": { "baseline": "2.12.0", "port-version": 1 diff --git a/versions/z-/zimpl.json b/versions/z-/zimpl.json new file mode 100644 index 00000000000000..a9a9269988c89e --- /dev/null +++ b/versions/z-/zimpl.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "6598ebbe8c537c546a9cc0d71c8fd9e0a4dd6b94", + "version": "3.5.3", + "port-version": 0 + } + ] +}