mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-02 10:52:57 +02:00
libsearpc: switch to python3, subpkg libsearpc-python3
This commit is contained in:
parent
08dbfd97a4
commit
a843b89f87
3 changed files with 97 additions and 4 deletions
1
srcpkgs/libsearpc-python3
Symbolic link
1
srcpkgs/libsearpc-python3
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
libsearpc
|
81
srcpkgs/libsearpc/patches/python3.patch
Normal file
81
srcpkgs/libsearpc/patches/python3.patch
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
--- pysearpc/client.py.orig 2018-08-21 03:42:02.000000000 +0200
|
||||||
|
+++ pysearpc/client.py 2018-10-03 18:10:31.097876808 +0200
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
import json
|
||||||
|
-from common import SearpcError
|
||||||
|
+from .common import SearpcError
|
||||||
|
|
||||||
|
def _fret_int(ret_str):
|
||||||
|
try:
|
||||||
|
@@ -7,10 +7,10 @@
|
||||||
|
except:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
|
||||||
|
- if dicts.has_key('err_code'):
|
||||||
|
+ if 'err_code' in dicts:
|
||||||
|
raise SearpcError(dicts['err_msg'])
|
||||||
|
|
||||||
|
- if dicts.has_key('ret'):
|
||||||
|
+ if 'ret' in dicts:
|
||||||
|
return dicts['ret']
|
||||||
|
else:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
@@ -21,10 +21,10 @@
|
||||||
|
except:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
|
||||||
|
- if dicts.has_key('err_code'):
|
||||||
|
+ if 'err_code' in dicts:
|
||||||
|
raise SearpcError(dicts['err_msg'])
|
||||||
|
|
||||||
|
- if dicts.has_key('ret'):
|
||||||
|
+ if 'ret' in dicts:
|
||||||
|
return dicts['ret']
|
||||||
|
else:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
@@ -61,7 +61,7 @@
|
||||||
|
except:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
|
||||||
|
- if dicts.has_key('err_code'):
|
||||||
|
+ if 'err_code' in dicts:
|
||||||
|
raise SearpcError(dicts['err_msg'])
|
||||||
|
|
||||||
|
if dicts['ret']:
|
||||||
|
@@ -75,7 +75,7 @@
|
||||||
|
except:
|
||||||
|
raise SearpcError('Invalid response format')
|
||||||
|
|
||||||
|
- if dicts.has_key('err_code'):
|
||||||
|
+ if 'err_code' in dicts:
|
||||||
|
raise SearpcError(dicts['err_msg'])
|
||||||
|
|
||||||
|
l = []
|
||||||
|
--- pysearpc/server.py.orig 2018-08-21 03:42:02.000000000 +0200
|
||||||
|
+++ pysearpc/server.py 2018-10-03 18:10:31.097876808 +0200
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
-from common import SearpcError
|
||||||
|
+from .common import SearpcError
|
||||||
|
|
||||||
|
class SearpcService(object):
|
||||||
|
def __init__(self, name):
|
||||||
|
@@ -25,7 +25,7 @@
|
||||||
|
"""input str -> output str"""
|
||||||
|
try:
|
||||||
|
argv = json.loads(fcallstr)
|
||||||
|
- except Exception, e:
|
||||||
|
+ except Exception as e:
|
||||||
|
raise SearpcError('bad call str: ' + str(e))
|
||||||
|
|
||||||
|
service = self.services[svcname]
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
def call_function(self, svcname, fcallstr):
|
||||||
|
try:
|
||||||
|
retVal = self._call_function(svcname, fcallstr)
|
||||||
|
- except Exception, e:
|
||||||
|
+ except Exception as e:
|
||||||
|
ret = {'err_code': 555, 'err_msg': str(e)}
|
||||||
|
else:
|
||||||
|
ret = {'ret': retVal}
|
|
@ -1,11 +1,11 @@
|
||||||
# Template file for 'libsearpc'
|
# Template file for 'libsearpc'
|
||||||
pkgname=libsearpc
|
pkgname=libsearpc
|
||||||
version=3.1.0
|
version=3.1.0
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
pycompile_module="pysearpc"
|
pycompile_module="pysearpc"
|
||||||
configure_args="--disable-static --disable-compile-demo"
|
configure_args="PYTHON=python3 --disable-static --disable-compile-demo"
|
||||||
hostmakedepends="automake libtool pkg-config python"
|
hostmakedepends="automake libtool pkg-config python3 glib-devel"
|
||||||
makedepends="libglib-devel jansson-devel"
|
makedepends="libglib-devel jansson-devel"
|
||||||
short_desc="Seafile RPC library"
|
short_desc="Seafile RPC library"
|
||||||
maintainer="yopito <pierre.bourgin@free.fr>"
|
maintainer="yopito <pierre.bourgin@free.fr>"
|
||||||
|
@ -35,7 +35,8 @@ libsearpc-devel_package() {
|
||||||
|
|
||||||
libsearpc-codegen_package() {
|
libsearpc-codegen_package() {
|
||||||
short_desc+=" - code generator"
|
short_desc+=" - code generator"
|
||||||
depends="python"
|
depends="python3"
|
||||||
|
python_version=3
|
||||||
noarch=yes
|
noarch=yes
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
vdoc AUTHORS
|
vdoc AUTHORS
|
||||||
|
@ -43,3 +44,13 @@ libsearpc-codegen_package() {
|
||||||
vmove usr/bin/searpc-codegen.py
|
vmove usr/bin/searpc-codegen.py
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libsearpc-python3_package() {
|
||||||
|
short_desc+=" - Python3 bindings"
|
||||||
|
pycompile_module="pysearpc"
|
||||||
|
depends="python3"
|
||||||
|
noarch=yes
|
||||||
|
pkg_install() {
|
||||||
|
vmove usr/lib/python3*
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue