LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Pygame 1.9.1 on Slackware64 14.0 (https://www.linuxquestions.org/questions/slackware-14/pygame-1-9-1-on-slackware64-14-0-a-4175441443/)

t35t 12-14-2012 07:58 AM

Pygame 1.9.1 on Slackware64 14.0
 
Hi all,

I am trying to build and install pygame 1.9.1 on a Slackware64 14.0 machine. When I type ;

python setup.py build

I get ;

In file included from src/_camera.c:36:0:
src/camera.h:42:32: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

Failure is originating from pygame.camera module trying to build.
Any ideas for a workaround ?

Thanks in advance.

ponce 12-14-2012 09:02 AM

apply these modifications to slackbuilds.org build script
Code:

--- pygame.orig/pygame.SlackBuild      2012-12-12 05:49:22.067570944 +0100
+++ pygame/pygame.SlackBuild    2012-12-14 15:59:02.123999930 +0100
@@ -4,8 +4,8 @@
 # Modified by the SlackBuilds.org project
 
 NAME=pygame
-VERSION=1.7.1
-BUILD=${BUILD:-3}
+VERSION=1.9.1
+BUILD=${BUILD:-1}
 TAG=${TAG:-_SBo}
 
 # Automatically determine the architecture we're building on:
@@ -34,6 +34,9 @@
 chown -R root:root .
 chmod -R u+w,go+r-w,a-s .
 
+# This header moved elsewhere
+sed -i "s|linux/videodev.h|libv4l1-videodev.h|" src/camera.h
+
 # Python programs use the CFLAGS specified used by python itself
 python -u config.py || exit 1
 python setup.py install --root=$PKG
diff -Naur pygame.orig/pygame.info pygame/pygame.info
--- pygame.orig/pygame.info    2012-12-12 05:49:22.067570944 +0100
+++ pygame/pygame.info  2012-12-14 16:00:25.757998902 +0100
@@ -1,8 +1,8 @@
 PRGNAM="pygame"
-VERSION="1.7.1"
+VERSION="1.9.1"
 HOMEPAGE="http://www.pygame.org/"
-DOWNLOAD="http://www.pygame.org/ftp/pygame-1.7.1release.tar.gz"
-MD5SUM="05d86d1af446f79411359400951053b7"
+DOWNLOAD="http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz"
+MD5SUM="1c4cdc708d17c8250a2d78ef997222fc"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
 REQUIRES="smpeg"


t35t 12-14-2012 09:11 AM

Quote:

Originally Posted by ponce (Post 4849285)
apply these modifications to slackbuilds.org build script
Code:

--- pygame.orig/pygame.SlackBuild      2012-12-12 05:49:22.067570944 +0100
+++ pygame/pygame.SlackBuild    2012-12-14 15:59:02.123999930 +0100
@@ -4,8 +4,8 @@
 # Modified by the SlackBuilds.org project
 
 NAME=pygame
-VERSION=1.7.1
-BUILD=${BUILD:-3}
+VERSION=1.9.1
+BUILD=${BUILD:-1}
 TAG=${TAG:-_SBo}
 
 # Automatically determine the architecture we're building on:
@@ -34,6 +34,9 @@
 chown -R root:root .
 chmod -R u+w,go+r-w,a-s .
 
+# This header moved elsewhere
+sed -i "s|linux/videodev.h|libv4l1-videodev.h|" src/camera.h
+
 # Python programs use the CFLAGS specified used by python itself
 python -u config.py || exit 1
 python setup.py install --root=$PKG
diff -Naur pygame.orig/pygame.info pygame/pygame.info
--- pygame.orig/pygame.info    2012-12-12 05:49:22.067570944 +0100
+++ pygame/pygame.info  2012-12-14 16:00:25.757998902 +0100
@@ -1,8 +1,8 @@
 PRGNAM="pygame"
-VERSION="1.7.1"
+VERSION="1.9.1"
 HOMEPAGE="http://www.pygame.org/"
-DOWNLOAD="http://www.pygame.org/ftp/pygame-1.7.1release.tar.gz"
-MD5SUM="05d86d1af446f79411359400951053b7"
+DOWNLOAD="http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz"
+MD5SUM="1c4cdc708d17c8250a2d78ef997222fc"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
 REQUIRES="smpeg"


How can I do that automatically, using "diff" command ? What do you exactly mean by apply these modifications ?

ponce 12-14-2012 09:22 AM

you can either:
- see the lines changed above and modify the original files accordingly with a text editor;
- save the text above as a file called my.patch and from the folder of the slackbuild of pygame do a
Code:

patch -p1 -i /path/to/my.patch
the slackbuild I modified is here

http://slackbuilds.org/repository/14.0/python/pygame/

t35t 12-14-2012 09:30 AM

Quote:

Originally Posted by ponce (Post 4849299)
you can either:
- see the lines changed above and modify the original files accordingly with a text editor;
- save the text above as a file called my.patch and from the folder of the slackbuild of pygame do a
Code:

patch -p1 -i /path/to/my.patch
the slackbuild I modified is here

http://slackbuilds.org/repository/14.0/python/pygame/

Worked like a charm.
Thank you!


All times are GMT -5. The time now is 07:37 AM.