-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpatch-ffmpeg.js
More file actions
executable file
·56 lines (45 loc) · 1.58 KB
/
patch-ffmpeg.js
File metadata and controls
executable file
·56 lines (45 loc) · 1.58 KB
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
#!/usr/bin/env node
/**
* Apply FFmpeg patches using quilt
* This script applies all patches from externals/jellyfin-ffmpeg/debian/patches
*/
import { execSync } from 'child_process';
import { existsSync } from 'fs';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const JELLYFIN_FFMPEG_PATH = join(__dirname, '..', 'externals', 'jellyfin-ffmpeg');
const main = () => {
console.log('Applying FFmpeg patches with quilt...');
// Check if jellyfin-ffmpeg directory exists
if (!existsSync(JELLYFIN_FFMPEG_PATH)) {
console.error(`Error: jellyfin-ffmpeg directory not found at ${JELLYFIN_FFMPEG_PATH}`);
process.exit(1);
}
// Check if debian/patches directory exists
const patchesDir = join(JELLYFIN_FFMPEG_PATH, 'debian', 'patches');
if (!existsSync(patchesDir)) {
console.error(`Error: patches directory not found at ${patchesDir}`);
process.exit(1);
}
try {
// Change to jellyfin-ffmpeg directory and apply patches
console.log(`Working directory: ${JELLYFIN_FFMPEG_PATH}`);
console.log('Running: quilt push -a\n');
execSync('quilt upgrade || true && quilt pop -af || true && quilt push -a', {
cwd: JELLYFIN_FFMPEG_PATH,
stdio: 'inherit',
env: {
...process.env,
QUILT_PATCHES: patchesDir,
},
});
console.log('\n✓ All patches applied successfully!');
} catch (error) {
console.error('\n✗ Failed to apply patches');
console.error(error.message);
process.exit(1);
}
};
main();