Files
rustdesk/res/vcpkg/mfx-dispatch/portfile.cmake
T
mike 56fae560dd
build-linux / build-linux-x64 (push) Failing after 4m18s
build-windows / build-windows-x64 (push) Successful in 1h11m59s
vcpkg(mfx-dispatch): run explicit autotools chain; skip vcpkg AUTOCONFIG
2026-05-05 14:31:20 +02:00

87 lines
3.6 KiB
CMake

vcpkg_download_distfile(
MISSING_CSTDINT_IMPORT_PATCH
URLS https://github.com/lu-zero/mfx_dispatch/commit/d6241243f85a0d947bdfe813006686a930edef24.patch?full_index=1
FILENAME fix-missing-cstdint-import-d6241243f85a0d947bdfe813006686a930edef24.patch
SHA512 5d2ffc4ec2ba0e5859d01d2e072f75436ebc3e62e0f6580b5bb8b9f82fe588e7558a46a1fdfa0297a782c0eeb8f50322258d0dd9e41d927cc9be496727b61e44
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lu-zero/mfx_dispatch
REF "${VERSION}"
SHA512 12517338342d3e653043a57e290eb9cffd190aede0c3a3948956f1c7f12f0ea859361cf3e534ab066b96b1c211f68409c67ef21fd6d76b68cc31daef541941b0
HEAD_REF master
PATCHES
fix-unresolved-symbol.patch
fix-pkgconf.patch
0003-upgrade-cmake-3.14.patch
${MISSING_CSTDINT_IMPORT_PATCH}
)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
else()
# autotools 1.17+ (Debian 13, Ubuntu 24.04+) has a tracing bug: even though
# configure.ac calls LT_INIT, autoreconf reports "configure.ac: not using
# Libtool" and skips libtoolize, leaving libtool's m4 macros uninstalled.
# automake then fails with "Libtool library used but 'LIBTOOL' is undefined".
#
# Running libtoolize *before* `autoreconf -vfi` doesn't help because the -i
# flag has autoreconf re-introspect and clean things up, undoing libtoolize.
# Solution: run the full autotools chain ourselves, in order, with libtoolize
# before aclocal, then call vcpkg_configure_make *without* AUTOCONFIG so it
# uses the configure script we produced.
file(MAKE_DIRECTORY "${SOURCE_PATH}/m4")
find_program(LIBTOOLIZE NAMES libtoolize glibtoolize REQUIRED)
find_program(ACLOCAL NAMES aclocal REQUIRED)
find_program(AUTOCONF NAMES autoconf REQUIRED)
find_program(AUTOMAKE NAMES automake REQUIRED)
message(STATUS "mfx-dispatch: running explicit autotools chain")
message(STATUS " libtoolize: ${LIBTOOLIZE}")
message(STATUS " aclocal : ${ACLOCAL}")
message(STATUS " autoconf : ${AUTOCONF}")
message(STATUS " automake : ${AUTOMAKE}")
vcpkg_execute_required_process(
COMMAND "${LIBTOOLIZE}" --force --copy --install
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "step1-libtoolize-${TARGET_TRIPLET}")
if(NOT EXISTS "${SOURCE_PATH}/m4/libtool.m4")
message(FATAL_ERROR "libtoolize did not produce ${SOURCE_PATH}/m4/libtool.m4 -- libtool package missing or broken")
endif()
vcpkg_execute_required_process(
COMMAND "${ACLOCAL}" --force -I m4
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "step2-aclocal-${TARGET_TRIPLET}")
vcpkg_execute_required_process(
COMMAND "${AUTOCONF}" --force
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "step3-autoconf-${TARGET_TRIPLET}")
vcpkg_execute_required_process(
COMMAND "${AUTOMAKE}" --add-missing --copy --force-missing
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "step4-automake-${TARGET_TRIPLET}")
if(VCPKG_TARGET_IS_MINGW)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
# NOT AUTOCONFIG -- we ran the chain manually above. Letting vcpkg
# rerun autoreconf -vfi would re-trigger the broken introspection.
)
vcpkg_install_make()
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")