nixpkgs/pkgs/applications/misc/goldendict/default.nix
Jan Tojnar eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00

71 lines
2.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, pkg-config
, libXtst, libvorbis, hunspell, lzo, xz, bzip2, libiconv
, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake
, wrapQtAppsHook
, wrapGAppsHook3
, withCC ? true, opencc
, withEpwing ? true, libeb
, withExtraTiff ? true, libtiff
, withFFmpeg ? true, libao, ffmpeg
, withMultimedia ? true
, withZim ? true, zstd }:
stdenv.mkDerivation rec {
pname = "goldendict";
version = "1.5.0";
src = fetchFromGitHub {
owner = "goldendict";
repo = pname;
rev = version;
hash = "sha256-80o8y+mbzpyMQYUGHYs/zgQT23nLVCs7Jcr8FbbXn8M=";
};
patches = [
./0001-dont-check-for-updates.patch
./0001-dont-use-maclibs.patch
];
postPatch = ''
substituteInPlace goldendict.pro \
--replace "hunspell-1.6.1" "hunspell-${lib.versions.majorMinor hunspell.version}" \
--replace "opencc.2" "opencc"
'';
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook wrapGAppsHook3 ];
buildInputs = [
qtbase qtsvg qtwebkit qttools
libvorbis hunspell xz lzo
] ++ lib.optionals stdenv.isLinux [ qtx11extras libXtst ]
++ lib.optionals stdenv.isDarwin [ bzip2 libiconv ]
++ lib.optional withCC opencc
++ lib.optional withEpwing libeb
++ lib.optional withExtraTiff libtiff
++ lib.optionals withFFmpeg [ libao ffmpeg ]
++ lib.optional withZim zstd;
qmakeFlags = with lib; [
"goldendict.pro"
(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")
];
postInstall = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
mv GoldenDict.app $out/Applications
'';
meta = with lib; {
homepage = "http://goldendict.org/";
description = "A feature-rich dictionary lookup program";
platforms = with platforms; linux ++ darwin;
mainProgram = "goldendict";
maintainers = with maintainers; [ gebner astsmtl sikmir ];
license = licenses.gpl3Plus;
};
}