diff options
author | Alexander F. Rødseth | 2019-03-27 10:18:16 +0100 |
---|---|---|
committer | Alexander F. Rødseth | 2019-03-27 10:18:16 +0100 |
commit | d2dded510d19f7004c14131e25217385dee51a79 (patch) | |
tree | 68d53f719cd2ed40aed289e6856cc79efc2917e2 | |
download | aur-d2dded510d19f7004c14131e25217385dee51a79.tar.gz |
Move from [community] to AUR in connection with the spring cleaning
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | appdata.patch | 79 | ||||
-rw-r--r-- | no-numpy.patch | 65 | ||||
-rw-r--r-- | optional-gconf.patch | 84 |
5 files changed, 303 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..7d1f196c7437 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +# Generated by mksrcinfo v8 +# Wed Mar 27 09:15:59 UTC 2019 +pkgbase = labyrinth + pkgdesc = Lightweight mind-mapping tool with support for image import and drawing + pkgver = 0.6 + pkgrel = 4 + url = https://github.com/labyrinth-team/labyrinth + arch = any + license = GPL + depends = pygtk + depends = python2-xdg + source = labyrinth-0.6.tar.gz::https://github.com/labyrinth-team/labyrinth/archive/0.6.tar.gz + source = no-numpy.patch + source = optional-gconf.patch + source = appdata.patch + sha256sums = c651ad0c6741e91251961107558d915dc7efbb57d84d64173ce0beed2a4aa34a + sha256sums = 67f5486d770253e8d9778795c2fe0b928a1a428e296f19b2760bf73114c340ce + sha256sums = aeb07b467634dd199918209f6f575f1c33a3d2ca09620443c29442f6e02545f8 + sha256sums = 44c9a9aaac2f62a3006fc5051924ad5a67aa9be76a6a30dff8dc8c2d78c2903a + +pkgname = labyrinth + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fcd90abb8aa3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: +# Contributor: Balló György <ballogyor+arch at gmail dot com> +# Contributor: M Rawash <mrawash@gmail.com> +# Contributor: zhuqin <zhuqin83@gmail.com> + +pkgname=labyrinth +pkgver=0.6 +pkgrel=4 +pkgdesc="Lightweight mind-mapping tool with support for image import and drawing" +arch=('any') +url="https://github.com/labyrinth-team/labyrinth" +license=('GPL') +depends=('pygtk' 'python2-xdg') +source=($pkgname-$pkgver.tar.gz::https://github.com/labyrinth-team/$pkgname/archive/$pkgver.tar.gz + no-numpy.patch + optional-gconf.patch + appdata.patch) +sha256sums=('c651ad0c6741e91251961107558d915dc7efbb57d84d64173ce0beed2a4aa34a' + '67f5486d770253e8d9778795c2fe0b928a1a428e296f19b2760bf73114c340ce' + 'aeb07b467634dd199918209f6f575f1c33a3d2ca09620443c29442f6e02545f8' + '44c9a9aaac2f62a3006fc5051924ad5a67aa9be76a6a30dff8dc8c2d78c2903a') + +prepare() { + cd $pkgname-$pkgver + sed -i 's@^#.*python$@#!/usr/bin/python2@' labyrinth_lib/*.py + + # Eliminate numpy dependency + patch -Np1 -i ../no-numpy.patch + + # Make gconf dependency optional + patch -Np1 -i ../optional-gconf.patch + + # Add appdata file + patch -Np1 -i ../appdata.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" + install -Dm644 data/labyrinth.appdata.xml "$pkgdir/usr/share/metainfo/labyrinth.appdata.xml" +} diff --git a/appdata.patch b/appdata.patch new file mode 100644 index 000000000000..dbea2050e14c --- /dev/null +++ b/appdata.patch @@ -0,0 +1,79 @@ +From 4852045b1832b2eaefcc890bdbc39c705f4ad6a1 Mon Sep 17 00:00:00 2001 +From: Cosimo Cecchi <cosimo@endlessm.com> +Date: Fri, 3 Aug 2018 16:35:33 -0700 +Subject: [PATCH] Add an updated .appdata file + +--- + data/labyrinth.appdata.xml | 49 ++++++++++++++++++++++++++++++++++++++ + install_data_files.sh | 3 +++ + 2 files changed, 52 insertions(+) + create mode 100644 data/labyrinth.appdata.xml + +diff --git a/data/labyrinth.appdata.xml b/data/labyrinth.appdata.xml +new file mode 100644 +index 0000000..8d24936 +--- /dev/null ++++ b/data/labyrinth.appdata.xml +@@ -0,0 +1,49 @@ ++<?xml version="1.0" encoding="UTF-8"?> ++<application> ++ <id type="desktop">labyrinth.desktop</id> ++ <metadata_license>CC0-1.0</metadata_license> ++ <project_license>GPL-2.0</project_license> ++ <name>Labyrinth</name> ++ <summary>A light weight mind mapping tool</summary> ++ <description> ++ <p> ++ Labyrinth is a lightweight mind-mapping tool, written in Python using Gtk and ++ Cairo to do the drawing. It is intended to be as light and intuitive as ++ possible, but still provide a wide range of powerful features. ++ </p> ++ ++ <p> ++ A mind-map is a diagram used to represent words, ideas, tasks or other items ++ linked to and arranged radially around a central key word or idea. It is used ++ to generate, visualize, structure and classify ideas, and as an aid in study, ++ organization, problem solving, and decision making (From Wikipedia). ++ </p> ++ ++ <p> ++ Currently, Labyrinth provides 3 different types of thoughts, or nodes - Text, ++ Image and Drawing. Text is the basic standard text node. Images allow you to ++ insert and scale any supported image file (PNG, JPEG, SVG). Drawings are for ++ those times when you want to illustrate something, but don't want to fire up a ++ separate drawing program. It allows you to quickly and easily sketch very ++ simple line diagrams. ++ </p> ++ ++ </description> ++ ++ <content_rating type="oars-1.1" /> ++ ++ <releases> ++ <release date="2012-11-02" version="0.6"/> ++ </releases> ++ ++ <screenshots> ++ <screenshot> ++ <image type="source">https://screenshots.debian.net/screenshots/000/009/362/large.png</image> ++ <image type="source">https://screenshots.debian.net/screenshots/000/009/194/large.png</image> ++ </screenshot> ++ </screenshots> ++ ++ <url type="homepage">https://github.com/labyrinth-team/labyrinth</url> ++ <updatecontact>Don@Scorgie.org</updatecontact> ++</application> ++ +diff --git a/install_data_files.sh b/install_data_files.sh +index 76ba767..c021211 100755 +--- a/install_data_files.sh ++++ b/install_data_files.sh +@@ -14,5 +14,8 @@ install -m 644 data/labyrinth.svg $DESTDIR/usr/share/icons/hicolor/scalable/apps + echo "Installing .desktop file" + install -D -m 755 data/labyrinth.desktop $DESTDIR/usr/share/applications/labyrinth.desktop + ++echo "Installing .appdata.xml file" ++install -D -m 644 data/labyrinth.appdata.xml $DESTDIR/usr/share/appdata/labyrinth.appdata.xml ++ + echo "Installing translations" + make -C po localedir=$DESTDIR/usr/share/locale install diff --git a/no-numpy.patch b/no-numpy.patch new file mode 100644 index 000000000000..29a3bfddb7ce --- /dev/null +++ b/no-numpy.patch @@ -0,0 +1,65 @@ +From 1612f7df877ff58e621cab7c195bf19796b5fa9b Mon Sep 17 00:00:00 2001 +From: Thomas Kluyver <takowl@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 + diff --git a/optional-gconf.patch b/optional-gconf.patch new file mode 100644 index 000000000000..e5844b3f95df --- /dev/null +++ b/optional-gconf.patch @@ -0,0 +1,84 @@ +diff -Naur labyrinth-0.6.orig/labyrinth_lib/Browser.py labyrinth-0.6/labyrinth_lib/Browser.py +--- labyrinth-0.6.orig/labyrinth_lib/Browser.py 2018-09-05 16:29:11.992110000 +0200 ++++ labyrinth-0.6/labyrinth_lib/Browser.py 2018-09-05 16:34:59.848220456 +0200 +@@ -29,7 +29,10 @@ + # Gtk stuff + import gtk + if os.name != 'nt': +- import gconf ++ try: ++ import gconf ++ except ImportError: ++ gconf = None + import gtk.glade + import pango + import gobject +@@ -89,7 +92,7 @@ + self.main_window = self.glade.get_widget ('MapBrowser') + + # set remembered size +- if os.name != 'nt': ++ if os.name != 'nt' and gconf: + self.config_client = gconf.client_get_default() + self.config_client.add_dir ("/apps/labyrinth", gconf.CLIENT_PRELOAD_NONE) + +@@ -105,7 +108,7 @@ + + view_sortable = self.view.get_model () + view_sortable.connect ('sort-column-changed', self.sort_column_changed_cb) +- if os.name != 'nt': ++ if os.name != 'nt' and gconf: + sort_order = self.config_client.get_int('/apps/labyrinth/map_sort_order') + column_id = self.config_client.get_int('/apps/labyrinth/map_sort_order_column') + view_sortable.set_sort_column_id (column_id, sort_order) +@@ -307,7 +310,7 @@ + + width, height = self.main_window.get_size() + +- if os.name != 'nt': ++ if os.name != 'nt' and gconf: + self.config_client.set_int('/apps/labyrinth/width', width) + self.config_client.set_int('/apps/labyrinth/height', height) + +@@ -335,6 +338,6 @@ + + def sort_column_changed_cb (self, data): + column_id, sort_order = data.get_sort_column_id () +- if os.name != 'nt': ++ if os.name != 'nt' and gconf: + self.config_client.set_int('/apps/labyrinth/map_sort_order', sort_order) + self.config_client.set_int('/apps/labyrinth/map_sort_order_column', column_id) +diff -Naur labyrinth-0.6.orig/labyrinth_lib/MainWindow.py labyrinth-0.6/labyrinth_lib/MainWindow.py +--- labyrinth-0.6.orig/labyrinth_lib/MainWindow.py 2018-09-05 16:29:11.998776000 +0200 ++++ labyrinth-0.6/labyrinth_lib/MainWindow.py 2018-09-05 16:35:40.649492236 +0200 +@@ -32,7 +32,10 @@ + import cairo, pangocairo + import gobject + if os.name != 'nt': +- import gconf ++ try: ++ import gconf ++ except ImportError: ++ gconf = None + + # Local imports + import MMapArea +@@ -81,7 +84,8 @@ + self.MainArea.connect ("set_attrs", self.attrs_cb) + if os.name != 'nt': + self.MainArea.connect ("text_selection_changed", self.selection_changed_cb) +- self.config_client = gconf.client_get_default() ++ if gconf: ++ self.config_client = gconf.client_get_default() + + glade = gtk.glade.XML(utils.get_data_file_name('labyrinth.glade')) + self.main_window = glade.get_widget ('MapWindow') +@@ -321,7 +325,7 @@ + + def view_change_cb(self, base, activated): + utils.use_bezier_curves = activated.get_current_value() == MMapArea.VIEW_BEZIER +- if os.name != 'nt': ++ if os.name != 'nt' and gconf: + self.config_client.set_bool('/apps/labyrinth/curves', utils.use_bezier_curves) + self.MainArea.update_all_links() + self.MainArea.invalidate() |