2021-01-17 02:09:27 +00:00
|
|
|
{ lib, stdenv, mkDerivation, fetchFromGitHub, pkg-config
|
2020-02-08 11:36:28 +00:00
|
|
|
, libXtst, libvorbis, hunspell, lzo, xz, bzip2, libiconv
|
|
|
|
, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake
|
|
|
|
, withCC ? true, opencc
|
|
|
|
, withEpwing ? true, libeb
|
|
|
|
, withExtraTiff ? true, libtiff
|
2021-05-18 15:58:18 +01:00
|
|
|
, withFFmpeg ? true, libao, ffmpeg
|
2020-02-08 11:36:28 +00:00
|
|
|
, withMultimedia ? true
|
2020-06-04 10:19:04 +01:00
|
|
|
, withZim ? true, zstd }:
|
2020-02-08 11:36:28 +00:00
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "goldendict";
|
2021-05-18 15:58:18 +01:00
|
|
|
version = "2021-03-09";
|
2017-06-02 16:40:19 +01:00
|
|
|
|
2018-07-01 10:57:58 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goldendict";
|
2020-02-08 11:36:28 +00:00
|
|
|
repo = pname;
|
2021-05-18 15:58:18 +01:00
|
|
|
rev = "b2e673961d28ca5eb920a909091252d3321f09d6";
|
|
|
|
sha256 = "sha256-+AAamnICq0/B54ggFpgF/Uupm1a4YiEYgHXrhIK4M0E=";
|
2012-02-05 21:02:27 +00:00
|
|
|
};
|
2015-09-23 18:06:29 +01:00
|
|
|
|
2020-02-08 11:36:28 +00:00
|
|
|
patches = [
|
|
|
|
./0001-dont-check-for-updates.patch
|
2021-01-15 05:42:41 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-02-08 11:36:28 +00:00
|
|
|
./0001-dont-use-maclibs.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace goldendict.pro \
|
2021-01-15 05:42:41 +00:00
|
|
|
--replace "hunspell-1.6.1" "hunspell-${lib.versions.majorMinor hunspell.version}"
|
2020-02-08 11:36:28 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake ];
|
2016-04-17 00:32:05 +01:00
|
|
|
buildInputs = [
|
2020-02-08 11:36:28 +00:00
|
|
|
qtbase qtsvg qtwebkit qttools
|
|
|
|
libvorbis hunspell xz lzo
|
2021-01-15 05:42:41 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ qtx11extras libXtst ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ bzip2 libiconv ]
|
|
|
|
++ lib.optional withCC opencc
|
|
|
|
++ lib.optional withEpwing libeb
|
|
|
|
++ lib.optional withExtraTiff libtiff
|
2021-05-18 15:58:18 +01:00
|
|
|
++ lib.optionals withFFmpeg [ libao ffmpeg ]
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optional withZim zstd;
|
2016-04-17 00:32:05 +01:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
qmakeFlags = with lib; [
|
2019-08-02 23:04:12 +01:00
|
|
|
"goldendict.pro"
|
2020-02-08 11:36:28 +00:00
|
|
|
(optional withCC "CONFIG+=chinese_conversion_support")
|
|
|
|
(optional (!withCC) "CONFIG+=no_chinese_conversion_support")
|
|
|
|
(optional (!withEpwing) "CONFIG+=no_epwing_support")
|
|
|
|
(optional (!withExtraTiff) "CONFIG+=no_extra_tiff_handler")
|
|
|
|
(optional (!withFFmpeg) "CONFIG+=no_ffmpeg_player")
|
|
|
|
(optional (!withMultimedia)"CONFIG+=no_qtmultimedia_player")
|
|
|
|
(optional withZim "CONFIG+=zim_support")
|
2019-08-02 23:04:12 +01:00
|
|
|
];
|
2012-02-05 21:02:27 +00:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-02-08 11:36:28 +00:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv GoldenDict.app $out/Applications
|
|
|
|
wrapQtApp $out/Applications/GoldenDict.app/Contents/MacOS/GoldenDict
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-08 11:36:28 +00:00
|
|
|
homepage = "http://goldendict.org/";
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "A feature-rich dictionary lookup program";
|
2020-02-08 11:36:28 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
maintainers = with maintainers; [ gebner astsmtl sikmir ];
|
2018-09-01 12:53:01 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2012-02-05 21:02:27 +00:00
|
|
|
};
|
|
|
|
}
|