forked from zhongfly/mpv-winbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile-lgpl-libmpv.patch
203 lines (198 loc) · 7.38 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
From 50e8f21bdf37d17ed9178e39188a3c8220b44aa9 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/mpv.cmake | 28 ++++++++--------------------
3 files changed, 9 insertions(+), 48 deletions(-)
diff --git a/cmake/packages_check.cmake b/cmake/packages_check.cmake
index 26e6c97..ef77c58 100644
--- a/cmake/packages_check.cmake
+++ b/cmake/packages_check.cmake
@@ -6,11 +6,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(vapoursynth_pkgconfig_libs "-lVapourSynth -Wl,-delayload=VapourSynth.dll")
set(vapoursynth_script_pkgconfig_libs "-lVSScript -Wl,-delayload=VSScript.dll")
diff --git a/packages/ffmpeg.cmake b/packages/ffmpeg.cmake
index e620f2f..74e9973 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
rav1e
dav1d
vapoursynth
uavs3d
- davs2
- rubberband
libva
openal-soft
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg.git
@@ -59,15 +48,11 @@ ExternalProject_Add(ffmpeg
--enable-cross-compile
--enable-runtime-cpudetect
${ffmpeg_hardcoded_tables}
- --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-librav1e
--enable-libdav1d
- --enable-libdavs2
--enable-libuavs3d
- --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
--enable-cuda-llvm
--enable-cuvid
diff --git a/packages/mpv.cmake b/packages/mpv.cmake
index 3cf19ce..5f85787 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
@@ -66,11 +64,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
@@ -90,14 +83,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.43.0