-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ data/ | |
__pycache__ | ||
build/ | ||
dist/ | ||
tmp/ | ||
|
||
# Astro | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import PyInstaller.__main__ | ||
import subprocess | ||
|
||
|
||
def build_application(): | ||
"""Build an executable file for the Application.""" | ||
|
||
print("[server] Creating linux executable file for Open Data Editor") | ||
PyInstaller.__main__.run([ | ||
'ode/main.py', | ||
'--collect-all', 'frictionless', # Frictionless depends on data files | ||
'--collect-all', 'ode', # Collect all assets from Open Data Editor | ||
'--log-level', 'WARN', | ||
'--name', 'opendataeditor', | ||
'--noconfirm', | ||
]) | ||
# Clean the spec file generated by PyInstaller | ||
subprocess.run(['rm', 'opendataeditor.spec']) | ||
|
||
|
||
if __name__ == "__main__": | ||
build_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# Script to create a PyQT deb package using fpm | ||
# | ||
# This script will create a folder structure that will be used as input | ||
# for the fpm command and copy into it all the distributable files generated by | ||
# pyinstaller. | ||
# We will create a folder with the same structure Linux systems expects: | ||
# - /opt for our executable and associated files (a.k.a our dist/ folder) | ||
# - /usr/share/applications (for the .desktop file) | ||
# - /usr/share/icons/hicolor/scalable/apps for our svg icons (only svg in scalable folder) | ||
# | ||
# More info: | ||
# - https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-linux-pyinstaller/ | ||
# - https://fpm.readthedocs.io/en/latest/packages/dir.html#dir-local-files | ||
# | ||
# Create folders | ||
[ -e package ] && rm -r tmp | ||
mkdir -p tmp/opt | ||
mkdir -p tmp/usr/share/applications | ||
mkdir -p tmp/usr/share/icons/hicolor/scalable/apps | ||
|
||
# Build the project | ||
[ -e build ] && rm -r build | ||
[ -e dist ] && rm -r dist | ||
python build.py | ||
|
||
# Copy files | ||
cp -r dist/opendataeditor tmp/opt/opendataeditor | ||
cp ./packaging/linux/icon.svg tmp/usr/share/icons/hicolor/scalable/apps/org.okfn.opendataeditor.svg | ||
cp ./packaging/linux/opendataeditor.desktop tmp/usr/share/applications | ||
|
||
# Change permissions | ||
# Packages retain the permissions of installed files from when they were packaged, | ||
# but will be installed by root. In order for ordinary users to be able to run the | ||
# application, we need to change the permissions. | ||
find tmp/opt/opendataeditor -type f -exec chmod 644 -- {} + | ||
find tmp/opt/opendataeditor -type d -exec chmod 755 -- {} + | ||
find tmp/usr/share -type f -exec chmod 644 -- {} + | ||
chmod +x tmp/opt/opendataeditor/opendataeditor | ||
|
||
# Create the deb package | ||
VERSION=$(python -c "import ode; print(ode.__version__)") | ||
FILENAME=opendataeditor-linux-$VERSION.deb | ||
[ -e $FILENAME ] && rm $FILENAME | ||
fpm -C tmp -s dir -t deb -n "opendataeditor" -v $VERSION -p dist/$FILENAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# Required for PyInstaller to collect all assets | ||
__version__ = "1.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Desktop Entry] | ||
|
||
# The type of the thing this desktop file refers to | ||
Type=Application | ||
|
||
# The Application Name | ||
Name=Open Data Editor | ||
|
||
# Tooltip comment to show in menus | ||
Comment=Data management for humans. | ||
|
||
# The path (folder) in which the executable is run | ||
Path=/opt/opendataeditor | ||
|
||
# The executable (can include arguments) | ||
Exec=/opt/opendataeditor/opendataeditor | ||
|
||
# The icon we install for the application, use the target filesystem path | ||
Icon=org.okfn.opendataeditor |
File renamed without changes.