Skip to content

Commit

Permalink
New package: python3-libdecsync-2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Ehret committed Sep 13, 2022
1 parent 9134136 commit 3f5404c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
@@ -0,0 +1,64 @@
From 5a2024669f4cc03e79c2a5ae856edd635bd87b9e Mon Sep 17 00:00:00 2001
From: Alexis Ehret <git@08a.re>
Date: Tue, 13 Sep 2022 18:04:32 +0200
Subject: [PATCH 1/1] hardcode libpath for voidlinux

Signed-off-by: Alexis Ehret <git@08a.re>
---
libdecsync/__init__.py | 27 +--------------------------
setup.py | 1 -
2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/libdecsync/__init__.py b/libdecsync/__init__.py
index fa2d14d..484c6dc 100644
--- a/libdecsync/__init__.py
+++ b/libdecsync/__init__.py
@@ -29,32 +29,7 @@ import sys
class DecsyncException(Exception):
pass

-os_name = platform.system()
-machine_type = platform.machine()
-platform_bits = platform.architecture()[0]
-if os_name == "Linux":
- if machine_type == "x86_64":
- libpath = resource_filename(__name__, "libs/libdecsync_amd64.so")
- elif machine_type.startswith("arm") or machine_type.startswith("aarch"):
- if platform_bits == "64bit":
- libpath = resource_filename(__name__, "libs/libdecsync_arm64.so")
- else:
- libpath = resource_filename(__name__, "libs/libdecsync_arm32.so")
- else:
- raise Exception("libdecsync: Machine type '" + machine_type + "' not supported")
-elif os_name == "Windows":
- if platform_bits == "64bit":
- libpath = resource_filename(__name__, "libs/decsync_x64.dll")
- else:
- libpath = resource_filename(__name__, "libs/decsync_x86.dll")
-elif os_name == "Darwin":
- if machine_type == "x86_64":
- libpath = resource_filename(__name__, "libs/libdecsync_amd64.dylib")
- else:
- libpath = resource_filename(__name__, "libs/libdecsync_arm64.dylib")
-else:
- raise Exception("libdecsync: Operating system '" + os_name + "' not supported")
-
+libpath = "/usr/lib/libdecsync.so.0"
_libdecsync = CDLL(libpath)

def _errcheckDecsync(result, func, args):
diff --git a/setup.py b/setup.py
index a79755a..6853f70 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,6 @@ setup(
keywords=["decsync"],
license="LGPLv2+",
packages=["libdecsync"],
- package_data={"libdecsync":["libs/*"]},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux",
--
2.37.3

16 changes: 16 additions & 0 deletions srcpkgs/python3-libdecsync/template
@@ -0,0 +1,16 @@
# Template file for 'python3-libdecsync'
pkgname=python3-libdecsync
version=2.2.1
revision=1
archs="x86_64"
wrksrc="libdecsync-bindings-python3-${version}"
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3 libdecsync-${version}_${revision}"
checkdepends="${depends}"
short_desc="Python3 wrapper around libdecsync for synchronizing using DecSync"
maintainer="Alexis Ehret <dev@08a.re>"
license="LGPL-2.0"
homepage="https://github.com/39aldo39/libdecsync-bindings-python3"
distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
checksum=68e0452c128306981dc8e7aa58248cc57855a2de241326b37fbeb5469446d10e

0 comments on commit 3f5404c

Please sign in to comment.