-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[yasm/yasm-tool] Incorporate yasm-tool into yasm #18816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c35a661
105a82a
c8ab16d
40497a6
3eda1b7
75f540e
ef230d1
f6f3b99
2a122d9
0c70aa2
7e5d4fe
10bda64
d8b2e83
edcef24
0de469f
5f533f6
c0ed2ca
5543487
dcbdaa3
8f9cb33
670e928
14d35f5
a6c385b
c5affe2
0021966
94cfd28
b209da2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,16 @@ | ||
| { | ||
| "name": "yasm-tool-helper", | ||
| "version-string": "2020-03-11", | ||
| "description": "Backfill that depends on yasm-tool:host", | ||
| "port-version": 1, | ||
| "description": "Backfill that depends on yasm:host", | ||
| "homepage": "https://github.com/Microsoft/vcpkg", | ||
| "dependencies": [ | ||
| { | ||
| "name": "yasm-tool", | ||
| "host": true | ||
| "name": "yasm", | ||
| "host": true, | ||
| "features": [ | ||
| "tools" | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| include("${CMAKE_CURRENT_LIST_DIR}/../../../@HOST_TRIPLET@/share/yasm-tool/vcpkg-port-config.cmake") | ||
| include("${CMAKE_CURRENT_LIST_DIR}/../../../@HOST_TRIPLET@/share/yasm/vcpkg-port-config.cmake") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1 @@ | ||
| vcpkg_fail_port_install(ON_TARGET "uwp") | ||
|
|
||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| set(YASM_BUILD_BINARY ON) | ||
| set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO yasm/yasm | ||
| REF 009450c7ad4d425fa5a10ac4bd6efbd25248d823 # 1.3.0 plus bugfixes for https://github.com/yasm/yasm/issues/153 | ||
| SHA512 a542577558676d11b52981925ea6219bffe699faa1682c033b33b7534f5a0dfe9f29c56b32076b68c48f65e0aef7c451be3a3af804c52caa4d4357de4caad83c | ||
| ) | ||
|
|
||
| file(INSTALL "${SOURCE_PATH}/COPYING" | ||
| DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" | ||
| RENAME copyright) | ||
| foreach(LICENSE Artistic.txt BSD.txt GNU_GPL-2.0 GNU_LGPL-2.0) | ||
| file(COPY "${SOURCE_PATH}/${LICENSE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
| endforeach() | ||
|
|
||
| vcpkg_find_acquire_program(PYTHON3) | ||
| get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) | ||
| vcpkg_add_to_path("${PYTHON3_DIR}") | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -DENABLE_NLS=OFF | ||
| -DYASM_BUILD_TESTS=OFF | ||
| ) | ||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_copy_tools(TOOL_NAMES yasm) | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include") | ||
| else() | ||
| set(YASM_BUILD_BINARY OFF) | ||
| set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
| endif() | ||
|
|
||
| configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake.in" | ||
| "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake" @ONLY) | ||
| SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this print a warning that it's now defunct?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to Robert's comment, we should not remove any ports.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't remove it because that would break people's scripts and stuff, but we can warn that they aren't using the canonical one. |
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| { | ||
| "name": "yasm-tool", | ||
| "version": "1.3.0", | ||
| "description": "A modular assembler.", | ||
| "homepage": "http://yasm.tortall.net/", | ||
| "supports": "native & !uwp" | ||
| "version-date": "2021-12-14", | ||
| "description": "Legacy port. Use port yasm instead.", | ||
| "dependencies": [ | ||
| "yasm" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # For the exported file, we should set 'Z_YASM_TOOL_HELPER_LIST_DIR' before calling 'find_package' | ||
| if (NOT DEFINED Z_YASM_TOOL_HELPER_LIST_DIR OR NOT Z_YASM_TOOL_HELPER_LIST_DIR) | ||
| # Get the host installed dir, use relative path here | ||
| set(Z_YASM_TOOL_HELPER_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}") | ||
| get_filename_component(Z_YASM_TOOL_HELPER_LIST_DIR "${Z_YASM_TOOL_HELPER_LIST_DIR}" PATH) | ||
| get_filename_component(Z_YASM_TOOL_HELPER_LIST_DIR "${Z_YASM_TOOL_HELPER_LIST_DIR}" PATH) | ||
| get_filename_component(Z_YASM_TOOL_HELPER_LIST_DIR "${Z_YASM_TOOL_HELPER_LIST_DIR}" PATH) | ||
| set(Z_YASM_TOOL_HELPER_LIST_DIR "${Z_YASM_TOOL_HELPER_LIST_DIR}/@HOST_TRIPLET@") | ||
| endif() | ||
|
|
||
| function(yasm_tool_helper) | ||
| cmake_parse_arguments(PARSE_ARGV 0 arg | ||
| "APPEND_TO_PATH;PREPEND_TO_PATH" | ||
| "OUT_VAR" | ||
| "" | ||
| ) | ||
|
|
||
| if(DEFINED arg_UNPARSED_ARGUMENTS) | ||
| message(FATAL_ERROR "Unexpected arguments to yasm_tool_helper: ${arg_UNPARSED_ARGUMENTS}") | ||
| endif() | ||
|
|
||
| find_program(YASM yasm PATHS "${Z_YASM_TOOL_HELPER_LIST_DIR}/tools/yasm") | ||
|
|
||
| if(arg_APPEND_TO_PATH) | ||
| get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) | ||
| vcpkg_add_to_path("${YASM_EXE_PATH}") | ||
| endif() | ||
| if(arg_PREPEND_TO_PATH) | ||
| get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) | ||
| vcpkg_add_to_path(PREPEND "${YASM_EXE_PATH}") | ||
| endif() | ||
| if(DEFINED arg_OUT_VAR) | ||
| set("${arg_OUT_VAR}" "${YASM}" PARENT_SCOPE) | ||
| endif() | ||
| endfunction() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,19 @@ Copy all DLL dependencies of built tools into the tool folder. | |
|
|
||
| ## Usage | ||
| ```cmake | ||
| vcpkg_copy_tool_dependencies(<${CURRENT_PACKAGES_DIR}/tools/${PORT}>) | ||
| vcpkg_copy_tool_dependencies( | ||
| <${CURRENT_PACKAGES_DIR}/tools/${PORT}> | ||
| [DEPENDENCIES <dep1>...] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This documentation suggests that the function uses named arguments but the implementation appears to use positional arguments. Why can't the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The yasm example shows that there are still other ports that use the same method (
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, there are ports that do that, yes, but I'm not seeing what's made clearer about this vs. just issuing the |
||
| ) | ||
| ``` | ||
| ## Parameters | ||
| The path to the directory containing the tools. | ||
| ## tool_dir | ||
| The path to the directory containing the tools. This will be set to `${CURRENT_PACKAGES_DIR}/tools/${PORT}` if omitted. | ||
|
|
||
| ## DEPENDENCIES | ||
| A list of dynamic libraries a tool is likely to load at runtime, such as plugins, | ||
| or other Run-Time Dynamic Linking mechanisms like LoadLibrary or dlopen. | ||
| These libraries will be copied into the same directory as the tool | ||
| even if they are not statically determined as dependencies from inspection of their import tables. | ||
|
|
||
| ## Notes | ||
| This command should always be called by portfiles after they have finished rearranging the binary output, if they have any tools. | ||
|
|
@@ -19,13 +28,26 @@ This command should always be called by portfiles after they have finished rearr | |
| * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) | ||
| #]===] | ||
|
|
||
| function(z_vcpkg_copy_tool_dependencies_search tool_dir path_to_search) | ||
| function(z_vcpkg_copy_tool_dependencies_search tool_dir path_to_search dependencies) | ||
| if(DEFINED Z_VCPKG_COPY_TOOL_DEPENDENCIES_COUNT) | ||
| set(count ${Z_VCPKG_COPY_TOOL_DEPENDENCIES_COUNT}) | ||
| else() | ||
| set(count 0) | ||
| endif() | ||
|
|
||
| file(GLOB tools "${tool_dir}/*.exe" "${tool_dir}/*.dll" "${tool_dir}/*.pyd") | ||
| if (dependencies) | ||
| foreach (SEARCH_ITEM IN_LIST dependencies) | ||
| if (EXISTS "${CURRENT_PACKAGES_DIR}/bin/${SEARCH_ITEM}") | ||
| debug_message("Copying file ${CURRENT_PACKAGES_DIR}/bin/${SEARCH_ITEM} to ${TOOL_DIR}") | ||
| file(COPY "${CURRENT_PACKAGES_DIR}/bin/${SEARCH_ITEM}" DESTINATION "${TOOL_DIR}") | ||
| vcpkg_list(APPEND tools "${TOOL_DIR}/${SEARCH_ITEM}") | ||
| else() | ||
| message(WARNING "Dynamic dependency ${SEARCH_ITEM} not found in ${CURRENT_PACKAGES_DIR}/bin.") | ||
| endif() | ||
| endforeach() | ||
| endif() | ||
|
|
||
| foreach(tool IN LISTS tools) | ||
| vcpkg_execute_required_process( | ||
| COMMAND "${Z_VCPKG_POWERSHELL_CORE}" -noprofile -executionpolicy Bypass -nologo | ||
|
|
@@ -42,7 +64,8 @@ function(z_vcpkg_copy_tool_dependencies_search tool_dir path_to_search) | |
| endfunction() | ||
|
|
||
| function(vcpkg_copy_tool_dependencies tool_dir) | ||
| if(ARGC GREATER 1) | ||
| cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "DEPENDENCIES") | ||
| if(ARGC GREATER 2) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ARGC is going to be greater than 2 if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this response.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| message(WARNING "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${ARGN}") | ||
| endif() | ||
|
|
||
|
|
@@ -56,11 +79,11 @@ function(vcpkg_copy_tool_dependencies tool_dir) | |
| OUTPUT_VARIABLE relative_tool_dir | ||
| ) | ||
| if(relative_tool_dir MATCHES "/debug/") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_INSTALLED_DIR}/debug/bin") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_PACKAGES_DIR}/debug/bin" "${arg_DEPENDENCIES}") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_INSTALLED_DIR}/debug/bin" "${arg_DEPENDENCIES}") | ||
| else() | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_PACKAGES_DIR}/bin") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_INSTALLED_DIR}/bin") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_PACKAGES_DIR}/bin" "${arg_DEPENDENCIES}") | ||
| z_vcpkg_copy_tool_dependencies_search("${tool_dir}" "${CURRENT_INSTALLED_DIR}/bin" "${arg_DEPENDENCIES}") | ||
| endif() | ||
| endif() | ||
| endfunction() | ||

Uh oh!
There was an error while loading. Please reload this page.