1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 autoreconfHook,
7 pkg-config,
8 glib,
9 expat,
10 installShellFiles,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "prevo-tools";
15 version = "0.2";
16
17 src = fetchFromGitHub {
18 owner = "bpeel";
19 repo = "prevodb";
20 rev = version;
21 hash = "sha256-TfgsZidwXewwqGkb31Qv0SrX8wQdPaK7JQA3nB5h2bs=";
22 };
23
24 patches = [
25 # Fix building with glib-2.82
26 # https://github.com/bpeel/prevodb/issues/8
27 (fetchpatch {
28 url = "https://github.com/bpeel/prevodb/commit/38474b47d0ab8ef5451997b87493f0677b8b8358.patch";
29 hash = "sha256-mGHwnN4TT3jiandaN+6uNttKMg0OjV9yKLSuVn3F0CA=";
30 })
31 ];
32
33 nativeBuildInputs = [
34 autoreconfHook
35 pkg-config
36 installShellFiles
37 ];
38 buildInputs = [
39 glib
40 expat
41 ];
42
43 postInstall = ''
44 installShellCompletion --bash src/prevo-completion
45 '';
46
47 meta = {
48 description = "CLI tools for the offline version of the Esperanto dictionary Reta Vortaro";
49 longDescription = ''
50 PReVo is the "portable" ReVo, i.e., the offline version
51 of the Esperanto dictionary Reta Vortaro.
52
53 This package provides the command line application prevo to query a local
54 ReVo database, as well as the command line tool revodb to create such a
55 database for this application or for the Android app of the same name.
56 '';
57 homepage = "https://github.com/bpeel/prevodb";
58 license = lib.licenses.gpl2Only;
59 mainProgram = "prevo";
60 maintainers = with lib.maintainers; [
61 das-g
62 ehmry
63 ];
64 platforms = lib.platforms.unix;
65 };
66}