Build binary on linux
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Setup/Install
|
# Setup/Install
|
||||||
/MANIFEST
|
/MANIFEST
|
||||||
/build/
|
/build/
|
||||||
|
/build_*/
|
||||||
/deploy/
|
/deploy/
|
||||||
/dist/
|
/dist/
|
||||||
/dist_*/
|
/dist_*/
|
||||||
|
|||||||
@@ -109,10 +109,10 @@ class Config:
|
|||||||
|
|
||||||
self._appPath = Path(__file__).parent.absolute()
|
self._appPath = Path(__file__).parent.absolute()
|
||||||
self._appRoot = self._appPath.parent
|
self._appRoot = self._appPath.parent
|
||||||
if self._appRoot.is_file():
|
if getattr(sys, "frozen", False):
|
||||||
# novelWriter is packaged as a single file
|
# novelWriter is packaged as an exe
|
||||||
self._appRoot = self._appRoot.parent
|
self._appPath = Path(__file__).parent.parent.absolute()
|
||||||
self._appPath = self._appRoot
|
self._appRoot = self._appPath
|
||||||
|
|
||||||
# Runtime Settings and Variables
|
# Runtime Settings and Variables
|
||||||
self._hasError = False # True if the config class encountered an error
|
self._hasError = False # True if the config class encountered an error
|
||||||
|
|||||||
@@ -1509,6 +1509,12 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
cmdBuildSetupExe.set_defaults(func=makeWindowsEmbedded)
|
cmdBuildSetupExe.set_defaults(func=makeWindowsEmbedded)
|
||||||
|
|
||||||
|
# Build Binary
|
||||||
|
cmdBuildBinary = parsers.add_parser(
|
||||||
|
"build-bin", help="Build a standalone binary package."
|
||||||
|
)
|
||||||
|
cmdBuildBinary.set_defaults(func=utils.binary_dist.main)
|
||||||
|
|
||||||
# Build Clean
|
# Build Clean
|
||||||
cmdBuildClean = parsers.add_parser(
|
cmdBuildClean = parsers.add_parser(
|
||||||
"build-clean", help="Recursively delete all build folders."
|
"build-clean", help="Recursively delete all build folders."
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
"""
|
||||||
|
novelWriter – Binary Dist Tools
|
||||||
|
===============================
|
||||||
|
|
||||||
|
This file is a part of novelWriter
|
||||||
|
Copyright (C) 2025 Veronica Berglyd Olsen and novelWriter contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
import PyInstaller.__main__
|
||||||
|
|
||||||
|
|
||||||
|
def runPyinstaller() -> None:
|
||||||
|
"""Run the pyinstaller."""
|
||||||
|
build = ["novelWriter.py", "--clean", "--windowed", "--onedir", "--noconfirm"]
|
||||||
|
build += ["--name", "novelwriter"]
|
||||||
|
build += ["--workpath", "build_bin"]
|
||||||
|
build += ["--distpath", "dist_bin"]
|
||||||
|
build += ["--hidden-import", "pyenchant"]
|
||||||
|
build += ["--add-data", "novelwriter/assets:assets"]
|
||||||
|
PyInstaller.__main__.run(build)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def main(args: argparse.Namespace) -> None:
|
||||||
|
"""Entry point function."""
|
||||||
|
runPyinstaller()
|
||||||
|
return
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
"""
|
||||||
|
novelWriter – Common Utils
|
||||||
|
==========================
|
||||||
|
|
||||||
|
This file is a part of novelWriter
|
||||||
|
Copyright (C) 2025 Veronica Berglyd Olsen and novelWriter contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROOT_DIR = Path(__file__).parent.parent
|
||||||
Reference in New Issue
Block a user