mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb
@ 2014-04-15  9:36 Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb Alexander Aring
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexander Aring @ 2014-04-15  9:36 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Aring

This patch series renames the libusbx to libusb again and add some
python checks to "configure.ac".

- Alex

changes since v2:
 - let use python to check python major version.
 - correct some text messages on failure.

changes since v3:
 - use Python instead python
 - add patch to use Python everywhere in configure.ac where it's possible.

Alexander Aring (4):
  libusb: rename libusbx to libusb
  configure.ac: add check for python 2.x version
  configure.ac: check for python2 binary as well
  configure.ac: use Python instead python everywhere

 configure.ac                                       | 24 ++++++++++++++++------
 .../0001-libusb-needs-librt-and-libpthread.patch}  | 13 ++++++------
 patches/libusb-1.0.18/series                       |  1 +
 patches/libusbx-1.0.18/series                      |  1 -
 rules/libusb.make                                  |  6 +++---
 5 files changed, 28 insertions(+), 17 deletions(-)
 rename patches/{libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthread.patch => libusb-1.0.18/0001-libusb-needs-librt-and-libpthread.patch} (73%)
 create mode 100644 patches/libusb-1.0.18/series
 delete mode 100644 patches/libusbx-1.0.18/series

-- 
1.9.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb
  2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
@ 2014-04-15  9:36 ` Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Alexander Aring
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-04-15  9:36 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 .../0001-libusb-needs-librt-and-libpthread.patch}           | 13 ++++++-------
 patches/libusb-1.0.18/series                                |  1 +
 patches/libusbx-1.0.18/series                               |  1 -
 rules/libusb.make                                           |  6 +++---
 4 files changed, 10 insertions(+), 11 deletions(-)
 rename patches/{libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthread.patch => libusb-1.0.18/0001-libusb-needs-librt-and-libpthread.patch} (73%)
 create mode 100644 patches/libusb-1.0.18/series
 delete mode 100644 patches/libusbx-1.0.18/series

diff --git a/patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthread.patch b/patches/libusb-1.0.18/0001-libusb-needs-librt-and-libpthread.patch
similarity index 73%
rename from patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthread.patch
rename to patches/libusb-1.0.18/0001-libusb-needs-librt-and-libpthread.patch
index 2ee3f72..2d0ebb5 100644
--- a/patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthread.patch
+++ b/patches/libusb-1.0.18/0001-libusb-needs-librt-and-libpthread.patch
@@ -1,10 +1,9 @@
-From e5c3ffc155a33a9d8f97dc1524be9a776d4ed656 Mon Sep 17 00:00:00 2001
+From 57ec2296445225a11706b1a1eaae56b37a06c9eb Mon Sep 17 00:00:00 2001
 From: Alexander Aring <alex.aring@gmail.com>
 Date: Fri, 28 Mar 2014 12:04:23 +0100
-Subject: [PATCH] libusbx: libusb needs librt and libpthread
+Subject: [PATCH] libusb: needs librt and libpthread
 
-This patch is taken from the old libusb package and changes to apply the
-libusbx package. Original commit msg from patch is:
+Original commit msg from older libusb package:
 
 Add missing dependencies.
 
@@ -19,11 +18,11 @@ Signed-off-by: Alexander Aring <alex.aring@gmail.com>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libusb-1.0.pc.in b/libusb-1.0.pc.in
-index 7bc33c1..0c6fea7 100644
+index aa023b3..eded053 100644
 --- a/libusb-1.0.pc.in
 +++ b/libusb-1.0.pc.in
 @@ -6,6 +6,6 @@ includedir=@includedir@
- Name: libusbx-1.0
+ Name: libusb-1.0
  Description: C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace
  Version: @VERSION@
 -Libs: -L${libdir} -lusb-1.0
@@ -31,5 +30,5 @@ index 7bc33c1..0c6fea7 100644
  Libs.private: @LIBS@
  Cflags: -I${includedir}/libusb-1.0
 -- 
-1.9.1
+1.9.2
 
diff --git a/patches/libusb-1.0.18/series b/patches/libusb-1.0.18/series
new file mode 100644
index 0000000..ea8d389
--- /dev/null
+++ b/patches/libusb-1.0.18/series
@@ -0,0 +1 @@
+0001-libusb-needs-librt-and-libpthread.patch
diff --git a/patches/libusbx-1.0.18/series b/patches/libusbx-1.0.18/series
deleted file mode 100644
index 4284244..0000000
--- a/patches/libusbx-1.0.18/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-libusbx-libusb-needs-librt-and-libpthread.patch
diff --git a/rules/libusb.make b/rules/libusb.make
index addc4d8..0699cc1 100644
--- a/rules/libusb.make
+++ b/rules/libusb.make
@@ -17,10 +17,10 @@ PACKAGES-$(PTXCONF_LIBUSB) += libusb
 # Paths and names
 #
 LIBUSB_VERSION	:= 1.0.18
-LIBUSB_MD5	:= f2ccd0589dde901dfd5607459f77bf44
-LIBUSB		:= libusbx-$(LIBUSB_VERSION)
+LIBUSB_MD5	:= 4a6d049923efc6496f1d383054dac1a6
+LIBUSB		:= libusb-$(LIBUSB_VERSION)
 LIBUSB_SUFFIX	:= tar.bz2
-LIBUSB_URL	:= $(call ptx/mirror, SF, libusbx/$(LIBUSB).$(LIBUSB_SUFFIX))
+LIBUSB_URL	:= $(call ptx/mirror, SF, libusb/$(LIBUSB).$(LIBUSB_SUFFIX))
 LIBUSB_SOURCE	:= $(SRCDIR)/$(LIBUSB).$(LIBUSB_SUFFIX)
 LIBUSB_DIR	:= $(BUILDDIR)/$(LIBUSB)
 LIBUSB_LICENSE	:= LGPLv2.1
-- 
1.9.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version
  2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb Alexander Aring
@ 2014-04-15  9:36 ` Alexander Aring
  2014-04-17  7:38   ` Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 3/4] configure.ac: check for python2 binary as well Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 4/4] configure.ac: use Python instead python everywhere Alexander Aring
  3 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2014-04-15  9:36 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 configure.ac | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 2a97944..ce4e539 100644
--- a/configure.ac
+++ b/configure.ac
@@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
 	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
 	AC_SUBST(PYTHON)
     ])
+
+dnl
+dnl Check for Python 2.x
+dnl
+AC_MSG_CHECKING([check for Python major version])
+PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null`
+case "$PYTHON_MAJOR_VERSION" in
+2) ;;
+*)   AC_MSG_ERROR([we need Python version 2.x but found $PYTHON_MAJOR_VERSION.x]) ;;
+esac
+AC_MSG_RESULT([$PYTHON_MAJOR_VERSION])
+
 dnl
 dnl We need the Python distutils
 dnl
