1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 makeDesktopItem,
7 copyDesktopItems,
8 cmake,
9 boost,
10 cups,
11 fmt,
12 libvorbis,
13 libsndfile,
14 minizip,
15 gtest,
16 qt6,
17}:
18
19stdenv.mkDerivation (finalAttrs: {
20 pname = "lsd2dsl";
21 version = "0.6.0";
22
23 src = fetchFromGitHub {
24 owner = "nongeneric";
25 repo = "lsd2dsl";
26 tag = "v${finalAttrs.version}";
27 hash = "sha256-0UsxDNpuWpBrfjh4q3JhZnOyXhHatSa3t/cApiG2JzM=";
28 };
29
30 patches = [
31 (fetchpatch {
32 url = "https://github.com/nongeneric/lsd2dsl/commit/bbda5be1b76a4a44804483d00c07d79783eceb6b.patch";
33 hash = "sha256-7is83D1cMBArXVLe5TP7D7lUcwnTMeXjkJ+cbaH5JQk=";
34 })
35 ];
36
37 postPatch = ''
38 substituteInPlace CMakeLists.txt --replace "-Werror" ""
39 '';
40
41 nativeBuildInputs = [
42 cmake
43 qt6.wrapQtAppsHook
44 ]
45 ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems;
46
47 buildInputs = [
48 boost
49 cups
50 fmt
51 libvorbis
52 libsndfile
53 minizip
54 gtest
55 qt6.qt5compat
56 qt6.qtwebengine
57 ];
58
59 env.NIX_CFLAGS_COMPILE = "-Wno-int-conversion";
60
61 desktopItems = lib.singleton (makeDesktopItem {
62 name = "lsd2dsl";
63 exec = "lsd2dsl-qtgui";
64 desktopName = "lsd2dsl";
65 genericName = "lsd2dsl";
66 comment = finalAttrs.meta.description;
67 categories = [
68 "Dictionary"
69 "FileTools"
70 "Qt"
71 ];
72 });
73
74 installPhase = ''
75 install -Dm755 console/lsd2dsl gui/lsd2dsl-qtgui -t $out/bin
76 '';
77
78 meta = {
79 homepage = "https://rcebits.com/lsd2dsl/";
80 description = "Lingvo dictionaries decompiler";
81 longDescription = ''
82 A decompiler for ABBYY Lingvo’s proprietary dictionaries.
83 '';
84 license = lib.licenses.mit;
85 maintainers = with lib.maintainers; [ sikmir ];
86 platforms = lib.platforms.unix;
87 };
88})