vcpkg/ports/libdwarf/portfile.cmake
Jeremy Rifkin 809e93f524
[libdwarf] New port (#34382)
* Try to add libdwarf

* Has

* fix

* hash

* fixes

* hash

* Fixes

* bump hash

* zlib fix

* bump hash

* fix

* bump hash

* fixes

* Bump hash

* fix

* bump

* x

* bump

* fix

* bump

* fix

* bump

* fix

* bump

* fix

* bump

* fix

* bump

* Try this

* bump

* cleanup

* bump

* Update patches

* bump hash

* fix whitespace

* bump

* Update usage

* Bump

* Update portfile and patches (#1)

* Re-introduce off_t patch

* Bump

* Fix patch

* Bump

* Usage is now correct

* Bump

* Revert "Usage is now correct"

This reverts commit 54b32d172de8abd916589f781065c87d3afaaaf2.

* Bump

---------

Co-authored-by: Kai Pastor <dg0yt@darc.de>
2023-10-31 12:31:57 -07:00

38 lines
1.2 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO davea42/libdwarf-code
REF "v${VERSION}"
SHA512 3117c69cc77d5a1189aeb1ea7e74d917dedfb84e9e9e98e3df7fec930f8183d12f55bb12e4871ed3746cdb19a29aba924bc73d6334b23bbb6413a1f4be67d499
HEAD_REF main
PATCHES
dependencies.diff
msvc-runtime.diff
no-suffix.diff
off_t.diff
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_NON_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_NON_SHARED=${BUILD_NON_SHARED}
-DBUILD_SHARED=${BUILD_SHARED}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/libdwarf")
vcpkg_fixup_pkgconfig()
vcpkg_copy_tools(TOOL_NAMES dwarfdump AUTO_CLEAN)
if(BUILD_SHARED)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libdwarf/libdwarf.h" "ifndef LIBDWARF_STATIC" "if 1")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")