git.iko.soy/typeable/nixpkgs
on master help sign in
aegisub: fix x86_64-linux build
commit5f30bb2484deb1f80022f76f78b7c2a2f21ab059 authorfuzzypixelz <mazouz-2002@outlook.com> dateMon 10 May 2021, 05:09 (6 years ago) parenta8dc2d5
2 files changed+123
pkgs/applications/video/aegisub/default.nix+18 pkgs/applications/video/aegisub/update-ffms2.patch+105
pkgs/applications/video/aegisub/default.nix+18
@@ -76,6 +76,20 @@ stdenv.mkDerivation rec {
7676 url = "https://github.com/Aegisub/Aegisub/commit/6bd3f4c26b8fc1f76a8b797fcee11e7611d59a39.patch";
7777 sha256 = "sha256-rG8RJokd4V4aSYOQw2utWnrWPVrkqSV3TAvnGXNhLOk=";
7878 })
79+
80+ # Compatibility with ffms2
81+ (fetchpatch {
82+ url = "https://github.com/Aegisub/Aegisub/commit/1aa9215e7fc360de05da9b7ec2cd68f1940af8b2.patch";
83+ sha256 = "sha256-JsuI4hQTcT0TEqHHoSsGbuiTg4hMCH3Cxp061oLk8Go=";
84+ })
85+
86+ ./update-ffms2.patch
87+
88+ # Compatibility with X11
89+ (fetchpatch {
90+ url = "https://github.com/Aegisub/Aegisub/commit/7a6da26be6a830f4e1255091952cc0a1326a4520.patch";
91+ sha256 = "sha256-/aTcIjFlZY4N9+IyHL4nwR0hUR4HTJM7ibbdKmNxq0w=";
92+ })
7993 ];
8094
8195 nativeBuildInputs = [
@@ -113,6 +127,10 @@ stdenv.mkDerivation rec {
113127 "relro"
114128 ];
115129
130+ postPatch = ''
131+ sed -i 's/-Wno-c++11-narrowing/-Wno-narrowing/' configure.ac src/Makefile
132+ '';
133+
116134 # compat with icu61+
117135 # https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
118136 CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ];
pkgs/applications/video/aegisub/update-ffms2.patchnew file+105
@@ -0,0 +1,105 @@
1+commit 89c4e8d34ab77c3322f097b91fd9de22cbea7a37
2+Author: Thomas Goyne <plorkyeran@aegisub.org>
3+Date: Wed Nov 21 16:41:05 2018 -0800
4+
5+ Update ffmpeg and ffms2
6+
7+diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp
8+index 8bd68fbbf..f4ed6a2f2 100644
9+--- a/src/video_provider_ffmpegsource.cpp
10++++ b/src/video_provider_ffmpegsource.cpp
11+@@ -44,6 +44,23 @@
12+ #include <libaegisub/make_unique.h>
13+
14+ namespace {
15++typedef enum AGI_ColorSpaces {
16++ AGI_CS_RGB = 0,
17++ AGI_CS_BT709 = 1,
18++ AGI_CS_UNSPECIFIED = 2,
19++ AGI_CS_FCC = 4,
20++ AGI_CS_BT470BG = 5,
21++ AGI_CS_SMPTE170M = 6,
22++ AGI_CS_SMPTE240M = 7,
23++ AGI_CS_YCOCG = 8,
24++ AGI_CS_BT2020_NCL = 9,
25++ AGI_CS_BT2020_CL = 10,
26++ AGI_CS_SMPTE2085 = 11,
27++ AGI_CS_CHROMATICITY_DERIVED_NCL = 12,
28++ AGI_CS_CHROMATICITY_DERIVED_CL = 13,
29++ AGI_CS_ICTCP = 14
30++} AGI_ColorSpaces;
31++
32+ /// @class FFmpegSourceVideoProvider
33+ /// @brief Implements video loading through the FFMS library.
34+ class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvider {
35+@@ -78,7 +95,7 @@ public:
36+ if (matrix == RealColorSpace)
37+ FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), nullptr);
38+ else if (matrix == "TV.601")
39+- FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
40++ FFMS_SetInputFormatV(VideoSource, AGI_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
41+ else
42+ return;
43+ ColorSpace = matrix;
44+@@ -103,16 +120,16 @@ std::string colormatrix_description(int cs, int cr) {
45+ std::string str = cr == FFMS_CR_JPEG ? "PC" : "TV";
46+
47+ switch (cs) {
48+- case FFMS_CS_RGB:
49++ case AGI_CS_RGB:
50+ return "None";
51+- case FFMS_CS_BT709:
52++ case AGI_CS_BT709:
53+ return str + ".709";
54+- case FFMS_CS_FCC:
55++ case AGI_CS_FCC:
56+ return str + ".FCC";
57+- case FFMS_CS_BT470BG:
58+- case FFMS_CS_SMPTE170M:
59++ case AGI_CS_BT470BG:
60++ case AGI_CS_SMPTE170M:
61+ return str + ".601";
62+- case FFMS_CS_SMPTE240M:
63++ case AGI_CS_SMPTE240M:
64+ return str + ".240M";
65+ default:
66+ throw VideoOpenError("Unknown video color space");
67+@@ -206,8 +223,10 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
68+
69+ // set thread count
70+ int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt();
71++#if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0)
72+ if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF)
73+ Threads = 1;
74++#endif
75+
76+ // set seekmode
77+ // TODO: give this its own option?
78+@@ -235,18 +254,22 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
79+ else
80+ DAR = double(Width) / Height;
81+
82+- CS = TempFrame->ColorSpace;
83++ int VideoCS = CS = TempFrame->ColorSpace;
84+ CR = TempFrame->ColorRange;
85+
86+- if (CS == FFMS_CS_UNSPECIFIED)
87+- CS = Width > 1024 || Height >= 600 ? FFMS_CS_BT709 : FFMS_CS_BT470BG;
88++ if (CS == AGI_CS_UNSPECIFIED)
89++ CS = Width > 1024 || Height >= 600 ? AGI_CS_BT709 : AGI_CS_BT470BG;
90+ RealColorSpace = ColorSpace = colormatrix_description(CS, CR);
91+
92+ #if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0)
93+- if (CS != FFMS_CS_RGB && CS != FFMS_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
94+- if (FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), &ErrInfo))
95++ if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
96++ CS = AGI_CS_BT470BG;
97++ ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR);
98++ }
99++
100++ if (CS != VideoCS) {
101++ if (FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), &ErrInfo))
102+ throw VideoOpenError(std::string("Failed to set input format: ") + ErrInfo.Buffer);
103+- ColorSpace = colormatrix_description(FFMS_CS_BT470BG, CR);
104+ }
105+ #endif