[Nix-dev] pypoppler: new package

2014-09-13 Thread Nick Sauce
pypoppler: new package
---

diff --git \
a/pkgs/development/python-modules/pypoppler-build.patch \
b/pkgs/development/python-modules/pypoppler-build.patch
new file mode 100644
index 000..5d41607
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-build.patch
@@ -0,0 +1,116 @@
+diff -Naur b/configure a/configure
+--- b/configure2009-09-27 06:07:56.0 +0900
 a/configure2014-09-11 12:48:24.910548221 +0900
+@@ -13507,12 +13507,11 @@
+ 
+ 
+ 
+-
+ { $as_echo $as_me:$LINENO: checking for pygtk codegen 5
+ $as_echo_n checking for pygtk codegen...  6; }
+-CODEGENDIR=`pkg-config --variable=codegendir pygtk-2.0`
+-if test -f $CODEGENDIR/codegen.py; then
+-  CODEGEN=$CODEGENDIR/codegen.py
++PYGTK_DIR=`pkg-config --variable=prefix pygtk-2.0`
++if test -f $PYGTK_DIR/bin/pygtk-codegen-2.0; then
++  CODEGEN=$PYGTK_DIR/bin/pygtk-codegen-2.0
+   { $as_echo $as_me:$LINENO: result: yes 5
+ $as_echo yes 6; }
+ else
+diff -Naur b/Makefile.am a/Makefile.am
+--- b/Makefile.am  2009-09-27 03:31:23.0 +0900
 a/Makefile.am  2014-09-11 12:48:24.911548226 +0900
+@@ -19,7 +19,7 @@
+ 
+ .defs.c:
+   (cd $(srcdir)\
+-   $(PYTHON) $(CODEGEN) \
++   $(CODEGEN) \
+   --override $*.override \
+   --register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
+   --register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
+diff -Naur b/Makefile.in a/Makefile.in
+--- b/Makefile.in  2009-09-27 06:07:55.0 +0900
 a/Makefile.in  2014-09-11 12:48:24.911548226 +0900
+@@ -881,7 +881,7 @@
+ 
+ .defs.c:
+   (cd $(srcdir)\
+-   $(PYTHON) $(CODEGEN) \
++   $(CODEGEN) \
+   --override $*.override \
+   --register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
+   --register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
+diff -Naur b/poppler.defs a/poppler.defs
+--- b/poppler.defs 2009-09-27 18:07:59.0 +0900
 a/poppler.defs 2014-09-11 12:48:32.525582270 +0900
+@@ -1646,58 +1646,6 @@
+   (return-type GType)
+ )
+ 
+-(define-method render_to_pixbuf
+-  (of-object PopplerPage)
+-  (c-name poppler_page_render_to_pixbuf)
+-  (return-type none)
+-  (parameters
+-'(int src_x)
+-'(int src_y)
+-'(int src_width)
+-'(int src_height)
+-'(double scale)
+-'(int rotation)
+-'(GdkPixbuf* pixbuf)
+-  )
+-)
+-
+-(define-method render_to_pixbuf_for_printing
+-  (of-object PopplerPage)
+-  (c-name poppler_page_render_to_pixbuf_for_printing)
+-  (return-type none)
+-  (parameters
+-'(int src_x)
+-'(int src_y)
+-'(int src_width)
+-'(int src_height)
+-'(double scale)
+-'(int rotation)
+-'(GdkPixbuf* pixbuf)
+-  )
+-)
+-
+-(define-method get_thumbnail_pixbuf
+-  (of-object PopplerPage)
+-  (c-name poppler_page_get_thumbnail_pixbuf)
+-  (return-type GdkPixbuf*)
+-)
+-
+-(define-method render_selection_to_pixbuf
+-  (of-object PopplerPage)
+-  (c-name poppler_page_render_selection_to_pixbuf)
+-  (return-type none)
+-  (parameters
+-'(gdouble scale)
+-'(int rotation)
+-'(GdkPixbuf* pixbuf)
+-'(PopplerRectangle* selection)
+-'(PopplerRectangle* old_selection)
+-'(PopplerSelectionStyle style)
+-'(GdkColor* glyph_color)
+-'(GdkColor* background_color)
+-  )
+-)
+-
+ (define-method render
+   (of-object PopplerPage)
+   (c-name poppler_page_render)
+@@ -1796,10 +1744,6 @@
+   (of-object PopplerPage)
+   (c-name poppler_page_get_text)
+   (return-type char*)
+-  (parameters
+-'(PopplerSelectionStyle style)
+-'(PopplerRectangle* rect)
+-  )
+ )
+ 
+ (define-method get_selection_region
diff --git \
a/pkgs/top-level/python-packages.nix \
b/pkgs/top-level/python-packages.nix
index f3efb97..df009a5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6832,6 +6832,33 @@ rec {
 };
   };
 
+  pypoppler = pkgs.stdenv.mkDerivation (rec {
+name = pypoppler-0.12.1;
+
+src = fetchurl {
+  url =
+https://launchpad.net/poppler-python/trunk/development/+download/; +
+${name}.tar.gz;
+  sha256 =
+322f183d24798a056f3005d1ab8e3ac27d8cfbbf0982725b323bbfec1bab5355;
+};
+
+patches = [
+  ../development/python-modules/pypoppler-build.patch
+];
+
+buildInputs = [ python pkgs.pkgconfig ];
+
+propagatedBuildInputs = [
+  pygtk pkgs.atk pkgs.poppler.poppler_glib
+];
+
+meta = {
+  description = Python bindings for the Poppler PDF rendering library;
+  homepage = https://launchpad.net/poppler-python;
+  license = pkgs.stdenv.lib.licenses.gpl2;
+};
+  });
 
   pyquery = buildPythonPackage rec {
 name = pyquery-1.2.4;
@@ -10808,6 +10835,4 @@ rec {
 };
   };
 
-
-
 }); in pythonPackages


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] pygtkspell: new package

