blob: 5b4aa2b6476d9e077c0f7f908127797f03ed33ff (
plain)
1 # Description: Open Source H265/HEVC video encoder.
2 # URL: https://bitbucket.org/multicoreware/x265_git/wiki/Home
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: cmake
5
6 name=x265
7 version=3.5
8 release=2
9 source=(https://bitbucket.org/multicoreware/${name}_git/downloads/${name}_$version.tar.gz
10 Version.cmake)
11
12 build() {
13 # https://bitbucket.org/multicoreware/x265_git/src/ce882936d5f62ea94c13972fa42cab6192864a7d/source/CMakeLists.txt#lines-676
14 # we don't depend on git to figure out which version we are building, do we?
15 sed "s!@@VERSION@@!$version!g" -i Version.cmake && mv Version.cmake ${name}_$version/source/cmake/Version.cmake
16
17 [[ -e '/usr/bin/ninja' ]] && PKGMK_X265+=' -G Ninja'
18
19 # common args
20 local common_args=(
21 -D CMAKE_INSTALL_PREFIX=/usr
22 -D CMAKE_BUILD_TYPE=Release
23 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -Wno-restrict -Wno-format-overflow"
24 -D CMAKE_ASM_NASM_FLAGS_RELEASE=' -wno-macro-params-legacy'
25 -D HIGH_BIT_DEPTH=TRUE
26 -D EXPORT_C_API=FALSE
27 -D ENABLE_CLI=FALSE
28 -D ENABLE_SHARED=FALSE
29 )
30
31 # build 12
32 cmake -S $SRC/${name}_$version/source -B build-12 $PKGMK_X265 \
33 -D MAIN12=TRUE \
34 "${common_args[@]}" \
35 -Wno-dev
36 cmake --build build-12
37
38 # build 10
39 cmake -S $SRC/${name}_$version/source -B build-10 $PKGMK_X265 \
40 "${common_args[@]}" \
41 -Wno-dev
42 cmake --build build-10
43
44 # build 8
45 mkdir build-8
46 ln -s $SRC/build-12/libx265.a $SRC/build-8/libx265_main12.a
47 ln -s $SRC/build-10/libx265.a $SRC/build-8/libx265_main10.a
48
49 cmake -S $SRC/${name}_$version/source -B build-8 $PKGMK_X265 \
50 "${common_args[@]:0:10}" \
51 -D ENABLE_SHARED=TRUE \
52 -D EXTRA_LIB='x265_main10.a;x265_main12.a' \
53 -D EXTRA_LINK_FLAGS='-L.' \
54 -D LINKED_10BIT=TRUE \
55 -D LINKED_12BIT=TRUE \
56 -D ENABLE_HDR10_PLUS=TRUE \
57 -Wno-dev
58 cmake --build build-8
59 DESTDIR=$PKG cmake --install build-8
60 }
|