From 9f623a820d75de957158afd4c2181012cea8baf4 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Sat, 31 Jan 2015 02:17:00 +0100 Subject: [PATCH] Adds a new package: cherrytree - A hierarchical note taking application cherrytree - A hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single xml or sqlite file. This commit also adds PyGtkSourceView - a Python wrapper for the GtkSourceView widget library. Official page http://www.giuspen.com/cherrytree --- pkgs/applications/misc/cherrytree/default.nix | 36 +++++++++++++++++++ .../misc/cherrytree/subprocess.patch | 15 ++++++++ .../pygtksourceview/codegendir.patch | 25 +++++++++++++ .../pygtksourceview/default.nix | 16 +++++++++ pkgs/top-level/all-packages.nix | 4 +++ pkgs/top-level/release-python.nix | 1 + 6 files changed, 97 insertions(+) create mode 100644 pkgs/applications/misc/cherrytree/default.nix create mode 100644 pkgs/applications/misc/cherrytree/subprocess.patch create mode 100644 pkgs/development/python-modules/pygtksourceview/codegendir.patch create mode 100644 pkgs/development/python-modules/pygtksourceview/default.nix diff --git a/pkgs/applications/misc/cherrytree/default.nix b/pkgs/applications/misc/cherrytree/default.nix new file mode 100644 index 000000000000..0950817c7888 --- /dev/null +++ b/pkgs/applications/misc/cherrytree/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchurl, python, pythonPackages, gettext, pygtksourceview, sqlite }: + +stdenv.mkDerivation rec { + name = "cherrytree-0.35.6"; + + src = fetchurl { + url = "http://www.giuspen.com/software/${name}.tar.xz"; + sha256 = "1nfrnnwaxb07jf5c3id8zimr3q3rbhvzjlmpb99d41d7hqrd2bxj"; + }; + + propagatedBuildInputs = [ pythonPackages.sqlite3 ]; + + buildInputs = with pythonPackages; [ python gettext wrapPython pygtk dbus pygtksourceview ]; + + pythonPath = with pythonPackages; [ pygtk dbus pygtksourceview ]; + + patches = [ ./subprocess.patch ]; + + installPhase = '' + python setup.py install --prefix="$out" + + for file in "$out"/bin/*; do + wrapProgram "$file" \ + --prefix PYTHONPATH : "$(toPythonPath $out):$PYTHONPATH" + done + ''; + + doCheck = false; + + meta = { + description = "A hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single xml or sqlite file"; + homepage = http://www.giuspen.com/cherrytree; + license = stdenv.lib.licenses.gpl3; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/applications/misc/cherrytree/subprocess.patch b/pkgs/applications/misc/cherrytree/subprocess.patch new file mode 100644 index 000000000000..cff357a5693b --- /dev/null +++ b/pkgs/applications/misc/cherrytree/subprocess.patch @@ -0,0 +1,15 @@ +diff -Naur cherrytree-0.35.6-orig/setup.py cherrytree-0.35.6/setup.py +--- cherrytree-0.35.6-orig/setup.py 2014-05-30 23:25:11.000000000 +0200 ++++ cherrytree-0.35.6/setup.py 2015-01-29 07:35:32.785904009 +0100 +@@ -205,4 +205,9 @@ + }, + distclass=CherryTreeDist + ) +- subprocess.call("update-desktop-database") ++ try: ++ subprocess.check_call(['update-desktop-database']) ++ except subprocess.CalledProcessError: ++ pass # handle errors in the called executable ++ except OSError: ++ pass # executable not found + diff --git a/pkgs/development/python-modules/pygtksourceview/codegendir.patch b/pkgs/development/python-modules/pygtksourceview/codegendir.patch new file mode 100644 index 000000000000..783c5e2d4671 --- /dev/null +++ b/pkgs/development/python-modules/pygtksourceview/codegendir.patch @@ -0,0 +1,25 @@ +diff -Nur pygtksourceview-2.10.1-orig/configure pygtksourceview-2.10.1/configure +--- pygtksourceview-2.10.1-orig/configure 2010-04-18 15:29:55.000000000 +0200 ++++ pygtksourceview-2.10.1/configure 2015-01-30 20:36:31.784541887 +0100 +@@ -12950,7 +12950,7 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pygtk codegen" >&5 + $as_echo_n "checking for pygtk codegen... " >&6; } +-CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0` ++CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygobject-2.0` + echo $CODEGENDIR + if test -f $CODEGENDIR/codegen.py; then + CODEGEN=$CODEGENDIR/codegen.py +diff -Nur pygtksourceview-2.10.1-orig/configure.ac pygtksourceview-2.10.1/configure.ac +--- pygtksourceview-2.10.1-orig/configure.ac 2010-04-18 15:28:39.000000000 +0200 ++++ pygtksourceview-2.10.1/configure.ac 2015-01-30 20:36:42.781648830 +0100 +@@ -116,7 +116,7 @@ + + dnl codegen + AC_MSG_CHECKING(for pygtk codegen) +-CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0` ++CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygobject-2.0` + echo $CODEGENDIR + if test -f $CODEGENDIR/codegen.py; then + CODEGEN=$CODEGENDIR/codegen.py + diff --git a/pkgs/development/python-modules/pygtksourceview/default.nix b/pkgs/development/python-modules/pygtksourceview/default.nix new file mode 100644 index 000000000000..f282d3d36972 --- /dev/null +++ b/pkgs/development/python-modules/pygtksourceview/default.nix @@ -0,0 +1,16 @@ +{ stdenv, fetchurl, python, pkgconfig, pygobject, glib, pygtk, gnome2 }: + +let version = "2.10.1"; in + +stdenv.mkDerivation { + name = "pygtksourceview-${version}"; + + src = fetchurl { + url = "http://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-${version}.tar.bz2"; + sha256 = "0x2r9k547ad68sfddr5am341ap6zvy8k0rh3rd0n38k7xdd7rd5l"; + }; + + patches = [ ./codegendir.patch ]; + + buildInputs = [ python pkgconfig pygobject glib pygtk gnome2.gtksourceview ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 134116cba582..09704fcaf5c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -691,6 +691,8 @@ let corosync = callPackage ../servers/corosync { }; + cherrytree = callPackage ../applications/misc/cherrytree { }; + chntpw = callPackage ../tools/security/chntpw { }; coprthr = callPackage ../development/libraries/coprthr { @@ -7696,6 +7698,8 @@ let pygtk = pythonPackages.pygtk; + pygtksourceview = callPackage ../development/python-modules/pygtksourceview { }; + pyGtkGlade = pythonPackages.pyGtkGlade; pylint = callPackage ../development/python-modules/pylint { }; diff --git a/pkgs/top-level/release-python.nix b/pkgs/top-level/release-python.nix index ea7ca4d501f7..a7d3194cdbb6 100644 --- a/pkgs/top-level/release-python.nix +++ b/pkgs/top-level/release-python.nix @@ -38,6 +38,7 @@ let pygame = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; pygobject = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; pygtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; + pygtksourceview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; pyGtkGlade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; pyIRCt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; }; pyMAILt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };