2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
|
|
|
, config
|
2020-04-24 23:36:52 +00:00
|
|
|
, stdenv
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
2023-08-04 22:07:22 +00:00
|
|
|
, boost179
|
2022-07-14 12:49:19 +00:00
|
|
|
, cmake
|
|
|
|
, expat
|
|
|
|
, harfbuzz
|
2021-05-03 20:48:10 +00:00
|
|
|
, ffmpeg
|
|
|
|
, ffms
|
|
|
|
, fftw
|
2020-04-24 23:36:52 +00:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
2022-07-14 12:49:19 +00:00
|
|
|
, fribidi
|
|
|
|
, glib
|
2021-05-03 20:48:10 +00:00
|
|
|
, icu
|
|
|
|
, intltool
|
2020-04-24 23:36:52 +00:00
|
|
|
, libGL
|
2021-05-03 20:48:10 +00:00
|
|
|
, libGLU
|
|
|
|
, libX11
|
2020-04-24 23:36:52 +00:00
|
|
|
, libass
|
2021-05-03 20:48:10 +00:00
|
|
|
, libiconv
|
2022-06-16 17:23:12 +00:00
|
|
|
, libuchardet
|
2022-07-14 12:49:19 +00:00
|
|
|
, luajit
|
|
|
|
, pcre
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkg-config
|
2022-06-16 17:23:12 +00:00
|
|
|
, which
|
2023-01-20 10:41:00 +00:00
|
|
|
, wrapGAppsHook
|
2021-05-03 20:48:10 +00:00
|
|
|
, wxGTK
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib
|
|
|
|
|
|
|
|
, spellcheckSupport ? true
|
|
|
|
, hunspell ? null
|
|
|
|
|
|
|
|
, openalSupport ? false
|
|
|
|
, openal ? null
|
|
|
|
|
|
|
|
, alsaSupport ? stdenv.isLinux
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
|
|
|
|
, libpulseaudio ? null
|
|
|
|
|
|
|
|
, portaudioSupport ? false
|
|
|
|
, portaudio ? null
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
, useBundledLuaJIT ? false
|
2022-12-17 10:02:37 +00:00
|
|
|
, darwin
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert spellcheckSupport -> (hunspell != null);
|
|
|
|
assert openalSupport -> (openal != null);
|
2021-06-28 23:13:55 +00:00
|
|
|
assert alsaSupport -> (alsa-lib != null);
|
2020-04-24 23:36:52 +00:00
|
|
|
assert pulseaudioSupport -> (libpulseaudio != null);
|
|
|
|
assert portaudioSupport -> (portaudio != null);
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
let
|
2022-06-16 17:23:12 +00:00
|
|
|
luajit52 = luajit.override { enable52Compat = true; };
|
2021-05-03 20:48:10 +00:00
|
|
|
inherit (lib) optional;
|
2022-12-17 10:02:37 +00:00
|
|
|
inherit (darwin.apple_sdk.frameworks) CoreText CoreFoundation AppKit Carbon IOKit Cocoa;
|
2021-05-03 20:48:10 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "aegisub";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wangqr";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-oKhLv81EFudrJaaJ2ga3pVh4W5Hd2YchpjsoYoqRm78=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
intltool
|
2022-06-16 17:23:12 +00:00
|
|
|
luajit52
|
2021-05-03 20:48:10 +00:00
|
|
|
pkg-config
|
2022-06-16 17:23:12 +00:00
|
|
|
which
|
2022-07-14 12:49:19 +00:00
|
|
|
cmake
|
2023-01-20 10:41:00 +00:00
|
|
|
wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
buildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
boost179
|
2022-07-14 12:49:19 +00:00
|
|
|
expat
|
2021-05-03 20:48:10 +00:00
|
|
|
ffmpeg
|
|
|
|
ffms
|
|
|
|
fftw
|
2020-04-24 23:36:52 +00:00
|
|
|
fontconfig
|
|
|
|
freetype
|
2022-07-14 12:49:19 +00:00
|
|
|
fribidi
|
|
|
|
glib
|
|
|
|
harfbuzz
|
2021-05-03 20:48:10 +00:00
|
|
|
icu
|
2020-04-24 23:36:52 +00:00
|
|
|
libGL
|
2021-05-03 20:48:10 +00:00
|
|
|
libGLU
|
|
|
|
libX11
|
2020-04-24 23:36:52 +00:00
|
|
|
libass
|
|
|
|
libiconv
|
2022-06-16 17:23:12 +00:00
|
|
|
libuchardet
|
2022-07-14 12:49:19 +00:00
|
|
|
pcre
|
2021-05-03 20:48:10 +00:00
|
|
|
wxGTK
|
|
|
|
zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
]
|
2022-07-14 12:49:19 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreText
|
|
|
|
CoreFoundation
|
|
|
|
AppKit
|
|
|
|
Carbon
|
|
|
|
IOKit
|
|
|
|
Cocoa
|
|
|
|
]
|
2021-06-28 23:13:55 +00:00
|
|
|
++ optional alsaSupport alsa-lib
|
2021-05-03 20:48:10 +00:00
|
|
|
++ optional openalSupport openal
|
|
|
|
++ optional portaudioSupport portaudio
|
|
|
|
++ optional pulseaudioSupport libpulseaudio
|
|
|
|
++ optional spellcheckSupport hunspell
|
|
|
|
;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
hardeningDisable = [
|
|
|
|
"bindnow"
|
|
|
|
"relro"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
patches = lib.optionals (!useBundledLuaJIT) [
|
|
|
|
./remove-bundled-luajit.patch
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# error: unknown type name 'NSUInteger'
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/dialog_colorpicker.cpp \
|
|
|
|
--replace "NSUInteger" "size_t"
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-I${luajit52}/include";
|
2022-07-14 12:49:19 +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 ..
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/wangqr/Aegisub";
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
2021-05-03 20:48:10 +00:00
|
|
|
# The Aegisub sources are itself BSD/ISC, but they are linked against GPL'd
|
|
|
|
# softwares - so the resulting program will be GPL
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres wegank ];
|
2022-07-14 12:49:19 +00:00
|
|
|
platforms = platforms.unix;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "aegisub";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|