1
0
telegram-desktop/tg_owt-packager.py

84 lines
3.2 KiB
Python
Raw Normal View History

#!/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)
Accepting request 984925 from home:manfred-h - Update tg_owt; this does not include pipewire anymore, therefore: * Add BuildRequires: pkgconfig(libpipewire-0.3) - Remove patches no longer needed: * 0002-tg_owt-fix-name-confliction.patch * 0005-add-wayland-include-path.patch * fix-unused-variable-error.patch - Add suport for Qt version 6 - Update to version 4.0.0 * Premium: Send media and files each up to 4 GB in size. * Premium: Download media and files at the fastest possible speed, with no limits. * Premium: Double most of the limits in the app. * Premium: Get a new button next to any voice message to generate a transcript of its audio. * Premium: React with even more emoji, including :clown: and 😍. * Premium: Send unique stickers with additional effects, updated monthly. * Premium: Set a default chat folder or enable tools to auto-archive and hide new chats. * Premium: Subscribers have a badge next to their name, showing they help support Telegram. * Premium: Show off your profile video that will be animated for everyone in chats and the chat list. * Premium: Sponsored Messages that are sometimes shown in public channels will no longer appear. * Enable join requests for your public groups – no invite links required. * Users who open the group will see an Apply to Join Group button. * Once approved by an admin, users will be able to participate in the chat. * Bots that are integrated into the attachment menu can be programmed to work in groups and channels. - Update to version 3.7.6 * Settings > Advanced > Experimental adds an option to open chats in separate windows. * Fix possible crash in video chat reconnection. * Fix possible crash after account switch. - Update to version 3.7.5 * Improve cloud password management design. * Fix a crash in shared media search. * Fix audio recording on macOS. - Update to version 3.7.4 * More icons for chat folders. * Improve some more sections design. * Update the OpenAL library to 1.22.0. OBS-URL: https://build.opensuse.org/request/show/984925 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=226
2022-06-24 20:02:14 +02:00
#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)
Accepting request 1040875 from home:polslinux:branches:server:messaging - Update to 4.4.0: * You can set a Global Auto-Delete Timer for all new chats and groups you create. * New messages will be deleted after 1 day, week, month - or a custom duration you choose. * The new menu in Settings > Privacy & Security > Auto-Delete Messages also lets you set up Auto-Delete for any of your existing chats faster. * Admins of groups with 100+ members can organize discussions into separate topics. * Topics now have a two-column layout that keeps recent chats easily accessible as you browse topics. * Previews of topic messages in the chat list work like a button - click to jump to the last updated topic. * Up to 5 topics can be pinned to the top of the list. * Each topic now supports multiple pinned messages. * The View as Messages mode now shows which topic each message belongs to. * Badge counters for topics you never opened will have a lighter, less distracting color. * A new General topic is now included by default, containing service messages and the earlier message history from the group. * Admins can rename the General topic. * Large groups can enable Aggressive Filtering in Manage Group > Administrators to remove more spam with automated algorithms. * Admins help improve filtering by reporting any false positives in Recent Actions. OBS-URL: https://build.opensuse.org/request/show/1040875 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=237
2022-12-07 20:02:55 +01:00
zipname = 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)
Accepting request 984925 from home:manfred-h - Update tg_owt; this does not include pipewire anymore, therefore: * Add BuildRequires: pkgconfig(libpipewire-0.3) - Remove patches no longer needed: * 0002-tg_owt-fix-name-confliction.patch * 0005-add-wayland-include-path.patch * fix-unused-variable-error.patch - Add suport for Qt version 6 - Update to version 4.0.0 * Premium: Send media and files each up to 4 GB in size. * Premium: Download media and files at the fastest possible speed, with no limits. * Premium: Double most of the limits in the app. * Premium: Get a new button next to any voice message to generate a transcript of its audio. * Premium: React with even more emoji, including :clown: and 😍. * Premium: Send unique stickers with additional effects, updated monthly. * Premium: Set a default chat folder or enable tools to auto-archive and hide new chats. * Premium: Subscribers have a badge next to their name, showing they help support Telegram. * Premium: Show off your profile video that will be animated for everyone in chats and the chat list. * Premium: Sponsored Messages that are sometimes shown in public channels will no longer appear. * Enable join requests for your public groups – no invite links required. * Users who open the group will see an Apply to Join Group button. * Once approved by an admin, users will be able to participate in the chat. * Bots that are integrated into the attachment menu can be programmed to work in groups and channels. - Update to version 3.7.6 * Settings > Advanced > Experimental adds an option to open chats in separate windows. * Fix possible crash in video chat reconnection. * Fix possible crash after account switch. - Update to version 3.7.5 * Improve cloud password management design. * Fix a crash in shared media search. * Fix audio recording on macOS. - Update to version 3.7.4 * More icons for chat folders. * Improve some more sections design. * Update the OpenAL library to 1.22.0. OBS-URL: https://build.opensuse.org/request/show/984925 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=226
2022-06-24 20:02:14 +02:00
# 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)