From af73b0e7c2bb055b4ac3439e0e690fc67ae7860e Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Wed, 22 Jul 2020 21:26:55 +0100 Subject: [PATCH 1/7] added libsbml port which works on windows x86 and x64. Tried it on linux with wsl but bzip2 dependency did not work --- ports/libsbml/CONTROL | 72 ++++++++++++++++++++++++++++++++++++ ports/libsbml/portfile.cmake | 63 +++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 ports/libsbml/CONTROL create mode 100644 ports/libsbml/portfile.cmake diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL new file mode 100644 index 00000000000000..54de57de3995ee --- /dev/null +++ b/ports/libsbml/CONTROL @@ -0,0 +1,72 @@ +Source: libsbml +Version: 5.18.0 +Description: A free, open-source programming library to help you read, write, manipulate, translate, and validate SBML files and data streams +Build-Depends: zlib, libxml2, bzip2, libiconv, expat +Port-Version: 1 + + +Feature: ENABLE_L3V2EXTENDEDMATH ON +Description: ENABLE_L3V2EXTENDEDMATH + +Feature: ENABLE_LAYOUT ON +Description: ENABLE_LAYOUT + +Feature: WITH_BZIP2 ON +Description: WITH_BZIP2 + +Feature: WITH_CHECK OFF +Description: WITH_CHECK + +Feature: WITH_CPP_NAMESPACE ON +Description: WITH_CPP_NAMESPACE + +Feature: WITH_CSHARP PFF +Description: WITH_CSHARP + +Feature: WITH_EXAMPLES OFF +Description: WITH_EXAMPLES + +Feature: WITH_EXPAT OFF +Description: WITH_EXPAT + +Feature: WITH_JAVA OFF +Description: WITH_JAVA + +Feature: WITH_JAVASCRIPT OFF +Description: WITH_JAVASCRIPT + +Feature: WITH_LIBXML ON +Description: WITH_LIBXML + +Feature: WITH_MATLAB OFF +Description: WITH_MATLAB + +Feature: WITH_OCTAVE OFF +Description: WITH_OCTAVE + +Feature: WITH_PERL OFF +Description: WITH_PERL + +Feature: WITH_PHP OFF +Description: WITH_PHP + +Feature: WITH_PYTHON OFF +Description: WITH_PYTHON + +Feature: WITH_R OFF +Description: WITH_R + +Feature: WITH_STATIC_RUNTIME OFF +Description: WITH_STATIC_RUNTIME + +Feature: WITH_XERCES OFF +Description: WITH_XERCES + +Feature: WITH_SWIG OFF +Description: WITH_SWIG + +Feature: WITH_XERCES OFF +Description: WITH_XERCES + +Feature: WITH_ZLIB ON +Description: WITH_ZLIB diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake new file mode 100644 index 00000000000000..e57b4e67670ddc --- /dev/null +++ b/ports/libsbml/portfile.cmake @@ -0,0 +1,63 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO opencor/libsbml + REF v5.18.0 + SHA512 7d48de4ab40018ba92206daf4f5e5376050c4497b589cdf86de0875e3986b5e6b27c4ae178df627d208e037cf32d8ab3d04e33a52e5e077db14999f4fb601ea5 + HEAD_REF master +) +message("SOURCE_PATH ${SOURCE_PATH}") +message("CURRENT_PACKAGES_DIR ${CURRENT_PACKAGES_DIR}") +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DWITH_CPP_NAMESPACE:BOOL=ON +) +vcpkg_install_cmake() + +# remove include files for libsbml +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/libsbml/cmake") + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libsbml/cmake) + + +configure_file("${CURRENT_PACKAGES_DIR}/LICENSE.txt" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) + + +set(FILES_TO_REMOVE + "${CURRENT_PACKAGES_DIR}/COPYING.txt" + "${CURRENT_PACKAGES_DIR}/FUNDING.txt" + "${CURRENT_PACKAGES_DIR}/LICENSE.txt" + "${CURRENT_PACKAGES_DIR}/NEWS.txt" + "${CURRENT_PACKAGES_DIR}/OLD_NEWS.txt" + "${CURRENT_PACKAGES_DIR}/README.txt" + "${CURRENT_PACKAGES_DIR}/VERSION.txt" + + "${CURRENT_PACKAGES_DIR}/debug/COPYING.txt" + "${CURRENT_PACKAGES_DIR}/debug/FUNDING.txt" + "${CURRENT_PACKAGES_DIR}/debug/LICENSE.txt" + "${CURRENT_PACKAGES_DIR}/debug/NEWS.txt" + "${CURRENT_PACKAGES_DIR}/debug/OLD_NEWS.txt" + "${CURRENT_PACKAGES_DIR}/debug/README.txt" + "${CURRENT_PACKAGES_DIR}/debug/VERSION.txt" + ) + + +foreach (f ${FILES_TO_REMOVE}) + file(REMOVE ${f}) +endforeach () + + + + + + + + + + + + + + From 1c3fd8f454006956ec68daccb0d1ae136cfa9fa4 Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Wed, 22 Jul 2020 22:28:59 +0100 Subject: [PATCH 2/7] add location to linux licence in sbml --- ports/libsbml/portfile.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index e57b4e67670ddc..085cc3873f89e7 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -21,8 +21,17 @@ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/libsbml/cmake") vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libsbml/cmake) +set(LICENCE_FILE "${CURRENT_PACKAGES_DIR}/LICENSE.txt") +if (NOT EXISTS "${LICENCE_FILE}") + message(STATUS "Licence file not found at ${LICENCE_fILE}") + set(LICENCE_FILE "${CURRENT_PACKAGES_DIR}/share/libsbml/LICENCE.txt") + message(STATUS "Setting licence to ${LICENCE_FILE}") + if (NOT EXISTS "${LICENCE_FILE}") + message(FATAL_ERROR "libsbml LICENCE.txt not found") + endif () +endif () -configure_file("${CURRENT_PACKAGES_DIR}/LICENSE.txt" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) +configure_file("${LICENCE_FILE}" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) set(FILES_TO_REMOVE @@ -49,7 +58,7 @@ foreach (f ${FILES_TO_REMOVE}) endforeach () - +vcpkg_copy_pdbs() From db4ab7532489f90dcb8580e1fd720139b20787a2 Mon Sep 17 00:00:00 2001 From: CiaranWelsh Date: Wed, 22 Jul 2020 11:51:06 +0100 Subject: [PATCH 3/7] fixed libsbml portfile for linux --- ports/libsbml/portfile.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index 085cc3873f89e7..cce695e9d74584 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -21,17 +21,17 @@ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/libsbml/cmake") vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libsbml/cmake) -set(LICENCE_FILE "${CURRENT_PACKAGES_DIR}/LICENSE.txt") -if (NOT EXISTS "${LICENCE_FILE}") - message(STATUS "Licence file not found at ${LICENCE_fILE}") - set(LICENCE_FILE "${CURRENT_PACKAGES_DIR}/share/libsbml/LICENCE.txt") - message(STATUS "Setting licence to ${LICENCE_FILE}") - if (NOT EXISTS "${LICENCE_FILE}") - message(FATAL_ERROR "libsbml LICENCE.txt not found") +set(LICENSE_FILE "${CURRENT_PACKAGES_DIR}/LICENSE.txt") +if (NOT EXISTS "${LICENSE_FILE}") + message(STATUS "LICENSE file not found at ${LICENSE_fILE}") + set(LICENSE_FILE "${CURRENT_PACKAGES_DIR}/share/libsbml/LICENSE.txt") + message(STATUS "Setting LICENSE to ${LICENSE_FILE}") + if (NOT EXISTS "${LICENSE_FILE}") + message(FATAL_ERROR "libsbml LICENSE.txt not found at ${LICENSE_FILE}") endif () endif () -configure_file("${LICENCE_FILE}" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) +configure_file("${LICENSE_FILE}" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) set(FILES_TO_REMOVE @@ -57,6 +57,7 @@ foreach (f ${FILES_TO_REMOVE}) file(REMOVE ${f}) endforeach () +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") vcpkg_copy_pdbs() From e7a6078bdd8e646711f7ed831f9ac2e3f5d46169 Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Mon, 14 Sep 2020 11:44:52 +0100 Subject: [PATCH 4/7] added vckpg port for libsbml. Referencing vcpkg github issue #12558 and a big thanks to JackBoosY for doing most of the work. --- ports/libsbml/CONTROL | 91 +++++++----------- ports/libsbml/fix-linkage-type.patch | 22 +++++ ports/libsbml/portfile.cmake | 139 ++++++++++++++++----------- ports/openblas/portfile.cmake | 2 +- 4 files changed, 140 insertions(+), 114 deletions(-) create mode 100644 ports/libsbml/fix-linkage-type.patch diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL index 54de57de3995ee..2b52fbe9e3a4eb 100644 --- a/ports/libsbml/CONTROL +++ b/ports/libsbml/CONTROL @@ -1,72 +1,49 @@ Source: libsbml Version: 5.18.0 -Description: A free, open-source programming library to help you read, write, manipulate, translate, and validate SBML files and data streams -Build-Depends: zlib, libxml2, bzip2, libiconv, expat -Port-Version: 1 +Description: A library for reading / writing SBML files +Default-Features: expat, comp, fbc, groups, layout, render +Build-Depends: libsbml[expat], libsbml[libxml2] +Feature: check +Description: Unit testing of libSBMLs implementation +Build-Depends: check -Feature: ENABLE_L3V2EXTENDEDMATH ON -Description: ENABLE_L3V2EXTENDEDMATH +Feature: bzip2 +Description: bz2 compression support for libsbml +Build-Depends: bzip2 -Feature: ENABLE_LAYOUT ON -Description: ENABLE_LAYOUT +Feature: zlib +Description: gzip compression support for libsbml +Build-Depends: zlib -Feature: WITH_BZIP2 ON -Description: WITH_BZIP2 +Feature: expat +Description: libsbml using expat parser +Build-Depends: expat -Feature: WITH_CHECK OFF -Description: WITH_CHECK +Feature: libxml2 +Description: libsbml using libxml2 parser +Build-Depends: libxml2 -Feature: WITH_CPP_NAMESPACE ON -Description: WITH_CPP_NAMESPACE +Feature: comp +Description: support for Hierarchical Model Composition -Feature: WITH_CSHARP PFF -Description: WITH_CSHARP +Feature: fbc +Description: support for Flux Balance Constrant Modeling -Feature: WITH_EXAMPLES OFF -Description: WITH_EXAMPLES +Feature: groups +Description: support for Groups -Feature: WITH_EXPAT OFF -Description: WITH_EXPAT +Feature: layout +Description: support for Pathway Layouts -Feature: WITH_JAVA OFF -Description: WITH_JAVA +Feature: multi +Description: support for Multistate Modeling -Feature: WITH_JAVASCRIPT OFF -Description: WITH_JAVASCRIPT +Feature: qual +Description: support for Qualitative Modeling -Feature: WITH_LIBXML ON -Description: WITH_LIBXML +Feature: render +Description: support for Rendering information -Feature: WITH_MATLAB OFF -Description: WITH_MATLAB - -Feature: WITH_OCTAVE OFF -Description: WITH_OCTAVE - -Feature: WITH_PERL OFF -Description: WITH_PERL - -Feature: WITH_PHP OFF -Description: WITH_PHP - -Feature: WITH_PYTHON OFF -Description: WITH_PYTHON - -Feature: WITH_R OFF -Description: WITH_R - -Feature: WITH_STATIC_RUNTIME OFF -Description: WITH_STATIC_RUNTIME - -Feature: WITH_XERCES OFF -Description: WITH_XERCES - -Feature: WITH_SWIG OFF -Description: WITH_SWIG - -Feature: WITH_XERCES OFF -Description: WITH_XERCES - -Feature: WITH_ZLIB ON -Description: WITH_ZLIB +Feature: namespace +Description: Build with the WITH_CPP_NAMESPACE option set to on \ No newline at end of file diff --git a/ports/libsbml/fix-linkage-type.patch b/ports/libsbml/fix-linkage-type.patch new file mode 100644 index 00000000000000..08186357ad360c --- /dev/null +++ b/ports/libsbml/fix-linkage-type.patch @@ -0,0 +1,22 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index eb692cf..11158db 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -524,7 +524,7 @@ INSTALL( + endif() + + +-endif() ++else() + + add_library (${LIBSBML_LIBRARY}-static STATIC ${LIBSBML_SOURCES} ) + +@@ -560,7 +560,7 @@ INSTALL(FILES + DESTINATION ${PACKAGE_CONFIG_DIR} + ) + endif() +- ++endif() + ############################################################################## + # + # add native tests diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index cce695e9d74584..f2dcea393f0c65 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -1,73 +1,100 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO opencor/libsbml - REF v5.18.0 - SHA512 7d48de4ab40018ba92206daf4f5e5376050c4497b589cdf86de0875e3986b5e6b27c4ae178df627d208e037cf32d8ab3d04e33a52e5e077db14999f4fb601ea5 - HEAD_REF master -) -message("SOURCE_PATH ${SOURCE_PATH}") -message("CURRENT_PACKAGES_DIR ${CURRENT_PACKAGES_DIR}") -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS -DWITH_CPP_NAMESPACE:BOOL=ON -) -vcpkg_install_cmake() +include(vcpkg_common_functions) -# remove include files for libsbml -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/sbml/files/libsbml/5.18.0/stable/libSBML-5.18.0-core-plus-packages-src.tar.gz/download" + FILENAME "libSBML-5.18.0.zip" + SHA512 49dedaa2fcd2077e7389a8f940adf931d80aa7a8f9d57330328372d2ac8ebcaeb03a20524df2fe0f1c6933587904613754585076c46e6cb5d6f7a001f427185b +) -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/libsbml/cmake") +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES fix-linkage-type.patch +) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libsbml/cmake) +SET(STATIC_RUNTIME OFF) +if (VCPKG_CRT_LINKAGE AND ${VCPKG_CRT_LINKAGE} MATCHES "static") + SET(STATIC_RUNTIME ON) +endif() + +SET(STATIC_LIBRARY OFF) +if (VCPKG_LIBRARY_LINKAGE AND ${VCPKG_LIBRARY_LINKAGE} MATCHES "static") + SET(STATIC_LIBRARY ON) +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + comp ENABLE_COMP + fbc ENABLE_FBC + groups ENABLE_GROUPS + layout ENABLE_LAYOUT + multi ENABLE_MULTI + qual ENABLE_QUAL + render ENABLE_RENDER + render ENABLE_LAYOUT + bzip2 WITH_BZIP2 + zlib WITH_ZLIB + check WITH_CHECK + namespace WITH_CPP_NAMESPACE +) -set(LICENSE_FILE "${CURRENT_PACKAGES_DIR}/LICENSE.txt") -if (NOT EXISTS "${LICENSE_FILE}") - message(STATUS "LICENSE file not found at ${LICENSE_fILE}") - set(LICENSE_FILE "${CURRENT_PACKAGES_DIR}/share/libsbml/LICENSE.txt") - message(STATUS "Setting LICENSE to ${LICENSE_FILE}") - if (NOT EXISTS "${LICENSE_FILE}") - message(FATAL_ERROR "libsbml LICENSE.txt not found at ${LICENSE_FILE}") - endif () -endif () +# Handle conflict features +set(WITH_EXPAT OFF) +if ("expat" IN_LIST FEATURES) + set(WITH_EXPAT ON) +endif() -configure_file("${LICENSE_FILE}" "${CURRENT_PACKAGES_DIR}/share/libsbml/copyright" COPYONLY) +set(WITH_LIBXML OFF) +if ("libxml2" IN_LIST FEATURES) + set(WITH_LIBXML ON) +endif() +set(WITH_CPP_NAMESPACE OFF) +if ("namespace" IN_LIST FEATURES) + set(WITH_CPP_NAMESPACE ON) +endif() -set(FILES_TO_REMOVE - "${CURRENT_PACKAGES_DIR}/COPYING.txt" - "${CURRENT_PACKAGES_DIR}/FUNDING.txt" - "${CURRENT_PACKAGES_DIR}/LICENSE.txt" - "${CURRENT_PACKAGES_DIR}/NEWS.txt" - "${CURRENT_PACKAGES_DIR}/OLD_NEWS.txt" - "${CURRENT_PACKAGES_DIR}/README.txt" - "${CURRENT_PACKAGES_DIR}/VERSION.txt" +if (WITH_EXPAT AND WITH_LIBXML) + message("Feature expat conflict with feature libxml2, currently using libxml2...") + set(WITH_EXPAT OFF) +endif() - "${CURRENT_PACKAGES_DIR}/debug/COPYING.txt" - "${CURRENT_PACKAGES_DIR}/debug/FUNDING.txt" - "${CURRENT_PACKAGES_DIR}/debug/LICENSE.txt" - "${CURRENT_PACKAGES_DIR}/debug/NEWS.txt" - "${CURRENT_PACKAGES_DIR}/debug/OLD_NEWS.txt" - "${CURRENT_PACKAGES_DIR}/debug/README.txt" - "${CURRENT_PACKAGES_DIR}/debug/VERSION.txt" - ) +if ("check" IN_LIST FEATURES AND WIN32) + message(FATAL_ERROR "Feature check only support UNIX.") +endif() +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS ${FEATURE_OPTIONS} + -DWITH_EXPAT=${WITH_EXPAT} + -DWITH_LIBXML=${WITH_LIBXML} + -DENABLE_L3V2EXTENDEDMATH:BOOL=ON + -DWITH_CPP_NAMESPACE:BOOL=${WITH_CPP_NAMESPACE} + -DWITH_STATIC_RUNTIME=${STATIC_RUNTIME} + -DLIBSBML_SKIP_SHARED_LIBRARY=${STATIC_LIBRARY} +) -foreach (f ${FILES_TO_REMOVE}) - file(REMOVE ${f}) -endforeach () +vcpkg_install_cmake() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) vcpkg_copy_pdbs() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(GLOB TXT_FILES ${CURRENT_PACKAGES_DIR}/debug/*.txt) +if (TXT_FILES) + file(REMOVE ${TXT_FILES}) +endif() +file(GLOB TXT_FILES ${CURRENT_PACKAGES_DIR}/*.txt) +if (TXT_FILES) + file(REMOVE ${TXT_FILES}) +endif() +if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/share) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +endif() - - - - - - - +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) \ No newline at end of file diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index 2decb588380674..0a65c323f00a00 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -83,7 +83,7 @@ else() endif() -vcpkg_install_cmake() +vcpkg_install_cmake(DISABLE_PARALLEL) vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) #maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file From 13288527b0e96ad2840220cddb1cc9f2b35469e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Fri, 25 Sep 2020 00:05:05 -0700 Subject: [PATCH 5/7] Update ports/openblas/portfile.cmake --- ports/openblas/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index c76948503ec012..b1f2a512d54e31 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -84,7 +84,7 @@ else() endif() -vcpkg_install_cmake(DISABLE_PARALLEL) +vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) set(ENV{PATH} "${PATH_BACKUP}") From 731dafa670085530ecba6233d6afed6ab9bee5ea Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Sep 2020 00:14:16 -0700 Subject: [PATCH 6/7] correct cmake --- ports/libsbml/CONTROL | 7 +++---- ports/libsbml/portfile.cmake | 39 ++++++++++-------------------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL index 2b52fbe9e3a4eb..4f4c450de22e7d 100644 --- a/ports/libsbml/CONTROL +++ b/ports/libsbml/CONTROL @@ -1,10 +1,9 @@ Source: libsbml Version: 5.18.0 Description: A library for reading / writing SBML files -Default-Features: expat, comp, fbc, groups, layout, render -Build-Depends: libsbml[expat], libsbml[libxml2] +Default-Features: expat,comp,fbc,groups,layout,render,libxml2 -Feature: check +Feature: test Description: Unit testing of libSBMLs implementation Build-Depends: check @@ -46,4 +45,4 @@ Feature: render Description: support for Rendering information Feature: namespace -Description: Build with the WITH_CPP_NAMESPACE option set to on \ No newline at end of file +Description: Build with the WITH_CPP_NAMESPACE option set to on diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index f2dcea393f0c65..ed7749daa979b7 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://sourceforge.net/projects/sbml/files/libsbml/5.18.0/stable/libSBML-5.18.0-core-plus-packages-src.tar.gz/download" FILENAME "libSBML-5.18.0.zip" @@ -12,15 +10,8 @@ vcpkg_extract_source_archive_ex( PATCHES fix-linkage-type.patch ) -SET(STATIC_RUNTIME OFF) -if (VCPKG_CRT_LINKAGE AND ${VCPKG_CRT_LINKAGE} MATCHES "static") - SET(STATIC_RUNTIME ON) -endif() - -SET(STATIC_LIBRARY OFF) -if (VCPKG_LIBRARY_LINKAGE AND ${VCPKG_LIBRARY_LINKAGE} MATCHES "static") - SET(STATIC_LIBRARY ON) -endif() +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC_LIBRARY) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS comp ENABLE_COMP @@ -33,7 +24,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS render ENABLE_LAYOUT bzip2 WITH_BZIP2 zlib WITH_ZLIB - check WITH_CHECK + test WITH_CHECK namespace WITH_CPP_NAMESPACE ) @@ -48,30 +39,24 @@ if ("libxml2" IN_LIST FEATURES) set(WITH_LIBXML ON) endif() -set(WITH_CPP_NAMESPACE OFF) -if ("namespace" IN_LIST FEATURES) - set(WITH_CPP_NAMESPACE ON) -endif() - if (WITH_EXPAT AND WITH_LIBXML) message("Feature expat conflict with feature libxml2, currently using libxml2...") set(WITH_EXPAT OFF) endif() -if ("check" IN_LIST FEATURES AND WIN32) - message(FATAL_ERROR "Feature check only support UNIX.") +if ("test" IN_LIST FEATURES AND WIN32) + message(FATAL_ERROR "Feature test only support UNIX.") endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS ${FEATURE_OPTIONS} - -DWITH_EXPAT=${WITH_EXPAT} - -DWITH_LIBXML=${WITH_LIBXML} - -DENABLE_L3V2EXTENDEDMATH:BOOL=ON - -DWITH_CPP_NAMESPACE:BOOL=${WITH_CPP_NAMESPACE} - -DWITH_STATIC_RUNTIME=${STATIC_RUNTIME} - -DLIBSBML_SKIP_SHARED_LIBRARY=${STATIC_LIBRARY} + -DWITH_EXPAT=${WITH_EXPAT} + -DWITH_LIBXML=${WITH_LIBXML} + -DENABLE_L3V2EXTENDEDMATH:BOOL=ON + -DWITH_STATIC_RUNTIME=${STATIC_RUNTIME} + -DLIBSBML_SKIP_SHARED_LIBRARY=${STATIC_LIBRARY} ) vcpkg_install_cmake() @@ -95,6 +80,4 @@ if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) endif() -# Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file From 55eec8b5ebb8dc03b2c4440fb39da4cfbb78a34d Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 25 Sep 2020 00:26:08 -0700 Subject: [PATCH 7/7] does not support uwp --- ports/libsbml/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL index 4f4c450de22e7d..654ea75bd13702 100644 --- a/ports/libsbml/CONTROL +++ b/ports/libsbml/CONTROL @@ -2,6 +2,7 @@ Source: libsbml Version: 5.18.0 Description: A library for reading / writing SBML files Default-Features: expat,comp,fbc,groups,layout,render,libxml2 +Supports: !uwp Feature: test Description: Unit testing of libSBMLs implementation