From fae2a0ddd4f791fadda8b55b72a81868fddf8e22 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 5 Feb 2023 12:53:48 +0800 Subject: [PATCH 01/13] Add configuration section for .deb projects. --- cookiecutter.json | 1 + {{ cookiecutter.app_name }}/pyproject.toml | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 5420928..51e6831 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -31,6 +31,7 @@ "pytest", "unittest" ], + "briefcase_version": "Unknown", "template": "Not provided", "branch": "Not provided", "_extensions": [ diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index ffcfe11..93aa560 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -1,4 +1,4 @@ -# This project was generated using template: {{ cookiecutter.template }} and branch: {{ cookiecutter.branch }} +# This project was generated with {{ cookiecutter.briefcase_version }} using template: {{ cookiecutter.template }}@{{ cookiecutter.branch }} [tool.briefcase] project_name = "{{ cookiecutter.project_name|escape_toml }}" bundle = "{{ cookiecutter.bundle }}" @@ -49,6 +49,25 @@ requires = [ {% endif -%} ] +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.deb] +system_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to compile pycairo wheel + 'libcairo2-dev', + # Needed to compile PyGObject wheel + 'libgirepository1.0-dev', +{% endif -%} +] + +system_runtime_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to provide GTK + "libgtk-3-0", + # Needed to provide WebKit2 at runtime + "libwebkit2gtk-4.0-37", +{% endif -%} +] + [tool.briefcase.app.{{ cookiecutter.app_name }}.linux.appimage] system_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} From 735f01e4e20b69777e4b2327646c2313d6b7f1c3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 23 Feb 2023 12:03:56 +0800 Subject: [PATCH 02/13] Add project configurations for linux system packages. --- {{ cookiecutter.app_name }}/pyproject.toml | 72 ++++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 93aa560..076fc3e 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -11,6 +11,8 @@ author_email = "{{ cookiecutter.author_email }}" [tool.briefcase.app.{{ cookiecutter.app_name }}] formal_name = "{{ cookiecutter.formal_name|escape_toml }}" description = "{{ cookiecutter.description|escape_toml }}" +long_description = """More details about the app should go here. +""" icon = "src/{{ cookiecutter.module_name }}/resources/{{ cookiecutter.app_name }}" sources = [ "src/{{ cookiecutter.module_name }}", @@ -46,17 +48,21 @@ requires = [ requires = [ {%- if cookiecutter.gui_framework == "Toga" %} "toga-gtk~=0.3.0", -{% endif -%} +{%- endif %} ] -[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.deb] +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.debian] system_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} # Needed to compile pycairo wheel 'libcairo2-dev', # Needed to compile PyGObject wheel 'libgirepository1.0-dev', -{% endif -%} +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} ] system_runtime_requires = [ @@ -65,7 +71,65 @@ system_runtime_requires = [ "libgtk-3-0", # Needed to provide WebKit2 at runtime "libwebkit2gtk-4.0-37", -{% endif -%} +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} +] + +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.redhat] +system_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to compile pycairo wheel + 'cairo-gobject-devel', + # Needed to compile PyGObject wheel + 'gobject-introspection-devel', +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} +] + +system_runtime_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to provide GTK + "gtk3", + # Needed to provide WebKit2 at runtime + "webkit2gtk3", +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} +] + +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.archlinux] +system_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to compile pycairo wheel + 'cairo', + # Needed to compile PyGObject wheel + 'gobject-introspection', +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} +] + +system_runtime_requires = [ +{%- if cookiecutter.gui_framework == "Toga" %} + # Needed to provide GTK + "gtk", + # Needed to provide WebKit2 at runtime + "webkit2gtk", +{%- elif cookiecutter.gui_framework == "PySide6" %} +# ?? FIXME +{%- elif cookiecutter.gui_framework == "PursuedPyBear" %} +# ?? FIXME +{%- endif %} ] [tool.briefcase.app.{{ cookiecutter.app_name }}.linux.appimage] From 3c57defddfde023262592ba6d8b8e92250d4a6e3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 23 Feb 2023 14:20:41 +0800 Subject: [PATCH 03/13] Pyside has no build-time requirements. --- {{ cookiecutter.app_name }}/pyproject.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 076fc3e..78a628e 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -58,8 +58,6 @@ system_requires = [ 'libcairo2-dev', # Needed to compile PyGObject wheel 'libgirepository1.0-dev', -{%- elif cookiecutter.gui_framework == "PySide6" %} -# ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %} @@ -85,8 +83,6 @@ system_requires = [ 'cairo-gobject-devel', # Needed to compile PyGObject wheel 'gobject-introspection-devel', -{%- elif cookiecutter.gui_framework == "PySide6" %} -# ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %} @@ -112,8 +108,6 @@ system_requires = [ 'cairo', # Needed to compile PyGObject wheel 'gobject-introspection', -{%- elif cookiecutter.gui_framework == "PySide6" %} -# ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %} From 9160ecec3c19dad3012c2fdc2bd7a749b2145106 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 2 Mar 2023 13:28:48 +0800 Subject: [PATCH 04/13] Add a stub changelog. --- {{ cookiecutter.app_name }}/CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 {{ cookiecutter.app_name }}/CHANGELOG diff --git a/{{ cookiecutter.app_name }}/CHANGELOG b/{{ cookiecutter.app_name }}/CHANGELOG new file mode 100644 index 0000000..da722d9 --- /dev/null +++ b/{{ cookiecutter.app_name }}/CHANGELOG @@ -0,0 +1,5 @@ +# {{ cookiecutter.formal_name }} Release Notes + +## 0.0.1 ({% now 'local', '%d %b %Y' %}) + +* Initial relase From dbd9440049c2d415f448b205d01d545ad83616d3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 3 Mar 2023 11:48:08 +0800 Subject: [PATCH 05/13] Revise names to match vendor names from /etc/os-release. --- {{ cookiecutter.app_name }}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 78a628e..a832d45 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -76,7 +76,7 @@ system_runtime_requires = [ {%- endif %} ] -[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.redhat] +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.rhel] system_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} # Needed to compile pycairo wheel @@ -101,7 +101,7 @@ system_runtime_requires = [ {%- endif %} ] -[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.archlinux] +[tool.briefcase.app.{{ cookiecutter.app_name }}.linux.system.arch] system_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} # Needed to compile pycairo wheel From 5dbb0a0504d29692d364387b7a72b34150977618 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 5 Mar 2023 14:11:44 +0800 Subject: [PATCH 06/13] Add some additional runtime dependencies for Debian. --- {{ cookiecutter.app_name }}/pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index a832d45..22630d6 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -67,8 +67,12 @@ system_runtime_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} # Needed to provide GTK "libgtk-3-0", + # Needed to provide GI bindings to GTK + "libgirepository-1.0-1", + "gir1.2-gtk-3.0", # Needed to provide WebKit2 at runtime "libwebkit2gtk-4.0-37", + "gir1.2-webkit2-4.0", {%- elif cookiecutter.gui_framework == "PySide6" %} # ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} From 9d21f811fa5b5da4796ec83a90d70894d972c878 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 7 Mar 2023 10:46:59 +0800 Subject: [PATCH 07/13] Don't install Webkit requirements by default. --- {{ cookiecutter.app_name }}/pyproject.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 22630d6..71df1da 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -71,8 +71,8 @@ system_runtime_requires = [ "libgirepository-1.0-1", "gir1.2-gtk-3.0", # Needed to provide WebKit2 at runtime - "libwebkit2gtk-4.0-37", - "gir1.2-webkit2-4.0", + # "libwebkit2gtk-4.0-37", + # "gir1.2-webkit2-4.0", {%- elif cookiecutter.gui_framework == "PySide6" %} # ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} @@ -97,7 +97,7 @@ system_runtime_requires = [ # Needed to provide GTK "gtk3", # Needed to provide WebKit2 at runtime - "webkit2gtk3", + # "webkit2gtk3", {%- elif cookiecutter.gui_framework == "PySide6" %} # ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} @@ -122,7 +122,7 @@ system_runtime_requires = [ # Needed to provide GTK "gtk", # Needed to provide WebKit2 at runtime - "webkit2gtk", + # "webkit2gtk", {%- elif cookiecutter.gui_framework == "PySide6" %} # ?? FIXME {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} @@ -133,13 +133,14 @@ system_runtime_requires = [ [tool.briefcase.app.{{ cookiecutter.app_name }}.linux.appimage] system_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} - "gir1.2-webkit2-4.0", "libcairo2-dev", "libgirepository1.0-dev", "libgtk-3-dev", "libpango1.0-dev", "librsvg2-dev", - "libwebkit2gtk-4.0-dev", + # Needed to support Webkit2 + # "gir1.2-webkit2-4.0", + # "libwebkit2gtk-4.0-dev", {% endif -%} ] linuxdeploy_plugins = [ From 772ef07afd6f788bf0b1a49ff163842b034b5c56 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 8 Mar 2023 07:44:38 +0800 Subject: [PATCH 08/13] Add default Debian runtime packages for Pyside. --- {{ cookiecutter.app_name }}/pyproject.toml | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 71df1da..63d6eba 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -73,8 +73,36 @@ system_runtime_requires = [ # Needed to provide WebKit2 at runtime # "libwebkit2gtk-4.0-37", # "gir1.2-webkit2-4.0", -{%- elif cookiecutter.gui_framework == "PySide6" %} -# ?? FIXME +{%- elif cookiecutter.gui_framework == "PySide2" or cookiecutter.gui_framework == "PySide6" %} + # Derived from https://doc.qt.io/qt-6/linux-requirements.html + "libxrender1", + "libxcb-render0", + "libxcb-render-util0", + "libxcb-shape0", + "libxcb-randr0", + "libxcb-xfixes0", + "libxcb-xkb1", + "libxcb-sync1", + "libxcb-shm0", + "libxcb-icccm4", + "libxcb-keysyms1", + "libxcb-image0", + "libxcb-util1", + "libxkbcommon0", + "libxkbcommon-x11-0", + "libfontconfig1", + "libfreetype6", + "libxext6", + "libx11-6", + "libxcb1", + "libx11-xcb1", + "libsm6", + "libice6", + "libglib2.0-0", + "libgl1", + "libegl1-mesa", + "libdbus-1-3", + "libgssapi-krb5-2", {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %} From 913825df505fdce4fa405b7e26637b1187daea16 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 8 Mar 2023 09:45:38 +0800 Subject: [PATCH 09/13] Correct typo in changelog Co-authored-by: Russell Martin --- {{ cookiecutter.app_name }}/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.app_name }}/CHANGELOG b/{{ cookiecutter.app_name }}/CHANGELOG index da722d9..5b188ae 100644 --- a/{{ cookiecutter.app_name }}/CHANGELOG +++ b/{{ cookiecutter.app_name }}/CHANGELOG @@ -2,4 +2,4 @@ ## 0.0.1 ({% now 'local', '%d %b %Y' %}) -* Initial relase +* Initial release From f158c5ca71619a37d84b5a7142c4c9e59b8c77ed Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 9 Mar 2023 06:50:51 +0800 Subject: [PATCH 10/13] Add RHEL runtime packages for Qt apps. --- {{ cookiecutter.app_name }}/pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 63d6eba..7af6d53 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -126,8 +126,10 @@ system_runtime_requires = [ "gtk3", # Needed to provide WebKit2 at runtime # "webkit2gtk3", -{%- elif cookiecutter.gui_framework == "PySide6" %} -# ?? FIXME +{%- cookiecutter.gui_framework == "PySide2" %} + "qt5-qt5base-gui", +{%- cookiecutter.gui_framework == "PySide6" %} + "qt6-qt6base-gui", {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %} From 506c59df195e22da359d26617a7d81b0af84619c Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 9 Mar 2023 08:27:54 +0800 Subject: [PATCH 11/13] Add gobject-introspection as a runtime requirement on RHEL. --- {{ cookiecutter.app_name }}/pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 7af6d53..b1506bf 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -122,6 +122,8 @@ system_requires = [ system_runtime_requires = [ {%- if cookiecutter.gui_framework == "Toga" %} + # Needed to support Python bindings to GTK + "gobject-introspection", # Needed to provide GTK "gtk3", # Needed to provide WebKit2 at runtime From 97b49cbf41e24a7ae8aa6fab06f010a24de445c5 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 9 Mar 2023 08:30:57 +0800 Subject: [PATCH 12/13] Correct template syntax. --- {{ cookiecutter.app_name }}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index b1506bf..56a7874 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -128,9 +128,9 @@ system_runtime_requires = [ "gtk3", # Needed to provide WebKit2 at runtime # "webkit2gtk3", -{%- cookiecutter.gui_framework == "PySide2" %} +{%- elif cookiecutter.gui_framework == "PySide2" %} "qt5-qt5base-gui", -{%- cookiecutter.gui_framework == "PySide6" %} +{%- elif cookiecutter.gui_framework == "PySide6" %} "qt6-qt6base-gui", {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME From a4bb40f7edfec121ba670104e5823f662022b2c0 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 9 Mar 2023 08:43:57 +0800 Subject: [PATCH 13/13] Correct Qt base package name Co-authored-by: Russell Martin --- {{ cookiecutter.app_name }}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.app_name }}/pyproject.toml b/{{ cookiecutter.app_name }}/pyproject.toml index 56a7874..42c34ee 100644 --- a/{{ cookiecutter.app_name }}/pyproject.toml +++ b/{{ cookiecutter.app_name }}/pyproject.toml @@ -129,9 +129,9 @@ system_runtime_requires = [ # Needed to provide WebKit2 at runtime # "webkit2gtk3", {%- elif cookiecutter.gui_framework == "PySide2" %} - "qt5-qt5base-gui", + "qt5-qtbase-gui", {%- elif cookiecutter.gui_framework == "PySide6" %} - "qt6-qt6base-gui", + "qt6-qtbase-gui", {%- elif cookiecutter.gui_framework == "PursuedPyBear" %} # ?? FIXME {%- endif %}