# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup muniversal 1.0 PortGroup cmake 1.1 PortGroup xcode_workaround 1.0 PortGroup github 1.0 # https://trac.macports.org/ticket/59875 PortGroup legacysupport 1.0 legacysupport.newest_darwin_requires_legacy 9 github.setup videolan x265 3.4 revision 2 checksums rmd160 e614c4a03134a67e79efe8d3dd64d54c3990b99a \ sha256 544d147bf146f8994a7bf8521ed878c93067ea1c7c6e93ab602389be3117eaaf \ size 1530200 categories multimedia license GPL-2+ maintainers nomaintainer # exclude pre-release versions github.livecheck.regex {([0-9.]+)} description H.265 encoder long_description x265 is a free software library and application for \ encoding video streams into the H.265/MPEG-H HEVC \ compression format, and is released under the terms of the \ GNU GPL. homepage https://www.videolan.org/developers/x265.html github.tarball_from archive worksrcdir ${name}-${version}/source # allow overriding system processor detection patchfiles patch-cmakelists-override-processor.diff # Altivec uses instructions unsupported on Darwin: https://trac.macports.org/ticket/64781 patchfiles-append patch-ppc.diff depends_build-append port:gmake compiler.blacklist-append *llvm-gcc-4.2 # https://trac.macports.org/ticket/59246 xcode_workaround.fixed_xcode_version 11.2 platform darwin 10 { # Rosetta build has to override CMAKE_SYSTEM_PROCESSOR: https://trac.macports.org/ticket/64528 if {${build_arch} eq "ppc"} { configure.args-append -DOVERRIDE_SYSTEM_PROCESSOR="ppc" } } if {${universal_possible} && [variant_isset universal] && ![variant_isset highdepth]} { if {"x86_64" in ${configure.universal_archs} || "i386" in ${configure.universal_archs}} { depends_build-append port:nasm set merger_configure_env(i386) NASM_EXECUTABLE=${prefix}/bin/nasm set merger_configure_env(x86_64) NASM_EXECUTABLE=${prefix}/bin/nasm } # error: illegal text-relocation to '_x265_pw_1' lappend merger_configure_ldflags(i386) -Wl,-read_only_relocs,suppress foreach uarch {arm64 i386 ppc ppc64 x86_64} { set merger_configure_args(${uarch}) -DOVERRIDE_SYSTEM_PROCESSOR=${uarch} } } else { if {${configure.build_arch} in {i386 x86_64}} { depends_build-append port:nasm configure.env NASM_EXECUTABLE=${prefix}/bin/nasm } if {${configure.build_arch} eq "i386"} { # error: illegal text-relocation to '_x265_pw_1' configure.ldflags-append -Wl,-read_only_relocs,suppress } } variant highdepth conflicts universal description {Enable 10-bit and 12-bit encoding} { # this builds the recommended multi-library interface # https://x265.readthedocs.io/en/master/api.html#multi-library-interface # with the default ABI being the standard 8bit ABI as always # we can perhaps explore how to use the method below with the muniversal PG pre-configure { system "mkdir ${workpath}/10bit" system "mkdir ${workpath}/12bit" } configure { set configure.dir ${workpath}/10bit configure.args -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF portconfigure::configure_main set configure.dir ${workpath}/12bit configure.args -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON portconfigure::configure_main set configure.dir ${workpath}/build configure.args -DEXTRA_LIB="x265_main10.a\;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON portconfigure::configure_main } build { set build.dir ${workpath}/10bit portbuild::build_main set build.dir ${workpath}/12bit portbuild::build_main ln ${workpath}/10bit/libx265.a ${workpath}/build/libx265_main10.a ln ${workpath}/12bit/libx265.a ${workpath}/build/libx265_main12.a set build.dir ${workpath}/build portbuild::build_main system -W ${workpath}/build "mv libx265.a libx265_main.a" system -W ${workpath}/build "libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a" } }