You are not logged in.

#1 2014-03-30 06:14:06

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

[Solved] Python packages and changing source

I've been trying to suppress a printf statement (that should be encompassed by #ifdef DEBUG)  in the  python module pygame for python 2.7.

The official repository has this package as python2-pygame, version 1.9.1, but this still has the debug messages as default.

I removed pygame using the -R flag of pacman, thus keeping the dependencies. I then went and downloaded the pygame tarball from their website, made the change to the source file in question, and was planning to build it myself -- but that failed with an error:

src/camera.h:42:32: fatal error: linux/videodev.h: No such file or directory
     #include <linux/videodev.h>

Thus, I'm clearing missing something on my machine.

I really just want to rebuild this package with one line in the source changed, but don't really know what I am doing when it comes to building/installing modules or messing with packages. Any help or pointers would be appreciated.

Last edited by sternenhimmel (2014-04-13 00:49:02)

Offline

#2 2014-03-30 06:27:50

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Python packages and changing source


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-03-30 22:44:22

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Python packages and changing source

For the build error; v4l support was removed upstream from the kernel years ago, don't try to build with support for it. But yes, use abs instead of building by hand.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2014-04-01 02:33:25

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

Re: [Solved] Python packages and changing source

So I did try using ABS to check out the package tree and go from there, but was unable to actually get the package I was looking for, am I missing something?

I tried:

abs python2-pygame

and

abs extra/python2-pygame

Although it doesn't fail in any sense that I can see, there is also no package tree for python2-pygame in /var/abs/.  There is one for python-pygame, but I assume this is for versions of python 3.x.x.

The package in question is here:
https://www.archlinux.org/packages/extr … n2-pygame/

Edit: After looking at the PKGBUILD file for python-pygame, appears that this is for python2-pygame -- they just have the same name for the ABS.

Now I just have to figure out how to modify the source and rebuild...

Last edited by sternenhimmel (2014-04-01 02:45:56)

Offline

#5 2014-04-01 03:39:20

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

Re: [Solved] Python packages and changing source

Okay. I am struggling to get the modified source built -- or rather, it's building and installing just fine, but minus the changes I made.

I made one change to a source file, joystick.c, to suppress a statement of the sort:

printf("SDL_JoystickGetAxis value:%d:\n", value);

and commented it out to read:

//printf("SDL_JoystickGetAxis value:%d:\n", value);

I then used this statement to make an archive from the source:

sudo tar cpfz pygame-1.9.1release_mod.tar.gz pygame-1.9.1release/*

I then moved this file to the folder with PKGBUILD, and changed the PKGBUILD source line to read:

source=(pygame-${pkgver}release_mod.tar.gz)

I then ran makpkg with these flags:

makepkg -f --skipinteg

Finally I removed the existing installation of python2-pygame.

sudo pacman -R python2-pygame

And installed the new version:

sudo pacman -U python2-pygame-1.9.1-8-x86_64.pkg.tar.xz

However, when I actually run the python script that uses this library, I am still getting the SDL_JoystickGetAxis output. Not sure where to go from here, or if I am doing something wrong when modifying the source?

Last edited by sternenhimmel (2014-04-01 03:40:51)

Offline

#6 2014-04-01 06:55:56

sonoran
Member
From: sonoran desert
Registered: 2009-01-12
Posts: 192

Re: [Solved] Python packages and changing source

Are you sure pacman isn't installing from the repo? Or from its cache? What is the pacman output?
You might have to prepend /the/path/to/python2-pygame.
https://wiki.archlinux.org/index.php/pa … l_commands

Offline

#7 2014-04-01 09:09:09

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Python packages and changing source

Make a patch and apply it in prepare()


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2014-04-01 22:43:19

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

Re: [Solved] Python packages and changing source

sonoran wrote:

Are you sure pacman isn't installing from the repo? Or from its cache? What is the pacman output?
You might have to prepend /the/path/to/python2-pygame.
https://wiki.archlinux.org/index.php/pa … l_commands

Gave the absolute path to the package with the same results -- still getting output from joystick.c

Forgive my ignorance, but I have no idea how to make a patch...

Offline

#9 2014-04-02 09:51:24

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Python packages and changing source

Google and you will find lots of good howtoes


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#10 2014-04-02 23:52:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Python packages and changing source

sternenhimmel wrote:

Forgive my ignorance, but I have no idea how to make a patch...

Maybe https://bbs.archlinux.org/viewtopic.php … 4#p1396064 helps a bit.

https://wiki.archlinux.org/index.php/Patching_in_ABS

Offline

#11 2014-04-13 00:48:23

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

Re: [Solved] Python packages and changing source

To give an update, I ended up following this guide on patching:

https://wiki.archlinux.org/index.php/Patching_in_ABS

And was able to make a successful patch, rebuild, and install successfully.

Thanks for the help!

Offline

#12 2014-04-13 09:36:06

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Python packages and changing source

That wiki page needs updating and fixing, eg patching should be done in prepare() not build()


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#13 2014-04-13 20:39:02

sternenhimmel
Member
Registered: 2013-10-09
Posts: 10

Re: [Solved] Python packages and changing source

I noticed that too, but just assumed the python package and a special PKGBUILD file, and used prepare() instead of build().

Offline

Board footer

Powered by FluxBB