Merge pull request #304345 from atorres1985-contrib/aegisub

Aegisub: refactor

authored by Weijia Wang and committed by GitHub 84ccaf7f 750bea5d

+167 -164
-163
pkgs/applications/video/aegisub/default.nix
··· 1 - { lib 2 - , config 3 - , stdenv 4 - , fetchFromGitHub 5 - , boost179 6 - , cmake 7 - , expat 8 - , harfbuzz 9 - , ffmpeg 10 - , ffms 11 - , fftw 12 - , fontconfig 13 - , freetype 14 - , fribidi 15 - , glib 16 - , icu 17 - , intltool 18 - , libGL 19 - , libGLU 20 - , libX11 21 - , libass 22 - , libiconv 23 - , libuchardet 24 - , luajit 25 - , pcre 26 - , pkg-config 27 - , which 28 - , wrapGAppsHook 29 - , wxGTK 30 - , zlib 31 - 32 - , spellcheckSupport ? true 33 - , hunspell ? null 34 - 35 - , openalSupport ? false 36 - , openal ? null 37 - 38 - , alsaSupport ? stdenv.isLinux 39 - , alsa-lib ? null 40 - 41 - , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux 42 - , libpulseaudio ? null 43 - 44 - , portaudioSupport ? false 45 - , portaudio ? null 46 - 47 - , useBundledLuaJIT ? false 48 - , darwin 49 - }: 50 - 51 - assert spellcheckSupport -> (hunspell != null); 52 - assert openalSupport -> (openal != null); 53 - assert alsaSupport -> (alsa-lib != null); 54 - assert pulseaudioSupport -> (libpulseaudio != null); 55 - assert portaudioSupport -> (portaudio != null); 56 - 57 - let 58 - luajit52 = luajit.override { enable52Compat = true; }; 59 - inherit (lib) optional; 60 - inherit (darwin.apple_sdk.frameworks) CoreText CoreFoundation AppKit Carbon IOKit Cocoa; 61 - in 62 - stdenv.mkDerivation rec { 63 - pname = "aegisub"; 64 - version = "3.3.3"; 65 - 66 - src = fetchFromGitHub { 67 - owner = "wangqr"; 68 - repo = pname; 69 - rev = "v${version}"; 70 - sha256 = "sha256-oKhLv81EFudrJaaJ2ga3pVh4W5Hd2YchpjsoYoqRm78="; 71 - }; 72 - 73 - nativeBuildInputs = [ 74 - intltool 75 - luajit52 76 - pkg-config 77 - which 78 - cmake 79 - wrapGAppsHook 80 - ]; 81 - 82 - buildInputs = [ 83 - boost179 84 - expat 85 - ffmpeg 86 - ffms 87 - fftw 88 - fontconfig 89 - freetype 90 - fribidi 91 - glib 92 - harfbuzz 93 - icu 94 - libGL 95 - libGLU 96 - libX11 97 - libass 98 - libiconv 99 - libuchardet 100 - pcre 101 - wxGTK 102 - zlib 103 - ] 104 - ++ lib.optionals stdenv.isDarwin [ 105 - CoreText 106 - CoreFoundation 107 - AppKit 108 - Carbon 109 - IOKit 110 - Cocoa 111 - ] 112 - ++ optional alsaSupport alsa-lib 113 - ++ optional openalSupport openal 114 - ++ optional portaudioSupport portaudio 115 - ++ optional pulseaudioSupport libpulseaudio 116 - ++ optional spellcheckSupport hunspell 117 - ; 118 - 119 - enableParallelBuilding = true; 120 - 121 - hardeningDisable = [ 122 - "bindnow" 123 - "relro" 124 - ]; 125 - 126 - patches = lib.optionals (!useBundledLuaJIT) [ 127 - ./remove-bundled-luajit.patch 128 - ]; 129 - 130 - # error: unknown type name 'NSUInteger' 131 - postPatch = '' 132 - substituteInPlace src/dialog_colorpicker.cpp \ 133 - --replace "NSUInteger" "size_t" 134 - ''; 135 - 136 - env.NIX_CFLAGS_COMPILE = "-I${luajit52}/include"; 137 - NIX_CFLAGS_LINK = "-L${luajit52}/lib"; 138 - 139 - configurePhase = '' 140 - export FORCE_GIT_VERSION=${version} 141 - # Workaround for a Nixpkgs bug; remove when the fix arrives 142 - mkdir build-dir 143 - cd build-dir 144 - cmake -DCMAKE_INSTALL_PREFIX=$out .. 145 - ''; 146 - 147 - meta = with lib; { 148 - homepage = "https://github.com/wangqr/Aegisub"; 149 - description = "An advanced subtitle editor"; 150 - longDescription = '' 151 - Aegisub is a free, cross-platform open source tool for creating and 152 - modifying subtitles. Aegisub makes it quick and easy to time subtitles to 153 - audio, and features many powerful tools for styling them, including a 154 - built-in real-time video preview. 155 - ''; 156 - # The Aegisub sources are itself BSD/ISC, but they are linked against GPL'd 157 - # softwares - so the resulting program will be GPL 158 - license = licenses.bsd3; 159 - maintainers = with maintainers; [ AndersonTorres wegank ]; 160 - platforms = platforms.unix; 161 - mainProgram = "aegisub"; 162 - }; 163 - }
pkgs/applications/video/aegisub/remove-bundled-luajit.patch pkgs/by-name/ae/aegisub/000-remove-bundled-luajit.patch
+164
pkgs/by-name/ae/aegisub/package.nix
··· 1 + { 2 + lib, 3 + alsa-lib, 4 + boost, 5 + cmake, 6 + config, 7 + darwin, 8 + expat, 9 + fetchFromGitHub, 10 + ffmpeg, 11 + ffms, 12 + fftw, 13 + fontconfig, 14 + freetype, 15 + fribidi, 16 + glib, 17 + harfbuzz, 18 + hunspell, 19 + icu, 20 + intltool, 21 + libGL, 22 + libGLU, 23 + libX11, 24 + libass, 25 + libiconv, 26 + libpulseaudio, 27 + libuchardet, 28 + luajit, 29 + ninja, 30 + openal, 31 + pcre, 32 + pkg-config, 33 + portaudio, 34 + stdenv, 35 + which, 36 + wrapGAppsHook, 37 + wxGTK, 38 + zlib, 39 + # Boolean guard flags 40 + alsaSupport ? stdenv.isLinux, 41 + openalSupport ? true, 42 + portaudioSupport ? true, 43 + pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, 44 + spellcheckSupport ? true, 45 + useBundledLuaJIT ? false, 46 + }: 47 + 48 + let 49 + inherit (darwin.apple_sdk.frameworks) 50 + AppKit 51 + Carbon 52 + Cocoa 53 + CoreFoundation 54 + CoreText 55 + IOKit 56 + OpenAL; 57 + in 58 + stdenv.mkDerivation (finalAttrs: { 59 + pname = "aegisub"; 60 + version = "3.3.3"; 61 + 62 + src = fetchFromGitHub { 63 + owner = "wangqr"; 64 + repo = "aegisub"; 65 + rev = "v${finalAttrs.version}"; 66 + hash = "sha256-oKhLv81EFudrJaaJ2ga3pVh4W5Hd2YchpjsoYoqRm78="; 67 + }; 68 + 69 + nativeBuildInputs = [ 70 + cmake 71 + intltool 72 + luajit 73 + ninja 74 + pkg-config 75 + which 76 + wrapGAppsHook 77 + wxGTK 78 + ]; 79 + 80 + buildInputs = [ 81 + boost 82 + expat 83 + ffmpeg 84 + ffms 85 + fftw 86 + fontconfig 87 + freetype 88 + fribidi 89 + glib 90 + harfbuzz 91 + icu 92 + libGL 93 + libGLU 94 + libX11 95 + libass 96 + libiconv 97 + libuchardet 98 + pcre 99 + wxGTK 100 + zlib 101 + ] 102 + ++ lib.optionals alsaSupport [ alsa-lib ] 103 + ++ lib.optionals openalSupport [ 104 + (if stdenv.isDarwin then OpenAL else openal) 105 + ] 106 + ++ lib.optionals portaudioSupport [ portaudio ] 107 + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] 108 + ++ lib.optionals spellcheckSupport [ hunspell ] 109 + ++ lib.optionals stdenv.isDarwin [ 110 + AppKit 111 + Carbon 112 + Cocoa 113 + CoreFoundation 114 + CoreText 115 + IOKit 116 + ]; 117 + 118 + hardeningDisable = [ 119 + "bindnow" 120 + "relro" 121 + ]; 122 + 123 + patches = lib.optionals (!useBundledLuaJIT) [ 124 + ./000-remove-bundled-luajit.patch 125 + ]; 126 + 127 + # error: unknown type name 'NSUInteger' 128 + postPatch = '' 129 + substituteInPlace src/dialog_colorpicker.cpp \ 130 + --replace "NSUInteger" "size_t" 131 + ''; 132 + 133 + env = { 134 + NIX_CFLAGS_COMPILE = "-I${lib.getDev luajit}/include"; 135 + NIX_CFLAGS_LINK = "-L${lib.getLib luajit}/lib"; 136 + }; 137 + 138 + preConfigure = '' 139 + export FORCE_GIT_VERSION=${finalAttrs.version} 140 + ''; 141 + 142 + cmakeBuildDir = "build-directory"; 143 + 144 + strictDeps = true; 145 + 146 + meta = { 147 + homepage = "https://github.com/wangqr/Aegisub"; 148 + description = "An advanced subtitle editor; wangqr's fork"; 149 + longDescription = '' 150 + Aegisub is a free, cross-platform open source tool for creating and 151 + modifying subtitles. Aegisub makes it quick and easy to time subtitles to 152 + audio, and features many powerful tools for styling them, including a 153 + built-in real-time video preview. 154 + ''; 155 + # The Aegisub sources are itself BSD/ISC, but they are linked against GPL'd 156 + # softwares - so the resulting program will be GPL 157 + license = with lib.licenses; [ 158 + bsd3 159 + ]; 160 + mainProgram = "aegisub"; 161 + maintainers = with lib.maintainers; [ AndersonTorres wegank ]; 162 + platforms = lib.platforms.unix; 163 + }; 164 + })
+3 -1
pkgs/top-level/all-packages.nix
··· 1577 1577 1578 1578 aefs = callPackage ../tools/filesystems/aefs { }; 1579 1579 1580 - aegisub = callPackage ../applications/video/aegisub ({ 1580 + aegisub = callPackage ../by-name/ae/aegisub/package.nix ({ 1581 + boost = boost179; 1582 + luajit = luajit.override { enable52Compat = true; }; 1581 1583 wxGTK = wxGTK32; 1582 1584 } // (config.aegisub or {})); 1583 1585