[yasm] Fix feature tools (#19162)

* [yasm] Fix feature tools

* version

* update baseline

* fix arm build, add host dependency

* version

* Fix desc

* update baseline

* Remove arm fix patch

* version

* Fix build, apply suggestions

* version

* Add line break

* version

* Set tools as a feature

* version

* Remove remaining ci.baseline.txt entry.

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Jack·Boos·Yu 2021-12-09 05:13:43 +08:00 committed by GitHub
parent 7bb175eafe
commit 37b323648a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 41 deletions

View File

@ -0,0 +1,10 @@
diff --git a/frontends/CMakeLists.txt b/frontends/CMakeLists.txt
index 9858b61..b151cc3 100644
--- a/frontends/CMakeLists.txt
+++ b/frontends/CMakeLists.txt
@@ -1,3 +1,5 @@
+if (BUILD_TOOLS)
ADD_SUBDIRECTORY(yasm)
ADD_SUBDIRECTORY(tasm)
ADD_SUBDIRECTORY(vsyasm)
+endif()

View File

@ -1,49 +1,46 @@
if (NOT VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "${PORT} only supports windows")
elseif (TRIPLET_SYSTEM_ARCH MATCHES "arm")
message(FATAL_ERROR "ARM is currently not supported.")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "Error: UWP builds are currently not supported.")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO yasm/yasm
REF v1.3.0
SHA512 f5053e2012e0d2ce88cc1cc06e3bdb501054aed5d1f78fae40bb3e676fe2eb9843d335a612d7614d99a2b9e49dca998d57f61b0b89fac8225afa4ae60ae848f1
REF 009450c7ad4d425fa5a10ac4bd6efbd25248d823 # 1.3.0 plus bugfixes for https://github.com/yasm/yasm/issues/153
SHA512 a542577558676d11b52981925ea6219bffe699faa1682c033b33b7534f5a0dfe9f29c56b32076b68c48f65e0aef7c451be3a3af804c52caa4d4357de4caad83c
HEAD_REF master
PATCHES add-feature-tools.patch
)
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON_PATH ${PYTHON2} DIRECTORY)
vcpkg_add_to_path("${PYTHON_PATH}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)
vcpkg_install_cmake()
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
file(REMOVE
${CURRENT_PACKAGES_DIR}/debug/bin/vsyasm.exe
${CURRENT_PACKAGES_DIR}/debug/bin/yasm.exe
${CURRENT_PACKAGES_DIR}/debug/bin/ytasm.exe
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DENABLE_NLS=OFF
-DYASM_BUILD_TESTS=OFF
)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vsyasm.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/vsyasm.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/yasm.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/yasm.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/ytasm.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/ytasm.exe)
vcpkg_cmake_install()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
if (BUILD_TOOLS)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_PACKAGES_DIR}/bin/yasmstd${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
endif()
vcpkg_copy_tools(TOOL_NAMES vsyasm yasm ytasm AUTO_CLEAN)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,8 +1,27 @@
{
"name": "yasm",
"version-string": "1.3.0",
"port-version": 1,
"description": "Yasm is a complete rewrite of the NASM assembler under the new BSD License.",
"port-version": 2,
"description": "Yasm is a complete rewrite of the NASM assembler under the new BSD License.",
"homepage": "https://github.com/yasm/yasm",
"supports": "windows & !uwp & !arm"
"supports": "windows & !uwp & !arm",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "yasm",
"host": true
}
],
"features": {
"tools": {
"description": "Build yasm tools"
}
}
}

View File

@ -1597,11 +1597,6 @@ yajl:arm-uwp=fail
yajl:x64-uwp=fail
yara:arm-uwp=fail
yara:x64-uwp=fail
yasm:arm64-windows=fail
yasm:arm-uwp=fail
yasm:x64-linux=fail
yasm:x64-osx=fail
yasm:x64-uwp=fail
yato:arm64-windows=fail
yato:arm-uwp=fail
yato:x64-uwp=fail

View File

@ -7390,7 +7390,7 @@
},
"yasm": {
"baseline": "1.3.0",
"port-version": 1
"port-version": 2
},
"yasm-tool": {
"baseline": "1.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eaab6c3ae3bfc1ffcfaee3b1695d7ee21dacc7b1",
"version-string": "1.3.0",
"port-version": 2
},
{
"git-tree": "10778f3b98b275cbbc840e6a3c6d96465b2a20a9",
"version-string": "1.3.0",