Split up setup.py and move packaging tools to new script
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
# Build and Install novelWriter
|
||||
|
||||
The root folder of the repository contains a standard `setup.py` script. The `setup` folder
|
||||
contains necessary files for the setup process, like icons and other files, and it also contains
|
||||
additional scripts that are included in the minimal zip packages.
|
||||
|
||||
## Setup Script
|
||||
|
||||
The `setup.py` script in the root folder has all the necessary commands for generating packages,
|
||||
installing icons, launcher, and file associations on Linux and Windows (no macOS support yet).
|
||||
|
||||
In addition, it is a wrapper for `setuptools` and accept all commands associated with this tool.
|
||||
|
||||
To list all custom package and install options in this script, run:
|
||||
```
|
||||
./setup.py help
|
||||
```
|
||||
## Windows Scripts
|
||||
|
||||
The `windows_install.bat` and `windows_uninstall.bat` are provided as convenience scripts for
|
||||
Windows users who aren't used to running commands from command line. They are both located in the
|
||||
`setup` folder in the source package, but in the minimal zip package for Windows, they can be
|
||||
found in the root folder.
|
||||
|
||||
These scripts are designed to be double-clicked by the user, but can also be run from the command
|
||||
line tool. In either case, they will check if Python is properly installed, and then run the
|
||||
commands to install or uninstall the core dependencies of novelWriter, and then setup or remove the
|
||||
desktop icon, start menu icon and registry entries.
|
||||
@@ -24,13 +24,13 @@ echo "Build Dir: $BUILD_DIR"
|
||||
|
||||
pushd "$SRC_DIR" || exit 1
|
||||
|
||||
VERSION="$(python3 setup.py version)"
|
||||
VERSION="$(python3 pkgutils.py version)"
|
||||
echo "novelWriter Version: $VERSION"
|
||||
|
||||
# --- Prepare Files ----------------------------------------------------------------------------- #
|
||||
|
||||
echo "Generating Info.plist"
|
||||
python3 setup.py gen-plist
|
||||
python3 pkgutils.py gen-plist
|
||||
if [ -f $SRC_DIR/setup/macos/Info.plist ]; then
|
||||
echo "Found: setup/macos/Info.plist"
|
||||
else
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rfv dist_upload
|
||||
python3 setup.py build-clean
|
||||
python3 pkgutils.py build-clean
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,7 +10,7 @@ echo ""
|
||||
echo " Building Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
python3 -m build
|
||||
mkdir -pv dist_upload
|
||||
cp -v dist/novelWriter-*.whl dist_upload/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,20 +10,20 @@ echo ""
|
||||
echo " Building Dependencies"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py clean-assets
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py clean-assets
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
|
||||
echo ""
|
||||
echo " Building Minimal Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py minimal-zip --target-win
|
||||
python3 setup.py minimal-zip --target-linux
|
||||
python3 setup.py minimal-zip --target-darwin
|
||||
python3 pkgutils.py minimal-zip --target-win
|
||||
python3 pkgutils.py minimal-zip --target-linux
|
||||
python3 pkgutils.py minimal-zip --target-darwin
|
||||
|
||||
echo ""
|
||||
echo " Building Linux Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py build-deb --sign
|
||||
python3 setup.py build-ubuntu --sign --first
|
||||
python3 pkgutils.py build-deb --sign
|
||||
python3 pkgutils.py build-ubuntu --sign --first
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,11 +10,11 @@ echo ""
|
||||
echo " Building Dependencies"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py clean-assets
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py clean-assets
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
|
||||
echo ""
|
||||
echo " Building Linux Snapshots"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py build-ubuntu --sign --snapshot
|
||||
python3 pkgutils.py build-ubuntu --sign --snapshot
|
||||
|
||||
@@ -7,12 +7,12 @@ python --version 2>NUL
|
||||
if errorlevel 1 goto errorNoPython
|
||||
echo Python found. OK.
|
||||
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
cd ..
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
goto errorNoSetup
|
||||
)
|
||||
@@ -23,7 +23,7 @@ echo.
|
||||
pip install --user pywin32 -r requirements.txt
|
||||
|
||||
:: Create the desktop and start menu icons
|
||||
python setup.py win-install
|
||||
python pkgutils.py win-install
|
||||
|
||||
pause
|
||||
goto:eof
|
||||
@@ -41,9 +41,9 @@ goto:eof
|
||||
|
||||
:errorNoSetup
|
||||
echo.
|
||||
echo ERROR^: Could not find the setup.py script.
|
||||
echo ERROR^: Could not find the pkgutils.py script.
|
||||
echo.
|
||||
echo Make sure you run setup.py from the novelWriter root folder.
|
||||
echo Make sure you run pkgutils.py from the novelWriter root folder.
|
||||
echo.
|
||||
|
||||
pause
|
||||
|
||||
@@ -7,12 +7,12 @@ python --version 2>NUL
|
||||
if errorlevel 1 goto errorNoPython
|
||||
echo Python found. OK.
|
||||
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
cd ..
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
goto errorNoSetup
|
||||
)
|
||||
@@ -27,7 +27,7 @@ goto afterUninst
|
||||
:doUninst
|
||||
|
||||
:: Remove the desktop and start menu icons
|
||||
python setup.py win-uninstall
|
||||
python pkgutils.py win-uninstall
|
||||
|
||||
:: Remove the PyQt5 and pyenchant dependencies
|
||||
pip uninstall --yes -r requirements.txt
|
||||
@@ -51,9 +51,9 @@ goto:eof
|
||||
|
||||
:errorNoSetup
|
||||
echo.
|
||||
echo ERROR^: Could not find the setup.py script.
|
||||
echo ERROR^: Could not find the pkgutils.py script.
|
||||
echo.
|
||||
echo Make sure you run setup.py from the novelWriter root folder.
|
||||
echo Make sure you run pkgutils.py from the novelWriter root folder.
|
||||
echo.
|
||||
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user