-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathautoupdate.py
136 lines (132 loc) · 3.43 KB
/
autoupdate.py
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
import json
from urllib import request
import in_place
resp = request.urlopen('https://github.com/eko5624/nginx-nosni/raw/master/old.json')
x = json.loads(resp.read().decode('utf-8'))
x = dict(map(lambda p: (p, x['data'][p]['version']), x['data'].keys()))
mingw = x['Mingw-w64-custom'][:x['Mingw-w64-custom'].find('ucrt')+4]
for t in ['build-toolchain-lhmouse.yml']:
with in_place.InPlace('.github/workflows/%s' % t, newline='') as f:
for l in f:
if (i:=l.find('key: mcf_')) > -1:
l = '%s%s\n' % (l[:i+9], mingw)
elif (i:=l.find('mingw-w64-gcc-mcf_')) > -1:
l = '%s%s.7z\n' % (l[:i+18], x['Mingw-w64-custom'])
f.write(l)
pkgs = {}
pkgs['libsixel'] = x['libsixel']
for p in ['freetype2', 'fribidi', 'harfbuzz', 'libjxl', 'spirv-cross']:
pkgs['%s-dev' % p] = x[p]
for p in pkgs:
with in_place.InPlace('%s/PKGBUILD-new' % p, newline='') as f:
for l in f:
if l.startswith('pkgver'):
l = 'pkgver=%s\n' % pkgs[p]
f.write(l)
pkgs['mcfgthread'] = mingw[:8]
pkgs['vapoursynth'] = x['VapourSynth'][1:]
for p in ['curl', 'mpv', 'ffmpeg', 'luajit2', 'mujs', 'rubberband']:
pkgs['%s' % p] = x[p]
pkgs['libvorbis_aotuv-dev'] = x['libvorbis']
for p in [
'amf',
'aom',
'angle',
'avisynth',
'brotli',
'bzip2',
'dav1d',
'davs2',
'expat',
'ffnvcodec',
'highway',
'lame',
'lcms2',
'libarchive',
'libaribcaption',
'libass',
'libbluray',
'libbs2b',
'libcaca',
'libdovi',
'libdvdcss',
'libdvdnav',
'libdvdread',
'libiconv',
'libudfread',
'libunibreak',
'libjpeg',
'libmodplug',
'libmysofa',
'libogg',
'libopenmpt',
'libplacebo',
'libpng',
'libsamplerate',
'libsdl2',
'libspeex',
'libssh',
'libsrt',
'libvpl',
'libvpx',
'libwebp',
'libxml2',
'libxvid',
'libva',
'libzimg',
'libzvbi',
'lzo',
'mbedtls',
'openal-soft',
'openssl',
'opus',
'rav1e',
'shaderc',
'svtav1',
'uavs3d',
'vulkan',
'vvdec',
'xxhash',
'xz',
'zlib',
'zstd',
]:
pkgs['%s-dev' % p] = x[p]
for p in pkgs:
with in_place.InPlace('%s/PKGBUILD' % p, newline='') as f:
for l in f:
if l.startswith('pkgver'):
l = 'pkgver=%s\n' % pkgs[p]
f.write(l)
pkgs['amf-headers-dev'] = x['amf']
pkgs['angle-headers-dev'] = x['angle']
pkgs['libsixel-dev'] = x['libsixel']
pkgs['luajit-dev'] = x['LuaJIT']
pkgs['luajit2-dev'] = x['luajit2']
pkgs['mujs-dev'] = x['mujs']
pkgs['rubberband-dev'] = x['rubberband']
pkgs['vapoursynth-dev'] = x['VapourSynth'][1:]
pkgs['ffmpeg-dev'] = x['ffmpeg']
pkgs['ffmpeg-git'] = x['ffmpeg']
pkgs['libmpv-git'] = x['mpv']
pkgs['mpv-git'] = x['mpv']
for t in ['curl.yml', 'ffmpeg.yml', 'libplacebo.yml', 'shaderc.yml', 'vulkan.yml', 'mpv.yml', 'build-all.yml', 'package.yml']:
with in_place.InPlace('.github/workflows/%s' % t, newline='') as f:
for l in f:
if (i:=l.find('key: mcf_')) > -1:
l = '%s%s\n' % (l[:i+9], mingw)
elif (i:=l.find('/dev/')) > -1:
r = l.find('-1-x86_64')
rr = l.rfind('-', i, r)
p = l[i+5:rr]
if p in pkgs:
l = '%s%s-%s%s' % (l[:i+5], p, pkgs[p], l[r:])
elif (i:=l.find('/latest/')) > -1:
r = l.find('-1-x86_64')
rr = l.rfind('-', i, r)
p = l[i+8:rr]
if p in pkgs:
l = '%s%s-%s%s' % (l[:i+8], p, pkgs[p], l[r:])
elif (i:=l.find('/yt-dlp/releases/download/')) > -1:
l = '%s%s/yt-dlp.exe\n' % (l[:i+26], x['yt-dlp'])
f.write(l)