2014-09-13 Thread Nick Sauce
pygtkspell: new package
---

diff --git \
a/pkgs/development/python-modules/pygtkspell/default.nix \
b/pkgs/development/python-modules/pygtkspell/default.nix
new file mode 100644
index 000..62786f4
--- /dev/null
+++ b/pkgs/development/python-modules/pygtkspell/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, pkgconfig
+, python
+, pygtk
+, gtkspell
+}:
+
+let
+  maj_min_ver = 2.25;
+  the_version = ${maj_min_ver}.3;
+
+in
+
+stdenv.mkDerivation rec {
+  name = pygtkspell-${the_version};
+
+  src = fetchurl {
+url = http://ftp.gnome.org/pub/gnome/sources/gnome-python-extras/; +
+  ${maj_min_ver}/gnome-python-extras-${the_version}.tar.gz;
+sha256 =
+  0d834bf5e372979a9d812bd85a0070441e90479cbc14e2c26017fa95ac6c1aff;
+  };
+
+  buildInputs = [
+python
+pkgconfig
+pygtk gtkspell
+  ];
+
+  configureFlags = --disable-eggtray;
+
+  preBuild = ''
+cd gtkspell
+  '';
+
+  postInstall = ''
+cd $out/lib/python*/site-packages
+ln -s gtk-*/gtkspell.so .
+ln -s gtk-*/gtkspell.la .
+  '';
+
+  meta = {
+description = Python bindings for the gtkspell;
+homepage = http://web.archive.org/web/20010611205147/; +
+   http://www.daa.com.au/~james/pygtk/;;
+license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git \
a/pkgs/top-level/python-packages.nix \
b/pkgs/top-level/python-packages.nix
index df009a5..34ecbff 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -161,6 +161,11 @@ rec {
 inherit python buildPythonPackage pygobject pycairo isPy3k;
   };
 
+  pygtkspell = import ../development/python-modules/pygtkspell {
+inherit (pkgs) stdenv fetchurl pkgconfig gtkspell;
+inherit python pygtk;
+  };
+
   # XXX: how can we get an override here?
   #pyGtkGlade = pygtk.override {
   #  inherit (pkgs.gnome) libglade;


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] pyenchant: new package

2014-09-13 Thread Nick Sauce
pyenchant: new package
---

diff --git \
a/pkgs/top-level/python-packages.nix \
b/pkgs/top-level/python-packages.nix
index 34ecbff..aec3a3b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -839,6 +839,36 @@ rec {
 };
   };
 
+  pyenchant = buildPythonPackage rec {
+name = pyenchant-1.6.6;
+
+src = fetchurl {
+  url =
+https://pypi.python.org/packages/source/p/pyenchant/${name}.tar.gz;;
+  sha256 =
+25c9d2667d512f8fc4410465fdd2e868377ca07eb3d56e2b6e534a86281d64d3;
+};
+
+propagatedBuildInputs = [ pkgs.enchant ];
+
+# XXX: ctypes' cdll.LoadLibrary doesn't appear to function appropriately
+patchPhase = let
+  path_hack_script =
+s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' + e_path)|;
+in ''
+sed -i ${path_hack_script} enchant/_enchant.py
+'';
+
+# dictionaries needed for tests
+doCheck = false;
+
+meta = {
+  description =
+Python spellchecking library, based on the Enchant library;
+  homepage = https://pythonhosted.org/pyenchant/;
+  license = stdenv.lib.licenses.lgpl21;
+};
+  };
 
   bitbucket_api = buildPythonPackage rec {
 name = bitbucket-api-0.4.4;


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] gimagereader: new package

