commit c8c65306d5dede770dadf05e0dc6acccd48f9bf0
parent b009cb457bb15861943d6f7b0114164d693b05ca
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Fri, 22 Jan 2021 03:08:29 +0300
Add opendict
Diffstat:
3 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -170,6 +170,7 @@ lib.makeScope newScope (
gt-bash-client = callPackage ./dict/gt-bash-client { };
lsdreader = callPackage ./dict/lsdreader { };
odict = callPackage ./dict/odict { };
+ opendict = callPackage ./dict/opendict { };
redict = libsForQt5.callPackage ./dict/redict {
inherit sources;
};
diff --git a/pkgs/dict/opendict/0001-fix-makefile.patch b/pkgs/dict/opendict/0001-fix-makefile.patch
@@ -0,0 +1,20 @@
+diff --git i/Makefile w/Makefile
+index 80654d8..bf634c3 100644
+--- i/Makefile
++++ w/Makefile
+@@ -30,12 +30,11 @@ install:
+
+ $(MAKE) -C po install prefix=$(DESTDIR)
+
+- cp opendict.py $(opendictdir)
+- chmod a+rx $(opendictdir)/opendict.py
++ mkdir -p $(bindir)
++ cp opendict.py $(bindir)/opendict
++ chmod a+rx $(bindir)/opendict
+ cp copying.html $(opendictdir)
+ chmod a+r $(opendictdir)/copying.html
+- mkdir -p $(bindir)
+- ln -sf $(opendictdir)/opendict.py $(bindir)/opendict
+ mkdir -p $(DESTDIR)/share/applications
+ cp misc/opendict.desktop $(DESTDIR)/share/applications
+ chmod a+r $(DESTDIR)/share/applications/opendict.desktop
diff --git a/pkgs/dict/opendict/default.nix b/pkgs/dict/opendict/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, python2Packages, gettext, sources }:
+
+python2Packages.buildPythonApplication rec {
+ pname = "opendict";
+ version = "0.6.8";
+
+ src = fetchFromGitHub {
+ owner = "nerijus";
+ repo = "opendict";
+ rev = version;
+ sha256 = "0jgamfrvadbbj08yracx22j4350l3j7bgvw3w9yb6in2hh0wflbf";
+ };
+
+ patches = [ ./0001-fix-makefile.patch ];
+
+ nativeBuildInputs = [ gettext ];
+ propagatedBuildInputs = with python2Packages; [ wxPython30 ];
+
+ dontUseSetuptoolsBuild = true;
+ dontUseSetuptoolsCheck = true;
+ dontUsePipInstall = true;
+
+ makeFlags = [ "DESTDIR=$(out)" ];
+ makeWrapperArgs = [ "--prefix PYTHONPATH : $out/share/opendict" ];
+
+ meta = with lib; {
+ description = "Free multiplatform dictionary";
+ homepage = "http://opendict.sf.net/";
+ license = licenses.gpl2Plus;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.unix;
+ };
+}