-
Notifications
You must be signed in to change notification settings - Fork 78
/
compile-lgpl-libmpv.patch
224 lines (220 loc) · 7.96 KB
/
compile-lgpl-libmpv.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
From 6a9032769c1b4c6c575d87cbce60c0ed10f960dd Mon Sep 17 00:00:00 2001
From: zhongfly <11155705+zhongfly@users.noreply.github.com>
Date: Sun, 10 Mar 2024 10:04:23 +0800
Subject: [PATCH] packages: compile lgpl libmpv
---
cmake/packages_check.cmake | 6 +-----
packages/ffmpeg.cmake | 23 -----------------------
packages/libarchive.cmake | 3 +--
packages/mpv.cmake | 28 ++++++++--------------------
4 files changed, 10 insertions(+), 50 deletions(-)
diff --git a/cmake/packages_check.cmake b/cmake/packages_check.cmake
index e303e10dc..6c2eeb399 100644
--- a/cmake/packages_check.cmake
+++ b/cmake/packages_check.cmake
@@ -7,11 +7,7 @@ if(COMPILER_TOOLCHAIN STREQUAL "gcc")
set(ffmpeg_extra_libs "-lstdc++")
set(libjxl_unaligned_vector "-Wa,-muse-unaligned-vector-move") # fix crash on AVX2 proc (64bit) due to unaligned stack memory
set(mpv_copy_debug COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/mpv.debug ${CMAKE_CURRENT_BINARY_DIR}/mpv-debug/mpv.debug)
- set(mpv_add_debuglink COMMAND ${EXEC} ${TARGET_ARCH}-objcopy --only-keep-debug <BINARY_DIR>/mpv.exe <BINARY_DIR>/mpv.debug
- COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/mpv.exe
- COMMAND ${EXEC} ${TARGET_ARCH}-objcopy --add-gnu-debuglink=<BINARY_DIR>/mpv.debug <BINARY_DIR>/mpv.exe
- COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/mpv.com
- COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/libmpv-2.dll)
+ set(mpv_add_debuglink COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/libmpv-2.dll)
elseif(COMPILER_TOOLCHAIN STREQUAL "clang")
set(rust_target "gnullvm")
set(vapoursynth_pkgconfig_libs "-lVapourSynth -Wl,-delayload=VapourSynth.dll")
diff --git a/packages/ffmpeg.cmake b/packages/ffmpeg.cmake
index 49a0f6e95..e06b281d2 100644
--- a/packages/ffmpeg.cmake
+++ b/packages/ffmpeg.cmake
@@ -1,18 +1,13 @@
ExternalProject_Add(ffmpeg
DEPENDS
amf-headers
- avisynth-headers
${nvcodec_headers}
bzip2
lame
lcms2
openssl
- libssh
- libsrt
libass
libbluray
- libdvdnav
- libdvdread
libmodplug
libpng
libsoxr
@@ -26,24 +21,18 @@ ExternalProject_Add(ffmpeg
opus
speex
vorbis
- x264
- ${ffmpeg_x265}
- xvidcore
libxml2
libvpl
libopenmpt
libjxl
shaderc
libplacebo
- libzvbi
libaribcaption
aom
svtav1
dav1d
vapoursynth
${ffmpeg_uavs3d}
- ${ffmpeg_davs2}
- rubberband
libva
openal-soft
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg.git
@@ -59,15 +48,11 @@ ExternalProject_Add(ffmpeg
--pkg-config-flags=--static
--enable-cross-compile
--enable-runtime-cpudetect
- --enable-gpl
--enable-version3
--enable-postproc
- --enable-avisynth
--enable-vapoursynth
--enable-libass
--enable-libbluray
- --enable-libdvdnav
- --enable-libdvdread
--enable-libfreetype
--enable-libfribidi
--enable-libfontconfig
@@ -81,28 +66,20 @@ ExternalProject_Add(ffmpeg
--enable-libspeex
--enable-libvorbis
--enable-libbs2b
- --enable-librubberband
--enable-libvpx
--enable-libwebp
- --enable-libx264
- --enable-libx265
--enable-libaom
--enable-libsvtav1
--enable-libdav1d
- ${ffmpeg_davs2_cmd}
${ffmpeg_uavs3d_cmd}
- --enable-libxvid
--enable-libzimg
--enable-openssl
--enable-libxml2
--enable-libmysofa
- --enable-libssh
- --enable-libsrt
--enable-libvpl
--enable-libjxl
--enable-libplacebo
--enable-libshaderc
- --enable-libzvbi
--enable-libaribcaption
${ffmpeg_cuda}
--enable-amf
diff --git a/packages/libarchive.cmake b/packages/libarchive.cmake
index 4773faef1..2e9027aea 100644
--- a/packages/libarchive.cmake
+++ b/packages/libarchive.cmake
@@ -2,7 +2,6 @@ ExternalProject_Add(libarchive
DEPENDS
bzip2
expat
- lzo
xz
zlib
zstd
@@ -26,7 +25,7 @@ ExternalProject_Add(libarchive
-DENABLE_ICONV=ON
-DENABLE_LIBXML2=ON
-DENABLE_EXPAT=ON
- -DENABLE_LZO=ON
+ -DENABLE_LZO=OFF
-DENABLE_LZMA=ON
-DENABLE_CPIO=OFF
-DENABLE_CNG=OFF
diff --git a/packages/mpv.cmake b/packages/mpv.cmake
index b30e6e33f..af4c944b6 100644
--- a/packages/mpv.cmake
+++ b/packages/mpv.cmake
@@ -6,15 +6,11 @@ ExternalProject_Add(mpv
lcms2
libarchive
libass
- libdvdnav
- libdvdread
libiconv
libjpeg
libpng
luajit
- rubberband
uchardet
- openal-soft
mujs
vulkan
shaderc
@@ -32,23 +28,25 @@ ExternalProject_Add(mpv
--cross-file=${MESON_CROSS}
--default-library=shared
--prefer-static
+ -Dgpl=false
-Ddebug=true
-Db_ndebug=true
-Doptimization=3
-Db_lto=true
${mpv_lto_mode}
+ -Dcplayer=false
-Dlibmpv=true
- -Dpdf-build=enabled
+ -Dpdf-build=disabled
-Dlua=enabled
-Djavascript=enabled
-Dsdl2=enabled
-Dlibarchive=enabled
-Dlibbluray=enabled
- -Ddvdnav=enabled
+ -Ddvdnav=disabled
-Duchardet=enabled
- -Drubberband=enabled
+ -Drubberband=disabled
-Dlcms2=enabled
- -Dopenal=enabled
+ -Dopenal=disabled
-Dspirv-cross=enabled
-Dvulkan=enabled
-Dvapoursynth=enabled
@@ -67,11 +65,6 @@ ExternalProject_Add_Step(mpv strip-binary
ExternalProject_Add_Step(mpv copy-binary
DEPENDEES strip-binary
- COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/mpv.exe ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv.exe
- COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/mpv.com ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv.com
- COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/mpv.pdf ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/doc/manual.pdf
- COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_INSTALL_PREFIX}/etc/fonts/fonts.conf ${CMAKE_CURRENT_BINARY_DIR}/mpv-package/mpv/fonts.conf
- ${mpv_copy_debug}
COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/libmpv-2.dll ${CMAKE_CURRENT_BINARY_DIR}/mpv-dev/libmpv-2.dll
COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/libmpv.dll.a ${CMAKE_CURRENT_BINARY_DIR}/mpv-dev/libmpv.dll.a
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/libmpv/client.h ${CMAKE_CURRENT_BINARY_DIR}/mpv-dev/include/mpv/client.h
@@ -91,14 +84,9 @@ mv $2 $2-git-\${GIT}")
ExternalProject_Add_Step(mpv copy-package-dir
DEPENDEES copy-binary
COMMAND chmod 755 ${RENAME}
- COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/mpv-package ${CMAKE_BINARY_DIR}/mpv-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
- COMMAND ${RENAME} <SOURCE_DIR> ${CMAKE_BINARY_DIR}/mpv-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
- COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/mpv-debug ${CMAKE_BINARY_DIR}/mpv-debug-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
- COMMAND ${RENAME} <SOURCE_DIR> ${CMAKE_BINARY_DIR}/mpv-debug-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
-
- COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/mpv-dev ${CMAKE_BINARY_DIR}/mpv-dev-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
- COMMAND ${RENAME} <SOURCE_DIR> ${CMAKE_BINARY_DIR}/mpv-dev-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
+ COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/mpv-dev ${CMAKE_BINARY_DIR}/mpv-dev-lgpl-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
+ COMMAND ${RENAME} <SOURCE_DIR> ${CMAKE_BINARY_DIR}/mpv-dev-lgpl-${TARGET_CPU}${x86_64_LEVEL}-${BUILDDATE}
COMMENT "Moving mpv package folder"
LOG 1
)
--
2.46.0