diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2021-05-21 11:56:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-21 11:56:32 -0700 |
| commit | 49b67d9cb856424ff69f10e7721aec5299624268 (patch) | |
| tree | 673c4e1d196f1fe38a8235c259b7d4993e84b33b /ports/yasm-tool | |
| parent | 2f9972005f61f02fa3cda7fc062d1b834b534b8d (diff) | |
| download | vcpkg-49b67d9cb856424ff69f10e7721aec5299624268.tar.gz vcpkg-49b67d9cb856424ff69f10e7721aec5299624268.zip | |
[yasm-tool] Migrate to Host Dependencies (#16478)
* [yasm-tool] Fix usage of port to be host dependencies
This allows mpg123, nettle, and gmp to support non-x86 windows manifest mode
* fix gmp
* oops
* versions update
Diffstat (limited to 'ports/yasm-tool')
| -rw-r--r-- | ports/yasm-tool/portfile.cmake | 84 | ||||
| -rw-r--r-- | ports/yasm-tool/vcpkg-port-config.cmake.in | 31 | ||||
| -rw-r--r-- | ports/yasm-tool/vcpkg.json | 6 |
3 files changed, 81 insertions, 40 deletions
diff --git a/ports/yasm-tool/portfile.cmake b/ports/yasm-tool/portfile.cmake index a417f105c..d4949bc9c 100644 --- a/ports/yasm-tool/portfile.cmake +++ b/ports/yasm-tool/portfile.cmake @@ -1,37 +1,47 @@ -vcpkg_fail_port_install(MESSAGE "The yasm-tool port is only intended to be built for x86 Windows" ON_TARGET "Linux" "OSX" ON_ARCH "x64" "arm")
-
-set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
-set(VCPKG_LIBRARY_LINKAGE static)
-
-vcpkg_find_acquire_program(PYTHON3)
-get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
-vcpkg_add_to_path("${PYTHON3_DIR}")
-
-vcpkg_from_github(
- OUT_SOURCE_PATH SOURCE_PATH
- REPO yasm/yasm
- REF 009450c7ad4d425fa5a10ac4bd6efbd25248d823 # 7.0.3 plus bugfixes for https://github.com/yasm/yasm/issues/153
- SHA512 a542577558676d11b52981925ea6219bffe699faa1682c033b33b7534f5a0dfe9f29c56b32076b68c48f65e0aef7c451be3a3af804c52caa4d4357de4caad83c
-)
-
-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")
-
-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_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) diff --git a/ports/yasm-tool/vcpkg-port-config.cmake.in b/ports/yasm-tool/vcpkg-port-config.cmake.in new file mode 100644 index 000000000..5abe7520a --- /dev/null +++ b/ports/yasm-tool/vcpkg-port-config.cmake.in @@ -0,0 +1,31 @@ +set(Z_YASM_TOOL_HELPER_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}") + +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() + + if(@YASM_BUILD_BINARY@) + set(YASM "${Z_YASM_TOOL_HELPER_LIST_DIR}/../../tools/yasm-tool/yasm.exe") + else() + vcpkg_find_acquire_program(YASM) + endif() + + 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() diff --git a/ports/yasm-tool/vcpkg.json b/ports/yasm-tool/vcpkg.json index 20e37b570..a3552faaa 100644 --- a/ports/yasm-tool/vcpkg.json +++ b/ports/yasm-tool/vcpkg.json @@ -1,7 +1,7 @@ { "name": "yasm-tool", - "version-string": "2020-10-12", - "description": "A modular assembler. This port is intended to build other ports and should not be used directly.", + "version": "1.3.0", + "description": "A modular assembler.", "homepage": "http://yasm.tortall.net/", - "supports": "windows & x86" + "supports": "native & !uwp" } |
