vcpkg/ports/x264/portfile.cmake

92 lines
2.8 KiB
CMake
Raw Normal View History

2018-09-16 11:00:54 +08:00
set(X264_VERSION 157)
vcpkg_fail_port_install(ON_ARCH "arm")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mirror/x264
2018-09-16 11:00:54 +08:00
REF 303c484ec828ed0d8bfe743500e70314d026c3bd
SHA512 faf210a3f9543028ed882c8348b243dd7ae6638e7b3ef43bec1326b717f23370f57c13d0ddb5e1ae94411088a2e33031a137b68ae9f64c18f8f33f601a0da54d
HEAD_REF master
PATCHES
"uwp-cflags.patch"
)
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_add_to_path(${NASM_EXE_PATH})
if(VCPKG_TARGET_IS_WINDOWS)
_vcpkg_determine_autotools_host_cpu(BUILD_ARCH)
_vcpkg_determine_autotools_target_cpu(HOST_ARCH)
list(APPEND OPTIONS --build=${BUILD_ARCH}-pc-mingw32)
list(APPEND OPTIONS --host=${HOST_ARCH}-pc-mingw32)
[vcpkg/scripts] Add a way to get cmake compiler settings/flags (#12936) * add function get_cmake_vars * fine tuning. * apply to make based ports. * add log suffix on not windows platforms * fix c&p error * add previous LINK env * setup env on windows and extract cpp flags correctly. * Apply suggestions from code review * commit changes from fontconfig PR * Apply suggestions from code review Co-authored-by: nicole mazzuca <mazzucan@outlook.com> * cleanup docs * add conversion from somelib.lib to -lsomelib * add missing ar-lib wrapper * small but important regex correction * add latest changes from update_fontconfig PR * Apply suggestions from code review first set which don't need special attention Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * Apply suggestions from code review one more simple change Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * [x264] set env AS * fix bugs due to refactor * use subpath everywhere * apply changes from CR * remove unnecessary lines 41 & 44 * remove flag transformation * reintroduce the flag / to - transformation for MSVC * Apply suggestions from code review Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * rename the function * rename function/variables * transform flags list * Apply suggestions from code review * fix vcpkg_build_make due to the variable name change * fix another case of function renaming regressions * only rename config.log if it exists * actually add the script after vcpkg_common_functions was deleted. * remove setting of ldflags if path contains spaces Co-authored-by: nicole mazzuca <mazzucan@outlook.com> Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
2020-11-11 01:52:02 +08:00
set(ENV{AS} "${NASM}")
endif()
if(VCPKG_TARGET_IS_UWP)
list(APPEND OPTIONS --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00)
list(APPEND OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib)
list(APPEND OPTIONS --disable-asm)
endif()
if(VCPKG_TARGET_IS_LINUX)
list(APPEND OPTIONS --enable-pic)
endif()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
NO_ADDITIONAL_PATHS
OPTIONS
${OPTIONS}
--enable-strip
--disable-lavf
--disable-swscale
--disable-avs
--disable-ffms
--disable-gpac
--disable-lsmash
--enable-debug
)
vcpkg_install_make()
if(NOT VCPKG_TARGET_IS_UWP)
vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(VCPKG_TARGET_IS_WINDOWS)
set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x264.pc")
if(EXISTS "${pcfile}")
vcpkg_replace_string("${pcfile}" "-lx264" "-llibx264")
endif()
set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x264.pc")
if(EXISTS "${pcfile}")
vcpkg_replace_string("${pcfile}" "-lx264" "-llibx264")
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib)
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# force U_STATIC_IMPLEMENTATION macro
file(READ ${CURRENT_PACKAGES_DIR}/include/x264.h HEADER_CONTENTS)
string(REPLACE "defined(U_STATIC_IMPLEMENTATION)" "1" HEADER_CONTENTS "${HEADER_CONTENTS}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/x264.h "${HEADER_CONTENTS}")
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin
)
endif()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
[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(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)