From 3608a34634a83eaff44ff1d53875c71f8db8d389cb7c49c5e916bd313c80717d Mon Sep 17 00:00:00 2001 From: Marcel Kuehlhorn Date: Sun, 12 Dec 2021 15:59:35 +0000 Subject: [PATCH 1/3] Accepting request 939499 from home:nuklly:branches:server:messaging - Update to 3.3.0 * Content creators can restrict the ability to save media and forward messages from their groups and channels. * Clear messages in one-on-one chats from a specific day or date range. * Comment as one of your channels in public groups and channel comments. - Add tg_owt-packager.py OBS-URL: https://build.opensuse.org/request/show/939499 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=206 --- tdesktop-3.2.8-full.tar.gz | 3 -- tdesktop-3.3.0-full.tar.gz | 3 ++ telegram-desktop.changes | 12 ++++++ telegram-desktop.spec | 9 +++-- tg_owt-master.zip | 4 +- tg_owt-packager.py | 83 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 9 deletions(-) delete mode 100644 tdesktop-3.2.8-full.tar.gz create mode 100644 tdesktop-3.3.0-full.tar.gz create mode 100644 tg_owt-packager.py diff --git a/tdesktop-3.2.8-full.tar.gz b/tdesktop-3.2.8-full.tar.gz deleted file mode 100644 index d4321d5..0000000 --- a/tdesktop-3.2.8-full.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01ffaf2ef0e7be009f82516995f91646ac2c3576cb7e30c64312d791fe6a8ae2 -size 38661855 diff --git a/tdesktop-3.3.0-full.tar.gz b/tdesktop-3.3.0-full.tar.gz new file mode 100644 index 0000000..97bfaf9 --- /dev/null +++ b/tdesktop-3.3.0-full.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72c51d0f24c78f9362c334091fb2de71ecfe786e8d9076f9f4fca4925809489b +size 38662573 diff --git a/telegram-desktop.changes b/telegram-desktop.changes index 03ad05e..add32bf 100644 --- a/telegram-desktop.changes +++ b/telegram-desktop.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat Dec 11 04:01:59 UTC 2021 - Xu Zhao + +- Update to 3.3.0 + * Content creators can restrict the ability to save media and + forward messages from their groups and channels. + * Clear messages in one-on-one chats from a specific day or + date range. + * Comment as one of your channels in public groups and channel + comments. +- Add tg_owt-packager.py + ------------------------------------------------------------------- Tue Dec 7 05:28:18 UTC 2021 - Xu Zhao diff --git a/telegram-desktop.spec b/telegram-desktop.spec index 200de3d..8e2a884 100644 --- a/telegram-desktop.spec +++ b/telegram-desktop.spec @@ -34,14 +34,15 @@ %define _dwz_max_die_limit 200000000 Name: telegram-desktop -Version: 3.2.8 +Version: 3.3.0 Release: 0 Summary: Messaging application with a focus on speed and security License: GPL-3.0-only Group: Productivity/Networking/Instant Messenger URL: https://github.com/telegramdesktop/tdesktop Source0: https://github.com/telegramdesktop/tdesktop/releases/download/v%{version}/tdesktop-%{version}-full.tar.gz -# git clone --recurse-submodules https://github.com/desktop-app/tg_owt.git tg_owt-master +# Use tg_owt-package.py to prepare tg_owt-master.zip +# Usage: python tg_owt-package.py --repo-dir $PWD/tg_owt-master Source1: tg_owt-master.zip # PATCH-FIX-OPENSUSE Patch1: 0001-use-bundled-ranged-exptected-gsl.patch @@ -222,7 +223,7 @@ cd %{_builddir}/tdesktop-%{version}-full %install %cmake_install -appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml %files %license LICENSE LEGAL @@ -230,6 +231,6 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/*/apps/*.png -%{_datadir}/metainfo/*.appdata.xml +%{_datadir}/metainfo/*.metainfo.xml %changelog diff --git a/tg_owt-master.zip b/tg_owt-master.zip index 1795b49..4e7dde1 100644 --- a/tg_owt-master.zip +++ b/tg_owt-master.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ceb9edc7cc73a2400c8ba118b7feb07fc2db51f1a265acbb7e832b0a3614820 -size 207698320 +oid sha256:ca53812672a4c480044adfb4baed542f93d19da1b46bdb5d7ac52c7b02becb3e +size 31999928 diff --git a/tg_owt-packager.py b/tg_owt-packager.py new file mode 100644 index 0000000..86668b8 --- /dev/null +++ b/tg_owt-packager.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +import re +import os +import git +import argparse +import subprocess +from pathlib import Path +from git import Repo + +tg_owt_url = 'https://github.com/desktop-app/tg_owt.git' +repo_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "tg_owt-master") + +def clone_repo(git_url, repo_dir): + try: + repo = Repo(repo_dir) + except (git.exc.GitCommandError, git.exc.NoSuchPathError): + Repo.clone_from(git_url, repo_dir) + repo = Repo(repo_dir) + return repo + +def load_submodules(repo): + for sms in repo.submodules: + sms.update(init=True) + +def find_pipewire_path(repo): + "Return the relative path of pipewire (relative to repo path)" + sms = map(lambda x: x.name, repo.submodules) + sms = filter(lambda x: "pipewire" in x, sms) + sms = list(sms) + assert len(sms) == 1, f"find more than 1 pipewire submodule: {sms}" + return sms[0] + +def find_pipewire_ver(pipeware_path): + pw_build_file = os.path.join(pipeware_path, "meson.build") + with open(pw_build_file, "r") as pf: + pw_build = list(map(lambda x: x.strip(), pf.read().splitlines())) + version_re = "^version : '([0-9]+)\.([0-9]+)\.([0-9]+)'," + apiver_re = "^apiversion = '([0-9.]+)'" + ver_line = list(filter(lambda x: re.match(version_re, x), pw_build)) + apiver_line = list(filter(lambda x: re.match(apiver_re, x), pw_build)) + assert len(ver_line) == 1, f"Found more than one version line: {ver_line}" + assert len(apiver_line) == 1, f"Found more than one apiversion line: {apiver_line}" + ver = re.match(version_re, ver_line[0]).groups() + api_ver = re.match(apiver_re, apiver_line[0]).groups()[0] + return ver, api_ver + +def gen_pipewire_version_header(pipewire_path, pw_ver, pw_apiver): + pw_ver_major, pw_ver_minor, pw_ver_micro = pw_ver + replace_map = { + '@PIPEWIRE_API_VERSION@': pw_apiver, + '@PIPEWIRE_VERSION_MAJOR@': pw_ver_major, + '@PIPEWIRE_VERSION_MINOR@': pw_ver_minor, + '@PIPEWIRE_VERSION_MICRO@': pw_ver_micro, + } + part_header_file = os.path.join(pipewire_path, "src", "pipewire", "version.h.in") + with open(part_header_file, "r") as phf: + part_header = phf.read() + for k, v in replace_map.items(): + part_header = part_header.replace(k, v) + header_file = os.path.join(pipewire_path, "src", "pipewire", "version.h") + with open(header_file, "w") as hf: + hf.write(part_header) + +def compress_package(repo_dir): + basename = os.path.basename(repo_dir) + zipname = f"{basename}.zip" + path = Path(repo_dir).parent + command = ['zip', zipname, '-r', basename, '-x', '*.git*'] + subprocess.check_call(command, cwd=path) + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description="Package tg_owt for telegram-desktop build.") + parser.add_argument('--repo-dir', required=True, help="Specify path to clone tg_owt master branch.") + args = parser.parse_args() + + repo_dir = args.repo_dir + repo = clone_repo(tg_owt_url, repo_dir) + load_submodules(repo) + pipewire_path = find_pipewire_path(repo) + pipewire_path = os.path.join(repo_dir, pipewire_path) + pw_ver, pw_apiver = find_pipewire_ver(pipewire_path) + gen_pipewire_version_header(pipewire_path, pw_ver, pw_apiver) + compress_package(repo_dir) From e54bb3e5b6ad9b0af480b734bf6a7e3b9c78bf36e06915a4b58c2eb21f7c4af5 Mon Sep 17 00:00:00 2001 From: Marcel Kuehlhorn Date: Sun, 12 Dec 2021 16:51:35 +0000 Subject: [PATCH 2/3] Accepting request 940101 from home:tux93:branches:server:messaging - Add tg_owt-packager.py as Source to satisfy factory-auto OBS-URL: https://build.opensuse.org/request/show/940101 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=207 --- telegram-desktop.changes | 5 +++++ telegram-desktop.spec | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/telegram-desktop.changes b/telegram-desktop.changes index add32bf..3719539 100644 --- a/telegram-desktop.changes +++ b/telegram-desktop.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Dec 12 16:42:17 UTC 2021 - Marcel Kuehlhorn + +- Add tg_owt-packager.py as Source to satisfy factory-auto + ------------------------------------------------------------------- Sat Dec 11 04:01:59 UTC 2021 - Xu Zhao diff --git a/telegram-desktop.spec b/telegram-desktop.spec index 8e2a884..c7f5d92 100644 --- a/telegram-desktop.spec +++ b/telegram-desktop.spec @@ -41,9 +41,10 @@ License: GPL-3.0-only Group: Productivity/Networking/Instant Messenger URL: https://github.com/telegramdesktop/tdesktop Source0: https://github.com/telegramdesktop/tdesktop/releases/download/v%{version}/tdesktop-%{version}-full.tar.gz -# Use tg_owt-package.py to prepare tg_owt-master.zip -# Usage: python tg_owt-package.py --repo-dir $PWD/tg_owt-master -Source1: tg_owt-master.zip +# Use tg_owt-packager.py to prepare tg_owt-master.zip +# Usage: python tg_owt-packager.py --repo-dir $PWD/tg_owt-master +Source1: tg_owt-packager.py +Source2: tg_owt-master.zip # PATCH-FIX-OPENSUSE Patch1: 0001-use-bundled-ranged-exptected-gsl.patch # PATCH-FIX-OPENSUSE @@ -172,7 +173,7 @@ The service also provides APIs to independent developers. %patch5 -p1 cd ../ -unzip -q %{S:1} +unzip -q %{S:2} mkdir Libraries mv tg_owt-master Libraries/tg_owt %patch2 -p2 -d Libraries/tg_owt From a626150afe60b695c19ac808a4121a29ec87b34a4f0f8cc70203624a1504d628 Mon Sep 17 00:00:00 2001 From: Marcel Kuehlhorn Date: Tue, 21 Dec 2021 13:26:49 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=208 --- telegram-desktop.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram-desktop.changes b/telegram-desktop.changes index 3719539..31361ce 100644 --- a/telegram-desktop.changes +++ b/telegram-desktop.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Sun Dec 12 16:42:17 UTC 2021 - Marcel Kuehlhorn -- Add tg_owt-packager.py as Source to satisfy factory-auto +- Add tg_owt-packager.py to Source list in spec ------------------------------------------------------------------- Sat Dec 11 04:01:59 UTC 2021 - Xu Zhao