minor improvements from Andrew
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / compile_multibit_X265.txt
1 From: Andrew Randrianasulu <randrianasulu@gmail.com>
2 Date: Sun, 20 Jun 2021 10:35:26 +0300
3 Subject: [PATCH 32/67] Add multilib x265 (slower compilation, but you can
4  render 10 bit h265 out of the box)
5
6 ---
7  cinelerra-5.1/thirdparty/Makefile            |  5 +-
8  cinelerra-5.1/thirdparty/src/x265_3.5.patch1 |  4 ++
9  cinelerra-5.1/thirdparty/src/x265_3.5.patch2 |  7 +++
10  cinelerra-5.1/thirdparty/src/x265_3.5.patch3 | 57 ++++++++++++++++++++
11  4 files changed, 71 insertions(+), 2 deletions(-)
12  create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch1
13  create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch2
14  create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch3
15
16 diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile
17 --- a/cinelerra-5.1/thirdparty/Makefile
18 +++ b/cinelerra-5.1/thirdparty/Makefile
19 @@ -250,8 +250,9 @@ tiff.cfg_params+= --enable-shared=no --disable-zstd $(call if_pkg,libwebp,\
20   $(call if_npkg,libwebp,--disable-webp)
21  twolame.cfg_params?=--enable-shared=no
22  x264.cfg_params?= --enable-static --enable-pic
23 -x265.cfg_vars?=$(call cmake_config,source)
24 -x265.cfg_params?= -DENABLE_SHARED=no
25 +x265.cfg_vars?=chmod +x ./configure; chmod +x ./multilib.sh;
26 +#x265.cfg_vars?=$(call cmake_config,source)
27 +#x265.cfg_params?= -DENABLE_SHARED=no
28  libvpx.cfg_params?= --enable-pic --disable-avx512 --disable-examples --disable-unit_tests
29
30  DS:=$$$$$$$$
31 diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch1 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch1
32 new file mode 100644
33 --- /dev/null
34 +++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch1
35 @@ -0,0 +1,4 @@
36 +--- /dev/null  2020-03-14 06:02:18.586124011 +0300
37 ++++ ./configure        2020-03-18 00:04:59.360807192 +0300
38 +@@ -0,0 +1 @@
39 ++/bin/true
40 diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch2 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch2
41 new file mode 100644
42 --- /dev/null
43 +++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch2
44 @@ -0,0 +1,7 @@
45 +--- /dev/null  2020-03-14 06:02:18.586124011 +0300
46 ++++ ./Makefile 2020-03-18 00:04:59.388807329 +0300
47 +@@ -0,0 +1,4 @@
48 ++#$(shell cd build/linux ; ./multilib.sh)
49 ++.NOTPARALLEL:
50 ++all:
51 ++      $(shell ./multilib.sh ; cp 8bit/libx265.a . ; cp 8bit/x265.pc . ; cp 8bit/x265_config.h .)
52 diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch3 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch3
53 new file mode 100644
54 --- /dev/null
55 +++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch3
56 @@ -0,0 +1,57 @@
57 +--- /dev/null  2020-07-19 09:07:01.788494015 +0300
58 ++++ ./multilib.sh      2020-08-02 02:34:58.444933214 +0300
59 +@@ -0,0 +1,54 @@
60 ++#!/bin/sh
61 ++
62 ++mkdir -p 8bit 10bit 12bit
63 ++
64 ++
65 ++cd 12bit
66 ++if [ $(uname -m) == 'x86_64' ]; then
67 ++  # 64-bit stuff here
68 ++cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
69 ++else
70 ++  # 32-bit stuff here
71 ++cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
72 ++fi
73 ++make
74 ++
75 ++cd ../10bit
76 ++if [ $(uname -m) == 'x86_64' ]; then
77 ++  # 64-bit stuff here
78 ++cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
79 ++else
80 ++  # 32-bit stuff here
81 ++cmake ../source -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
82 ++fi
83 ++make
84 ++
85 ++cd ../8bit
86 ++ln -sf ../10bit/libx265.a libx265_main10.a
87 ++ln -sf ../12bit/libx265.a libx265_main12.a
88 ++cmake ../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DENABLE_SHARED=OFF -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON
89 ++make
90 ++
91 ++# rename the 8bit library, then combine all three into libx265.a
92 ++mv libx265.a libx265_main.a
93 ++
94 ++uname=`uname`
95 ++if [ "$uname" = "Linux" ]
96 ++then
97 ++
98 ++# On Linux, we use GNU ar to combine the static libraries together
99 ++ar -M <<EOF
100 ++CREATE libx265.a
101 ++ADDLIB libx265_main.a
102 ++ADDLIB libx265_main10.a
103 ++ADDLIB libx265_main12.a
104 ++SAVE
105 ++END
106 ++EOF
107 ++
108 ++else
109 ++
110 ++# Mac/BSD libtool
111 ++libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2>/dev/null
112 ++
113 ++fi