-- 
1.9.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v3 3/4] configure.ac: check for python2 binary as well
  2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Alexander Aring
@ 2014-04-15  9:36 ` Alexander Aring
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 4/4] configure.ac: use Python instead python everywhere Alexander Aring
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-04-15  9:36 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ce4e539..4170462 100644
--- a/configure.ac
+++ b/configure.ac
@@ -301,7 +301,7 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
 	AC_SUBST(PYTHON)
 	AC_MSG_NOTICE([Using python executable $PYTHON])
     ],[
-	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
+	AC_PATH_PROGS(PYTHON, python2 python2.7 python2.6 python)
 	AC_SUBST(PYTHON)
     ])
 
-- 
1.9.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v3 4/4] configure.ac: use Python instead python everywhere
  2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
                   ` (2 preceding siblings ...)
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 3/4] configure.ac: check for python2 binary as well Alexander Aring
@ 2014-04-15  9:36 ` Alexander Aring
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-04-15  9:36 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 configure.ac | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4170462..d0ad7fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,13 +293,13 @@ dnl Check for gcc
 AC_PATH_PROGS(GCC, gcc,, $PATH)
 
 dnl
-dnl Checks for python, needed for ipkg-utils
+dnl Checks for Python, needed for ipkg-utils
 dnl
-AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executable to use]),
+AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the Python executable to use]),
     [
 	PYTHON="$withval"
 	AC_SUBST(PYTHON)
-	AC_MSG_NOTICE([Using python executable $PYTHON])
+	AC_MSG_NOTICE([Using Python executable $PYTHON])
     ],[
 	AC_PATH_PROGS(PYTHON, python2 python2.7 python2.6 python)
 	AC_SUBST(PYTHON)
@@ -327,13 +327,13 @@ else
 	AC_MSG_ERROR(Please install the Python distutils package)
 fi
 
-AC_MSG_CHECKING(whether python development files are present)
+AC_MSG_CHECKING(whether Python development files are present)
 PYTHON_MAKEFILE=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_makefile_filename()" 2> /dev/null`
 if test -e "$PYTHON_MAKEFILE"; then
 	AC_MSG_RESULT(yes)
 else
 	AC_MSG_RESULT(no)
