public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
       [not found] <E1IgKWE-0002tU-Su@stork.gentoo.org>
@ 2007-10-13  0:39 ` Donnie Berkholz
  2007-10-13  8:44   ` Torsten Veller
  2007-10-14  1:29   ` Alistair Bush
  0 siblings, 2 replies; 10+ messages in thread
From: Donnie Berkholz @ 2007-10-13  0:39 UTC (permalink / raw
  To: gentoo-dev, remi

On 13:25 Fri 12 Oct     , Remi Cardona (remi) wrote:
> 1.1                  dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild
> 
> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&view=markup
> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&content-type=text/plain

> pkg_postinst() {
> 	python_version
> 	python_mod_optimize "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
> }
> 
> pkg_postrm() {
> 	python_version
> 	python_mod_cleanup "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
> }

python_mod_optimize() and python_mod_cleanup() already tag ROOT on, so 
for ROOT != / this is broken.

Thanks,
Donnie
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  0:39 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild Donnie Berkholz
@ 2007-10-13  8:44   ` Torsten Veller
  2007-10-13  9:01     ` Donnie Berkholz
  2007-10-14  1:29   ` Alistair Bush
  1 sibling, 1 reply; 10+ messages in thread
From: Torsten Veller @ 2007-10-13  8:44 UTC (permalink / raw
  To: gentoo-dev

* Donnie Berkholz <dberkholz@gentoo.org>:
> On 13:25 Fri 12 Oct     , Remi Cardona (remi) wrote:
> > 1.1                  dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild
> > 
> > file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&view=markup
> > plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&content-type=text/plain
> 
> > pkg_postinst() {
> > 	python_version
> > 	python_mod_optimize "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
> > }
> > 
> > pkg_postrm() {
> > 	python_version
> > 	python_mod_cleanup "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
> > }
> 
> python_mod_optimize() and python_mod_cleanup() already tag ROOT on,

python_mod_optimize() does not.

> so for ROOT != / this is broken.

But does python_mod_optimize do anything useful with ROOT !=/ and
cross-compilation? What if python versions differ?
-- 
.:           Torsten Veller           |                          :.
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  8:44   ` Torsten Veller
@ 2007-10-13  9:01     ` Donnie Berkholz
  2007-10-13  9:11       ` Torsten Veller
  2007-10-13  9:14       ` Rémi Cardona
  0 siblings, 2 replies; 10+ messages in thread
From: Donnie Berkholz @ 2007-10-13  9:01 UTC (permalink / raw
  To: gentoo-dev

On 10:44 Sat 13 Oct     , Torsten Veller wrote:
> * Donnie Berkholz <dberkholz@gentoo.org>:
> > python_mod_optimize() and python_mod_cleanup() already tag ROOT on,
> 
> python_mod_optimize() does not.

Mine does:

python_mod_optimize() {
    local myroot
    # strip trailing slash
    myroot="${ROOT%/}"

	...

    ebegin "Byte compiling python modules for python-${PYVER} .."
    python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${c$
    python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py $
    eend $?
}

> > so for ROOT != / this is broken.
> 
> But does python_mod_optimize do anything useful with ROOT !=/ and
> cross-compilation? What if python versions differ?

That's a good question, and it looks like python_version() could use a 
fix for ROOT != / on same-arch systems. On cross-compiled, it'll 
probably be more work and I'm not sure how to deal with it.

Thanks,
Donnie
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  9:01     ` Donnie Berkholz
@ 2007-10-13  9:11       ` Torsten Veller
  2007-10-13  9:30         ` Donnie Berkholz
  2007-10-13  9:14       ` Rémi Cardona
  1 sibling, 1 reply; 10+ messages in thread
From: Torsten Veller @ 2007-10-13  9:11 UTC (permalink / raw
  To: gentoo-dev

* Donnie Berkholz <dberkholz@gentoo.org>:
> On 10:44 Sat 13 Oct     , Torsten Veller wrote:
> > * Donnie Berkholz <dberkholz@gentoo.org>:
> > > python_mod_optimize() and python_mod_cleanup() already tag ROOT on,
> > 
> > python_mod_optimize() does not.
> 
> Mine does:
> 
> python_mod_optimize() {
>     local myroot
>     # strip trailing slash
>     myroot="${ROOT%/}"
> 
> 	...
> 
>     ebegin "Byte compiling python modules for python-${PYVER} .."
      python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
      python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
>     eend $?
> }

No. The arguments of python_mod_optimize are just passed to the ROOTed compileall.py.
-- 
.:               Torsten Veller               |                              :.
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  9:01     ` Donnie Berkholz
  2007-10-13  9:11       ` Torsten Veller
@ 2007-10-13  9:14       ` Rémi Cardona
  2007-10-13 22:08         ` Ryan Hill
  1 sibling, 1 reply; 10+ messages in thread
From: Rémi Cardona @ 2007-10-13  9:14 UTC (permalink / raw
  To: gentoo-dev

Donnie Berkholz wrote:
> python_mod_optimize() {
>     local myroot
>     # strip trailing slash
>     myroot="${ROOT%/}"
> 
> 	...
> 
>     ebegin "Byte compiling python modules for python-${PYVER} .."
>     python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${c$
>     python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py $
>     eend $?
> }

Could the python eclass have a function (or whatever as I'm no bash
guru) that returns this :

${ROOT}/usr/$(get_libdir)/python${PYVER}/

We use it over and over in all our ebuilds, and it's error-prone as my
last few commits have shown.

Cheers,

Rémi
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  9:11       ` Torsten Veller
@ 2007-10-13  9:30         ` Donnie Berkholz
  0 siblings, 0 replies; 10+ messages in thread
From: Donnie Berkholz @ 2007-10-13  9:30 UTC (permalink / raw
  To: gentoo-dev

On 11:11 Sat 13 Oct     , Torsten Veller wrote:
> * Donnie Berkholz <dberkholz@gentoo.org>:
> > On 10:44 Sat 13 Oct     , Torsten Veller wrote:
> > > * Donnie Berkholz <dberkholz@gentoo.org>:
> > > > python_mod_optimize() and python_mod_cleanup() already tag ROOT on,
> > > 
> > > python_mod_optimize() does not.
> > 
> > Mine does:
> > 
> > python_mod_optimize() {
> >     local myroot
> >     # strip trailing slash
> >     myroot="${ROOT%/}"
> > 
> > 	...
> > 
> >     ebegin "Byte compiling python modules for python-${PYVER} .."
>       python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
>       python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
> >     eend $?
> > }
> 
> No. The arguments of python_mod_optimize are just passed to the ROOTed compileall.py.

It took me about five minutes to figure out what you meant: this means 
that the filenames do not get passed with ROOT prepended to them, so 
compileall.py in ROOT compiles the files outside of ROOT.

Thanks,
Donnie
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev]  Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  9:14       ` Rémi Cardona
@ 2007-10-13 22:08         ` Ryan Hill
  2007-10-13 22:21           ` Rémi Cardona
  0 siblings, 1 reply; 10+ messages in thread
From: Ryan Hill @ 2007-10-13 22:08 UTC (permalink / raw
  To: gentoo-dev

Rémi Cardona wrote:
> Donnie Berkholz wrote:
>> python_mod_optimize() {
>>     local myroot
>>     # strip trailing slash
>>     myroot="${ROOT%/}"
>>
>> 	...
>>
>>     ebegin "Byte compiling python modules for python-${PYVER} .."
>>     python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${c$
>>     python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py $
>>     eend $?
>> }
> 
> Could the python eclass have a function (or whatever as I'm no bash
> guru) that returns this :
> 
> ${ROOT}/usr/$(get_libdir)/python${PYVER}/
> 
> We use it over and over in all our ebuilds, and it's error-prone as my
> last few commits have shown.

Why not just leave the path off altogether then?  That should default to
${ROOT}/usr/$(get_libdir)/python[0-9].[0-9]* IIRC.

-- 
                  fonts / wxWindows / gcc-porting / treecleaners
  EFFD 380E 047A 4B51 D2BD  C64F 8AA8 8346 F9A4 0662 (0xF9A40662)

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev]  Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13 22:08         ` Ryan Hill
@ 2007-10-13 22:21           ` Rémi Cardona
  0 siblings, 0 replies; 10+ messages in thread
From: Rémi Cardona @ 2007-10-13 22:21 UTC (permalink / raw
  To: gentoo-dev

Ryan Hill wrote:
> Why not just leave the path off altogether then?  That should default to
> ${ROOT}/usr/$(get_libdir)/python[0-9].[0-9]* IIRC.

We (gnome herd, possibly others) still need to append
/site-packages/gtk-2.0 to that path for most of our operations. So if we
could write :

python_mod_optimize "$(python_lib_dir)site-packages/gtk-2.0"

or even :

python_mod_optimize "$(python_site_packges)gtk-2.0"

that would be fantastic :)

Could that function benefit other ebuilds than ours?

Cheers,

Rémi
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-13  0:39 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild Donnie Berkholz
  2007-10-13  8:44   ` Torsten Veller
@ 2007-10-14  1:29   ` Alistair Bush
  2007-10-14 19:01     ` Rémi Cardona
  1 sibling, 1 reply; 10+ messages in thread
From: Alistair Bush @ 2007-10-14  1:29 UTC (permalink / raw
  To: gentoo-dev

> On 13:25 Fri 12 Oct     , Remi Cardona (remi) wrote:
>> 1.1                  dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild
>>
>> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&view=markup
>> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/gnome-python-extras/gnome-python-extras-2.19.1-r1.ebuild?rev=1.1&content-type=text/plain
> 
>> pkg_postinst() {
>> 	python_version
>> 	python_mod_optimize "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
>> }
>>
>> pkg_postrm() {
>> 	python_version
>> 	python_mod_cleanup "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0"
>> }

While you guys are on this subject, I thought I would put in the
experience I just had.

http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/java-config/java-config-2.1.2.ebuild?rev=1.1&view=markup

As you will note in the ebuild above I inherit distutils and then

declare

PYTHON_MODNAME="java_config_2"

and have my 2 functions as so....

pkg_postrm() {
	distutils_python_version
	distutils_pkg_postrm
}

pkg_postinst() {
	distutils_pkg_postinst
	...
	...
}

Firstly it is interesting to note that you must call *python_version
before distutils_pkg_postrm while distutils_pkg_postinst handles this
itself.

Is this a good solution? Would it also be a good solution in your case?

PYTHON_MODNAME from my understanding what i've investigated will accept
a list of modules if you need it to.

Anyway, hopefully this helps.

Alistair.

ps.  My python experience has not left the realm of java-config and I
have only done 2 releases, 1 1/2 of which I completely screwed up.  I am
no expert and have no idea whether the above is correct, valid or
otherwise safe for human consumption. Don't complain!!
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild
  2007-10-14  1:29   ` Alistair Bush
@ 2007-10-14 19:01     ` Rémi Cardona
  0 siblings, 0 replies; 10+ messages in thread
From: Rémi Cardona @ 2007-10-14 19:01 UTC (permalink / raw
  To: gentoo-dev

Alistair Bush wrote:
> While you guys are on this subject, I thought I would put in the
> experience I just had.
> 
> http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/java-config/java-config-2.1.2.ebuild?rev=1.1&view=markup
> 
> As you will note in the ebuild above I inherit distutils and then
> 
> declare
> 
> PYTHON_MODNAME="java_config_2"
> 
> and have my 2 functions as so....
> 
> pkg_postrm() {
> 	distutils_python_version
> 	distutils_pkg_postrm
> }
> 
> pkg_postinst() {
> 	distutils_pkg_postinst
> 	...
> 	...
> }

I just had a quick look at it and this looks really great, I'll take a
better look at it to make sure it does what we need.

Thanks for this great tip :)

Cheers,

Rémi
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-10-14 19:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1IgKWE-0002tU-Su@stork.gentoo.org>
2007-10-13  0:39 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-python/gnome-python-extras: ChangeLog gnome-python-extras-2.19.1-r1.ebuild Donnie Berkholz
2007-10-13  8:44   ` Torsten Veller
2007-10-13  9:01     ` Donnie Berkholz
2007-10-13  9:11       ` Torsten Veller
2007-10-13  9:30         ` Donnie Berkholz
2007-10-13  9:14       ` Rémi Cardona
2007-10-13 22:08         ` Ryan Hill
2007-10-13 22:21           ` Rémi Cardona
2007-10-14  1:29   ` Alistair Bush
2007-10-14 19:01     ` Rémi Cardona

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox