Compare commits

...

23 Commits

Author SHA1 Message Date
Alessandro Astone 5089d76d4c debian: Add python3-setuptools build-dep 2025-03-20 19:48:57 +01:00
Alessandro Astone dfc0c32cea debian: Treat as a native package 2025-03-20 19:33:44 +01:00
Alessandro Astone b06f2f00c2 debian: Upver to 1.1.2 2023-09-16 20:07:51 +02:00
Alessandro Astone f92bc6c522 Merge tag '1.1.2' into bullseye 2023-09-16 20:06:39 +02:00
Erfan Abdi a2c5093c73
Merge pull request #15 from aleasto/main
Fix returning a transaction error and Cython3
2023-09-16 21:28:25 +03:30
Alessandro Astone 21317b0537 Version bump: 1.1.2 2023-09-16 19:14:46 +02:00
Alessandro Astone 1ad1fef0c0 Fix returning a transaction error 2023-09-16 19:14:46 +02:00
Alessandro Astone 4d8cb8f56d Explicit noexcept
Fixes the build with Cython 3
2023-09-16 19:14:41 +02:00
cyan 990c3007ee CI: add support for ubuntu mantic 2023-06-10 00:39:26 +02:00
Alessandro Astone 8469102e91 CI: Add ubuntu lunar 2023-02-10 23:09:34 +01:00
Alessandro Astone 398a4a3c61 debian: Add changelog 2023-01-21 12:46:19 +01:00
Jami Kettunen 23dbd4743a debian: Depend on libgbinder (>= 1.1.20)
Older libgbinder is no longer supported due to e.g. the following seen
under Ubuntu Touch 16.04 from "import gbinder":

  ImportError: /usr/lib/python3/dist-packages/gbinder.cpython-35m-aarch64-linux-gnu.so: undefined symbol: gbinder_servicemanager_new2
2023-01-21 12:46:01 +01:00
Alessandro Astone 423dc36656 Version bump: 1.1.1 2022-08-29 12:57:50 +02:00
Alessandro Astone 22652172e2 Handle empty service list 2022-08-29 12:57:50 +02:00
Alessandro Astone 8e87e5f5ae Version bump: 1.1.1 2022-08-29 15:19:19 +04:30
Alessandro Astone fc82bf10f4 Handle empty service list 2022-08-29 15:19:19 +04:30
Alessandro Astone f8e413c9b2
CI: Restore versioned debian 2022-08-25 11:34:05 +02:00
cyan 53ef4f6809 CI: add support for rolling releases 2022-08-17 21:53:45 +02:00
cyan da16278f0d ci: update to jammy 2022-07-13 21:58:46 +04:30
Erfan Abdi 29a8faaa4f
Merge branch 'main' into bullseye 2022-07-06 21:04:58 +04:30
Erfan Abdi cd7620aa0d
ci: Add .abstruse.yml 2021-09-12 16:08:34 +04:30
Erfan Abdi 88566f61e6
debian: Downver debhelper 2021-09-05 11:56:44 +04:30
Eugenio Paolantonio (g7) 6538376c06 [packaging] Added initial packaging
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
2021-08-29 01:07:40 +02:00
9 changed files with 142 additions and 13 deletions

25
.abstruse.yml Normal file
View File