2014-09-13 Thread Nick Sauce
gimagereader: new package
---

diff --git \
a/pkgs/applications/graphics/gimagereader/default.nix \
b/pkgs/applications/graphics/gimagereader/default.nix
new file mode 100644
index 000..8151555
--- /dev/null
+++ b/pkgs/applications/graphics/gimagereader/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl
+, python
+, pythonPackages
+, tesseract
+}:
+
+let
+  version = 0.9.1;
+
+in
+
+pythonPackages.buildPythonPackage rec {
+  name = gimagereader-${version};
+
+  src = fetchurl {
+url = http://downloads.sourceforge.net/project/gimagereader/; +
+  ${version}/${name}.tar.gz;
+sha256 =
1276fd7ec1f8bb7453c5c70e9be6f0c3b8b899cbe6c43b4bf327be6ae85bb86a;
+  };
+
+  patchPhase = ''
+  sed -i s|^dict_path=.*|dict_path=['${tesseract}/share/tessdata']| \
+  src/config.py
+  '';
+
+  propagatedBuildInputs = [
+python
+pythonPackages.pygtk pythonPackages.pycairo pythonPackages.pygtkspell
+pythonPackages.pyenchant pythonPackages.pil pythonPackages.pypoppler
+tesseract
+  ];
+
+  meta = {
+description = A simple Gtk front-end to tesseract;
+homepage = http://sourceforge.net/projects/gimagereader/;
+license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git \
a/pkgs/top-level/all-packages.nix \
b/pkgs/top-level/all-packages.nix
index 2a67aae..b2d49e0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9026,6 +9026,8 @@ let
 
   get_iplayer = callPackage ../applications/misc/get_iplayer {};
 
+  gimagereader = callPackage ../applications/graphics/gimagereader { };
+
   gimp_2_8 = callPackage ../applications/graphics/gimp/2.8.nix {
 inherit (gnome) libart_lgpl;
 webkit = null;


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Luca Bruno
Out of curiosity, is anybody reviewing your patches in the mailing list? We
usually use github.

On Sat, Sep 13, 2014 at 10:57 AM, Nick Sauce nick.sa...@monumentmail.com
wrote:

 pyenchant: new package
 ---

 diff --git \
 a/pkgs/top-level/python-packages.nix \
 b/pkgs/top-level/python-packages.nix
 index 34ecbff..aec3a3b 100644
 --- a/pkgs/top-level/python-packages.nix
 +++ b/pkgs/top-level/python-packages.nix
 @@ -839,6 +839,36 @@ rec {
  };
};

 +  pyenchant = buildPythonPackage rec {
 +name = pyenchant-1.6.6;
 +
 +src = fetchurl {
 +  url =
 +
 https://pypi.python.org/packages/source/p/pyenchant/${name}.tar.gz;;
 +  sha256 =
 +
 25c9d2667d512f8fc4410465fdd2e868377ca07eb3d56e2b6e534a86281d64d3;
 +};
 +
 +propagatedBuildInputs = [ pkgs.enchant ];
 +
 +# XXX: ctypes' cdll.LoadLibrary doesn't appear to function
 appropriately
 +patchPhase = let
 +  path_hack_script =
 +s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' +
 e_path)|;
 +in ''
 +sed -i ${path_hack_script} enchant/_enchant.py
 +'';
 +
 +# dictionaries needed for tests
 +doCheck = false;
 +
 +meta = {
 +  description =
 +Python spellchecking library, based on the Enchant library;
 +  homepage = https://pythonhosted.org/pyenchant/;
 +  license = stdenv.lib.licenses.lgpl21;
 +};
 +  };

bitbucket_api = buildPythonPackage rec {
  name = bitbucket-api-0.4.4;


 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev




-- 
www.debian.org - The Universal Operating System
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Vladimír Čunát


Nick: do you want to become a maintainer of all these newly added 
packages? It means that you would be getting e-mail when a package 
changes status (success/failure), and you would be expected to try to 
keep them working.


On 09/13/2014 11:13 AM, Luca Bruno wrote:

Out of curiosity, is anybody reviewing your patches in the mailing list?
We usually use github.


I did review and push the previous set of three patches. But I must 
admit github is slightly more comfortable.



Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Terminus console font

2014-09-13 Thread Dmitry Malikov
The actual problem now is that `setfont` is not called automatically. So 
after calling it manually all works well.

Who should call it? Should it be called by systemd?
On 09/09/2014 05:58 AM, 宋文武 wrote:
 M. P. Ashton d...@imap.cc writes:

 On Sun, Sep 7, 2014, at 02:20 PM, Dmitry Malikov wrote:
 Good day.

 I'm not a huge fan of X server, that why I'm spending my time inside a
 tty and virtual terminals. Default fonts that NixOS offers are not
 perfectly suite my eyes that why I'm looking for a way to use terminus
 font there.

 I.e. in Gentoo OS there is a `consoleFont` variable which could be set
 to ter-116n value to get terminus in Xless console. I'm trying to do
 the same via setting `i18n.consoleFont = ter-116n`([1]) , but it do
 nothing.

 Also as you see `pkgs.terminus_font` is added to the `fonts.fonts`
 statement, that why I'm assuming terminus font is installed in my system.

 have you guys achieved it? What am I doing wrong?
 What works for me is the line:

 i18n.consoleFont = Lat2-Terminus16;

 Something like this works for me:

 i18n.consoleFont = ${pkg.terminus}/share/consolefonts/ter-i16n.pcf.gz;

 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev

-- 
Best regards,
dmitry malikov
!

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Mateusz Kowalczyk
On 09/13/2014 12:33 PM, Vladimír Čunát wrote:
 
 Nick: do you want to become a maintainer of all these newly added 
 packages? It means that you would be getting e-mail when a package 
 changes status (success/failure), and you would be expected to try to 
 keep them working.
 
 On 09/13/2014 11:13 AM, Luca Bruno wrote:
 Out of curiosity, is anybody reviewing your patches in the mailing list?
 We usually use github.
 
 I did review and push the previous set of three patches. But I must 
 admit github is slightly more comfortable.
 
 
 Vladimir
 

GitHub has a pretty shitty terms of service which is why these patches
are being sent over e-mail.

Maybe we could hook up a simple bot that takes the patches from the
mailing list and opens PRs but I don't know if the effort is worth it.

-- 
Mateusz K.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Vladimír Čunát

On 09/13/2014 07:48 PM, Mateusz Kowalczyk wrote:

GitHub has a pretty shitty terms of service which is why these patches
are being sent over e-mail.


Can you point me to some explanation why they're shitty?

Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Mateusz Kowalczyk
On 09/13/2014 06:49 PM, Vladimír Čunát wrote:
 On 09/13/2014 07:48 PM, Mateusz Kowalczyk wrote:
 GitHub has a pretty shitty terms of service which is why these patches
 are being sent over e-mail.

which is probably*

 Can you point me to some explanation why they're shitty?
 
 Vladimir

Apparently, upon (re-)reading the ToS, I can't! They either changed
their license since I last checked (quite a while ago) or I managed to
delude myself somehow… It seems their clause about them being able to
change the license at any time is gone and now they will notify you
(after which you automatically agree).

Of course there is still the problem of GitHub not being responsive to
feature requests (we still can't delete issues and it took YEARS to be
able to lock them) and its service all the way up to its web frontend
being proprietary code.

-- 
Mateusz K.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Vladimír Čunát

On 09/13/2014 09:41 PM, Mateusz Kowalczyk wrote:

Of course there is still the problem of GitHub not being responsive to
feature requests (we still can't delete issues and it took YEARS to be
able to lock them) and its service all the way up to its web frontend
being proprietary code.


Yes, the closed-ness of github was discussed before migrating to it, but 
noone here could produce anything else that would provide similar range 
of features.


Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pyenchant: new package

2014-09-13 Thread Nathan Bijnens
It's not that migrating away from Github, if it was ever necessary, is
going to be really hard. It's not that they added proprietary stuff to git,
just a very nice frontend.

Just my 2 cents,
  Nathan

On Sat, Sep 13, 2014 at 10:07 PM, Vladimír Čunát vcu...@gmail.com wrote:

 On 09/13/2014 09:41 PM, Mateusz Kowalczyk wrote:

 Of course there is still the problem of GitHub not being responsive to
 feature requests (we still can't delete issues and it took YEARS to be
 able to lock them) and its service all the way up to its web frontend
 being proprietary code.


 Yes, the closed-ness of github was discussed before migrating to it, but
 noone here could produce anything else that would provide similar range of
 features.

 Vladimir



 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev