From a8d552daa60f9074350806ca8aa12203de7c6f7d Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 29 Oct 2022 09:54:53 +0000 Subject: [PATCH 01/10] [openfst] Add new port --- ports/openfst/fix-build.patch | 110 ++++++++++++++++++++++++++++++++++ ports/openfst/portfile.cmake | 24 ++++++++ ports/openfst/vcpkg.json | 18 ++++++ versions/baseline.json | 4 ++ versions/o-/openfst.json | 9 +++ 5 files changed, 165 insertions(+) create mode 100644 ports/openfst/fix-build.patch create mode 100644 ports/openfst/portfile.cmake create mode 100644 ports/openfst/vcpkg.json create mode 100644 versions/o-/openfst.json diff --git a/ports/openfst/fix-build.patch b/ports/openfst/fix-build.patch new file mode 100644 index 00000000000000..6df9d50342848e --- /dev/null +++ b/ports/openfst/fix-build.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f6189db..8457084 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,7 @@ + project(openfst) ++if(BUILD_UNIT_TESTS) + include(CTest) ++endif() + find_package(ICU COMPONENTS data i18n io test tu uc) + if (ICU_FOUND) + include_directories(${ICU_INCLUDE_DIRS}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index acc4bf1..00283d7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -6,13 +6,21 @@ install(DIRECTORY include/ DESTINATION include/ + FILES_MATCHING PATTERN "*.h") + + add_subdirectory(lib) ++if(BUILD_TOOLS) + add_subdirectory(script) ++endif() + + if(HAVE_BIN) ++if(BUILD_TOOLS) + add_subdirectory(bin) ++endif() + endif(HAVE_BIN) + ++if(BUILD_TOOLS) + add_subdirectory(extensions) ++endif() + ++if(BUILD_UNIT_TESTS) + enable_testing() + add_subdirectory(test) ++endif() +diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt +index c004aee..eff17ed 100644 +--- a/src/lib/CMakeLists.txt ++++ b/src/lib/CMakeLists.txt +@@ -1,7 +1,10 @@ + FILE(GLOB HEADER_FILES ../include/fst/*.h) + ++include(CMakePackageConfigHelpers) ++include(GNUInstallDirs) + +-add_library(fst ++if (BUILD_SHARED_LIBS) ++add_library(fst SHARED + compat.cc + flags.cc + fst-types.cc +@@ -14,13 +17,51 @@ add_library(fst + weight.cc + ${HEADER_FILES} + ) ++else() ++add_library(fst STATIC ++ compat.cc ++ flags.cc ++ fst-types.cc ++ fst.cc ++ mapped-file.cc ++ properties.cc ++ symbol-table.cc ++ symbol-table-ops.cc ++ util.cc ++ weight.cc ++ ${HEADER_FILES} ++) ++endif() ++ + set_target_properties(fst PROPERTIES + SOVERSION "${SOVERSION}" + ) + ++if (BUILD_SHARED_LIBS) ++install(TARGETS fst EXPORT openfstTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++else() ++install(TARGETS fst EXPORT openfstTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() + ++file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/openfst-config.cmake" ++[[include(CMakeFindDependencyMacro) ++file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/openfstTargets.cmake") ++foreach (TARGET_FILE ${TARGET_FILES}) ++ include("${TARGET_FILE}") ++endforeach() ++]]) ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/openfst-config.cmake" DESTINATION share/openfst) + +-install(TARGETS fst +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++install(DIRECTORY ../include/fst DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install(EXPORT openfstTargets ++ NAMESPACE openfst:: ++ DESTINATION share/openfst ++) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake new file mode 100644 index 00000000000000..6298a5d9655fc1 --- /dev/null +++ b/ports/openfst/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO kkm000/openfst + REF 338225416178ac36b8002d70387f5556e44c8d05 #1.7.2 + SHA512 14e1ac44ff5d059dc12ab0412037744a207e54485443dbf6eab4e6fb4aab122bbbcbd54af3ce23732c7d960448756c5a5ec0e116e0a797fa343156bb865f3eb1 + HEAD_REF winport + PATCHES + fix-build.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME openfst CONFIG_PATH share/openfst) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +vcpkg_fixup_pkgconfig() diff --git a/ports/openfst/vcpkg.json b/ports/openfst/vcpkg.json new file mode 100644 index 00000000000000..6326265537165c --- /dev/null +++ b/ports/openfst/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "openfst", + "version": "1.7.2", + "description": "Port of the OpenFST library to Windows", + "homepage": "https://github.com/kkm000/openfst", + "license": "Apache-2.0", + "supports": "!arm", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 847731fa20fa79..7f356c6b372171 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5492,6 +5492,10 @@ "baseline": "2022-07-18", "port-version": 0 }, + "openfst": { + "baseline": "1.7.2", + "port-version": 0 + }, "opengl": { "baseline": "2022-10-08", "port-version": 0 diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json new file mode 100644 index 00000000000000..2873b2d18831d1 --- /dev/null +++ b/versions/o-/openfst.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "00a79697cf563496020930e9f6cb61c1b0cf611c", + "version": "1.7.2", + "port-version": 0 + } + ] +} From aba98620478be6dea21410f659e8ce1350edde62 Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 29 Oct 2022 13:12:23 +0000 Subject: [PATCH 02/10] use unofficial --- ports/openfst/fix-build.patch | 67 +++++++---------------------------- ports/openfst/portfile.cmake | 2 +- versions/o-/openfst.json | 2 +- 3 files changed, 15 insertions(+), 56 deletions(-) diff --git a/ports/openfst/fix-build.patch b/ports/openfst/fix-build.patch index 6df9d50342848e..7f5cd1a390132d 100644 --- a/ports/openfst/fix-build.patch +++ b/ports/openfst/fix-build.patch @@ -37,74 +37,33 @@ index acc4bf1..00283d7 100644 add_subdirectory(test) +endif() diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt -index c004aee..eff17ed 100644 +index c004aee..b2d716d 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt -@@ -1,7 +1,10 @@ +@@ -1,5 +1,7 @@ FILE(GLOB HEADER_FILES ../include/fst/*.h) +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) --add_library(fst -+if (BUILD_SHARED_LIBS) -+add_library(fst SHARED + add_library(fst compat.cc - flags.cc - fst-types.cc -@@ -14,13 +17,51 @@ add_library(fst - weight.cc - ${HEADER_FILES} - ) -+else() -+add_library(fst STATIC -+ compat.cc -+ flags.cc -+ fst-types.cc -+ fst.cc -+ mapped-file.cc -+ properties.cc -+ symbol-table.cc -+ symbol-table-ops.cc -+ util.cc -+ weight.cc -+ ${HEADER_FILES} -+) -+endif() -+ - set_target_properties(fst PROPERTIES +@@ -18,9 +20,12 @@ set_target_properties(fst PROPERTIES SOVERSION "${SOVERSION}" ) -+if (BUILD_SHARED_LIBS) -+install(TARGETS fst EXPORT openfstTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+else() -+install(TARGETS fst EXPORT openfstTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+endif() - -+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/openfst-config.cmake" -+[[include(CMakeFindDependencyMacro) -+file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/openfstTargets.cmake") -+foreach (TARGET_FILE ${TARGET_FILES}) -+ include("${TARGET_FILE}") -+endforeach() -+]]) -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/openfst-config.cmake" DESTINATION share/openfst) - +- +- -install(TARGETS fst - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION lib) ++install(TARGETS fst EXPORT unofficial-openfstTargets ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(DIRECTORY ../include/fst DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+install(EXPORT openfstTargets -+ NAMESPACE openfst:: -+ DESTINATION share/openfst ++install(EXPORT unofficial-openfstTargets ++ NAMESPACE unofficial::openfst:: ++ DESTINATION share/unofficial-openfst +) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index 6298a5d9655fc1..925a50c0ea472b 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -13,7 +13,7 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(PACKAGE_NAME openfst CONFIG_PATH share/openfst) +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openfst CONFIG_PATH share/unofficial-openfst) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index 2873b2d18831d1..a1dd1037edbc25 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "00a79697cf563496020930e9f6cb61c1b0cf611c", + "git-tree": "a7d39ee95e61faec313b93fffa4ecda7d7bead25", "version": "1.7.2", "port-version": 0 } From fb2988e0aef76bcc3f5ecf50045c8c970e249357 Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 29 Oct 2022 13:28:52 +0000 Subject: [PATCH 03/10] fix linkage --- ports/openfst/portfile.cmake | 4 ++++ ports/openfst/vcpkg.json | 2 +- versions/o-/openfst.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index 925a50c0ea472b..8811517a9e8923 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -1,3 +1,7 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO kkm000/openfst diff --git a/ports/openfst/vcpkg.json b/ports/openfst/vcpkg.json index 6326265537165c..35005c20fb264f 100644 --- a/ports/openfst/vcpkg.json +++ b/ports/openfst/vcpkg.json @@ -4,7 +4,7 @@ "description": "Port of the OpenFST library to Windows", "homepage": "https://github.com/kkm000/openfst", "license": "Apache-2.0", - "supports": "!arm", + "supports": "!arm & !uwp", "dependencies": [ { "name": "vcpkg-cmake", diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index a1dd1037edbc25..8799a699b3e831 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a7d39ee95e61faec313b93fffa4ecda7d7bead25", + "git-tree": "4ceefc47c0c6d2f3f25a6b600a13045f0578bdc4", "version": "1.7.2", "port-version": 0 } From 142031fc7b55d0428c4cf032119ff34ad46f1c55 Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 5 Nov 2022 15:55:54 +0000 Subject: [PATCH 04/10] use make --- ports/openfst/fix-build.patch | 69 ----------------------------------- ports/openfst/portfile.cmake | 49 +++++++++++++++---------- ports/openfst/vcpkg.json | 8 ++-- versions/baseline.json | 2 +- versions/o-/openfst.json | 4 +- 5 files changed, 37 insertions(+), 95 deletions(-) delete mode 100644 ports/openfst/fix-build.patch diff --git a/ports/openfst/fix-build.patch b/ports/openfst/fix-build.patch deleted file mode 100644 index 7f5cd1a390132d..00000000000000 --- a/ports/openfst/fix-build.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f6189db..8457084 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,5 +1,7 @@ - project(openfst) -+if(BUILD_UNIT_TESTS) - include(CTest) -+endif() - find_package(ICU COMPONENTS data i18n io test tu uc) - if (ICU_FOUND) - include_directories(${ICU_INCLUDE_DIRS}) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index acc4bf1..00283d7 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -6,13 +6,21 @@ install(DIRECTORY include/ DESTINATION include/ - FILES_MATCHING PATTERN "*.h") - - add_subdirectory(lib) -+if(BUILD_TOOLS) - add_subdirectory(script) -+endif() - - if(HAVE_BIN) -+if(BUILD_TOOLS) - add_subdirectory(bin) -+endif() - endif(HAVE_BIN) - -+if(BUILD_TOOLS) - add_subdirectory(extensions) -+endif() - -+if(BUILD_UNIT_TESTS) - enable_testing() - add_subdirectory(test) -+endif() -diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt -index c004aee..b2d716d 100644 ---- a/src/lib/CMakeLists.txt -+++ b/src/lib/CMakeLists.txt -@@ -1,5 +1,7 @@ - FILE(GLOB HEADER_FILES ../include/fst/*.h) - -+include(CMakePackageConfigHelpers) -+include(GNUInstallDirs) - - add_library(fst - compat.cc -@@ -18,9 +20,12 @@ set_target_properties(fst PROPERTIES - SOVERSION "${SOVERSION}" - ) - -- -- --install(TARGETS fst -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib -- RUNTIME DESTINATION lib) -+install(TARGETS fst EXPORT unofficial-openfstTargets -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(DIRECTORY ../include/fst DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+install(EXPORT unofficial-openfstTargets -+ NAMESPACE unofficial::openfst:: -+ DESTINATION share/unofficial-openfst -+) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index 8811517a9e8923..fa4b40f1f75f73 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -1,28 +1,39 @@ -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO kkm000/openfst - REF 338225416178ac36b8002d70387f5556e44c8d05 #1.7.2 - SHA512 14e1ac44ff5d059dc12ab0412037744a207e54485443dbf6eab4e6fb4aab122bbbcbd54af3ce23732c7d960448756c5a5ec0e116e0a797fa343156bb865f3eb1 - HEAD_REF winport - PATCHES - fix-build.patch +vcpkg_download_distfile( + ARCHIVE + URLS https://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.8.2.tar.gz + FILENAME openfst-1.8.2.tar.gz + SHA512 ca7f9f19e24141e1f1d0bbabf43795e6e278bce3887c14261d9ce204a0e01b1588eaf982755a9105247510a19f67da2f566e9b14b1d869497148f95b55606d5c ) -vcpkg_cmake_configure( +vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${ARCHIVE}") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(LINKAGE_DYNAMIC yes) + set(LINKAGE_STATIC no) +else() + set(LINKAGE_DYNAMIC no) + set(LINKAGE_STATIC yes) +endif() + +vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG + OPTIONS + "--enable-shared=${LINKAGE_DYNAMIC}" + "--enable-static=${LINKAGE_STATIC}" + "--prefix=${CURRENT_INSTALLED_DIR}" + "--disable-doxygen" + OPTIONS_DEBUG + "--enable-debug" ) -vcpkg_cmake_install() -vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openfst CONFIG_PATH share/unofficial-openfst) +vcpkg_install_make() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -vcpkg_copy_pdbs() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools") file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -vcpkg_fixup_pkgconfig() diff --git a/ports/openfst/vcpkg.json b/ports/openfst/vcpkg.json index 35005c20fb264f..4427102e6fe01c 100644 --- a/ports/openfst/vcpkg.json +++ b/ports/openfst/vcpkg.json @@ -1,10 +1,10 @@ { "name": "openfst", - "version": "1.7.2", - "description": "Port of the OpenFST library to Windows", - "homepage": "https://github.com/kkm000/openfst", + "version": "1.8.2", + "description": "OpenFst is a library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).", + "homepage": "https://www.openfst.org/twiki/bin/view/FST/WebHome", "license": "Apache-2.0", - "supports": "!arm & !uwp", + "supports": "!arm & !windows & !osx", "dependencies": [ { "name": "vcpkg-cmake", diff --git a/versions/baseline.json b/versions/baseline.json index 7f356c6b372171..0e76d62491c886 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5493,7 +5493,7 @@ "port-version": 0 }, "openfst": { - "baseline": "1.7.2", + "baseline": "1.8.2", "port-version": 0 }, "opengl": { diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index 8799a699b3e831..d118509d13f831 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "4ceefc47c0c6d2f3f25a6b600a13045f0578bdc4", - "version": "1.7.2", + "git-tree": "045c606695a2b448e2592300b2f2047e37816955", + "version": "1.8.2", "port-version": 0 } ] From 82154f1fdae8a3a8145370aa240d30a3b7ca458a Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sun, 6 Nov 2022 00:34:07 +0800 Subject: [PATCH 05/10] fix compile --- ports/openfst/portfile.cmake | 3 --- versions/o-/openfst.json | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index fa4b40f1f75f73..1ff9fd5f0f83b7 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -22,9 +22,6 @@ vcpkg_configure_make( "--enable-shared=${LINKAGE_DYNAMIC}" "--enable-static=${LINKAGE_STATIC}" "--prefix=${CURRENT_INSTALLED_DIR}" - "--disable-doxygen" - OPTIONS_DEBUG - "--enable-debug" ) vcpkg_install_make() diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index d118509d13f831..5a25ca119b87f0 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "045c606695a2b448e2592300b2f2047e37816955", + "git-tree": "995183f56cdea590e15aa56a8ec667cc8c813abf", "version": "1.8.2", "port-version": 0 } From 217d8911f3ca160d76eeb65f337e7ec2da34f3cb Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 3 Dec 2022 01:24:05 +0800 Subject: [PATCH 06/10] add usage --- ports/openfst/portfile.cmake | 18 ++---------------- ports/openfst/usage | 5 +++++ ports/openfst/vcpkg.json | 12 +----------- versions/o-/openfst.json | 2 +- 4 files changed, 9 insertions(+), 28 deletions(-) create mode 100644 ports/openfst/usage diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index 1ff9fd5f0f83b7..430d3142c3e212 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -7,30 +7,16 @@ vcpkg_download_distfile( vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${ARCHIVE}") -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(LINKAGE_DYNAMIC yes) - set(LINKAGE_STATIC no) -else() - set(LINKAGE_DYNAMIC no) - set(LINKAGE_STATIC yes) -endif() - vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG - OPTIONS - "--enable-shared=${LINKAGE_DYNAMIC}" - "--enable-static=${LINKAGE_STATIC}" - "--prefix=${CURRENT_INSTALLED_DIR}" + COPY_SOURCE ) vcpkg_install_make() vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools") - file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/openfst/usage b/ports/openfst/usage new file mode 100644 index 00000000000000..6cf90419e6e6b3 --- /dev/null +++ b/ports/openfst/usage @@ -0,0 +1,5 @@ +The package openfst can be imported via CMake FindPkgConfig module: + + find_package(PkgConfig REQUIRED) + pkg_check_modules(openfst REQUIRED IMPORTED_TARGET openfst) + target_link_libraries(main PkgConfig::openfst) diff --git a/ports/openfst/vcpkg.json b/ports/openfst/vcpkg.json index 4427102e6fe01c..6539b34ac7201d 100644 --- a/ports/openfst/vcpkg.json +++ b/ports/openfst/vcpkg.json @@ -4,15 +4,5 @@ "description": "OpenFst is a library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).", "homepage": "https://www.openfst.org/twiki/bin/view/FST/WebHome", "license": "Apache-2.0", - "supports": "!arm & !windows & !osx", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] + "supports": "!windows" } diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index 5a25ca119b87f0..f38bae7f7e1333 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "995183f56cdea590e15aa56a8ec667cc8c813abf", + "git-tree": "6296942441c49554285d1b6a74f3bc25c5590106", "version": "1.8.2", "port-version": 0 } From 19b0b2541f34b8f3226846abd4fd0bc444fc014d Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Sat, 3 Dec 2022 02:00:39 +0800 Subject: [PATCH 07/10] up usage --- ports/openfst/portfile.cmake | 1 - ports/openfst/usage | 10 ++++++---- versions/o-/openfst.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/openfst/portfile.cmake b/ports/openfst/portfile.cmake index 430d3142c3e212..18d44e2661c555 100644 --- a/ports/openfst/portfile.cmake +++ b/ports/openfst/portfile.cmake @@ -10,7 +10,6 @@ vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${ARCHIVE}") vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG - COPY_SOURCE ) vcpkg_install_make() diff --git a/ports/openfst/usage b/ports/openfst/usage index 6cf90419e6e6b3..305c3240d41b66 100644 --- a/ports/openfst/usage +++ b/ports/openfst/usage @@ -1,5 +1,7 @@ -The package openfst can be imported via CMake FindPkgConfig module: +The package openfst does not provide CMake targets: - find_package(PkgConfig REQUIRED) - pkg_check_modules(openfst REQUIRED IMPORTED_TARGET openfst) - target_link_libraries(main PkgConfig::openfst) + find_path(FST_INCLUDE_DIRS "fst/fst.h") + find_library(FST_LIBRARY NAMES fst fstscript) + + target_include_directories(main PRIVATE ${FST_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${FST_LIBRARY}) diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index f38bae7f7e1333..72cbed64528de2 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6296942441c49554285d1b6a74f3bc25c5590106", + "git-tree": "cfd9da035813f54716c82b2a916156f3f5b10cec", "version": "1.8.2", "port-version": 0 } From 467aba70352933cd8e34439ca5e49a00bdcceb86 Mon Sep 17 00:00:00 2001 From: day253 <9634619+day253@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:35:05 +0000 Subject: [PATCH 08/10] fix usage --- ports/openfst/usage | 3 --- versions/o-/openfst.json | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/openfst/usage b/ports/openfst/usage index 305c3240d41b66..d4fac24c090305 100644 --- a/ports/openfst/usage +++ b/ports/openfst/usage @@ -1,7 +1,4 @@ The package openfst does not provide CMake targets: - find_path(FST_INCLUDE_DIRS "fst/fst.h") find_library(FST_LIBRARY NAMES fst fstscript) - - target_include_directories(main PRIVATE ${FST_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${FST_LIBRARY}) diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index 72cbed64528de2..70e31482faae6c 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "cfd9da035813f54716c82b2a916156f3f5b10cec", + "git-tree": "4821e5fe62e7800e1607481bc535d71f5a57fd38", "version": "1.8.2", "port-version": 0 } From 3d90e369441a8b4a730ba33437c561186a5b18be Mon Sep 17 00:00:00 2001 From: MonicaLiu Date: Mon, 6 Feb 2023 17:23:40 +0800 Subject: [PATCH 09/10] Restore usage --- ports/openfst/usage | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/openfst/usage b/ports/openfst/usage index d4fac24c090305..1fc1ae205f3a5d 100644 --- a/ports/openfst/usage +++ b/ports/openfst/usage @@ -1,4 +1,7 @@ The package openfst does not provide CMake targets: + find_path(FST_INCLUDE_DIRS "fst/fst.h") find_library(FST_LIBRARY NAMES fst fstscript) + + target_include_directories(main PRIVATE ${FST_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${FST_LIBRARY}) From 75a76e3d48a586e3f969586ba798f0ad1862d332 Mon Sep 17 00:00:00 2001 From: MonicaLiu Date: Mon, 6 Feb 2023 17:25:17 +0800 Subject: [PATCH 10/10] update version --- versions/o-/openfst.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openfst.json b/versions/o-/openfst.json index 70e31482faae6c..6eba36e953aa0a 100644 --- a/versions/o-/openfst.json +++ b/versions/o-/openfst.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4821e5fe62e7800e1607481bc535d71f5a57fd38", + "git-tree": "e744e135ca3b8b196dc16e516683281bb896c6c6", "version": "1.8.2", "port-version": 0 }