Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-10-03 Thread David Coppa
On Thu, 03 Oct 2013, Landry Breuil wrote:

> That works for the three ports broken by the previous diff (terminator,
> py-cef and py-greenlet) but that looks like a huge hack to me.

We settled on this:

Index: python.port.mk
===
RCS file: /cvs/ports/lang/python/python.port.mk,v
retrieving revision 1.72
diff -u -p -u -p -r1.72 python.port.mk
--- python.port.mk  24 Sep 2013 16:55:02 -  1.72
+++ python.port.mk  3 Oct 2013 16:06:24 -
@@ -91,6 +91,7 @@ MODPY_SETUPUTILS =Yes
 # The setuptools uses test target
 TEST_TARGET ?= test
 _MODPY_USERBASE =
+_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info || true
 .else
 # Try to detect the case where a port will build regardless of setuptools
 # but the final plist will be different if it's present.
@@ -117,13 +118,6 @@ MODPY_BIN =${LOCALBASE}/bin/python${MO
 MODPY_INCDIR = 
${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
 MODPY_LIBDIR = ${LOCALBASE}/lib/python${MODPY_VERSION}
 MODPY_SITEPKG =${MODPY_LIBDIR}/site-packages
-
-.if defined(MODPY_BADEGGS)
-.  for egg in ${MODPY_BADEGGS}
-_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
-.  endfor
-.endif
-
 
 # usually setup.py but Setup.py can be found too
 MODPY_SETUP ?= setup.py



Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-10-03 Thread Landry Breuil
On Thu, Oct 03, 2013 at 05:01:33PM +0200, David Coppa wrote:
> On Thu, 26 Sep 2013, David Coppa wrote:
> 
> > On Thu, Sep 26, 2013 at 2:30 PM, Remi Pointel  wrote:
> > > On Thu, 26 Sep 2013 14:19:28 +0200
> > > David Coppa  wrote:
> > >> On Thu, 26 Sep 2013, David Coppa wrote:
> > >>
> > >> >
> > >> > Why not getting rid of MODPY_BADEGGS and doing this instead:
> > >> >
> > >> > This will assure the egg-info directory is always created with the
> > >> > right permissions...
> > >> >
> > >> > Comments?
> > >>
> > >> Oops!
> > >> Now with everything in its right place:
> > >>
> > >> Index: python.port.mk
> > >> ===
> > >> RCS file: /cvs/ports/lang/python/python.port.mk,v
> > >> retrieving revision 1.72
> > >> diff -u -p -u -p -r1.72 python.port.mk
> > >> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
> > >> +++ python.port.mk26 Sep 2013 12:19:08 -
> > >> @@ -91,6 +91,7 @@ MODPY_SETUPUTILS =  Yes
> > >>  # The setuptools uses test target
> > >>  TEST_TARGET ?=   test
> > >>  _MODPY_USERBASE =
> > >> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
> > >>  .else
> > >>  # Try to detect the case where a port will build regardless of 
> > >> setuptools
> > >>  # but the final plist will be different if it's present.
> > >> @@ -117,13 +118,6 @@ MODPY_BIN =  ${LOCALBASE}/bin/python${MO
> > >>  MODPY_INCDIR =   
> > >> ${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
> > >>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
> > >>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
> > >> -
> > >> -.if defined(MODPY_BADEGGS)
> > >> -.  for egg in ${MODPY_BADEGGS}
> > >> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> > >> -.  endfor
> > >> -.endif
> > >> -
> > >>
> > >>  # usually setup.py but Setup.py can be found too
> > >>  MODPY_SETUP ?=   setup.py
> > >
> > > Could be useful to test this diff in a bulk, no?
> > 
> > Running against all the ports using py-setuptools should be sufficient.
> > 
> > > Remi.
> 
> As seen on icb, not all the setuptools based stuff support this
> command. Some ports fail with: 
> 
> error: invalid command 'egg_info'
> 
> New revision of the diff, hope I got it right this time:
> 
> Index: python.port.mk
> ===
> RCS file: /cvs/ports/lang/python/python.port.mk,v
> retrieving revision 1.72
> diff -u -p -u -p -r1.72 python.port.mk
> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
> +++ python.port.mk3 Oct 2013 15:01:04 -
> @@ -91,6 +91,7 @@ MODPY_SETUPUTILS =  Yes
>  # The setuptools uses test target
>  TEST_TARGET ?=   test
>  _MODPY_USERBASE =
> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} --help-commands | grep -qw egg_info 
> && ${MODPY_CMD} egg_info
>  .else
>  # Try to detect the case where a port will build regardless of setuptools
>  # but the final plist will be different if it's present.
> @@ -117,13 +118,6 @@ MODPY_BIN =  ${LOCALBASE}/bin/python${MO
>  MODPY_INCDIR =   
> ${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
> -
> -.if defined(MODPY_BADEGGS)
> -.  for egg in ${MODPY_BADEGGS}
> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> -.  endfor
> -.endif
> -
>  
>  # usually setup.py but Setup.py can be found too
>  MODPY_SETUP ?=   setup.py
> 

That works for the three ports broken by the previous diff (terminator,
py-cef and py-greenlet) but that looks like a huge hack to me.

Landry



Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-10-03 Thread David Coppa
On Thu, 26 Sep 2013, David Coppa wrote:

> On Thu, Sep 26, 2013 at 2:30 PM, Remi Pointel  wrote:
> > On Thu, 26 Sep 2013 14:19:28 +0200
> > David Coppa  wrote:
> >> On Thu, 26 Sep 2013, David Coppa wrote:
> >>
> >> >
> >> > Why not getting rid of MODPY_BADEGGS and doing this instead:
> >> >
> >> > This will assure the egg-info directory is always created with the
> >> > right permissions...
> >> >
> >> > Comments?
> >>
> >> Oops!
> >> Now with everything in its right place:
> >>
> >> Index: python.port.mk
> >> ===
> >> RCS file: /cvs/ports/lang/python/python.port.mk,v
> >> retrieving revision 1.72
> >> diff -u -p -u -p -r1.72 python.port.mk
> >> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
> >> +++ python.port.mk26 Sep 2013 12:19:08 -
> >> @@ -91,6 +91,7 @@ MODPY_SETUPUTILS =  Yes
> >>  # The setuptools uses test target
> >>  TEST_TARGET ?=   test
> >>  _MODPY_USERBASE =
> >> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
> >>  .else
> >>  # Try to detect the case where a port will build regardless of setuptools
> >>  # but the final plist will be different if it's present.
> >> @@ -117,13 +118,6 @@ MODPY_BIN =  ${LOCALBASE}/bin/python${MO
> >>  MODPY_INCDIR =   
> >> ${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
> >>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
> >>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
> >> -
> >> -.if defined(MODPY_BADEGGS)
> >> -.  for egg in ${MODPY_BADEGGS}
> >> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> >> -.  endfor
> >> -.endif
> >> -
> >>
> >>  # usually setup.py but Setup.py can be found too
> >>  MODPY_SETUP ?=   setup.py
> >
> > Could be useful to test this diff in a bulk, no?
> 
> Running against all the ports using py-setuptools should be sufficient.
> 
> > Remi.

As seen on icb, not all the setuptools based stuff support this
command. Some ports fail with: 

error: invalid command 'egg_info'

New revision of the diff, hope I got it right this time:

Index: python.port.mk
===
RCS file: /cvs/ports/lang/python/python.port.mk,v
retrieving revision 1.72
diff -u -p -u -p -r1.72 python.port.mk
--- python.port.mk  24 Sep 2013 16:55:02 -  1.72
+++ python.port.mk  3 Oct 2013 15:01:04 -
@@ -91,6 +91,7 @@ MODPY_SETUPUTILS =Yes
 # The setuptools uses test target
 TEST_TARGET ?= test
 _MODPY_USERBASE =
+_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} --help-commands | grep -qw egg_info && 
${MODPY_CMD} egg_info
 .else
 # Try to detect the case where a port will build regardless of setuptools
 # but the final plist will be different if it's present.
@@ -117,13 +118,6 @@ MODPY_BIN =${LOCALBASE}/bin/python${MO
 MODPY_INCDIR = 
${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
 MODPY_LIBDIR = ${LOCALBASE}/lib/python${MODPY_VERSION}
 MODPY_SITEPKG =${MODPY_LIBDIR}/site-packages
-
-.if defined(MODPY_BADEGGS)
-.  for egg in ${MODPY_BADEGGS}
-_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
-.  endfor
-.endif
-
 
 # usually setup.py but Setup.py can be found too
 MODPY_SETUP ?= setup.py



Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-09-26 Thread David Coppa
On Thu, Sep 26, 2013 at 2:30 PM, Remi Pointel  wrote:
> On Thu, 26 Sep 2013 14:19:28 +0200
> David Coppa  wrote:
>> On Thu, 26 Sep 2013, David Coppa wrote:
>>
>> >
>> > Why not getting rid of MODPY_BADEGGS and doing this instead:
>> >
>> > ---8<---
>> >
>> > Index: python.port.mk
>> > ===
>> > RCS file: /cvs/ports/lang/python/python.port.mk,v
>> > retrieving revision 1.72
>> > diff -u -p -u -p -r1.72 python.port.mk
>> > --- python.port.mk  24 Sep 2013 16:55:02 -  1.72
>> > +++ python.port.mk  26 Sep 2013 11:55:58 -
>> > @@ -118,12 +118,7 @@ MODPY_INCDIR = ${LOCALBASE}/include/pyt
>> >  MODPY_LIBDIR = ${LOCALBASE}/lib/python${MODPY_VERSION}
>> >  MODPY_SITEPKG =${MODPY_LIBDIR}/site-packages
>> >
>> > -.if defined(MODPY_BADEGGS)
>> > -.  for egg in ${MODPY_BADEGGS}
>> > -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
>> > -.  endfor
>> > -.endif
>> > -
>> > +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
>> >
>> >  # usually setup.py but Setup.py can be found too
>> >  MODPY_SETUP ?= setup.py
>> >
>> > ---8<---
>> >
>> > This will assure the egg-info directory is always created with the
>> > right permissions...
>> >
>> > Comments?
>>
>> Oops!
>> Now with everything in its right place:
>>
>> Index: python.port.mk
>> ===
>> RCS file: /cvs/ports/lang/python/python.port.mk,v
>> retrieving revision 1.72
>> diff -u -p -u -p -r1.72 python.port.mk
>> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
>> +++ python.port.mk26 Sep 2013 12:19:08 -
>> @@ -91,6 +91,7 @@ MODPY_SETUPUTILS =  Yes
>>  # The setuptools uses test target
>>  TEST_TARGET ?=   test
>>  _MODPY_USERBASE =
>> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
>>  .else
>>  # Try to detect the case where a port will build regardless of setuptools
>>  # but the final plist will be different if it's present.
>> @@ -117,13 +118,6 @@ MODPY_BIN =  ${LOCALBASE}/bin/python${MO
>>  MODPY_INCDIR =   
>> ${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
>>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
>>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
>> -
>> -.if defined(MODPY_BADEGGS)
>> -.  for egg in ${MODPY_BADEGGS}
>> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
>> -.  endfor
>> -.endif
>> -
>>
>>  # usually setup.py but Setup.py can be found too
>>  MODPY_SETUP ?=   setup.py
>
> Could be useful to test this diff in a bulk, no?

Running against all the ports using py-setuptools should be sufficient.

> Remi.

ciao,
David



Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-09-26 Thread Remi Pointel
On Thu, 26 Sep 2013 14:19:28 +0200
David Coppa  wrote:
> On Thu, 26 Sep 2013, David Coppa wrote:
> 
> > 
> > Why not getting rid of MODPY_BADEGGS and doing this instead:
> > 
> > ---8<---
> > 
> > Index: python.port.mk
> > ===
> > RCS file: /cvs/ports/lang/python/python.port.mk,v
> > retrieving revision 1.72
> > diff -u -p -u -p -r1.72 python.port.mk
> > --- python.port.mk  24 Sep 2013 16:55:02 -  1.72
> > +++ python.port.mk  26 Sep 2013 11:55:58 -
> > @@ -118,12 +118,7 @@ MODPY_INCDIR = ${LOCALBASE}/include/pyt
> >  MODPY_LIBDIR = ${LOCALBASE}/lib/python${MODPY_VERSION}
> >  MODPY_SITEPKG =${MODPY_LIBDIR}/site-packages
> >  
> > -.if defined(MODPY_BADEGGS)
> > -.  for egg in ${MODPY_BADEGGS}
> > -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> > -.  endfor
> > -.endif
> > -
> > +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
> >  
> >  # usually setup.py but Setup.py can be found too
> >  MODPY_SETUP ?= setup.py
> > 
> > ---8<---
> > 
> > This will assure the egg-info directory is always created with the
> > right permissions...
> > 
> > Comments?
> 
> Oops!
> Now with everything in its right place:
> 
> Index: python.port.mk
> ===
> RCS file: /cvs/ports/lang/python/python.port.mk,v
> retrieving revision 1.72
> diff -u -p -u -p -r1.72 python.port.mk
> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
> +++ python.port.mk26 Sep 2013 12:19:08 -
> @@ -91,6 +91,7 @@ MODPY_SETUPUTILS =  Yes
>  # The setuptools uses test target
>  TEST_TARGET ?=   test
>  _MODPY_USERBASE =
> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
>  .else
>  # Try to detect the case where a port will build regardless of setuptools
>  # but the final plist will be different if it's present.
> @@ -117,13 +118,6 @@ MODPY_BIN =  ${LOCALBASE}/bin/python${MO
>  MODPY_INCDIR =   
> ${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
> -
> -.if defined(MODPY_BADEGGS)
> -.  for egg in ${MODPY_BADEGGS}
> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> -.  endfor
> -.endif
> -
>  
>  # usually setup.py but Setup.py can be found too
>  MODPY_SETUP ?=   setup.py

Could be useful to test this diff in a bulk, no?

Remi.



Re: MODPY_BADEGGS revised (Was: [UPDATE] databases/py-redis)

2013-09-26 Thread David Coppa
On Thu, 26 Sep 2013, David Coppa wrote:

> 
> Why not getting rid of MODPY_BADEGGS and doing this instead:
> 
> ---8<---
> 
> Index: python.port.mk
> ===
> RCS file: /cvs/ports/lang/python/python.port.mk,v
> retrieving revision 1.72
> diff -u -p -u -p -r1.72 python.port.mk
> --- python.port.mk24 Sep 2013 16:55:02 -  1.72
> +++ python.port.mk26 Sep 2013 11:55:58 -
> @@ -118,12 +118,7 @@ MODPY_INCDIR =   ${LOCALBASE}/include/pyt
>  MODPY_LIBDIR =   ${LOCALBASE}/lib/python${MODPY_VERSION}
>  MODPY_SITEPKG =  ${MODPY_LIBDIR}/site-packages
>  
> -.if defined(MODPY_BADEGGS)
> -.  for egg in ${MODPY_BADEGGS}
> -_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
> -.  endfor
> -.endif
> -
> +_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
>  
>  # usually setup.py but Setup.py can be found too
>  MODPY_SETUP ?=   setup.py
> 
> ---8<---
> 
> This will assure the egg-info directory is always created with the
> right permissions...
> 
> Comments?

Oops!
Now with everything in its right place:

Index: python.port.mk
===
RCS file: /cvs/ports/lang/python/python.port.mk,v
retrieving revision 1.72
diff -u -p -u -p -r1.72 python.port.mk
--- python.port.mk  24 Sep 2013 16:55:02 -  1.72
+++ python.port.mk  26 Sep 2013 12:19:08 -
@@ -91,6 +91,7 @@ MODPY_SETUPUTILS =Yes
 # The setuptools uses test target
 TEST_TARGET ?= test
 _MODPY_USERBASE =
+_MODPY_PRE_BUILD_STEPS += ;${MODPY_CMD} egg_info
 .else
 # Try to detect the case where a port will build regardless of setuptools
 # but the final plist will be different if it's present.
@@ -117,13 +118,6 @@ MODPY_BIN =${LOCALBASE}/bin/python${MO
 MODPY_INCDIR = 
${LOCALBASE}/include/python${MODPY_VERSION}${MODPY_LIB_SUFFIX}
 MODPY_LIBDIR = ${LOCALBASE}/lib/python${MODPY_VERSION}
 MODPY_SITEPKG =${MODPY_LIBDIR}/site-packages
-
-.if defined(MODPY_BADEGGS)
-.  for egg in ${MODPY_BADEGGS}
-_MODPY_PRE_BUILD_STEPS += ;mkdir -p ${WRKBUILD}/${egg}.egg-info
-.  endfor
-.endif
-
 
 # usually setup.py but Setup.py can be found too
 MODPY_SETUP ?= setup.py