LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-18-2017, 06:20 PM   #1
Lenard Spencer
Member
 
Registered: Sep 2004
Location: Florida
Distribution: Slackware, Linux from Scratch
Posts: 216

Rep: Reputation: 35
Gourmet -current SBo


Some time ago I had found a patch for Gourmet for the newer versions of Python 2.7 to handle the tostring-tobytes error (tostring had been replaced by tobytes in Python). I had emailed the maintainer but never got a response, so I am posting the fix here for the SBo script. (Maybe I should also post to SlackBuild-users as well?)
In addition to the patch, there are a couple of additional deps: lxml and pypoppler. Here is the full patch:
Code:
diff -Naur gourmet/gourmet.SlackBuild gourmet-patched/gourmet.SlackBuild
--- gourmet/gourmet.SlackBuild	2016-12-01 13:48:00.000000000 -0500
+++ gourmet-patched/gourmet.SlackBuild	2016-11-13 10:19:16.595150351 -0500
@@ -24,7 +24,7 @@
 
 PRGNAM=gourmet
 VERSION=${VERSION:-0.17.4}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
 TAG=${TAG:-_SBo}
 
 if [ -z "$ARCH" ]; then
@@ -69,6 +69,9 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
+# Patch to replace removed tostring() with tobytes()
+patch -p1 < $CWD/tostring-to-tobytes.patch
+
 python setup.py install --root=$PKG
 
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
diff -Naur gourmet/gourmet.info gourmet-patched/gourmet.info
--- gourmet/gourmet.info	2016-12-01 13:48:00.000000000 -0500
+++ gourmet-patched/gourmet.info	2017-06-18 18:56:17.720839713 -0400
@@ -5,6 +5,6 @@
 MD5SUM="937334364abc3093709a604c1d473e9f"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
-REQUIRES="SQLAlchemy python-distutils-extra reportlab pygtkspell gst0-python python-elib.intl"
+REQUIRES="SQLAlchemy lxml python-distutils-extra reportlab pygtkspell gst0-python python-elib.intl pypoppler"
 MAINTAINER="Erwin van Zanten"
 EMAIL="e.van.zanten.evz@gmail.com"
diff -Naur gourmet/slack-desc gourmet-patched/slack-desc
--- gourmet/slack-desc	2016-12-01 13:48:00.000000000 -0500
+++ gourmet-patched/slack-desc	2017-06-18 19:05:58.778055927 -0400
@@ -6,7 +6,7 @@
 # customary to leave one space after the ':' except on otherwise blank lines.
 
        |-----handy-ruler------------------------------------------------------|
-gourmet: gourmet (A Recipe organizer for Linux)
+gourmet: Gourmet (a recipe organizer for Linux)
 gourmet:
 gourmet: Gourmet Recipe Manager is a recipe-organizer that allows you
 gourmet: to collect, search, organize, and browse your recipes.
diff -Naur gourmet/tostring-to-tobytes.patch gourmet-patched/tostring-to-tobytes.patch
--- gourmet/tostring-to-tobytes.patch	1969-12-31 19:00:00.000000000 -0500
+++ gourmet-patched/tostring-to-tobytes.patch	2016-11-13 10:09:20.452109878 -0500
@@ -0,0 +1,26 @@
+diff --git a/gourmet/gtk_extras/ratingWidget.py b/gourmet/gtk_extras/ratingWidget.py
+index 0e01735..efa6463 100644
+--- a/gourmet/gtk_extras/ratingWidget.py
++++ b/gourmet/gtk_extras/ratingWidget.py
+@@ -135,7 +135,7 @@ class StarGenerator:
+         if is_rgba: rowstride = 4
+         else: rowstride = 3
+         pb=gtk.gdk.pixbuf_new_from_data(
+-            image.tostring(),
++            image.tobytes(),
+             gtk.gdk.COLORSPACE_RGB,
+             is_rgba,
+             8,
+diff --git a/gourmet/plugins/browse_recipes/icon_helpers.py b/gourmet/plugins/browse_recipes/icon_helpers.py
+index 61c772c..2e7b08b 100644
+--- a/gourmet/plugins/browse_recipes/icon_helpers.py
++++ b/gourmet/plugins/browse_recipes/icon_helpers.py
+@@ -38,7 +38,7 @@ def get_pixbuf_from_image (image):
+     if is_rgba: rowstride = 4
+     else: rowstride = 3
+     pb=gtk.gdk.pixbuf_new_from_data(
+-        image.tostring(),
++        image.tobytes(),
+         gtk.gdk.COLORSPACE_RGB,
+         is_rgba,
+         8,
Without the tostring-to-tobytes patch, it is impossible to either enter new recipes or edit any existing recipes.
NOTE: This patch is ONLY needed for -current (unless Python 2 is upgraded in 14.2).

Edit: I forgot to mention the additional deps, lxml and pypoppler.

Last edited by Lenard Spencer; 06-18-2017 at 06:22 PM. Reason: Forgot to mention additional deps
 
Old 06-19-2017, 05:58 AM   #2
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 340

Rep: Reputation: 181Reputation: 181
Right now Python version for both 14.2 (in patches/) and -current is the same (2.7.13), the only difference is that Python in -current is built using --enable-unicode=ucs4, while package in 14.2 still uses ucs2, which could likely be the reason why you needed to patch Gourmet. Or it could be something else, e.g. some differences in GTK+ stack.

Just wanted to make that clear.
 
Old 06-21-2017, 11:38 AM   #3
Lenard Spencer
Member
 
Registered: Sep 2004
Location: Florida
Distribution: Slackware, Linux from Scratch
Posts: 216

Original Poster
Rep: Reputation: 35
Good point. I just noticed the 14.2 python version myself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Glabels from SBo does not start in current Slack brodo Slackware 4 01-13-2017 08:09 AM
using a 14.1-built sbo package in current? pzognar Slackware 10 09-11-2015 06:56 PM
[SOLVED] problem compiling gtkmm3 (from Sbo) on current Qury Slackware 2 05-03-2015 05:53 PM
[SOLVED] kyotocabinet (1.2.76) Sbo and Slackware Current carlitoco Slackware 4 03-06-2013 05:23 AM
[SOLVED] Digikam from SBo does not compile on 64-current of 2010-03-09 gargamel Slackware 10 03-21-2010 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration