diff options
| author | Lily <47812810+wangli28@users.noreply.github.com> | 2019-08-14 05:12:28 +0800 |
|---|---|---|
| committer | Griffin Downs <35574547+grdowns@users.noreply.github.com> | 2019-08-13 14:12:28 -0700 |
| commit | 86ec91b6ee56ab59a03d966fc3e38e74f4382874 (patch) | |
| tree | c4e33337928c308518a0c82d162c08c9ba35f22d | |
| parent | 1516bfddf78455788f0cefe228a30ce7b965b652 (diff) | |
| download | vcpkg-86ec91b6ee56ab59a03d966fc3e38e74f4382874.tar.gz vcpkg-86ec91b6ee56ab59a03d966fc3e38e74f4382874.zip | |
[yasm] Add new port (#7478)
* [yasm] Add new port
* [yasm] Add new port
* Remove patch; Use port var; use vcpkg_add_to_path
| -rw-r--r-- | ports/yasm/CONTROL | 4 | ||||
| -rw-r--r-- | ports/yasm/portfile.cmake | 51 |
2 files changed, 55 insertions, 0 deletions
diff --git a/ports/yasm/CONTROL b/ports/yasm/CONTROL new file mode 100644 index 000000000..5cb349270 --- /dev/null +++ b/ports/yasm/CONTROL @@ -0,0 +1,4 @@ +Source: yasm +Version: 1.3.0 +Homepage: https://github.com/yasm/yasm +Description: Yasm is a complete rewrite of the NASM assembler under the “new” BSD License. diff --git a/ports/yasm/portfile.cmake b/ports/yasm/portfile.cmake new file mode 100644 index 000000000..5dfe2a51c --- /dev/null +++ b/ports/yasm/portfile.cmake @@ -0,0 +1,51 @@ +include(vcpkg_common_functions) + +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 + HEAD_REF master +) + +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_install_cmake() + +file(REMOVE + ${CURRENT_PACKAGES_DIR}/debug/bin/vsyasm.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/yasm.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/ytasm.exe +) + +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_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +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)
\ No newline at end of file |