-	AC_MSG_ERROR([some python development files could not be found, you are
+	AC_MSG_ERROR([some Python development files could not be found, you are
 		      likely using suse or redhat system as host. In this case
 		      please install the python-devel packages])
 fi
-- 
1.9.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version
  2014-04-15  9:36 ` [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Alexander Aring
@ 2014-04-17  7:38   ` Alexander Aring
  2014-04-19 14:15     ` Michael Olbrich
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2014-04-17  7:38 UTC (permalink / raw)
  To: ptxdist

Hi,

On Tue, Apr 15, 2014 at 11:36:53AM +0200, Alexander Aring wrote:
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>  configure.ac | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 2a97944..ce4e539 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
>  	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
>  	AC_SUBST(PYTHON)
>      ])
> +
> +dnl
> +dnl Check for Python 2.x
> +dnl
> +AC_MSG_CHECKING([check for Python major version])
> +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null`

I think a $PYTHON -c "import sys; print(sys.version_info.major) is
better here instead of the array access. I wait for Michaels opinion for
the rest of the patches in this series. If all seems fine I will resend a v4.

- Alex


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version
  2014-04-17  7:38   ` Alexander Aring
@ 2014-04-19 14:15     ` Michael Olbrich
  2014-04-19 16:29       ` Alexander Aring
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olbrich @ 2014-04-19 14:15 UTC (permalink / raw)
  To: ptxdist

On Thu, Apr 17, 2014 at 09:38:36AM +0200, Alexander Aring wrote:
> Hi,
> 
> On Tue, Apr 15, 2014 at 11:36:53AM +0200, Alexander Aring wrote:
> > Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> > ---
> >  configure.ac | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 2a97944..ce4e539 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
> >  	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
> >  	AC_SUBST(PYTHON)
> >      ])
> > +
> > +dnl
> > +dnl Check for Python 2.x
> > +dnl
> > +AC_MSG_CHECKING([check for Python major version])
> > +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null`
> 
> I think a $PYTHON -c "import sys; print(sys.version_info.major) is

$ python2.6 -c "import sys; print(sys.version_info.major)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'major'

> better here instead of the array access. I wait for Michaels opinion for
> the rest of the patches in this series. If all seems fine I will resend a v4.

Maybe parsing "$PYTHON --version" is a better idea?

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version
  2014-04-19 14:15     ` Michael Olbrich
@ 2014-04-19 16:29       ` Alexander Aring
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-04-19 16:29 UTC (permalink / raw)
  To: ptxdist

Hi,

On Sat, Apr 19, 2014 at 04:15:21PM +0200, Michael Olbrich wrote:
> On Thu, Apr 17, 2014 at 09:38:36AM +0200, Alexander Aring wrote:
> > Hi,
> > 
> > On Tue, Apr 15, 2014 at 11:36:53AM +0200, Alexander Aring wrote:
> > > Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> > > ---
> > >  configure.ac | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/configure.ac b/configure.ac
> > > index 2a97944..ce4e539 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
> > >  	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
> > >  	AC_SUBST(PYTHON)
> > >      ])
> > > +
> > > +dnl
> > > +dnl Check for Python 2.x
> > > +dnl
> > > +AC_MSG_CHECKING([check for Python major version])
> > > +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null`
> > 
> > I think a $PYTHON -c "import sys; print(sys.version_info.major) is
> 
> $ python2.6 -c "import sys; print(sys.version_info.major)"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> AttributeError: 'tuple' object has no attribute 'major'
> 
grml :(

> > better here instead of the array access. I wait for Michaels opinion for
> > the rest of the patches in this series. If all seems fine I will resend a v4.
> 
> Maybe parsing "$PYTHON --version" is a better idea?
> 
Yea, I will falling back on the sed solution, which was my first
solution to check on the python version. Need to redirect stderr to
stdout for this because the version is printed out on stderr.

Thanks for you opinion and test with python 2.6.

- Alex

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2014-04-19 16:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Alexander Aring
2014-04-17  7:38   ` Alexander Aring
2014-04-19 14:15     ` Michael Olbrich
2014-04-19 16:29       ` Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 3/4] configure.ac: check for python2 binary as well Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 4/4] configure.ac: use Python instead python everywhere Alexander Aring

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