5
5
# $4 = CPUs
6
6
# $5 = x265 version
7
7
8
- set -x
8
+ set -x
9
9
# load functions
10
10
. $1 /functions.sh
11
11
12
+ if [[ " ${BUILD_FROM_MAIN} " == " TRUE" ]]
13
+ then
14
+ BRANCH=" "
15
+ PATCH=" git apply $1 /x265_arm64_threading.patch"
16
+ else
17
+ BRANCH=" --branch stable"
18
+ PATCH=" patch -p1 -i $1 /apple_arm64_x265.patch"
19
+ fi
12
20
13
21
make_directories () {
14
22
@@ -39,7 +47,7 @@ download_code() {
39
47
40
48
# Build fails when using git shallow clone
41
49
# https://bitbucket.org/multicoreware/x265_git/issues/572/pc-file-is-not-generated
42
- git clone https://bitbucket.org/multicoreware/x265_git.git --branch stable
50
+ git clone https://bitbucket.org/multicoreware/x265_git.git ${BRANCH}
43
51
checkStatus $? " download of x265 failed"
44
52
45
53
# TODO: checksum validation (if available)
@@ -58,12 +66,15 @@ configure_build () {
58
66
59
67
60
68
# patch for arm64 / neon recognition
61
- patch -p1 < $1 /apple_arm64_x265.patch
69
+ # patch -p1 < $1/apple_arm64_x265.patch
70
+ ${PATCH}
71
+
62
72
63
73
cd ../12bit
64
74
65
75
# prepare build
66
76
77
+ FF
67
78
cmake -DCMAKE_INSTALL_PREFIX:PATH=$3 -DENABLE_SHARED=NO -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_CLI=OFF -DMAIN12=ON ../$GIT_DIR /source
68
79
checkStatus $? " configuration of 12bit x265 failed"
69
80
@@ -78,7 +89,7 @@ configure_build () {
78
89
79
90
# prepare build
80
91
81
- cmake -DCMAKE_INSTALL_PREFIX:PATH=$3 -DENABLE_SHARED=NO -DEXTRA_LIB=" x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DENABLE_CLI=NO ../$GIT_DIR /source
92
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=$3 -DENABLE_SHARED=NO -DEXTRA_LIB=" x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DENABLE_CLI=OFF ../$GIT_DIR /source
82
93
checkStatus $? " configuration of 8bit x265 failed"
83
94
84
95
}
@@ -125,14 +136,15 @@ make_compile () {
125
136
cd " $2 /x265/8bit"
126
137
checkStatus $? " change directory failed"
127
138
139
+ # soft symlink the libraies
140
+ ln -sf ../10bit/libx265.a libx265_main10.a
141
+ ln -sf ../12bit/libx265.a libx265_main12.a
142
+
128
143
# build
129
144
make -j $4
130
145
checkStatus $? " build of x265 failed"
131
146
132
147
# merge the libaries together
133
- ln -sf ../10bit/libx265.a libx265_main10.a
134
- ln -sf ../12bit/libx265.a libx265_main12.a
135
-
136
148
mv libx265.a libx265_main.a
137
149
libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2> /dev/null
138
150
checkStatus $? " merge of x265 objects failed"
@@ -141,9 +153,6 @@ make_compile () {
141
153
make install
142
154
checkStatus $? " installation of x265 failed"
143
155
144
- # post-installation
145
- # modify pkg-config file for usage with ffmpeg (it seems that the flag for threads is missing)
146
- sed -i.original -e ' s/lx265/lx265 -lpthread/g' $3 /lib/pkgconfig/x265.pc
147
156
148
157
}
149
158
@@ -174,3 +183,4 @@ build_main () {
174
183
175
184
176
185
build_main $@
186
+
0 commit comments