aboutsummaryrefslogtreecommitdiff
path: root/ports/yasm-tool
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2020-10-28 14:26:41 -0700
committerGitHub <noreply@github.com>2020-10-28 14:26:41 -0700
commit1b1c17de8206231831b2bc8a06cff80506184be1 (patch)
treeb14e701224a7b12015ec3fef4782332251cd34de /ports/yasm-tool
parent0ff714bd520f5315081db50acce43644832451ba (diff)
downloadvcpkg-1b1c17de8206231831b2bc8a06cff80506184be1.tar.gz
vcpkg-1b1c17de8206231831b2bc8a06cff80506184be1.zip
[vcpkg baseline] [vs-yasm] Build yasm instead of downloading it to work around memory corruption bugs in yasm itself. (#14003)
Diffstat (limited to 'ports/yasm-tool')
-rw-r--r--ports/yasm-tool/portfile.cmake37
-rw-r--r--ports/yasm-tool/vcpkg.json7
2 files changed, 44 insertions, 0 deletions
diff --git a/ports/yasm-tool/portfile.cmake b/ports/yasm-tool/portfile.cmake
new file mode 100644
index 000000000..a417f105c
--- /dev/null
+++ b/ports/yasm-tool/portfile.cmake
@@ -0,0 +1,37 @@
+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()
diff --git a/ports/yasm-tool/vcpkg.json b/ports/yasm-tool/vcpkg.json
new file mode 100644
index 000000000..20e37b570
--- /dev/null
+++ b/ports/yasm-tool/vcpkg.json
@@ -0,0 +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.",
+ "homepage": "http://yasm.tortall.net/",
+ "supports": "windows & x86"
+}