[arch-commits] Commit in (5 files)
Balló György
bgyorgy at archlinux.org
Tue Aug 12 16:15:04 UTC 2014
Date: Tuesday, August 12, 2014 @ 18:15:04
Author: bgyorgy
Revision: 117309
Move labyrinth from AUR with 25 votes
Added:
labyrinth/
labyrinth/trunk/
labyrinth/trunk/PKGBUILD
labyrinth/trunk/labyrinth.install
labyrinth/trunk/no-numpy.patch
-------------------+
PKGBUILD | 43 ++++++++++++++++++++++++++++++++++
labyrinth.install | 11 ++++++++
no-numpy.patch | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 119 insertions(+)
Added: labyrinth/trunk/PKGBUILD
===================================================================
--- labyrinth/trunk/PKGBUILD (rev 0)
+++ labyrinth/trunk/PKGBUILD 2014-08-12 16:15:04 UTC (rev 117309)
@@ -0,0 +1,43 @@
+# $Id$
+# Maintainer: Balló György <ballogyor+arch at gmail dot com>
+# Contributor: M Rawash <mrawash at gmail.com>
+# Contributor: zhuqin <zhuqin83 at gmail.com>
+
+pkgname=labyrinth
+pkgver=0.6
+pkgrel=2
+pkgdesc="Lightweight mind-mapping tool with support for image import and drawing"
+arch=('any')
+url="https://github.com/labyrinth-team/labyrinth"
+license=('GPL')
+depends=('python2-gconf' 'python2-xdg')
+install=$pkgname.install
+source=($pkgname-$pkgver.tar.gz::https://github.com/labyrinth-team/$pkgname/archive/$pkgver.tar.gz
+ no-numpy.patch)
+md5sums=('e008ebfc1eaeab7f40cff05cb1865c45'
+ 'c993d413288a1c68bee8e4b0ea187972')
+
+prepare() {
+ cd $pkgname-$pkgver
+ sed -i 's@^#.*python$@#!/usr/bin/python2@' labyrinth_lib/*.py
+
+ # Eliminate numpy dependency
+ patch -Np1 -i ../no-numpy.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+ python2 setup.py build
+ make -C po
+}
+
+package() {
+ cd $pkgname-$pkgver
+ python2 setup.py install --root "$pkgdir" --optimize=1
+ make -C po localedir=$pkgdir/usr/share/locale install
+ install -Dm644 data/$pkgname-16.png "$pkgdir/usr/share/icons/hicolor/16x16/apps/$pkgname.png"
+ install -Dm644 data/$pkgname-22.png "$pkgdir/usr/share/icons/hicolor/22x22/apps/$pkgname.png"
+ install -Dm644 data/$pkgname-24.png "$pkgdir/usr/share/icons/hicolor/24x24/apps/$pkgname.png"
+ install -Dm644 data/$pkgname.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
+ install -Dm644 data/$pkgname.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
+}
Property changes on: labyrinth/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: labyrinth/trunk/labyrinth.install
===================================================================
--- labyrinth/trunk/labyrinth.install (rev 0)
+++ labyrinth/trunk/labyrinth.install 2014-08-12 16:15:04 UTC (rev 117309)
@@ -0,0 +1,11 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
Added: labyrinth/trunk/no-numpy.patch
===================================================================
--- labyrinth/trunk/no-numpy.patch (rev 0)
+++ labyrinth/trunk/no-numpy.patch 2014-08-12 16:15:04 UTC (rev 117309)
@@ -0,0 +1,65 @@
+From 1612f7df877ff58e621cab7c195bf19796b5fa9b Mon Sep 17 00:00:00 2001
+From: Thomas Kluyver <takowl at gmail.com>
+Date: Wed, 4 Jun 2014 10:32:08 -0700
+Subject: [PATCH] Eliminate numpy dependency
+
+We only used numpy for one little thing, and it seems we don't actually
+need it.
+---
+ grab_files.sh | 10 ++++++++--
+ installer.cfg | 1 -
+ labyrinth_lib/ImageThought.py | 7 +++----
+ labyrinth_lib/utils.py | 15 ---------------
+ 4 files changed, 11 insertions(+), 22 deletions(-)
+
+diff --git a/labyrinth_lib/ImageThought.py b/labyrinth_lib/ImageThought.py
+index ac68eb7..55c2849 100644
+--- a/labyrinth_lib/ImageThought.py
++++ b/labyrinth_lib/ImageThought.py
+@@ -117,10 +117,9 @@ def export (self, context, move_x, move_y):
+ if self.pic:
+ if hasattr(context, "set_source_pixbuf"):
+ context.set_source_pixbuf (self.pic, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
+- elif hasattr(context, "set_source_surface"):
+- pixel_array = utils.pixbuf_to_cairo (self.pic.get_pixels_array())
+- image_surface = cairo.ImageSurface.create_for_data(pixel_array, cairo.FORMAT_ARGB32, self.width, self.height, -1)
+- context.set_source_surface (image_surface, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
++ else:
++ gcontext = gtk.gdk.CairoContext(context)
++ gcontext.set_source_pixbuf(self.pic, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
+ context.rectangle (self.pic_location[0]+move_x, self.pic_location[1]+move_y, self.width, self.height)
+ context.fill ()
+ context.set_source_rgb (0,0,0)
+diff --git a/labyrinth_lib/utils.py b/labyrinth_lib/utils.py
+index 73e2401..00f40aa 100644
+--- a/labyrinth_lib/utils.py
++++ b/labyrinth_lib/utils.py
+@@ -27,7 +27,6 @@
+ from os.path import join, dirname, exists, isdir, isfile
+ import os
+ import warnings
+-from numpy import array
+ from xdg import BaseDirectory
+
+ __BE_VERBOSE=os.environ.get('DEBUG_LABYRINTH',0)
+@@ -196,17 +195,3 @@ def export_thought_outline (context, ul, lr, background_color, am_root = False,
+ real_ul = (ul[0]+move[0], ul[1]+move[1])
+ real_lr = (lr[0]+move[0], lr[1]+move[1])
+ draw_thought_extended (context, real_ul, real_lr, False, am_primary, background_color, style == STYLE_EXTENDED_CONTENT)
+-
+-def pixbuf_to_cairo (pixel_array):
+- result = []
+- for y in pixel_array:
+- row = []
+- for x in y:
+- color = [int(x[2][0]), int(x[1][0]), int(x[0][0])]
+- if len(x) == 3:
+- color.append(255)
+- elif len(x) == 4:
+- color.append(int(x[3][0]))
+- row.append(color)
+- result.append(row)
+- return array(result, 'b')
+--
+2.0.3
+
More information about the arch-commits
mailing list