@ -0,0 +1,25 @@
image: mrcyjanek/waydroid:ubuntu-devel
matrix:
- env: DISTRO=ubuntu-devel
image: mrcyjanek/waydroid:ubuntu-devel
- env: DISTRO=sid
image: mrcyjanek/waydroid:sid
- env: DISTRO=bookworm
image: mrcyjanek/waydroid:bookworm
- env: DISTRO=bullseye
image: mrcyjanek/waydroid:bullseye
- env: DISTRO=lunar
image: mrcyjanek/waydroid:lunar
- env: DISTRO=jammy
image: mrcyjanek/waydroid:jammy
- env: DISTRO=focal
image: mrcyjanek/waydroid:focal
- env: DISTRO=mantic
image: mrcyjanek/waydroid:mantic
script:
- apt update
- build_changelog
- mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends"
- debuild -b -uc -us
- mkdir -p /apt/$DISTRO/ || true
- mv ../*.deb /apt/$DISTRO/

12
debian/changelog vendored Normal file
View File

@ -0,0 +1,12 @@
gbinder-python (1.1.2) bullseye; urgency=medium
* Explicit noexcept
* Fix returning a transaction error
-- Alessandro Astone <ales.astone@gmail.com> Wed, 16 Sep 2023 18:07:00 +0000
gbinder-python (1.1.1) bullseye; urgency=medium
* Initial versioned changelog
-- Alessandro Astone <ales.astone@gmail.com> Sat, 21 Jan 2023 11:35:09 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
13

27
debian/control vendored Normal file
View File

@ -0,0 +1,27 @@
Source: gbinder-python
Maintainer: Eugenio Paolantonio (g7) <me@medesimo.eu>
Section: python
Priority: optional
Build-Depends: debhelper (>= 9),
dh-python,
python3-all-dev (>= 3.2),
python3-setuptools,
cython3,
libgbinder-dev (>= 1.1.20),
libglibutil-dev,
libglib2.0-dev,
pkgconf,
Standards-Version: 4.5.0.3
Vcs-Browser: https://github.com/droidian/gbinder-python
Vcs-Git: https://github.com/droidian/gbinder-python.git
Package: python3-gbinder
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
${python3:Depends},
python3,
libgbinder (>= 1.1.20),
Description: Cython extension module for C++ gbinder functions
This package contains a cython extension module for gbinder,
allowing to call gbinder from Python scripts.

50
debian/copyright vendored Normal file
View File

@ -0,0 +1,50 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gbinder-python
Source: https://github.com/erfanoabdi/gbinder-python
Files: *
Copyright: 2021 Erfan Abdi <erfangplus@gmail.com>
2021 NotKit <nekit1000@gmail.com>
License: GPL-3+
Files: debian/*
Copyright: 2020 Eugenio Paolantonio (g7) <me@medesimo.eu>
License: BSD-3-clause
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7
debian/rules vendored Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PYBUILD_BUILD_ARGS_python3=--cython
%:
dh $@ --with python3 --buildsystem=pybuild

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)

View File

@ -65,7 +65,7 @@ cdef class RemoteObject:
if self._object is not NULL: if self._object is not NULL:
cgbinder.gbinder_remote_object_remove_handler(self._object, id) cgbinder.gbinder_remote_object_remove_handler(self._object, id)
cdef void remote_object_local_notify_func(cgbinder.GBinderRemoteObject* obj, void* user_data) with gil: cdef void remote_object_local_notify_func(cgbinder.GBinderRemoteObject* obj, void* user_data) noexcept with gil:
(<object>user_data).notify_func_callback() (<object>user_data).notify_func_callback()
cdef class RemoteReply: cdef class RemoteReply:
@ -202,12 +202,12 @@ cdef class Client:
def cancel(self, unsigned long id): def cancel(self, unsigned long id):
return cgbinder.gbinder_client_cancel(self._client, id) return cgbinder.gbinder_client_cancel(self._client, id)
cdef void client_reply_func(cgbinder.GBinderClient* client, cgbinder.GBinderRemoteReply* c_reply, int status, void* user_data) with gil: cdef void client_reply_func(cgbinder.GBinderClient* client, cgbinder.GBinderRemoteReply* c_reply, int status, void* user_data) noexcept with gil:
reply = RemoteReply() reply = RemoteReply()
reply.set_c_reply(c_reply) reply.set_c_reply(c_reply)
(<object>user_data).reply_func_callback(reply, status) (<object>user_data).reply_func_callback(reply, status)
cdef void local_destroy_notif(void* user_data) with gil: cdef void local_destroy_notif(void* user_data) noexcept with gil:
(<object>user_data).destroy_notif_callback() (<object>user_data).destroy_notif_callback()
cdef class LocalRequest: cdef class LocalRequest:
@ -514,12 +514,14 @@ cdef class LocalObject:
reply.set_c_reply(c_reply) reply.set_c_reply(c_reply)
return reply return reply
cdef cgbinder.GBinderLocalReply* local_transact_callback(cgbinder.GBinderLocalObject* obj, cgbinder.GBinderRemoteRequest* c_req, unsigned int code, unsigned int flags, int* status, void* user_data) with gil: cdef cgbinder.GBinderLocalReply* local_transact_callback(cgbinder.GBinderLocalObject* obj, cgbinder.GBinderRemoteRequest* c_req, unsigned int code, unsigned int flags, int* status, void* user_data) noexcept with gil:
req = RemoteRequest() req = RemoteRequest()
req.set_c_req(c_req) req.set_c_req(c_req)
reply, status_ret = (<object>user_data).callback(req, code, flags) reply, status_ret = (<object>user_data).callback(req, code, flags)
cdef int stat = status_ret cdef int stat = status_ret
status = &stat status[0] = stat
if reply is None or status_ret < 0:
return NULL
return (<LocalReply>reply)._reply return (<LocalReply>reply)._reply
cdef class ServiceManager: cdef class ServiceManager:
@ -583,8 +585,10 @@ cdef class ServiceManager:
return None return None
cdef char** services = cgbinder.gbinder_servicemanager_list_sync(self._sm) cdef char** services = cgbinder.gbinder_servicemanager_list_sync(self._sm)
services_list = [] services_list = []
i = 0 if services == NULL:
return services_list
i = 0
while services[i] != NULL: while services[i] != NULL:
services_list.append(services[i].decode()) services_list.append(services[i].decode())
i += 1 i += 1
@ -667,27 +671,29 @@ cdef class ServiceManager:
else: else:
free(ids) free(ids)
cdef void service_manager_get_service_func(cgbinder.GBinderServiceManager* sm, cgbinder.GBinderRemoteObject* c_object, int status, void* user_data) with gil: cdef void service_manager_get_service_func(cgbinder.GBinderServiceManager* sm, cgbinder.GBinderRemoteObject* c_object, int status, void* user_data) noexcept with gil:
remote = RemoteObject() remote = RemoteObject()
remote.set_c_object(c_object) remote.set_c_object(c_object)
(<object>user_data).get_service_func_callback(remote, status) (<object>user_data).get_service_func_callback(remote, status)
cdef bint service_manager_list_func(cgbinder.GBinderServiceManager* sm, char** services, void* user_data) with gil: cdef bint service_manager_list_func(cgbinder.GBinderServiceManager* sm, char** services, void* user_data) noexcept with gil:
services_list = [] services_list = []
i = 0 if services == NULL:
return services_list
i = 0
while services[i] != NULL: while services[i] != NULL:
services_list.append(services[i].decode()) services_list.append(services[i].decode())
i += 1 i += 1
return (<object>user_data).list_func_callback(services_list) return (<object>user_data).list_func_callback(services_list)
cdef void service_manager_add_service_func(cgbinder.GBinderServiceManager* sm, int status, void* user_data) with gil: cdef void service_manager_add_service_func(cgbinder.GBinderServiceManager* sm, int status, void* user_data) noexcept with gil:
(<object>user_data).add_service_func_callback(status) (<object>user_data).add_service_func_callback(status)
cdef void service_manager_func(cgbinder.GBinderServiceManager* sm, void* user_data) with gil: cdef void service_manager_func(cgbinder.GBinderServiceManager* sm, void* user_data) noexcept with gil:
(<object>user_data).func_callback() (<object>user_data).func_callback()
cdef void service_manager_registration_func(cgbinder.GBinderServiceManager* sm, const char* name, void* user_data) with gil: cdef void service_manager_registration_func(cgbinder.GBinderServiceManager* sm, const char* name, void* user_data) noexcept with gil:
(<object>user_data).registration_func_callback(name) (<object>user_data).registration_func_callback(name)
cdef class Buffer: cdef class Buffer:

View File

@ -31,7 +31,7 @@ if USE_CYTHON:
setup( setup(
name="gbinder-python", name="gbinder-python",
description="""Cython extension module for C++ gbinder functions""", description="""Cython extension module for C++ gbinder functions""",
version="1.0.0", version="1.1.2",
author="Erfan Abdi", author="Erfan Abdi",
author_email="erfangplus@gmail.com", author_email="erfangplus@gmail.com",
url="https://github.com/erfanoabdi/gbinder-python", url="https://github.com/erfanoabdi/gbinder-python",