-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmpv-deus0ww-patch.txt
260 lines (245 loc) · 8.17 KB
/
mpv-deus0ww-patch.txt
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
diff --git a/ffmpeg.rb b/ffmpeg.rb
index 5dac130..e03c60a 100644
--- a/ffmpeg.rb
+++ b/ffmpeg.rb
@@ -55,6 +55,7 @@ class Ffmpeg < Formula
depends_on "libvpx"
depends_on "opencore-amr"
depends_on "openjpeg"
+ #depends_on "gnutls"
depends_on "openssl@3"
depends_on "opus"
depends_on "rubberband"
@@ -106,6 +107,11 @@ class Ffmpeg < Formula
sha256 "57e26caced5a1382cb639235f9555fc50e45e7bf8333f7c9ae3d49b3241d3f77"
end
+ patch do
+ url "https://raw.githubusercontent.com/dafyk/mpv-macos-builds/main/ffmpeg.git-1231003c3c6d.patch.txt"
+ sha256 "cfb25204162b59dc03c0c506df33da2fa75945bc40159232388e8f11db98764f"
+ end
+
def install
# The new linker leads to duplicate symbol issue https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/140
ENV.append "LDFLAGS", "-Wl,-ld_classic" if DevelopmentTools.clang_build_version >= 1500
@@ -123,7 +129,8 @@ class Ffmpeg < Formula
--enable-opencl
--enable-pthreads
--enable-shared
-
+ --enable-static
+ --enable-lcms2
--enable-frei0r
--enable-libaom
--enable-libaribb24
@@ -160,10 +167,24 @@ class Ffmpeg < Formula
--enable-libzimg
--enable-lzma
--enable-openssl
+ --enable-librubberband
+ --enable-libspeex
+ --enable-frei0r
+ --enable-libsoxr
+ --disable-logging
--disable-htmlpages
--disable-podpages
--disable-txtpages
+ --disable-manpages
+ --disable-ffplay
+ --disable-ffprobe
+ --disable-doc
+ --disable-libxcb
+ --disable-libxcb-shm
+ --disable-libxcb-xfixes
+ --disable-libxcb-shape
+ --disable-mbedtls
--disable-libjack
--disable-indev=jack
diff --git a/libplacebo.rb b/libplacebo.rb
index e3f413d..ab8d82f 100644
--- a/libplacebo.rb
+++ b/libplacebo.rb
@@ -13,19 +13,24 @@ class Libplacebo < Formula
depends_on "[email protected]" => :build
depends_on "vulkan-headers" => :build
- depends_on "deus0ww/tap/glslang" if MacOS.version < :big_sur
- depends_on "glslang" if MacOS.version >= :big_sur
+ depends_on "deus0ww/tap/glslang"
+ depends_on "deus0ww/tap/shaderc"
depends_on "little-cms2"
depends_on "sdl2"
depends_on "vulkan-loader"
-
- resource "glad" do
+
+ resource "fast_float" do
+ url "https://github.com/fastfloat/fast_float/archive/refs/tags/v5.2.0.tar.gz"
+ sha256 "72bbfd1914e414c920e39abdc81378adf910a622b62c45b4c61d344039425d18"
+ end
+
+ resource "glad2" do
url "https://files.pythonhosted.org/packages/8b/b3/191508033476b6a409c070c6166b1c41ebb547cc6136260e9157343e6a2b/glad2-2.0.4.tar.gz"
sha256 "ede1639f69f2ba08f1f498a40a707f34a609d24eb2ea0d6c9364689a798cf7d0"
end
- resource "jinja" do
+ resource "jinja2" do
url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz"
sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
end
@@ -37,18 +42,32 @@ class Libplacebo < Formula
def install
resources.each do |r|
- r.stage(Pathname("3rdparty")/r.name)
+ # Override resource name to use expected directory name
+ dir_name = case r.name
+ when "glad2", "jinja2"
+ r.name.sub(/\d+$/, "")
+ else
+ r.name
+ end
+
+ r.stage(Pathname("3rdparty")/dir_name)
end
args = %w[
-Db_lto=true
-Db_lto_mode=thin
-Ddemos=false
+
+ -Dvulkan=enabled
+ -Dopengl=enabled
+ -Dshaderc=enabled
+ -Dlcms=enabled
]
args << ("-Dc_args=" + (Hardware::CPU.arm? ? "-mcpu=native" : "-march=native -mtune=native") + " -Ofast")
system "meson", "setup", "build",
"-Dvulkan-registry=#{Formula["vulkan-headers"].share}/vulkan/registry/vk.xml",
+ "--default-library=both",
*args, *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
diff --git a/mpv.rb b/mpv.rb
index 240de4e..de65249 100644
--- a/mpv.rb
+++ b/mpv.rb
@@ -24,16 +24,18 @@ class Mpv < Formula
depends_on "mujs"
depends_on "uchardet"
depends_on "zimg"
-
- depends_on "libbluray" => :optional
- depends_on "rubberband" => :optional
- depends_on "sdl2" => :optional
- depends_on "vapoursynth" => :optional
+ depends_on "libiconv"
+ depends_on "zlib"
+ depends_on "libdvdcss"
+ depends_on "libdvdread"
+ depends_on "libdvdnav"
+ depends_on "libbluray"
+ depends_on "rubberband"
+ depends_on "sdl2"
+ #depends_on "vapoursynth"
on_macos do
depends_on "coreutils" => :recommended
- depends_on "deus0ww/tap/dockutil@2" => :recommended if MacOS.version < :big_sur
- depends_on "deus0ww/tap/dockutil@3" => :recommended if MacOS.version >= :big_sur
depends_on "tag" => :recommended
depends_on "trash" => :recommended
end
@@ -42,6 +44,11 @@ class Mpv < Formula
depends_on "alsa-lib"
end
+ patch do
+ url "https://raw.githubusercontent.com/dafyk/mpv-macos-builds/main/swift_compat.patch"
+ sha256 "3c4d1ce9dcfef9ce0656b49b5f40606fcf2fc890e60599817090cb2f7da98d41"
+ end
+
def install
# LANG is unset by default on macOS and causes issues when calling getlocale
# or getdefaultlocale in docutils. Force the default c/posix locale since
@@ -58,40 +65,53 @@ class Mpv < Formula
args = %W[
-Db_lto=true
-Db_lto_mode=thin
-
+ -Dhtml-build=disabled
+ -Dmanpage-build=disabled
+ -Dpdf-build=disabled
+ -Dx11=disabled
+ -Dmacos-10-14-features=disabled
+ -Dmacos-touchbar=disabled
+ -Dtests=false
+ -Dcplayer=true
-Dlibmpv=true
+ -Dcocoa=enabled
+ -Dgl-cocoa=enabled
+ -Dmacos-cocoa-cb=enabled
+ -Dplain-gl=enabled
+ -Dmacos-media-player=enabled
+ -Dcoreaudio=enabled
+ -Dcplugins=enabled
-Ddvdnav=enabled
-
- --default-library=both
+ -Dgl=enabled
+ -Djavascript=enabled
+ -Dlcms2=enabled
+ -Dlibplacebo=enabled
+ -Dlua=luajit
+ -Duchardet=disabled
+ -Dvideotoolbox-gl=enabled
+ -Dvulkan=disabled
+ -Dzimg=enabled
+ -Dzlib=enabled
+ -Dlibarchive=enabled
+ -Dshaderc=enabled
+ --default-library=static
+ --prefer-static
--sysconfdir=#{pkgetc}
--datadir=#{pkgshare}
--mandir=#{man}
]
+ # -Diconv=enabled
args << "-Dsdl2=enabled" if build.with? "sdl2"
args << ("-Dc_args=" + (Hardware::CPU.arm? ? "-mcpu=native" : "-march=native -mtune=native") + " -Ofast")
- args << "-Dswift-flags=-O -wmo"
+ args << "-Dswift-flags=-O -wmo -target x86_64-apple-macosx10.13"
system "meson", "setup", "build", *args, *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
- if OS.mac?
- # `pkg-config --libs mpv` includes libarchive, but that package is
- # keg-only so it needs to look for the pkgconfig file in libarchive's opt
- # path.
- libarchive = Formula["libarchive"].opt_prefix
- inreplace lib/"pkgconfig/mpv.pc" do |s|
- s.gsub!(/^Requires\.private:(.*)\blibarchive\b(.*?)(,.*)?$/,
- "Requires.private:\\1#{libarchive}/lib/pkgconfig/libarchive.pc\\3")
- end
- end
-
- bash_completion.install "etc/mpv.bash-completion" => "mpv"
- zsh_completion.install "etc/_mpv.zsh" => "_mpv"
-
# Build, Fix, and Codesign App Bundle
- system "python3.11", "TOOLS/osxbundle.py", "build/mpv", "--skip-deps"
+ system "python3.11", "TOOLS/osxbundle.py", "build/mpv"
bindir = "build/mpv.app/Contents/MacOS/"
rm bindir + "mpv-bundle"
mv bindir + "mpv", bindir + "mpv-bundle"
@@ -99,17 +119,5 @@ class Mpv < Formula
system "codesign", "--deep", "-fs", "-", "build/mpv.app"
prefix.install "build/mpv.app"
- # Add to Dock
- if build.with?("dockutil@2") || build.with?("dockutil@3")
- system "dockutil", "--add", "#{prefix}/mpv.app", "--replacing", "mpv", "--allhomes"
- end
- end
-
- test do
- system bin/"mpv", "--ao=null", "--vo=null", test_fixtures("test.wav")
- assert_match "vapoursynth", shell_output(bin/"mpv --vf=help")
-
- # Make sure `pkg-config` can parse `mpv.pc` after the `inreplace`.
- system "pkg-config", "mpv"
end
end