Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python bindings to librsvg #115

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions pkgs/applications/video/key-mon/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ stdenv, fetchurl, buildPythonPackage, gnome, librsvg, makeWrapper, pygtk
, pythonPackages }:

buildPythonPackage rec {
name = "key-mon-${version}";
version = "1.13";
namePrefix = "";

src = fetchurl {
url = "http://key-mon.googlecode.com/files/${name}.tar.gz";
sha256 = "02h7lcnyqwyqsycd1vlvl11ms81v0zmr9p0pfyl5gmzry9dj7imj";
};

propagatedBuildInputs =
[ gnome.python_rsvg librsvg makeWrapper pygtk pythonPackages.xlib ];

doCheck = false;

postInstall = ''
wrapProgram $out/bin/key-mon --prefix GDK_PIXBUF_MODULE_FILE : \
${librsvg}/lib/gdk-pixbuf/loaders.cache
'';

meta = with stdenv.lib; {
homepage = http://code.google.com/p/key-mon;
description = "Utility to show live keyboard and mouse status for teaching and screencasts";
license = licenses.asl20;
maintainers = [ maintainers.goibhniu ];

};
}
2 changes: 2 additions & 0 deletions pkgs/desktops/gnome-2/bindings/gnome-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ stdenv.mkDerivation rec {

installPhase = ''
python waf install
cp bonobo/* $out/share/pygtk/2.0/defs/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ ls /nix/store/526bjh0phkwp46sv2ix90m1klhb6pg3w-gnome-python-2.28.1/share/pygtk/2.0/defs
activationmodule.c   bonoboui.defs        __init__.py
bonobo-arg.c         bonobouimodule.c     Makefile.am
bonobo-arg-types.py  bonoboui.override    Makefile.in
bonobo.defs          bonoboui-types.defs  pybonobo.c
bonobomodule.c       gconf.defs           pybonobo.h
bonobo.override      gnome.defs           wscript
bonobo-types.defs    gnome-types.defs

I guess cping bonobo/*.defs bonobo/*.py should be enough, right? But definitely not Makefile.* and the like.
Please copy only the files which are really needed to the defs directory. And is there even a more official way in the build system that could be used?

'';


buildInputs = [ python pkgconfig pygobject pygtk glib gtk GConf libgnome pythonDBus ];

Expand Down
29 changes: 29 additions & 0 deletions pkgs/desktops/gnome-2/bindings/python-rsvg/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ stdenv, fetchurl, gnome, librsvg, pkgconfig, pygtk, python }:

stdenv.mkDerivation rec {
version = "2.32";
name = "python-rsvg-${version}";

src = fetchurl {
url = "mirror://gnome/sources/gnome-python-desktop/${version}/gnome-python-desktop-${version}.0.tar.gz";
sha256 = "1xhh3h1qdnimydvv55pmqwyzjchhjwfvp951sjlq0180kskqrlj5";
};

configurePhase = ''
sed -e "s@{PYTHONDIR}/gtk-2.0@{PYTHONDIR}/@" -i rsvg/wscript
python waf configure --enable-modules=rsvg --prefix=$out
'';

buildPhase = "python waf build";

installPhase = "python waf install";

buildInputs = [ gnome.gnome_python librsvg pkgconfig pygtk python ];

meta = with stdenv.lib; {
homepage = "http://www.pygtk.org";
description = "The rsvg python module";
license = licenses.lgpl21;
maintainers = [ maintainers.goibhniu ];
};
}
2 changes: 2 additions & 0 deletions pkgs/desktops/gnome-2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

libbonoboui = callPackage ./platform/libbonoboui { };

python_rsvg = callPackage ./bindings/python-rsvg { };

at_spi = callPackage ./platform/at-spi { };

gtkhtml = callPackage ./platform/gtkhtml { };
Expand Down
17 changes: 15 additions & 2 deletions pkgs/development/libraries/librsvg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ stdenv.mkDerivation {
propagatedBuildInputs = [ glib gtk ];
buildNativeInputs = [ pkgconfig ];

# It tries to install the loader to $gdk_pixbuf
configureFlags = "--disable-pixbuf-loader";
# It wants to add loaders and update the loaders.cache in gdk-pixbuf
# Patching the Makefiles to it creates rsvg specific loaders and the
# relevant loader.cache here.
# The loaders.cache can be used by setting GDK_PIXBUF_MODULE_FILE to
# point to this file in a wrapper.
postConfigure = ''
GDK_PIXBUF=$out/lib/gdk-pixbuf
mkdir -p $GDK_PIXBUF/loaders
sed -e "s#gdk_pixbuf_moduledir = .*#gdk_pixbuf_moduledir = $GDK_PIXBUF/loaders#" \
-i gdk-pixbuf-loader/Makefile
sed -e "s#gdk_pixbuf_cache_file = .*#gdk_pixbuf_cache_file = $GDK_PIXBUF/loaders.cache#" \
-i gdk-pixbuf-loader/Makefile
sed -e "s#\$(GDK_PIXBUF_QUERYLOADERS)#GDK_PIXBUF_MODULEDIR=$GDK_PIXBUF/loaders \$(GDK_PIXBUF_QUERYLOADERS)#" \
-i gdk-pixbuf-loader/Makefile
'';
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7141,6 +7141,8 @@ let

kermit = callPackage ../tools/misc/kermit { };

keymon = callPackage ../applications/video/key-mon { };

kino = callPackage ../applications/video/kino {
inherit (gnome) libglade;
};
Expand Down