~alpine/aports

1

[alpine-aports] [PATCH] main/py-dbus: update to include a python3 version

Luca Weiss
Details
Message ID
<20170923191505.9868-1-luca@z3ntu.xyz>
Sender timestamp
1506194105
DKIM signature
missing
Download raw message
Patch: +50 -17
python2 -c "import dbus"
python3 -c "import dbus"
both work
---
 main/py-dbus/APKBUILD | 67 ++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 50 insertions(+), 17 deletions(-)

diff --git a/main/py-dbus/APKBUILD b/main/py-dbus/APKBUILD
index 5b507c7ca6..762dda689f 100644
--- a/main/py-dbus/APKBUILD
+++ b/main/py-dbus/APKBUILD
@@ -1,37 +1,70 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=py-dbus
 pkgver=1.2.0
-pkgrel=2
+pkgrel=0
 pkgdesc="Python bindings for DBUS"
 url="http://www.freedesktop.org/wiki/Software/DBusBindings"
 arch="all"
 license="GPL LGPL"
-depends="python2"
-depends_dev="py-dbus"
-makedepends="dbus-glib-dev python2-dev"
-subpackages="$pkgname-dev $pkgname-doc"
+depends=""
+#depends_dev="py-dbus"
+makedepends="dbus-glib-dev python2-dev python3-dev"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc $pkgname-dev"
 source="http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$pkgver.tar.gz"
 
 _builddir="$srcdir"/dbus-python-$pkgver
 
 prepare() {
-	cd "$_builddir"
-	update_config_sub || return 1
+	local python; for python in python2 python3; do
+		cp -r "$_builddir" "$_builddir-$python"
+		cd "$_builddir-$python"
+		update_config_sub
+	done
 }
-build() {
-	cd "$_builddir"
-	./configure \
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	replaces="$pkgname"
+	_py python2
+}
+
+_py3() {
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	#install_if="$pkgname-$pkgver-r$pkgrel $python"
+	cd "$_builddir-$python"
+	PYTHON=$python ./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
-		--prefix=/usr \
-		|| return 1
-	make || return 1
-	make test || return 1
+		--prefix=/usr
+	make
+	make test
+	make DESTDIR="$subpkgdir" install
+	rm -rf "$pkgdir"/docpkg "$pkgdir"/devpkg
+	mkdir -p "$pkgdir"/docpkg "$pkgdir"/devpkg
+	mv "$subpkgdir"/usr/share/doc "$pkgdir"/docpkg
+	mv "$subpkgdir"/usr/lib/pkgconfig "$pkgdir"/devpkg
+	mv "$subpkgdir"/usr/include "$pkgdir"/devpkg
+	rmdir "$subpkgdir"/usr/share
 }
 
