Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package olm for openSUSE:Factory checked in at 2023-08-14 22:35:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/olm (Old) and /work/SRC/openSUSE:Factory/.olm.new.11712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "olm" Mon Aug 14 22:35:21 2023 rev:10 rq:1103713 version:3.2.15 Changes: -------- --- /work/SRC/openSUSE:Factory/olm/olm.changes 2023-01-18 13:09:22.496316710 +0100 +++ /work/SRC/openSUSE:Factory/.olm.new.11712/olm.changes 2023-08-14 22:35:25.236286760 +0200 @@ -1,0 +2,18 @@ +Sun Aug 13 18:00:00 UTC 2023 - [email protected] + +- remove python future build dependency + +------------------------------------------------------------------- +Wed Aug 9 10:14:02 UTC 2023 - ecsos <[email protected]> + +- Update to 3.2.15 + * Improvements to Python packaging + - No longer depend on future since Python 2 is no longer supported. + - Improve compatibility with tox 4. + - Add support for making standalone sdist. + * Improvements to Nix flake (Thanks to Jon Ringer) + - Improve structure. + - Enable Darwin builds. + * TypeScript type fix + +------------------------------------------------------------------- Old: ---- olm-3.2.14.tar.bz2 New: ---- olm-3.2.15.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ olm.spec ++++++ --- /var/tmp/diff_new_pack.TisHYF/_old 2023-08-14 22:35:25.964291388 +0200 +++ /var/tmp/diff_new_pack.TisHYF/_new 2023-08-14 22:35:25.972291439 +0200 @@ -23,7 +23,7 @@ %global descriptor An implementation of the Double Ratchet cryptographic ratchet \ in C and C++, including an implementation of the Megolm cryptographic ratchet Name: %{origname} -Version: 3.2.14 +Version: 3.2.15 Release: 0 Summary: Double Ratchet cryptographic library License: Apache-2.0 @@ -43,7 +43,6 @@ BuildRequires: python-rpm-macros Requires: %{libname} = %{version} Requires: python-cffi >= 1.0.0 -Requires: python-future %ifpython2 Requires: python-typing %endif ++++++ olm-3.2.14.tar.bz2 -> olm-3.2.15.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/CHANGELOG.rst new/olm-3.2.15/CHANGELOG.rst --- old/olm-3.2.14/CHANGELOG.rst 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/CHANGELOG.rst 2023-05-01 17:35:20.000000000 +0200 @@ -1,3 +1,16 @@ +Changes in `3.2.15 <https://gitlab.matrix.org/matrix-org/olm/tags/3.2.15>`_ +=========================================================================== + +This release includes the following changes since 3.2.15: + +* Improvements to Python packaging + * No longer depend on ``future`` since Python 2 is no longer supported. + * Improve compatibility with tox 4. + * Add support for making standalone sdist. +* Improvements to Nix flake (Thanks to Jon Ringer) + * Improve structure. + * Enable Darwin builds. + Changes in `3.2.14 <https://gitlab.matrix.org/matrix-org/olm/tags/3.2.14>`_ =========================================================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/CMakeLists.txt new/olm-3.2.15/CMakeLists.txt --- old/olm-3.2.14/CMakeLists.txt 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/CMakeLists.txt 2023-05-01 17:35:20.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.4) -project(olm VERSION 3.2.14 LANGUAGES CXX C) +project(olm VERSION 3.2.15 LANGUAGES CXX C) option(OLM_TESTS "Build tests" ON) option(BUILD_SHARED_LIBS "Build as a shared library" ON) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/Makefile new/olm-3.2.15/Makefile --- old/olm-3.2.14/Makefile 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/Makefile 2023-05-01 17:35:20.000000000 +0200 @@ -8,7 +8,6 @@ DEBUG_OPTIMIZE_FLAGS ?= -g -O0 -U_FORTIFY_SOURCE JS_OPTIMIZE_FLAGS ?= -O3 FUZZER_OPTIMIZE_FLAGS ?= -O3 -CC = gcc EMCC = emcc EMAR = emar AR = ar @@ -31,7 +30,7 @@ WASM_TARGET := $(BUILD_DIR)/wasm/libolm.a JS_EXPORTED_FUNCTIONS := javascript/exported_functions.json -JS_EXPORTED_RUNTIME_METHODS := [ALLOC_STACK,writeAsciiToMemory,intArrayFromString] +JS_EXPORTED_RUNTIME_METHODS := [ALLOC_STACK,writeAsciiToMemory,intArrayFromString,UTF8ToString,stringToUTF8] JS_EXTERNS := javascript/externs.js PUBLIC_HEADERS := include/olm/olm.h include/olm/outbound_group_session.h include/olm/inbound_group_session.h include/olm/pk.h include/olm/sas.h include/olm/error.h include/olm/olm_export.h @@ -94,7 +93,7 @@ CFLAGS_NATIVE = -fPIC CXXFLAGS_NATIVE = -fPIC -EMCCFLAGS = --closure 1 --memory-init-file 0 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s MODULARIZE=1 +EMCCFLAGS = --closure 1 --memory-init-file 0 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s MODULARIZE=1 -Wno-error=closure # Olm generally doesn't need a lot of memory to encrypt / decrypt its usual # payloads (ie. Matrix messages), but we do need about 128K of heap to encrypt @@ -106,7 +105,7 @@ # we don't use this for the legacy build.) EMCCFLAGS_WASM += -s TOTAL_STACK=65536 -s TOTAL_MEMORY=262144 -s ALLOW_MEMORY_GROWTH -EMCCFLAGS_ASMJS += -s WASM=0 -Wno-error=closure +EMCCFLAGS_ASMJS += -s WASM=0 EMCC.c = $(EMCC) $(CFLAGS) $(CPPFLAGS) -c -DNDEBUG -DOLM_STATIC_DEFINE=1 EMCC.cc = $(EMCC) $(CXXFLAGS) $(CPPFLAGS) -c -DNDEBUG -DOLM_STATIC_DEFINE=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/OLMKit.podspec new/olm-3.2.15/OLMKit.podspec --- old/olm-3.2.14/OLMKit.podspec 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/OLMKit.podspec 2023-05-01 17:35:20.000000000 +0200 @@ -3,7 +3,7 @@ # The libolm version MAJOR = 3 MINOR = 2 - PATCH = 14 + PATCH = 15 s.name = "OLMKit" s.version = "#{MAJOR}.#{MINOR}.#{PATCH}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/Package.swift new/olm-3.2.15/Package.swift --- old/olm-3.2.14/Package.swift 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/Package.swift 2023-05-01 17:35:20.000000000 +0200 @@ -2,7 +2,7 @@ import PackageDescription -let major = 3, minor = 2, patch = 14 +let major = 3, minor = 2, patch = 15 let package = Package( name: "Olm", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/README.md new/olm-3.2.15/README.md --- old/olm-3.2.14/README.md 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/README.md 2023-05-01 17:35:20.000000000 +0200 @@ -52,13 +52,16 @@ #### Python -Pre-built packages for Python are available for certain architectures at -<https://gitlab.matrix.org/matrix-org/olm/-/packages?type=PyPI>. They can be -installed by running +A Python source package and pre-built packages for certain architectures from +<https://pypi.org/project/python-olm/>. If a pre-built package is not +available for your architecture, you will need: -```bash -pip install python-olm --extra-index-url https://gitlab.matrix.org/api/v4/projects/27/packages/pypi/simple -``` +- cmake (recommended) or GNU make +- a C/C++ compiler + +to build the source package. + +You can then run `pip install python-olm`. Currently, we try to provide packages for all supported versions of Python on x86-64, i686, and aarch64, but we cannot guarantee that packages for all @@ -203,8 +206,9 @@ ## Release process First: bump version numbers in ``common.mk``, ``CMakeLists.txt``, -``javascript/package.json``, ``python/olm/__version__.py``, ``OLMKit.podspec``, -``Package.swift``, and ``android/gradle.properties``. +``javascript/package.json``, ``python/olm/__version__.py``, +``python/pyproject.toml``, ``OLMKit.podspec``, ``Package.swift``, and +``android/gradle.properties``. Also, ensure the changelog is up to date, and that everything is committed to git. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/android/gradle.properties new/olm-3.2.15/android/gradle.properties --- old/olm-3.2.14/android/gradle.properties 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/android/gradle.properties 2023-05-01 17:35:20.000000000 +0200 @@ -26,7 +26,7 @@ # Ref: https://github.com/vanniktech/gradle-maven-publish-plugin GROUP=org.matrix.android POM_ARTIFACT_ID=olm -VERSION_NAME=3.2.14 +VERSION_NAME=3.2.15 POM_PACKAGING=aar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/common.mk new/olm-3.2.15/common.mk --- old/olm-3.2.14/common.mk 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/common.mk 2023-05-01 17:35:20.000000000 +0200 @@ -1,4 +1,4 @@ MAJOR := 3 MINOR := 2 -PATCH := 14 +PATCH := 15 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/flake.nix new/olm-3.2.15/flake.nix --- old/olm-3.2.14/flake.nix 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/flake.nix 2023-05-01 17:35:20.000000000 +0200 @@ -11,126 +11,30 @@ }; outputs = { self, nixpkgs, flake-utils, npmlock2nix }: - ( + let + localOverlay = import ./nix/overlay.nix; + pkgsForSystem = system: import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + npmlock2nix = final.callPackage npmlock2nix {}; + node_modules = final.npmlock2nix.node_modules { src = ./javascript; }; + }) + localOverlay + ]; + }; + in ( # some systems cause issues, e.g. i686-linux is unsupported by gradle, # which causes "nix flake check" to fail. Investigate more later, but for # now, we will just allow x86_64-linux - flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ - (final: prev: { - npmlock2nix = final.callPackage npmlock2nix {}; - }) - ]; - }; - node_modules = pkgs.npmlock2nix.node_modules { src = ./javascript; }; - in - rec { - checks.gcc-cmake = pkgs.gccStdenv.mkDerivation { - name = "olm"; - - buildInputs = [ pkgs.cmake ]; - - src = ./.; - - buildPhase = '' - cmake . -Bbuild - cmake --build build - ''; - - doCheck = true; - checkPhase = '' - cd build/tests - ctest . - cd ../.. - ''; - }; - - checks.clang-cmake = pkgs.clangStdenv.mkDerivation { - name = "olm"; - - buildInputs = [ pkgs.cmake ]; - - src = ./.; - - buildPhase = '' - cmake . -Bbuild - cmake --build build - ''; - - doCheck = true; - checkPhase = '' - cd build/tests - ctest . - cd ../.. - ''; - }; - - checks.gcc-make = pkgs.gccStdenv.mkDerivation { - name = "olm"; - - src = ./.; - - buildPhase = '' - make - ''; - - doCheck = true; - checkPhase = '' - make test - ''; - - installPhase = '' - make install PREFIX=$out - ''; - }; - - packages.javascript = pkgs.buildEmscriptenPackage { - pname = "olm"; - inherit (builtins.fromJSON (builtins.readFile ./javascript/package.json)) version; - - buildInputs = with pkgs; [ gnumake python3 nodejs ]; - - src = ./.; - - postPatch = '' - patchShebangs . - ''; - - configurePhase = ""; - - buildPhase = '' - export EM_CACHE=$TMPDIR - make javascript/exported_functions.json - make js - ''; - - output = [ "out" ]; - - installPhase = '' - mkdir -p $out/javascript - cd javascript - echo sha256: > checksums.txt - sha256sum olm.js olm_legacy.js olm.wasm >> checksums.txt - echo sha512: >> checksums.txt - sha512sum olm.js olm_legacy.js olm.wasm >> checksums.txt - cp package.json olm.js olm.wasm olm_legacy.js index.d.ts README.md checksums.txt $out/javascript - cd .. - ''; - - checkPhase = '' - cd javascript - export HOME=$TMPDIR - ln -s ${node_modules}/node_modules ./node_modules - npm test - cd .. - ''; - }; - - packages.default = packages.javascript; - } - ) - ); + flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ] (system: rec { + legacyPackages = pkgsForSystem system; + checks = { + inherit (legacyPackages) olm-gcc-cmake olm-clang-cmake olm-gcc-make; + }; + packages = { + javascript = legacyPackages.olm-javascript; + }; + } + )); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/javascript/index.d.ts new/olm-3.2.15/javascript/index.d.ts --- old/olm-3.2.14/javascript/index.d.ts 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/javascript/index.d.ts 2023-05-01 17:35:20.000000000 +0200 @@ -74,7 +74,7 @@ create(session_key: string): string; import_session(session_key: string): string; decrypt(message: string): { - message_index: string; + message_index: number; plaintext: string; }; session_id(): string; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/javascript/olm_pre.js new/olm-3.2.15/javascript/olm_pre.js --- old/olm-3.2.14/javascript/olm_pre.js 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/javascript/olm_pre.js 2023-05-01 17:35:20.000000000 +0200 @@ -14,7 +14,6 @@ var bytes = nodeCrypto['randomBytes'](buf.length); buf.set(bytes); }; - process = global["process"]; } else { throw new Error("Cannot find global to attach library to"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/javascript/package.json new/olm-3.2.15/javascript/package.json --- old/olm-3.2.14/javascript/package.json 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/javascript/package.json 2023-05-01 17:35:20.000000000 +0200 @@ -1,6 +1,6 @@ { "name": "@matrix-org/olm", - "version": "3.2.14", + "version": "3.2.15", "description": "An implementation of the Double Ratchet cryptographic ratchet", "main": "olm.js", "files": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/nix/overlay.nix new/olm-3.2.15/nix/overlay.nix --- old/olm-3.2.14/nix/overlay.nix 1970-01-01 01:00:00.000000000 +0100 +++ new/olm-3.2.15/nix/overlay.nix 2023-05-01 17:35:20.000000000 +0200 @@ -0,0 +1,76 @@ +final: prev: { + olm-gcc-cmake = prev.gccStdenv.mkDerivation { + name = "olm_gcc_cmake"; + + src = ./..; + + nativeBuildInputs = [ prev.cmake ]; + doCheck = true; + checkPhase = '' + (cd tests && ctest . -j $NIX_BUILD_CORES) + ''; + }; + + olm-clang-cmake = prev.clangStdenv.mkDerivation { + name = "olm_clang_cmake"; + + src = ./..; + + nativeBuildInputs = [ prev.cmake ]; + + doCheck = true; + checkPhase = '' + (cd tests && ctest . -j $NIX_BUILD_CORES) + ''; + }; + + olm-gcc-make = prev.gccStdenv.mkDerivation { + name = "olm"; + + src = ./..; + + doCheck = true; + makeFlags = [ "PREFIX=$out" ]; + }; + + olm-javascript = final.buildEmscriptenPackage { + pname = "olm_javascript"; + inherit (builtins.fromJSON (builtins.readFile ../javascript/package.json)) version; + + src = ./..; + + nativeBuildInputs = with prev; [ gnumake python3 nodejs ]; + + postPatch = '' + patchShebangs . + ''; + + configurePhase = false; + + buildPhase = '' + export EM_CACHE=$TMPDIR + make javascript/exported_functions.json + make js + ''; + + installPhase = '' + mkdir -p $out/javascript + cd javascript + echo sha256: > checksums.txt + sha256sum olm.js olm_legacy.js olm.wasm >> checksums.txt + echo sha512: >> checksums.txt + sha512sum olm.js olm_legacy.js olm.wasm >> checksums.txt + cp package.json olm.js olm.wasm olm_legacy.js index.d.ts README.md checksums.txt $out/javascript + cd .. + ''; + + checkPhase = '' + cd javascript + export HOME=$TMPDIR + ln -s ${final.node_modules}/node_modules ./node_modules + npm test + cd .. + ''; + }; + +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/MANIFEST.in new/olm-3.2.15/python/MANIFEST.in --- old/olm-3.2.14/python/MANIFEST.in 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/MANIFEST.in 2023-05-01 17:35:20.000000000 +0200 @@ -1,5 +1,3 @@ -include include/olm/olm.h -include include/olm/pk.h -include include/olm/sas.h +include include/olm/*.h include Makefile include olm_build.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/README.md new/olm-3.2.15/python/README.md --- old/olm-3.2.14/python/README.md 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/README.md 2023-05-01 17:35:20.000000000 +0200 @@ -15,6 +15,18 @@ The full API reference can be found [here][7]. +# Installation instructions + +To install from the source package, you will need: + +- cmake (recommended) or GNU make +- a C/C++ compiler + +You can then run `pip install python-olm`. + +This should work in UNIX-like environments, including macOS, and may work in +other environments too, but is known to not work yet in Windows. + # Accounts Accounts create and hold the central identity of the Olm protocol, they consist of a fingerprint and identity diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/make_sdist.sh new/olm-3.2.15/python/make_sdist.sh --- old/olm-3.2.14/python/make_sdist.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/olm-3.2.15/python/make_sdist.sh 2023-05-01 17:35:20.000000000 +0200 @@ -0,0 +1,35 @@ +#!/bin/bash +set -e + +DIR=$(mktemp -d) +SRC=$(pwd) + +echo "Making headers" +make headers + +cd $DIR + +echo "Copying python module" +cp -a $SRC/* . +mkdir -p libolm +echo "Cleaning sources" +make clean > /dev/null +cp -a $SRC/include . +echo "Copying libolm sources" +for src in cmake CMakeLists.txt common.mk include lib Makefile olm.pc.in src tests; do + cp -a $SRC/../$src libolm +done +find libolm -name \*~ -delete +find libolm -name \#\*\# -delete + +echo "Building" +patch -p1 < $SRC/packaging.diff +python3 setup.py sdist + +echo "Copying result" +mkdir -p $SRC/dist +cp dist/* $SRC/dist + +echo "Cleaning up" +cd $SRC +rm -rf $DIR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/__version__.py new/olm-3.2.15/python/olm/__version__.py --- old/olm-3.2.14/python/olm/__version__.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/__version__.py 2023-05-01 17:35:20.000000000 +0200 @@ -1,9 +1,9 @@ __title__ = "python-olm" __description__ = ("python CFFI bindings for the olm " "cryptographic ratchet library") -__url__ = "https://github.com/poljar/python-olm" -__version__ = "3.2.14" +__url__ = "https://gitlab.matrix.org/matrix-org/olm/-/tree/master/python" +__version__ = "3.2.15" __author__ = "Damir JeliÄ" __author_email__ = "[email protected]" __license__ = "Apache 2.0" -__copyright__ = "Copyright 2018-2019 Damir JeliÄ" +__copyright__ = "Copyright 2018-2019 Damir JeliÄ, 2019-2023 The Matrix.org Foundation C.I.C." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/_finalize.py new/olm-3.2.15/python/olm/_finalize.py --- old/olm-3.2.14/python/olm/_finalize.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/_finalize.py 2023-05-01 17:35:20.000000000 +0200 @@ -23,7 +23,6 @@ This is designed for avoiding __del__. """ -from __future__ import print_function import sys import traceback diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/account.py new/olm-3.2.15/python/olm/account.py --- old/olm-3.2.14/python/olm/account.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/account.py 2023-05-01 17:35:20.000000000 +0200 @@ -32,8 +32,6 @@ from builtins import bytes, super from typing import AnyStr, Dict, Optional, Type -from future.utils import bytes_to_native_str - # pylint: disable=no-name-in-module from _libolm import ffi, lib # type: ignore @@ -93,8 +91,7 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string((lib.olm_account_last_error(self._account)))) + last_error = ffi.string((lib.olm_account_last_error(self._account))).decode() raise OlmAccountError(last_error) @@ -209,7 +206,7 @@ for i in range(0, len(bytes_message)): bytes_message[i] = 0 - return bytes_to_native_str(ffi.unpack(out_buffer, out_length)) + return ffi.unpack(out_buffer, out_length).decode() @property def max_one_time_keys(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/group_session.py new/olm-3.2.15/python/olm/group_session.py --- old/olm-3.2.14/python/olm/group_session.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/group_session.py 2023-05-01 17:35:20.000000000 +0200 @@ -28,8 +28,6 @@ from builtins import bytes, super from typing import AnyStr, Optional, Tuple, Type -from future.utils import bytes_to_native_str - # pylint: disable=no-name-in-module from _libolm import ffi, lib # type: ignore @@ -171,8 +169,9 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str(ffi.string( - lib.olm_inbound_group_session_last_error(self._session))) + last_error = ffi.string( + lib.olm_inbound_group_session_last_error(self._session) + ).decode() raise OlmGroupSessionError(last_error) @@ -252,7 +251,7 @@ id_length ) self._check_error(ret) - return bytes_to_native_str(ffi.unpack(id_buffer, id_length)) + return ffi.unpack(id_buffer, id_length).decode() @property def first_known_index(self): @@ -290,7 +289,7 @@ message_index ) self._check_error(ret) - export_str = bytes_to_native_str(ffi.unpack(export_buffer, export_length)) + export_str = ffi.unpack(export_buffer, export_length).decode() # clear out copies of the key lib.memset(export_buffer, 0, export_length) @@ -373,9 +372,9 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str(ffi.string( + last_error = ffi.string( lib.olm_outbound_group_session_last_error(self._session) - )) + ).decode() raise OlmGroupSessionError(last_error) @@ -483,7 +482,7 @@ for i in range(0, len(byte_plaintext)): byte_plaintext[i] = 0 - return bytes_to_native_str(ffi.unpack(message_buffer, message_length)) + return ffi.unpack(message_buffer, message_length).decode() @property def id(self): @@ -499,7 +498,7 @@ ) self._check_error(ret) - return bytes_to_native_str(ffi.unpack(id_buffer, id_length)) + return ffi.unpack(id_buffer, id_length).decode() @property def message_index(self): @@ -529,4 +528,4 @@ ) self._check_error(ret) - return bytes_to_native_str(ffi.unpack(key_buffer, key_length)) + return ffi.unpack(key_buffer, key_length).decode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/pk.py new/olm-3.2.15/python/olm/pk.py --- old/olm-3.2.14/python/olm/pk.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/pk.py 2023-05-01 17:35:20.000000000 +0200 @@ -36,8 +36,6 @@ from builtins import super from typing import AnyStr, Type -from future.utils import bytes_to_native_str - from _libolm import ffi, lib # type: ignore from ._compat import URANDOM, to_bytearray, to_unicode_str @@ -116,8 +114,9 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string(lib.olm_pk_encryption_last_error(self._pk_encryption))) + last_error = ffi.string( + lib.olm_pk_encryption_last_error(self._pk_encryption) + ).decode() raise PkEncryptionError(last_error) @@ -166,12 +165,9 @@ byte_plaintext[i] = 0 message = PkMessage( - bytes_to_native_str( - ffi.unpack(ephemeral_key, ephemeral_key_size)), - bytes_to_native_str( - ffi.unpack(mac, mac_length)), - bytes_to_native_str( - ffi.unpack(ciphertext, ciphertext_length)) + ffi.unpack(ephemeral_key, ephemeral_key_size).decode(), + ffi.unpack(mac, mac_length).decode(), + ffi.unpack(ciphertext, ciphertext_length).decode(), ) return message @@ -217,18 +213,19 @@ random_buffer, random_length ) self._check_error(ret) - self.public_key: str = bytes_to_native_str(ffi.unpack( + self.public_key: str = ffi.unpack( key_buffer, key_length - )) + ).decode() def _check_error(self, ret): # type: (int) -> None if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string(lib.olm_pk_decryption_last_error(self._pk_decryption))) + last_error = ffi.string( + lib.olm_pk_decryption_last_error(self._pk_decryption) + ).decode() raise PkDecryptionError(last_error) @@ -306,10 +303,10 @@ for i in range(0, len(byte_key)): byte_key[i] = 0 - obj.public_key = bytes_to_native_str(ffi.unpack( + obj.public_key = ffi.unpack( pubkey_buffer, pubkey_length - )) + ).decode() return obj @@ -411,17 +408,14 @@ self._check_error(ret) - self.public_key = bytes_to_native_str( - ffi.unpack(pubkey_buffer, pubkey_length) - ) + self.public_key = ffi.unpack(pubkey_buffer, pubkey_length).decode() def _check_error(self, ret): # type: (int) -> None if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string(lib.olm_pk_signing_last_error(self._pk_signing))) + last_error = ffi.string(lib.olm_pk_signing_last_error(self._pk_signing)).decode() raise PkSigningError(last_error) @@ -456,6 +450,4 @@ signature_buffer, signature_length) self._check_error(ret) - return bytes_to_native_str( - ffi.unpack(signature_buffer, signature_length) - ) + return ffi.unpack(signature_buffer, signature_length).decode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/sas.py new/olm-3.2.15/python/olm/sas.py --- old/olm-3.2.14/python/olm/sas.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/sas.py 2023-05-01 17:35:20.000000000 +0200 @@ -34,8 +34,6 @@ from functools import wraps from typing import Optional -from future.utils import bytes_to_native_str - from _libolm import ffi, lib from ._compat import URANDOM, to_bytearray, to_bytes @@ -92,8 +90,7 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string((lib.olm_sas_last_error(self._sas)))) + last_error = ffi.string((lib.olm_sas_last_error(self._sas))).decode() raise OlmSasError(last_error) @@ -115,7 +112,7 @@ lib.olm_sas_get_pubkey(self._sas, pubkey_buffer, pubkey_length) ) - return bytes_to_native_str(ffi.unpack(pubkey_buffer, pubkey_length)) + return ffi.unpack(pubkey_buffer, pubkey_length).decode() @property def other_key_set(self): @@ -208,7 +205,7 @@ mac_length ) ) - return bytes_to_native_str(ffi.unpack(mac_buffer, mac_length)) + return ffi.unpack(mac_buffer, mac_length).decode() def calculate_mac_fixed_base64(self, message, extra_info): # type: (str, str) -> str @@ -242,7 +239,7 @@ mac_length ) ) - return bytes_to_native_str(ffi.unpack(mac_buffer, mac_length)) + return ffi.unpack(mac_buffer, mac_length).decode() def calculate_mac_long_kdf(self, message, extra_info): # type: (str, str) -> str @@ -276,4 +273,4 @@ mac_length ) ) - return bytes_to_native_str(ffi.unpack(mac_buffer, mac_length)) + return ffi.unpack(mac_buffer, mac_length).decode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/session.py new/olm-3.2.15/python/olm/session.py --- old/olm-3.2.14/python/olm/session.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/session.py 2023-05-01 17:35:20.000000000 +0200 @@ -35,8 +35,6 @@ from builtins import bytes, super from typing import AnyStr, Optional, Type -from future.utils import bytes_to_native_str - # pylint: disable=no-name-in-module from _libolm import ffi, lib # type: ignore @@ -146,8 +144,7 @@ if ret != lib.olm_error(): return - last_error = bytes_to_native_str( - ffi.string(lib.olm_session_last_error(self._session))) + last_error = ffi.string(lib.olm_session_last_error(self._session)).decode() raise OlmSessionError(last_error) @@ -260,16 +257,16 @@ if message_type == lib.OLM_MESSAGE_TYPE_PRE_KEY: return OlmPreKeyMessage( - bytes_to_native_str(ffi.unpack( + ffi.unpack( ciphertext_buffer, ciphertext_length - ))) + ).decode()) elif message_type == lib.OLM_MESSAGE_TYPE_MESSAGE: return OlmMessage( - bytes_to_native_str(ffi.unpack( + ffi.unpack( ciphertext_buffer, ciphertext_length - ))) + ).decode()) else: # pragma: no cover raise ValueError("Unknown message type") @@ -340,7 +337,7 @@ self._check_error( lib.olm_session_id(self._session, id_buffer, id_length) ) - return bytes_to_native_str(ffi.unpack(id_buffer, id_length)) + return ffi.unpack(id_buffer, id_length).decode() def matches(self, message, identity_key=None): # type: (OlmPreKeyMessage, Optional[AnyStr]) -> bool @@ -407,7 +404,7 @@ lib.olm_session_describe( self._session, describe_buffer, buffer_length ) - return bytes_to_native_str(ffi.string(describe_buffer)) + return ffi.string(describe_buffer).decode() class InboundSession(Session): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm/utility.py new/olm-3.2.15/python/olm/utility.py --- old/olm-3.2.14/python/olm/utility.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm/utility.py 2023-05-01 17:35:20.000000000 +0200 @@ -33,8 +33,6 @@ # pylint: disable=redefined-builtin,unused-import from typing import AnyStr, Type -from future.utils import bytes_to_native_str - # pylint: disable=no-name-in-module from _libolm import ffi, lib # type: ignore @@ -123,7 +121,7 @@ cls._check_error(ret, OlmHashError) - return bytes_to_native_str(ffi.unpack(hash, hash_length)) + return ffi.unpack(hash, hash_length).decode() def ed25519_verify(key, message, signature): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/olm_build.py new/olm-3.2.15/python/olm_build.py --- old/olm-3.2.14/python/olm_build.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/olm_build.py 2023-05-01 17:35:20.000000000 +0200 @@ -15,8 +15,6 @@ # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -from __future__ import unicode_literals - import os import subprocess @@ -28,18 +26,10 @@ DEVELOP = os.environ.get("DEVELOP") compile_args = ["-I../include"] -link_args = ["-L../build"] if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: link_args.append('-Wl,-rpath=../build') -# If libolm is compiled statically, we may need to link to the C++ standard -# library dynamically. This flag allows passing the required linker flag to do -# so. -CXX_LIB = os.environ.get("CXX_LIB") -if CXX_LIB: - link_args.extend(CXX_LIB.split()) - headers_build = subprocess.Popen("make headers", shell=True) headers_build.wait() @@ -53,8 +43,10 @@ #include <olm/sas.h> """, libraries=["olm"], + library_dirs=[os.path.join("..", "build")], extra_compile_args=compile_args, - extra_link_args=link_args) + source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension +) with open(os.path.join(PATH, "include/olm/error.h")) as f: ffibuilder.cdef(f.read(), override=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/packaging.diff new/olm-3.2.15/python/packaging.diff --- old/olm-3.2.14/python/packaging.diff 1970-01-01 01:00:00.000000000 +0100 +++ new/olm-3.2.15/python/packaging.diff 2023-05-01 17:35:20.000000000 +0200 @@ -0,0 +1,56 @@ +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -1,3 +1,8 @@ + include include/olm/*.h +-include Makefile + include olm_build.py ++include libolm/* ++include libolm/cmake/* ++include libolm/include/olm/* ++recursive-include libolm/lib * ++include libolm/src/* ++recursive-include libolm/tests * +--- a/olm_build.py ++++ b/olm_build.py +@@ -25,12 +25,29 @@ + + DEVELOP = os.environ.get("DEVELOP") + +-compile_args = ["-I../include"] ++compile_args = ["-Ilibolm/include"] + + if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: + link_args.append('-Wl,-rpath=../build') + +-headers_build = subprocess.Popen("make headers", shell=True) +-headers_build.wait() ++# Try to build with cmake first, fall back to GNU make ++try: ++ subprocess.run( ++ ["cmake", ".", "-Bbuild", "-DBUILD_SHARED_LIBS=NO"], ++ cwd="libolm", check=True, ++ ) ++ subprocess.run( ++ ["cmake", "--build", "build"], ++ cwd="libolm", check=True, ++ ) ++except FileNotFoundError: ++ try: ++ # try "gmake" first because some systems have a non-GNU make ++ # installed as "make" ++ subprocess.run(["gmake", "static"], cwd="libolm", check=True) ++ except FileNotFoundError: ++ # some systems have GNU make installed without the leading "g" ++ # so give that a try (though this may fail if it isn't GNU make) ++ subprocess.run(["make", "static"], cwd="libolm", check=True) + + ffibuilder.set_source( +@@ -43,7 +60,7 @@ + #include <olm/sas.h> + """, + libraries=["olm"], +- library_dirs=[os.path.join("..", "build")], ++ library_dirs=[os.path.join("libolm", "build")], + extra_compile_args=compile_args, + source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/pyproject.toml new/olm-3.2.15/python/pyproject.toml --- old/olm-3.2.14/python/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/olm-3.2.15/python/pyproject.toml 2023-05-01 17:35:20.000000000 +0200 @@ -0,0 +1,14 @@ +[project] +name = "python-olm" +version = "3.2.15" +description = "python CFFI bindings for the olm cryptographic ratchet library" +authors = [{name = "Damir JeliÄ", email = "[email protected]"}] +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Topic :: Communications", +] +dependencies = ["cffi>=1.0.0"] + +[build-system] +requires = ["setuptools", "cffi>=1.0.0"] +build-backend = "setuptools.build_meta" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/requirements.txt new/olm-3.2.15/python/requirements.txt --- old/olm-3.2.14/python/requirements.txt 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/requirements.txt 2023-05-01 17:35:20.000000000 +0200 @@ -1,3 +1,2 @@ -future cffi typing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/setup.py new/olm-3.2.15/python/setup.py --- old/olm-3.2.14/python/setup.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/setup.py 2023-05-01 17:35:20.000000000 +0200 @@ -24,7 +24,6 @@ cffi_modules=["olm_build.py:ffibuilder"], install_requires=[ "cffi>=1.0.0", - "future", "typing;python_version<'3.5'" ], zip_safe=False, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/tests/utils_test.py new/olm-3.2.15/python/tests/utils_test.py --- old/olm-3.2.14/python/tests/utils_test.py 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/tests/utils_test.py 2023-05-01 17:35:20.000000000 +0200 @@ -1,8 +1,6 @@ import base64 import hashlib -from future.utils import bytes_to_native_str - from olm import sha256 from olm._compat import to_bytes @@ -19,7 +17,7 @@ hashlib.sha256(to_bytes(input1)).digest() ) - hashlib_hash = bytes_to_native_str(hashlib_hash[:-1]) + hashlib_hash = hashlib_hash[:-1].decode() assert first_hash != second_hash assert hashlib_hash == first_hash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/olm-3.2.14/python/tox.ini new/olm-3.2.15/python/tox.ini --- old/olm-3.2.14/python/tox.ini 2022-12-05 23:58:00.000000000 +0100 +++ new/olm-3.2.15/python/tox.ini 2023-05-01 17:35:20.000000000 +0200 @@ -6,7 +6,7 @@ deps = -rrequirements.txt -rtest-requirements.txt -passenv = TOXENV CI TRAVIS TRAVIS_* +passenv = TOXENV,CI,TRAVIS,TRAVIS_* commands = pytest --benchmark-disable usedevelop = True
