Update Debian and Ubuntu builds (#2191)

This commit is contained in:
Veronica Berglyd Olsen
2025-01-16 11:12:29 +01:00
committed by GitHub
16 changed files with 40 additions and 107 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ documentation.
## Implementation ## Implementation
novelWriter is written with Python 3 (3.10+) using Qt6 and PyQt6 (6.0+), and is released on novelWriter is written with Python 3 (3.10+) using Qt6 and PyQt6 (6.4+), and is released on
Linux, Windows and macOS. It can in principle run on any Operating System that also supports Qt, Linux, Windows and macOS. It can in principle run on any Operating System that also supports Qt,
PyQt and Python. PyQt and Python.
+1 -1
View File
@@ -20,7 +20,7 @@ The project storage is suitable for version control software, and also well suit
synchronisation tools. All text is saved as plain text files, and your project data as standard synchronisation tools. All text is saved as plain text files, and your project data as standard
data formats in XML and JSON. See :ref:`a_storage` for more details. data formats in XML and JSON. See :ref:`a_storage` for more details.
Any operating system that has Python 3 and the Qt 5 libraries should be able to run novelWriter. Any operating system that has Python 3 and the Qt 6 libraries should be able to run novelWriter.
It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms as well. It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms as well.
See :ref:`a_started` for more details. See :ref:`a_started` for more details.
+1 -1
View File
@@ -144,7 +144,7 @@ In the Main section you must at least define the ``name`` and ``icontheme`` sett
setting must match the icon theme's folder name. setting must match the icon theme's folder name.
The Palette values correspond to the Qt enum values for ``QPalette::ColorRole``, see the The Palette values correspond to the Qt enum values for ``QPalette::ColorRole``, see the
`Qt documentation <https://doc.qt.io/qt-5.15/qpalette.html#ColorRole-enum>`_ for more details. The `Qt documentation <https://doc.qt.io/qt-6/qpalette.html#ColorRole-enum>`_ for more details. The
colour values are RGB numbers on the format ``r, g, b`` where each is an integer from ``0`` to colour values are RGB numbers on the format ``r, g, b`` where each is an integer from ``0`` to
``255``. Omitted values are not loaded and will use default values. If the ``helptext`` colour is ``255``. Omitted values are not loaded and will use default values. If the ``helptext`` colour is
not defined, it is computed as a colour between the ``window`` and ``windowtext`` colour. not defined, it is computed as a colour between the ``window`` and ``windowtext`` colour.
+1 -1
View File
@@ -4,7 +4,7 @@
File Locations File Locations
************** **************
.. _QStandardPaths: https://doc.qt.io/qt-5/qstandardpaths.html .. _QStandardPaths: https://doc.qt.io/qt-6/qstandardpaths.html
novelWriter will create a few files on your system outside of the application folder itself. These novelWriter will create a few files on your system outside of the application folder itself. These
file locations are described in this chapter. file locations are described in this chapter.
+1 -4
View File
@@ -136,12 +136,9 @@ document when reaching the end. There is also a switch that will try to match th
when the replacement is made. That is, it will try to keep the word upper, lower, or capitalised to when the replacement is made. That is, it will try to keep the word upper, lower, or capitalised to
match the word being replaced. match the word being replaced.
The regular expression search is somewhat dependant on which version of Qt your system has. If you
have Qt 5.13 or higher, there is better support for Unicode symbols in the search.
.. seealso:: .. seealso::
For more information on the capabilities of the Regular Expression option, see the Qt For more information on the capabilities of the Regular Expression option, see the Qt
documentation for the `QRegularExpression <https://doc.qt.io/qt-5/qregularexpression.html>`_ documentation for the `QRegularExpression <https://doc.qt.io/qt-6/qregularexpression.html>`_
class. class.
+3 -3
View File
@@ -45,7 +45,7 @@ instance `en_GB` for British English.
## Qt GUI Localisation ## Qt GUI Localisation
You will need the translation tool Qt 5 Linguist on your system. You will need the translation tool Qt Linguist on your system.
For Ubuntu/Debian, run: For Ubuntu/Debian, run:
@@ -53,7 +53,7 @@ For Ubuntu/Debian, run:
sudo apt install qttools5-dev-tools sudo apt install qttools5-dev-tools
``` ```
See also [Qt Linguist Manual: Translators](https://doc.qt.io/qt-5/linguist-translators.html). See also [Qt Linguist Manual: Translators](https://doc.qt.io/qt-6/linguist-translators.html).
### Workflow ### Workflow
@@ -94,7 +94,7 @@ TS file format. On Debian/Ubuntu it is provided by the package `pyqt6-dev-tools`
### Edit the Translation File in Qt Linguist ### Edit the Translation File in Qt Linguist
The `i18n/nw_XX.ts` file can be edited with the Qt Linguist application provided by Qt 5. This is The `i18n/nw_XX.ts` file can be edited with the Qt Linguist application provided by Qt. This is
by far easier than manually editing the `.ts` file. by far easier than manually editing the `.ts` file.
Please select "English" and "United Kingdom" as the _source_ language if prompted by Qt Linguist. Please select "English" and "United Kingdom" as the _source_ language if prompted by Qt Linguist.
+7 -7
View File
@@ -47,9 +47,9 @@ __license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen" __author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen" __maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net" __email__ = "code@vkbo.net"
__version__ = "2.7a0" __version__ = "2.7a1"
__hexversion__ = "0x020700a0" __hexversion__ = "0x020700a1"
__date__ = "2025-01-10" __date__ = "2025-01-15"
__status__ = "Stable" __status__ = "Stable"
__domain__ = "novelwriter.io" __domain__ = "novelwriter.io"
@@ -202,14 +202,14 @@ def main(sysArgs: list | None = None) -> GuiMain | None:
"At least Python 3.10 is required, found %s" % CONFIG.verPyString "At least Python 3.10 is required, found %s" % CONFIG.verPyString
) )
errorCode |= 0x04 errorCode |= 0x04
if CONFIG.verQtValue < 0x060000: if CONFIG.verQtValue < 0x060400:
errorData.append( errorData.append(
"At least Qt6 version 6.0 is required, found %s" % CONFIG.verQtString "At least Qt6 version 6.4 is required, found %s" % CONFIG.verQtString
) )
errorCode |= 0x08 errorCode |= 0x08
if CONFIG.verPyQtValue < 0x060000: if CONFIG.verPyQtValue < 0x060400:
errorData.append( errorData.append(
"At least PyQt6 version 6.0 is required, found %s" % CONFIG.verPyQtString "At least PyQt6 version 6.4 is required, found %s" % CONFIG.verPyQtString
) )
errorCode |= 0x10 errorCode |= 0x10
+1 -1
View File
@@ -534,7 +534,7 @@ class Config:
self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat) self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat)
langList = [ langList = [
(self._qtLangPath, "qtbase"), # Qt 5.x (self._qtLangPath, "qtbase"), # Qt
(str(self._nwLangPath), "nw"), # novelWriter (str(self._nwLangPath), "nw"), # novelWriter
] ]
for lngPath, lngBase in langList: for lngPath, lngBase in langList:
+16 -33
View File
@@ -633,7 +633,7 @@ def copySourceCode(dst: Path) -> None:
# Copy Package Files # Copy Package Files
## ##
def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) -> None: def copyPackageFiles(dst: Path, setupPy: bool = False) -> None:
"""Copy files needed for packaging.""" """Copy files needed for packaging."""
copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"] copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
@@ -655,24 +655,10 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->
)) ))
print("Wrote: setup.py") print("Wrote: setup.py")
if useCfg: text = readFile(CURR_DIR / "pyproject.toml")
# This is needed for Ubuntu up to 22.04 text = text.replace("setup/description_pypi.md", "data/description_short.txt")
text = readFile(SETUP_DIR / "launchpad_setup.cfg") writeFile(dst / "pyproject.toml", text)
text = text.replace("setup/description_pypi.md", "data/description_short.txt") print("Wrote: pyproject.toml")
writeFile(dst / "setup.cfg", text)
print("Wrote: setup.cfg")
writeFile(dst / "pyproject.toml", (
"[build-system]\n"
"requires = [\"setuptools\"]\n"
"build-backend = \"setuptools.build_meta\"\n"
))
print("Wrote: pyproject.toml")
else:
text = readFile(CURR_DIR / "pyproject.toml")
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
writeFile(dst / "pyproject.toml", text)
print("Wrote: pyproject.toml")
return return
@@ -683,7 +669,7 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->
def makeDebianPackage( def makeDebianPackage(
signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable", signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable",
buildName: str = "", oldSetuptools: bool = False, forLaunchpad: bool = False buildName: str = "", forLaunchpad: bool = False
) -> str: ) -> str:
"""Build a Debian package.""" """Build a Debian package."""
print("") print("")
@@ -743,7 +729,7 @@ def makeDebianPackage(
print("Copying or generating additional files ...") print("Copying or generating additional files ...")
print("") print("")
copyPackageFiles(outDir, setupPy=True, useCfg=oldSetuptools) copyPackageFiles(outDir, setupPy=True)
# Copy/Write Debian Files # Copy/Write Debian Files
# ======================= # =======================
@@ -830,22 +816,20 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("==================") print("==================")
print("") print("")
if args.first: if args.build:
bldNum = "0" bldNum = str(args.build)
else: else:
bldNum = input("Build number [0]: ") bldNum = "0"
if bldNum == "":
bldNum = "0"
distLoop = [ distLoop = [
("22.04", "jammy", True), ("24.04", "noble"),
("24.04", "noble", False), ("24.10", "oracular"),
("24.10", "oracular", False), ("25.04", "plucky"),
] ]
print("Building Ubuntu packages for:") print("Building Ubuntu packages for:")
print("") print("")
for distNum, codeName, _ in distLoop: for distNum, codeName in distLoop:
print(f" * Ubuntu {distNum} {codeName.title()}") print(f" * Ubuntu {distNum} {codeName.title()}")
print("") print("")
@@ -855,14 +839,13 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("") print("")
dputCmd = [] dputCmd = []
for distNum, codeName, oldSetup in distLoop: for distNum, codeName in distLoop:
buildName = f"ubuntu{distNum}.{bldNum}" buildName = f"ubuntu{distNum}.{bldNum}"
dCmd = makeDebianPackage( dCmd = makeDebianPackage(
signKey=signKey, signKey=signKey,
sourceBuild=True, sourceBuild=True,
distName=codeName, distName=codeName,
buildName=buildName, buildName=buildName,
oldSetuptools=oldSetup,
forLaunchpad=True, forLaunchpad=True,
) )
dputCmd.append(dCmd) dputCmd.append(dCmd)
@@ -1579,7 +1562,7 @@ if __name__ == "__main__":
) )
) )
cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.") cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.")
cmdBuildUbuntu.add_argument("--first", action="store_true", help="Set build number to 0.") cmdBuildUbuntu.add_argument("--build", type=int, help="Set build number.")
cmdBuildUbuntu.set_defaults(func=buildForLaunchpad) cmdBuildUbuntu.set_defaults(func=buildForLaunchpad)
# Build AppImage # Build AppImage
+1 -1
View File
@@ -26,7 +26,7 @@ classifiers = [
] ]
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
"pyqt5>=5.15", "pyqt6>=6.4",
"pyenchant>=3.0.0", "pyenchant>=3.0.0",
] ]
dynamic = ["version"] dynamic = ["version"]
+1 -1
View File
@@ -1,2 +1,2 @@
pyqt6>=6.0 pyqt6>=6.4
pyenchant>=3.0.0 pyenchant>=3.0.0
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7a0" hexVersion="0x020700a0" fileVersion="1.5" fileRevision="4" timeStamp="2025-01-10 01:59:38"> <novelWriterXML appVersion="2.7a1" hexVersion="0x020700a1" fileVersion="1.5" fileRevision="4" timeStamp="2025-01-15 23:35:34">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2149" autoCount="281" editTime="95624"> <project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2152" autoCount="281" editTime="95820">
<name>Sample Project</name> <name>Sample Project</name>
<author>Jane Smith</author> <author>Jane Smith</author>
</project> </project>
+2 -2
View File
@@ -2,14 +2,14 @@ Source: novelwriter
Maintainer: Veronica Berglyd Olsen <code@vkbo.net> Maintainer: Veronica Berglyd Olsen <code@vkbo.net>
Section: text Section: text
Priority: optional Priority: optional
Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9), python3 (>=3.10), python3-pyqt5 (>= 5.15), python3-enchant (>= 2.0) Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9), python3 (>=3.10), python3-pyqt6 (>= 6.4), python3-pyqt6.qtsvg (>= 6.4), python3-enchant (>= 2.0)
Standards-Version: 4.5.1 Standards-Version: 4.5.1
Homepage: https://novelwriter.io Homepage: https://novelwriter.io
X-Python3-Version: >= 3.10 X-Python3-Version: >= 3.10
Package: novelwriter Package: novelwriter
Architecture: all Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.10), python3-pyqt5 (>= 5.15), python3-enchant (>= 2.0) Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.10), python3-pyqt6 (>= 6.4), python3-pyqt6.qtsvg (>= 6.4), python3-enchant (>= 2.0)
Description: A markdown-like text editor for planning and writing novels Description: A markdown-like text editor for planning and writing novels
novelWriter is a plain text editor designed for writing novels assembled from novelWriter is a plain text editor designed for writing novels assembled from
many smaller text documents. It uses a minimal formatting syntax inspired by many smaller text documents. It uses a minimal formatting syntax inspired by
+1 -1
View File
@@ -1 +1 @@
pyqt5 python3-pyqt5 pyqt6 python3-pyqt6
-47
View File
@@ -1,47 +0,0 @@
[metadata]
name = novelWriter
version = attr: novelwriter.__version__
author = Veronica Berglyd Olsen
author_email = code@vkbo.net
description = A markdown-like text editor for planning and writing novels
url = https://novelwriter.io
long_description = file: setup/description_pypi.md
long_description_content_type = text/markdown
license_files = LICENSE.md
license = GNU General Public License v3
classifiers =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Development Status :: 5 - Production/Stable
Operating System :: OS Independent
Intended Audience :: End Users/Desktop
Natural Language :: English
Topic :: Text Editors
project_urls =
Bug Tracker = https://github.com/vkbo/novelWriter/issues
Documentation = https://docs.novelwriter.io
Source Code = https://github.com/vkbo/novelWriter
[options]
zip_safe = False
python_requires = >=3.10
include_package_data = True
packages = find_namespace:
install_requires =
pyqt5>=5.15
pyenchant>=3.0.0
[options.packages.find]
include = novelwriter*
[options.entry_points]
gui_scripts =
novelwriter = novelwriter:main
[bdist_wheel]
universal = 0
+1 -1
View File
@@ -25,4 +25,4 @@ echo " Building Linux Packages"
echo "================================================================================" echo "================================================================================"
echo "" echo ""
python3 pkgutils.py build-deb --sign python3 pkgutils.py build-deb --sign
python3 pkgutils.py build-ubuntu --sign --first python3 pkgutils.py build-ubuntu --sign