-package() {
-	cd "$_builddir"
-	make DESTDIR="$pkgdir" install || return 1
+doc() {
+	mkdir -p "$subpkgdir"/usr/share/
+	mv "$pkgdir"/docpkg/doc "$subpkgdir"/usr/share/doc
+}
+
+dev() {
+	mkdir -p "$subpkgdir"/usr/lib
+	mv "$pkgdir"/devpkg/pkgconfig "$subpkgdir"/usr/lib/
+	mv "$pkgdir"/devpkg/include "$subpkgdir"/usr/
 }
 
 md5sums="b09cd2d1a057cc432ce944de3fc06bf7  dbus-python-1.2.0.tar.gz"
-- 
2.14.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Leonardo Arena
Details
Message ID
<11120628-0cec-a727-eb1a-f30797006940@gmail.com>
In-Reply-To
<20170923191505.9868-1-luca@z3ntu.xyz> (view parent)
Sender timestamp
1509548945
DKIM signature
missing
Download raw message
Hi,


On 09/23/2017 09:15 PM, Luca Weiss wrote:
> python2 -c "import dbus"
> python3 -c "import dbus"
> both work
> ---
>   main/py-dbus/APKBUILD | 67 ++++++++++++++++++++++++++++++++++++++-------------
>   1 file changed, 50 insertions(+), 17 deletions(-)
>
> diff --git a/main/py-dbus/APKBUILD b/main/py-dbus/APKBUILD
> index 5b507c7ca6..762dda689f 100644
> --- a/main/py-dbus/APKBUILD
> +++ b/main/py-dbus/APKBUILD
> @@ -1,37 +1,70 @@
>   # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
>   pkgname=py-dbus
>   pkgver=1.2.0
> -pkgrel=2
> +pkgrel=0
this should be bumped to "3".
>   pkgdesc="Python bindings for DBUS"
>   url="http://www.freedesktop.org/wiki/Software/DBusBindings"
>   arch="all"
>   license="GPL LGPL"
> -depends="python2"
> -depends_dev="py-dbus"
> -makedepends="dbus-glib-dev python2-dev"
> -subpackages="$pkgname-dev $pkgname-doc"
> +depends=""
> +#depends_dev="py-dbus"
> +makedepends="dbus-glib-dev python2-dev python3-dev"
> +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc $pkgname-dev"
>   source="http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$pkgver.tar.gz"
>   
>   _builddir="$srcdir"/dbus-python-$pkgver
Perhaps while there you can strip the "_" suffix. It's now an official 
APKBUILD variable.
>   
>   prepare() {
> -	cd "$_builddir"
> -	update_config_sub || return 1
> +	local python; for python in python2 python3; do
> +		cp -r "$_builddir" "$_builddir-$python"
> +		cd "$_builddir-$python"
> +		update_config_sub
> +	done
>   }
> -build() {
> -	cd "$_builddir"
> -	./configure \
> +
> +package() {
> +	mkdir -p "$pkgdir"
> +}
> +
> +_py2() {
> +	replaces="$pkgname"
> +	_py python2
> +}
> +
> +_py3() {
> +	_py python3
> +}
> +
> +_py() {
> +	local python="$1"
> +	pkgdesc="$pkgdesc (for $python)"
> +	depends="$depends $python"
> +	#install_if="$pkgname-$pkgver-r$pkgrel $python"
> +	cd "$_builddir-$python"
> +	PYTHON=$python ./configure \
>   		--build=$CBUILD \
>   		--host=$CHOST \
> -		--prefix=/usr \
> -		|| return 1
> -	make || return 1
> -	make test || return 1
> +		--prefix=/usr
Now abuild requires "test" to be separated in the "check()" function.
> +	make
> +	make test
Same here.
> +	make DESTDIR="$subpkgdir" install
> +	rm -rf "$pkgdir"/docpkg "$pkgdir"/devpkg
> +	mkdir -p "$pkgdir"/docpkg "$pkgdir"/devpkg
> +	mv "$subpkgdir"/usr/share/doc "$pkgdir"/docpkg
> +	mv "$subpkgdir"/usr/lib/pkgconfig "$pkgdir"/devpkg
> +	mv "$subpkgdir"/usr/include "$pkgdir"/devpkg
> +	rmdir "$subpkgdir"/usr/share
>   }
>   
> -package() {
> -	cd "$_builddir"
> -	make DESTDIR="$pkgdir" install || return 1
> +doc() {
> +	mkdir -p "$subpkgdir"/usr/share/
> +	mv "$pkgdir"/docpkg/doc "$subpkgdir"/usr/share/doc
> +}
> +
> +dev() {
> +	mkdir -p "$subpkgdir"/usr/lib
> +	mv "$pkgdir"/devpkg/pkgconfig "$subpkgdir"/usr/lib/
> +	mv "$pkgdir"/devpkg/include "$subpkgdir"/usr/
>   }
>   
>   md5sums="b09cd2d1a057cc432ce944de3fc06bf7  dbus-python-1.2.0.tar.gz"
Thanks!

/eo


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---