about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/prevo
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/applications/misc/prevo
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/prevo')
-rw-r--r--nixpkgs/pkgs/applications/misc/prevo/data.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/prevo/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/prevo/tools.nix38
3 files changed, 106 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/prevo/data.nix b/nixpkgs/pkgs/applications/misc/prevo/data.nix
new file mode 100644
index 000000000000..7f61f60bf6ae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/prevo/data.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub, prevo-tools }:
+
+stdenv.mkDerivation rec {
+  pname = "prevo-data";
+  version = "2020-03-08";
+
+  src = fetchFromGitHub {
+    owner = "bpeel";
+    repo = "revo";
+    rev = "1e8d7197c0bc831e2127909e77e64dfc26906bdd";
+    sha256 = "1ldhzpi3d5cbssv8r7acsn7qwxcl8qpqi8ywpsp7cbgx3w7hhkyz";
+  };
+
+  nativeBuildInputs = [ prevo-tools ];
+
+  dontUnpack = true;
+
+  buildPhase = ''
+    prevodb -s -i $src -o prevo.db
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/prevo
+    cp prevo.db $out/share/prevo/
+  '';
+
+  meta = with stdenv.lib; {
+    description =
+      "data for offline version of the Esperanto dictionary Reta Vortaro";
+    longDescription = ''
+      PReVo is the "portable" ReVo, i.e., the offline version
+      of the Esperanto dictionary Reta Vortaro.
+
+      This package provides the ReVo database for the prevo command line application.
+    '';
+    homepage = "https://github.com/bpeel/revo";
+    license = licenses.gpl2Only;
+    maintainers = [ maintainers.das-g ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/prevo/default.nix b/nixpkgs/pkgs/applications/misc/prevo/default.nix
new file mode 100644
index 000000000000..1f299b15d409
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/prevo/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, symlinkJoin, prevo-tools, prevo-data, makeWrapper }:
+
+symlinkJoin rec {
+  name = "prevo-${version}";
+  inherit (prevo-tools) version;
+
+  paths = [ prevo-tools ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/prevo \
+      --prefix XDG_DATA_DIRS : "${prevo-data}/share"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "offline version of the Esperanto dictionary Reta Vortaro";
+    longDescription = ''
+      PReVo is the "portable" ReVo, i.e., the offline version
+      of the Esperanto dictionary Reta Vortaro.
+    '';
+    homepage = "https://github.com/bpeel/prevodb";
+    license = licenses.gpl2Only;
+    maintainers = [ maintainers.das-g ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/prevo/tools.nix b/nixpkgs/pkgs/applications/misc/prevo/tools.nix
new file mode 100644
index 000000000000..39c54b73b2fe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/prevo/tools.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config, glib, expat
+, installShellFiles }:
+
+stdenv.mkDerivation rec {
+  pname = "prevo-tools";
+  version = "0.2";
+
+  src = fetchFromGitHub {
+    owner = "bpeel";
+    repo = "prevodb";
+    rev = version;
+    sha256 = "1fyrc4g9qdq04nxs4g8x0krxfani5xady6v9m0qfqpbh4xk2ry2d";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config installShellFiles ];
+  buildInputs = [ glib expat ];
+
+  postInstall = ''
+    installShellCompletion --bash src/prevo-completion
+  '';
+
+  meta = with stdenv.lib; {
+    description =
+      "CLI tools for the offline version of the Esperanto dictionary Reta Vortaro";
+    longDescription = ''
+      PReVo is the "portable" ReVo, i.e., the offline version
+      of the Esperanto dictionary Reta Vortaro.
+
+      This package provides the command line application prevo to query a local
+      ReVo database, as well as the command line tool revodb to create such a
+      database for this application or for the Android app of the same name.
+    '';
+    homepage = "https://github.com/bpeel/prevodb";
+    license = licenses.gpl2Only;
+    maintainers = [ maintainers.das-g ];
+    platforms = platforms.linux;
+  };
+}