vcpkg/ports/libmagic/portfile.cmake

71 lines
2.8 KiB
CMake
Raw Normal View History

if(VCPKG_TARGET_IS_WINDOWS)
set(PATCHES
"0001-Use-libtre.patch"
"0002-Change-zlib-lib-name-to-match-CMake-output.patch"
"0003-Fix-WIN32-macro-checks.patch"
"0004-Typedef-POSIX-types-on-Windows.patch"
"0005-Include-dirent.h-for-S_ISREG-and-S_ISDIR.patch"
"0006-Remove-Wrap-POSIX-headers.patch"
"0007-Substitute-unistd-macros-for-MSVC.patch"
"0008-Add-FILENO-defines.patch"
"0009-No-fcntl-in-magic.c.patch"
"0010-Properly-check-for-the-presence-of-bitmasks.patch"
"0011-Remove-pipe-related-functions-in-funcs.c.patch"
"0012-Convert-MSYS2-paths-to-Windows-paths.patch"
"0013-Check-for-backslash-in-argv-0-on-Windows.patch"
"0014-Define-POSIX-macros-if-missing.patch"
"0015-MSYS2-Remove-ioctl-call.patch"
)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO file/file
REF FILE5_40
SHA512 d76bfe5326e1b40368e055c2e049a24b4ffdbd727371f4f3aa1dd3f53787d16b88550b3cc71ecf02151e2fb3e567eb2598e4707badab8c391eb71113c2dcc319
HEAD_REF master
PATCHES ${PATCHES}
)
if(VCPKG_TARGET_IS_WINDOWS)
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS")
endif()
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
)
if(VCPKG_CROSSCOMPILING)
vcpkg_add_to_path(PREPEND ${CURRENT_HOST_INSTALLED_DIR}/tools/libmagic/bin)
elseif(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(EXTRA_ARGS "ADD_BIN_TO_PATH")
endif()
vcpkg_install_make(${EXTRA_ARGS})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
if(VCPKG_TARGET_IS_WINDOWS)
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/share/misc)
file(COPY ${CURRENT_PACKAGES_DIR}/share/${PORT}/misc/magic.mgc DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/share/misc)
endif()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/share/misc)
file(COPY ${CURRENT_PACKAGES_DIR}/share/${PORT}/misc/magic.mgc DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/share/misc)
endif()
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
[vcpkg] Improve make builds (#10402) * update all 16 configure_make ports * add make wrappers for msvc * improve make builds * fix relativ path errors on linux (and osx?) * revisit all 16 portfiles again * remove trace from install * fix relative build path issues. * bump control of the 16 configure ports * never forget .... real linux is case sensitive .... * Revert "bump control of the 16 configure ports" This reverts commit 40d6d81c01d2709c4acbdbec503b4787c3fd8282. * Revert "Revert "bump control of the 16 configure ports"" This reverts commit 9c9851ddfcd01bfad604ab9c9aed7379238d619a. * bump control again for real ci rebuild * add copy_source * remove message * pass parameters to vcpkg_build_make * fix healpix build. * fix libmagic regression * fix libwandio regression * pfring changes regression fix? (cannot test in wsl) * ws change to retrigger CI * fix libpq regression * fix libudns regression * add share/pkgconfig to PKG_CONFIG_PATH * cleanup of deprecated options * cleanup docs * Revert "bump control again for real ci rebuild" This reverts commit b4bc18edc2376eba6c3aa3dda52bd82286f23616. * shared binaries on linux should stay in lib. Only dlls are mvoed to bin * move pkgconfig check and add message about missing system packages * added autopoint as a build requirement * fix prerun shell working dir. * a few fixes from the x windows pr - add libpath setting - fixed pkgconfig search on windows platforms - fixed autopoint msys package on windows * fix release prefix * minimal cleanup and ws changes to trigger true CI rebuild * fix tcl by upgrading * remove unnecessary rename * fix pfring? can't test in WSL. Linux kernel headers required. * fix lowercase in patch * fix libwandio * remove x264 from fail list * replace wrappers with wrappers from automake * update make ports * remove unnecessary message * refactor vcpkg_configure_make * [tcl] remove stray ? * [farmhash] fix build * [freexl] ws change to retrigger ci build * [x264] add pthread as a dependency * [vcpkg/scripts] add ignore flag correctly * [sdl] fix vcpkg_fixup_pkgconfig call * [farmhash/freexl] delete configure and recreate it. * [libudns] remove trailing ? * [freexl] use empty build target * [freexl] add system library; remove previous change * Update ports/x264/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [libwandio] remove unncessary comment Co-authored-by: dan-shaw <51385773+dan-shaw@users.noreply.github.com> Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2020-05-22 01:46:07 +08:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/man5)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)