Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
python-websocket-client-git PKGBUILD patches
From f2b4cac45f777dcdcc4a83eff8a7cfe0e597e20d Mon Sep 17 00:00:00 2001
From: Alexei Colin <ac@alexeicolin.com>
Date: Tue, 19 Feb 2019 21:39:29 -0500
Subject: [PATCH 1/3] pkgver: add tagged version
new format: 0.54.0.r8.g9a146e3
---
PKGBUILD | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index 06bd507..ae64843 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
pkgname=('python-websocket-client-git')
_srcname='websocket-client'
-pkgver='r1'
-pkgrel='1'
+pkgver=0.54.0
+pkgrel=1
pkgdesc='Websocket client for python'
arch=('any')
url="https://github.com/liris/${_srcname}"
@@ -18,10 +18,7 @@ sha512sums=('SKIP')
pkgver() {
cd "${srcdir}/${_srcname}"
- printf 'r%s.%s.%s\n' \
- "$( git rev-list --count 'HEAD' )" \
- "$( git log --max-count='1' --pretty='format:%ct' )" \
- "$( git rev-parse --short 'HEAD' )"
+ echo $(git describe --tags --long | sed 's/^v//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
}
package() {
--
2.20.1
From ad7d68542a588695cf0097c2c8e3a323cba43449 Mon Sep 17 00:00:00 2001
From: Alexei Colin <ac@alexeicolin.com>
Date: Tue, 19 Feb 2019 21:40:09 -0500
Subject: [PATCH 2/3] build python3 and python2 packages
---
PKGBUILD | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index ae64843..9b60f77 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,4 @@
-pkgname=('python-websocket-client-git')
+pkgname=('python-websocket-client-git' 'python2-websocket-client-git')
_srcname='websocket-client'
pkgver=0.54.0
pkgrel=1
@@ -9,8 +9,6 @@ license=('GPL2')
depends=('python-six')
makedepends=('git' 'python-setuptools')
-provides=("${pkgname[0]%-git}")
-conflicts=("${pkgname[0]%-git}")
source=("${_srcname}::git+${url}.git")
sha512sums=('SKIP')
@@ -21,8 +19,28 @@ pkgver() {
echo $(git describe --tags --long | sed 's/^v//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
}
-package() {
+prepare() {
+ cd "${srcdir}/${_srcname}"
+
+ cp -r "${srcdir}/${_srcname}" "${srcdir}/${_srcname}-py2"
+}
+
+package_python-websocket-client-git() {
+ provides=("${pkgname%-git}")
+ conflicts=("${pkgname%-git}")
+
cd "${srcdir}/${_srcname}"
python setup.py install --root="${pkgdir}" --optimize=1
+ mv ${pkgdir}/usr/bin/wsdump{,3}.py
+}
+
+package_python2-websocket-client-git() {
+ provides=("${pkgname%-git}")
+ conflicts=("${pkgname%-git}")
+
+ cd "${srcdir}/${_srcname}-py2"
+
+ python2 setup.py install --root="${pkgdir}" --optimize=1
+ mv ${pkgdir}/usr/bin/wsdump{,2}.py
}
--
2.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.