nixpkgs/pkgs/applications/video/aegisub/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

164 lines
3.2 KiB
Nix
Raw Normal View History

2021-01-15 05:42:41 +00:00
{ lib
, config
2019-12-15 04:44:17 +00:00
, stdenv
, fetchFromGitHub
, boost179
2022-07-03 05:13:47 +00:00
, cmake
, expat
, harfbuzz
, ffmpeg
, ffms
, fftw
2019-12-15 04:44:17 +00:00
, fontconfig
, freetype
2022-07-03 05:13:47 +00:00
, fribidi
, glib
, icu
, intltool
2019-12-15 04:44:17 +00:00
, libGL
, libGLU
, libX11
2019-12-15 04:44:17 +00:00
, libass
, libiconv
, libuchardet
2022-07-03 05:13:47 +00:00
, luajit
, pcre
2019-12-15 04:44:17 +00:00
, pkg-config
, which
, wrapGAppsHook
, wxGTK
2019-12-15 04:44:17 +00:00
, zlib
, spellcheckSupport ? true
, hunspell ? null
, openalSupport ? false
, openal ? null
, alsaSupport ? stdenv.isLinux
, alsa-lib ? null
2019-12-15 04:44:17 +00:00
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
, libpulseaudio ? null
, portaudioSupport ? false
, portaudio ? null
2022-07-03 05:13:47 +00:00
, useBundledLuaJIT ? false
, darwin
2019-12-15 04:44:17 +00:00
}:
assert spellcheckSupport -> (hunspell != null);
assert openalSupport -> (openal != null);
assert alsaSupport -> (alsa-lib != null);
assert pulseaudioSupport -> (libpulseaudio != null);
assert portaudioSupport -> (portaudio != null);
let
luajit52 = luajit.override { enable52Compat = true; };
inherit (lib) optional;
inherit (darwin.apple_sdk.frameworks) CoreText CoreFoundation AppKit Carbon IOKit Cocoa;
in
stdenv.mkDerivation rec {
pname = "aegisub";
2022-07-26 22:23:47 +00:00
version = "3.3.3";
src = fetchFromGitHub {
owner = "wangqr";
repo = pname;
2022-07-26 22:23:47 +00:00
rev = "v${version}";
sha256 = "sha256-oKhLv81EFudrJaaJ2ga3pVh4W5Hd2YchpjsoYoqRm78=";
};
2019-12-15 04:44:17 +00:00
nativeBuildInputs = [
intltool
luajit52
pkg-config
which
2022-07-03 05:13:47 +00:00
cmake
wrapGAppsHook
2019-12-15 04:44:17 +00:00
];
2022-07-03 05:13:47 +00:00
buildInputs = [
boost179
2022-07-03 05:13:47 +00:00
expat
ffmpeg
ffms
fftw
2019-12-15 04:44:17 +00:00
fontconfig
freetype
2022-07-03 05:13:47 +00:00
fribidi
glib
harfbuzz
icu
2019-12-15 04:44:17 +00:00
libGL
libGLU
libX11
2019-12-15 04:44:17 +00:00
libass
libiconv
libuchardet
2022-07-03 05:13:47 +00:00
pcre
wxGTK
zlib
]
2022-07-03 05:13:47 +00:00
++ lib.optionals stdenv.isDarwin [
CoreText
CoreFoundation
AppKit
Carbon
IOKit
Cocoa
]
++ optional alsaSupport alsa-lib
++ optional openalSupport openal
++ optional portaudioSupport portaudio
++ optional pulseaudioSupport libpulseaudio
++ optional spellcheckSupport hunspell
;
enableParallelBuilding = true;
hardeningDisable = [
"bindnow"
"relro"
];
2022-07-03 05:13:47 +00:00
patches = lib.optionals (!useBundledLuaJIT) [
./remove-bundled-luajit.patch
];
2022-10-08 19:06:10 +00:00
# error: unknown type name 'NSUInteger'
postPatch = ''
substituteInPlace src/dialog_colorpicker.cpp \
--replace "NSUInteger" "size_t"
'';
env.NIX_CFLAGS_COMPILE = "-I${luajit52}/include";
2022-07-03 05:13:47 +00:00
NIX_CFLAGS_LINK = "-L${luajit52}/lib";
configurePhase = ''
export FORCE_GIT_VERSION=${version}
# Workaround for a Nixpkgs bug; remove when the fix arrives
mkdir build-dir
cd build-dir
cmake -DCMAKE_INSTALL_PREFIX=$out ..
'';
meta = with lib; {
homepage = "https://github.com/wangqr/Aegisub";
description = "An advanced subtitle editor";
longDescription = ''
Aegisub is a free, cross-platform open source tool for creating and
modifying subtitles. Aegisub makes it quick and easy to time subtitles to
audio, and features many powerful tools for styling them, including a
built-in real-time video preview.
'';
# The Aegisub sources are itself BSD/ISC, but they are linked against GPL'd
# softwares - so the resulting program will be GPL
license = licenses.bsd3;
2022-10-08 19:06:10 +00:00
maintainers = with maintainers; [ AndersonTorres wegank ];
2022-07-03 05:13:47 +00:00
platforms = platforms.unix;
2023-11-27 01:17:53 +00:00
mainProgram = "aegisub";
};
}