From 07ee1bb32109dc3aa4b6c5ec1435012dc7b1365f Mon Sep 17 00:00:00 2001 From: newbluemoon Date: Sat, 16 Feb 2019 19:09:09 +0100 Subject: [PATCH] olm: update to 3.0.0 and split off the python bindings into a separate template --- common/shlibs | 2 +- srcpkgs/olm-python | 1 - srcpkgs/olm-python/template | 31 ++++++++++++++ srcpkgs/olm-python3 | 2 +- srcpkgs/olm/patches/python-find-olm.patch | 16 ------- srcpkgs/olm/template | 52 ++++------------------- 6 files changed, 41 insertions(+), 63 deletions(-) delete mode 120000 srcpkgs/olm-python create mode 100644 srcpkgs/olm-python/template delete mode 100644 srcpkgs/olm/patches/python-find-olm.patch diff --git a/common/shlibs b/common/shlibs index 37762e5be40..421778941a9 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3329,7 +3329,7 @@ libretro-gtk-0.14.so.0 retro-gtk-0.16.0_1 libmanette-0.2.so.0 libmanette-0.2.1_1 libfmt.so.5 fmt-5.2.1_1 libelementary-calendar.so.0 libio.elementary.calendar-4.2.3_1 -libolm.so.2 olm-2.3.0_1 +libolm.so.3 olm-3.0.0_1 libcrypto.so.44 libcrypto44-2.8.2_1 libtls.so.18 libtls18-2.8.2_1 libssl.so.46 libssl46-2.8.2_1 diff --git a/srcpkgs/olm-python b/srcpkgs/olm-python deleted file mode 120000 index 38ebca23ad7..00000000000 --- a/srcpkgs/olm-python +++ /dev/null @@ -1 +0,0 @@ -olm \ No newline at end of file diff --git a/srcpkgs/olm-python/template b/srcpkgs/olm-python/template new file mode 100644 index 00000000000..b081bbae205 --- /dev/null +++ b/srcpkgs/olm-python/template @@ -0,0 +1,31 @@ +# Template file for 'olm-python' +pkgname=olm-python +version=3.0.0 +revision=1 +wrksrc="olm-${version}" +build_wrksrc=python +build_style=python-module +pycompile_module="olm" +hostmakedepends="python-setuptools python3-setuptools python-cffi python3-cffi" +makedepends="python-devel python3-devel libffi-devel olm-devel" +depends="python-cffi python-future python-typing" +short_desc="Implementation of the Double Ratchet cryptographic ratchet (Python2)" +maintainer="Adam Beckmeyer " +license="Apache-2.0" +homepage="https://git.matrix.org/git/olm/about/" +distfiles="https://git.matrix.org/git/olm/snapshot/olm-${version}.tar.gz" +checksum=4c54f93e4f426a9d5c8e66e63113d42fd2afca240cdcff30a469a342a6ec3bc6 + +pre_build() { + make include/olm/olm.h +} + +olm-python3_package() { + short_desc="${short_desc/Python2/Python3}" + depends="${sourcepkg}>=${version}_${revision} python3-cffi + python3-future" + pycompile_module="olm" + pkg_install() { + vmove ${py3_sitelib} + } +} diff --git a/srcpkgs/olm-python3 b/srcpkgs/olm-python3 index 38ebca23ad7..6786365785c 120000 --- a/srcpkgs/olm-python3 +++ b/srcpkgs/olm-python3 @@ -1 +1 @@ -olm \ No newline at end of file +olm-python \ No newline at end of file diff --git a/srcpkgs/olm/patches/python-find-olm.patch b/srcpkgs/olm/patches/python-find-olm.patch deleted file mode 100644 index 257e9028c3f..00000000000 --- a/srcpkgs/olm/patches/python-find-olm.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- python/olm/_base.py -+++ python/olm/_base.py -@@ -1,11 +1,10 @@ - import os.path - - from ctypes import * -+from ctypes import util - - --lib = cdll.LoadLibrary(os.path.join( -- os.path.dirname(__file__), "..", "..", "build", "libolm.so.2") --) -+lib = cdll.LoadLibrary(util.find_library("olm")) - - lib.olm_error.argtypes = [] - lib.olm_error.restypes = c_size_t diff --git a/srcpkgs/olm/template b/srcpkgs/olm/template index d6eb3ce4607..9bb8e16c291 100644 --- a/srcpkgs/olm/template +++ b/srcpkgs/olm/template @@ -1,58 +1,22 @@ # Template file for 'olm' pkgname=olm -version=2.3.0 +version=3.0.0 revision=1 -build_style=gnu-makefile -make_check_target=test -hostmakedepends="python-devel python3-devel" -makedepends="python-devel python3-devel" -short_desc="An implementation of the Double Ratchet cryptographic ratchet" +build_style=cmake +configure_args="-DOLM_TESTS=OFF" +short_desc="Implementation of the Double Ratchet cryptographic ratchet" maintainer="Adam Beckmeyer " license="Apache-2.0" homepage="https://git.matrix.org/git/olm/about/" -distfiles="https://git.matrix.org/git/olm/snapshot/${pkgname}-${version}.tar.gz" -checksum=533714fb84860e04c185790d16ef9085f15e902c2105db941d5c7e92b0565ef8 - -post_configure() { - # -O0 prevents _FORTIFY_SOURCE working - for _f in $(find ${wrksrc} -name Makefile); do - sed -i $_f -e "s; -O0;;" - done -} - -do_install() { - make DESTDIR=${DESTDIR} PREFIX=/usr install - for pysl in $py2_sitelib $py3_sitelib; do - mkdir -p ${DESTDIR}${pysl} - cp -r ${wrksrc}/python/olm ${DESTDIR}${pysl} - done -} +distfiles="https://git.matrix.org/git/olm/snapshot/olm-${version}.tar.gz" +checksum=4c54f93e4f426a9d5c8e66e63113d42fd2afca240cdcff30a469a342a6ec3bc6 olm-devel_package() { depends="${sourcepkg}>=${version}_${revision}" short_desc+=" - development files" pkg_install() { vmove usr/include - vmove usr/lib/*.so - } -} - -olm-python_package() { - noarch=yes - short_desc+=" - python bindings" - depends="${sourcepkg}>=${version}_${revision} python" - pycompile_module=olm - pkg_install() { - vmove ${py2_sitelib} - } -} - -olm-python3_package() { - noarch=yes - short_desc+=" - python3 bindings" - depends="${sourcepkg}>=${version}_${revision} python3" - pycompile_module=olm - pkg_install() { - vmove ${py3_sitelib} + vmove usr/lib/cmake + vmove "usr/lib/*.so" } }