Compare commits
7 Commits
Author | SHA256 | Date | |
---|---|---|---|
1a42c3d4b7 | |||
56d6125609 | |||
1bb68ba1be | |||
d831e3c24f | |||
b29201874c | |||
f4c4a085a7 | |||
689ed61843 |
122
torbrowser-launcher-qt6-port.patch
Normal file
122
torbrowser-launcher-qt6-port.patch
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
From 7fa6018a8d7e019140189fcbe523a6bee7429dfb Mon Sep 17 00:00:00 2001
|
||||||
|
From: zefr0x <zer0-x.7ty50@aleeas.com>
|
||||||
|
Date: Thu, 2 Nov 2023 22:38:06 +0300
|
||||||
|
Subject: [PATCH] Migrate code from PyQt5 to PySide6
|
||||||
|
|
||||||
|
---
|
||||||
|
setup.py | 2 +-
|
||||||
|
torbrowser_launcher/__init__.py | 9 ++++-----
|
||||||
|
torbrowser_launcher/launcher.py | 16 ++++++++--------
|
||||||
|
torbrowser_launcher/settings.py | 2 +-
|
||||||
|
4 files changed, 14 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 8d8fa7dd..ada31791 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -121,7 +121,7 @@ def create_mo_files():
|
||||||
|
install_requires=[
|
||||||
|
"gpg",
|
||||||
|
"packaging",
|
||||||
|
- "PyQt5",
|
||||||
|
+ "PySide6",
|
||||||
|
"requests",
|
||||||
|
"PySocks",
|
||||||
|
],
|
||||||
|
diff --git a/torbrowser_launcher/__init__.py b/torbrowser_launcher/__init__.py
|
||||||
|
index 115fd4fd..a20dae6a 100644
|
||||||
|
--- a/torbrowser_launcher/__init__.py
|
||||||
|
+++ b/torbrowser_launcher/__init__.py
|
||||||
|
@@ -31,7 +31,7 @@
|
||||||
|
import argparse
|
||||||
|
import signal
|
||||||
|
|
||||||
|
-from PyQt5 import QtCore, QtWidgets
|
||||||
|
+from PySide6 import QtWidgets
|
||||||
|
|
||||||
|
from .common import Common, SHARE
|
||||||
|
from .settings import Settings
|
||||||
|
@@ -44,7 +44,6 @@ class Application(QtWidgets.QApplication):
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
- self.setAttribute(QtCore.Qt.AA_X11InitThreads, True)
|
||||||
|
QtWidgets.QApplication.__init__(self, sys.argv)
|
||||||
|
self.installEventFilter(self)
|
||||||
|
|
||||||
|
@@ -87,11 +86,11 @@ def main():
|
||||||
|
gui = Launcher(common, app, url_list)
|
||||||
|
|
||||||
|
# Center the window
|
||||||
|
- desktop = app.desktop()
|
||||||
|
+ screen_size = app.primaryScreen().size()
|
||||||
|
window_size = gui.size()
|
||||||
|
gui.move(
|
||||||
|
- (desktop.width() - window_size.width()) // 2,
|
||||||
|
- (desktop.height() - window_size.height()) // 2,
|
||||||
|
+ (screen_size.width() - window_size.width()) // 2,
|
||||||
|
+ (screen_size.height() - window_size.height()) // 2,
|
||||||
|
)
|
||||||
|
gui.show()
|
||||||
|
|
||||||
|
diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
|
||||||
|
index 286b521d..831709bb 100644
|
||||||
|
--- a/torbrowser_launcher/launcher.py
|
||||||
|
+++ b/torbrowser_launcher/launcher.py
|
||||||
|
@@ -39,7 +39,7 @@
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
from packaging import version
|
||||||
|
|
||||||
|
-from PyQt5 import QtCore, QtWidgets, QtGui
|
||||||
|
+from PySide6 import QtCore, QtWidgets, QtGui
|
||||||
|
|
||||||
|
|
||||||
|
class TryStableException(Exception):
|
||||||
|
@@ -531,9 +531,9 @@ class DownloadThread(QtCore.QThread):
|
||||||
|
Download a file in a separate thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
- progress_update = QtCore.pyqtSignal(int, int)
|
||||||
|
- download_complete = QtCore.pyqtSignal()
|
||||||
|
- download_error = QtCore.pyqtSignal(str, str)
|
||||||
|
+ progress_update = QtCore.Signal(int, int)
|
||||||
|
+ download_complete = QtCore.Signal()
|
||||||
|
+ download_error = QtCore.Signal(str, str)
|
||||||
|
|
||||||
|
def __init__(self, common, url, path):
|
||||||
|
super(DownloadThread, self).__init__()
|
||||||
|
@@ -614,8 +614,8 @@ class VerifyThread(QtCore.QThread):
|
||||||
|
Verify the signature in a separate thread
|
||||||
|
"""
|
||||||
|
|
||||||
|
- success = QtCore.pyqtSignal()
|
||||||
|
- error = QtCore.pyqtSignal(str)
|
||||||
|
+ success = QtCore.Signal()
|
||||||
|
+ error = QtCore.Signal(str)
|
||||||
|
|
||||||
|
def __init__(self, common):
|
||||||
|
super(VerifyThread, self).__init__()
|
||||||
|
@@ -656,8 +656,8 @@ class ExtractThread(QtCore.QThread):
|
||||||
|
Extract the tarball in a separate thread
|
||||||
|
"""
|
||||||
|
|
||||||
|
- success = QtCore.pyqtSignal()
|
||||||
|
- error = QtCore.pyqtSignal()
|
||||||
|
+ success = QtCore.Signal()
|
||||||
|
+ error = QtCore.Signal()
|
||||||
|
|
||||||
|
def __init__(self, common):
|
||||||
|
super(ExtractThread, self).__init__()
|
||||||
|
diff --git a/torbrowser_launcher/settings.py b/torbrowser_launcher/settings.py
|
||||||
|
index cef18e03..b9125ea4 100644
|
||||||
|
--- a/torbrowser_launcher/settings.py
|
||||||
|
+++ b/torbrowser_launcher/settings.py
|
||||||
|
@@ -29,7 +29,7 @@
|
||||||
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
-from PyQt5 import QtCore, QtWidgets, QtGui
|
||||||
|
+from PySide6 import QtCore, QtWidgets, QtGui
|
||||||
|
|
||||||
|
|
||||||
|
class Settings(QtWidgets.QMainWindow):
|
@@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 26 10:38:49 UTC 2025 - Atri Bhattacharya <badshah400@gmail.com>
|
||||||
|
|
||||||
|
- Add torbrowser-launcher-qt6-port.patch: Port to pyside6 (Qt6);
|
||||||
|
upstream merge request.
|
||||||
|
- Switch BuildRequires to Qt6.
|
||||||
|
- Switch to using pyproject_* macros for build.
|
||||||
|
- Fix location of apparmor profiles when building using
|
||||||
|
pyproject_* macros.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 22 10:17:54 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- Drop unneeded runtime dependencies
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 7 19:54:54 UTC 2025 - Christian Boltz <suse-beta@cboltz.de>
|
||||||
|
|
||||||
|
- Load/reload AppArmor profiles when installing the package (boo#1235080)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 15 03:30:56 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>
|
Mon Jan 15 03:30:56 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package torbrowser-launcher
|
# spec file for package torbrowser-launcher
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define pythons python3
|
||||||
Name: torbrowser-launcher
|
Name: torbrowser-launcher
|
||||||
Version: 0.3.7
|
Version: 0.3.7
|
||||||
Release: 0
|
Release: 0
|
||||||
@@ -24,25 +25,30 @@ License: MIT
|
|||||||
Group: Productivity/Networking/Web/Utilities
|
Group: Productivity/Networking/Web/Utilities
|
||||||
URL: https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/
|
URL: https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/
|
||||||
Source0: https://github.com/torproject/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source0: https://github.com/torproject/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM torbrowser-launcher-qt6-port.patch badshah400@gmail.com -- Port to Qt6, taken from upstream MR
|
||||||
|
Patch0: https://patch-diff.githubusercontent.com/raw/torproject/torbrowser-launcher/pull/720.patch#/torbrowser-launcher-qt6-port.patch
|
||||||
|
BuildRequires: %{python_module PySocks}
|
||||||
|
BuildRequires: %{python_module devel}
|
||||||
|
BuildRequires: %{python_module distro}
|
||||||
|
BuildRequires: %{python_module gpg}
|
||||||
|
BuildRequires: %{python_module packaging}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module pyside6}
|
||||||
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: apparmor-abstractions
|
BuildRequires: apparmor-abstractions
|
||||||
|
BuildRequires: apparmor-rpm-macros
|
||||||
|
BuildRequires: desktop-file-utils
|
||||||
|
BuildRequires: fdupes
|
||||||
BuildRequires: gpg2
|
BuildRequires: gpg2
|
||||||
BuildRequires: hicolor-icon-theme
|
BuildRequires: hicolor-icon-theme
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
BuildRequires: python3-PySocks
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-distro
|
|
||||||
BuildRequires: python3-gpg
|
|
||||||
BuildRequires: python3-packaging
|
|
||||||
BuildRequires: python3-qt5
|
|
||||||
BuildRequires: update-desktop-files
|
|
||||||
Requires: gpg2
|
Requires: gpg2
|
||||||
Requires: hicolor-icon-theme
|
Requires: hicolor-icon-theme
|
||||||
Requires: python3-Parsley
|
|
||||||
Requires: python3-PySocks
|
Requires: python3-PySocks
|
||||||
Requires: python3-distro
|
|
||||||
Requires: python3-gpg
|
Requires: python3-gpg
|
||||||
Requires: python3-packaging
|
Requires: python3-packaging
|
||||||
Requires: python3-qt5
|
Requires: python3-pyside6
|
||||||
Requires: python3-requests
|
Requires: python3-requests
|
||||||
Requires: xmessage
|
Requires: xmessage
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
@@ -83,16 +89,20 @@ a Tor network compromise.
|
|||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
python3 setup.py build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
python3 setup.py install --skip-build --root %{buildroot}
|
%pyproject_install
|
||||||
|
|
||||||
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/torbrowser.desktop
|
|
||||||
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/torbrowser-settings.desktop
|
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}
|
||||||
|
%{python_expand mv %{buildroot}%{$python_sitelib}/etc/apparmor.d %{buildroot}%{_sysconfdir}/
|
||||||
|
%fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
}
|
||||||
%find_lang %{name} %{?no_lang_C}
|
%find_lang %{name} %{?no_lang_C}
|
||||||
|
|
||||||
|
%post -n torbrowser-apparmor-profile
|
||||||
|
%{apparmor_reload %{_sysconfdir}/apparmor.d/torbrowser.Browser.firefox %{_sysconfdir}/apparmor.d/torbrowser.Tor.tor}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc CHANGELOG.md README.md
|
%doc CHANGELOG.md README.md
|
||||||
@@ -101,8 +111,8 @@ python3 setup.py install --skip-build --root %{buildroot}
|
|||||||
%{_datadir}/metainfo/*.metainfo.xml
|
%{_datadir}/metainfo/*.metainfo.xml
|
||||||
%{_datadir}/icons/hicolor/*/apps/torbrowser*.png
|
%{_datadir}/icons/hicolor/*/apps/torbrowser*.png
|
||||||
%{_datadir}/%{name}/
|
%{_datadir}/%{name}/
|
||||||
%{python3_sitelib}/torbrowser_launcher-%{version}-py%{py3_ver}.egg-info
|
%{python_sitelib}/torbrowser_launcher-%{version}*.*-info
|
||||||
%{python3_sitelib}/torbrowser_launcher/
|
%{python_sitelib}/torbrowser_launcher/
|
||||||
|
|
||||||
%files -n torbrowser-apparmor-profile
|
%files -n torbrowser-apparmor-profile
|
||||||
%license apparmor/license.txt
|
%license apparmor/license.txt
|
||||||
|
Reference in New Issue
Block a user