2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXtst, libvorbis, hunspell, lzo, xz, bzip2, libiconv
|
|
|
|
, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake
|
2023-07-15 17:15:38 +00:00
|
|
|
, wrapQtAppsHook
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2020-04-24 23:36:52 +00:00
|
|
|
, withCC ? true, opencc
|
|
|
|
, withEpwing ? true, libeb
|
|
|
|
, withExtraTiff ? true, libtiff
|
2021-05-28 09:39:13 +00:00
|
|
|
, withFFmpeg ? true, libao, ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
, withMultimedia ? true
|
2020-06-18 07:06:33 +00:00
|
|
|
, withZim ? true, zstd }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "goldendict";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goldendict";
|
|
|
|
repo = pname;
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-80o8y+mbzpyMQYUGHYs/zgQT23nLVCs7Jcr8FbbXn8M=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./0001-dont-check-for-updates.patch
|
|
|
|
./0001-dont-use-maclibs.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace goldendict.pro \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace "hunspell-1.6.1" "hunspell-${lib.versions.majorMinor hunspell.version}" \
|
|
|
|
--replace "opencc.2" "opencc"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook wrapGAppsHook3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
qtbase qtsvg qtwebkit qttools
|
|
|
|
libvorbis hunspell xz lzo
|
2021-01-15 22:18:51 +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-28 09:39:13 +00:00
|
|
|
++ lib.optionals withFFmpeg [ libao ffmpeg ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional withZim zstd;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
qmakeFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
"goldendict.pro"
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.optional withCC "CONFIG+=chinese_conversion_support")
|
|
|
|
(lib.optional (!withCC) "CONFIG+=no_chinese_conversion_support")
|
|
|
|
(lib.optional (!withEpwing) "CONFIG+=no_epwing_support")
|
|
|
|
(lib.optional (!withExtraTiff) "CONFIG+=no_extra_tiff_handler")
|
|
|
|
(lib.optional (!withFFmpeg) "CONFIG+=no_ffmpeg_player")
|
|
|
|
(lib.optional (!withMultimedia)"CONFIG+=no_qtmultimedia_player")
|
|
|
|
(lib.optional withZim "CONFIG+=zim_support")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv GoldenDict.app $out/Applications
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://goldendict.org/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Feature-rich dictionary lookup program";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "goldendict";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ gebner astsmtl sikmir ];
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|