nixpkgs/pkgs/applications/misc/goldendict/default.nix

69 lines
2.3 KiB
Nix
Raw Normal View History

2020-02-08 11:36:28 +00:00
{ stdenv, mkDerivation, fetchFromGitHub, pkgconfig
, libXtst, libvorbis, hunspell, lzo, xz, bzip2, libiconv
, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake
, withCC ? true, opencc
, withEpwing ? true, libeb
, withExtraTiff ? true, libtiff
, withFFmpeg ? true, libao, ffmpeg
, withMultimedia ? true
, withZim ? true }:
mkDerivation rec {
pname = "goldendict";
version = "2020-01-09";
2017-06-02 16:40:19 +01:00
src = fetchFromGitHub {
owner = "goldendict";
2020-02-08 11:36:28 +00:00
repo = pname;
rev = "da197ff5cd0e7326124c9240a1853a0e8b1de439";
sha256 = "0dlzwjh9wg4bzhhib71jycpp21qw762ww63a37dd50z1ymi61lxc";
};
2015-09-23 18:06:29 +01:00
2020-02-08 11:36:28 +00:00
patches = [
./0001-dont-check-for-updates.patch
] ++ stdenv.lib.optionals stdenv.isDarwin [
./0001-dont-use-maclibs.patch
];
postPatch = ''
substituteInPlace goldendict.pro \
--replace "hunspell-1.6.1" "hunspell-${stdenv.lib.versions.majorMinor hunspell.version}"
'';
nativeBuildInputs = [ pkgconfig 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
] ++ stdenv.lib.optionals stdenv.isLinux [ qtx11extras libXtst ]
++ stdenv.lib.optionals stdenv.isDarwin [ bzip2 libiconv ]
++ stdenv.lib.optional withCC opencc
++ stdenv.lib.optional withEpwing libeb
++ stdenv.lib.optional withExtraTiff libtiff
++ stdenv.lib.optionals withFFmpeg [ libao ffmpeg ];
2016-04-17 00:32:05 +01:00
2020-02-08 11:36:28 +00:00
qmakeFlags = with stdenv.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
];
2020-02-08 11:36:28 +00:00
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
mv GoldenDict.app $out/Applications
wrapQtApp $out/Applications/GoldenDict.app/Contents/MacOS/GoldenDict
'';
meta = with stdenv.lib; {
homepage = "http://goldendict.org/";
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;
};
}