Skip to content

Commit

Permalink
Move lots of preprocessing out of appimg recipe (to support calculati…
Browse files Browse the repository at this point in the history
…on of app version)
  • Loading branch information
DarkFenX committed Dec 4, 2023
1 parent 713807d commit f60090f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 39 deletions.
36 changes: 18 additions & 18 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ for:
init:
- sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
install:
- sh: sudo add-apt-repository -y ppa:deadsnakes/ppa
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y update
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python3.11
# Needed for AppImage builder
# AppImage dependencies
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install libfuse2
# Needed to build binary distribution of wx
# - sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install libnotify4 libsdl2-2.0-0 libfuse2
# Preparation script dependencies
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python3-wxgtk4.0 python3-sqlalchemy
before_build:
# Prepare pyfa data
- sh: find locale/ -type f -name "*.po" -exec msgen "{}" -o "{}" \;
- sh: python3 -B scripts/compile_lang.py
- sh: python3 -B scripts/dump_crowdin_progress.py
- sh: python3 -B db_update.py
- sh: export APP_VERSION="$(python3 -B scripts/dump_version.py)"
- sh: mkdir build
- sh: curl -o build/$APPIMAGE_TOOL -L https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
- sh: chmod +x build/$APPIMAGE_TOOL
# Download packaging tool
- sh: curl -o $APPIMAGE_TOOL -L https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
- sh: chmod +x $APPIMAGE_TOOL
build_script:
- sh: mkdir -p AppDir/usr/src
- sh: cp -r eos graphs gui imgs locale service utils eve.db config.py pyfa.py db_update.py README.md LICENSE version.yml AppDir/usr/src
- sh: mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
- sh: cp imgs/gui/pyfa64.png AppDir/usr/share/icons/hicolor/64x64/apps/pyfa.png
- sh: sleep 60m
- sh: build/$APPIMAGE_TOOL --recipe dist_assets/linux/AppImageBuilder.yml

# Copy static AppImage files
# - sh: cd dist_assets/linux
# - sh: chmod +x AppRun
# - sh: cp AppRun pyfa.desktop ../../build/AppDir/
# - sh: cp pyfa.desktop ../../build/AppDir/usr/share/applications/
# - sh: cp pyfa.appdata.xml ../../build/AppDir/usr/share/metainfo/
# - sh: chmod +x pyfa && cp pyfa ../../build/AppDir/usr/bin
# - sh: cd ../../
- sh: ./$APPIMAGE_TOOL --recipe dist_assets/linux/AppImageBuilder.yml
after_build:
- sh: ls -la build
- sh: ls -la
artifacts:
- path: dist/pyfa-$PYFA_VERSION-linux.AppImage
deploy:
Expand Down
24 changes: 3 additions & 21 deletions dist_assets/linux/AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
version: 1

script:
- rm -rf AppDir | true
- mkdir -p AppDir/usr/src
# wxpython dependencies to host
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libnotify4 libsdl2-2.0-0
# Install wx (needed by crowdin script) and sqlalchemy/logbook (needed by db update script)
- grep -iE 'wxpython|sqlalchemy|logbook' requirements.txt | xargs python3 -B -s -m pip install --user -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04
# Compile app data
- find locale/ -type f -name "*.po" -exec msgen "{}" -o "{}" \;
- python3 -B scripts/compile_lang.py
- python3 -B scripts/dump_crowdin_progress.py
- python3 -B db_update.py
- export PYFA_VERSION="$(python3 -B scripts/dump_version.py)"
# Copy data over to app dir
- cp -r eos graphs gui imgs locale service utils eve.db config.py pyfa.py db_update.py README.md LICENSE version.yml AppDir/usr/src
- mkdir -p AppDir/usr/share/icons
- cp imgs/gui/pyfa64.png AppDir/usr/share/icons

AppDir:
path: ./AppDir

app_info:
id: pyfa
name: pyfa
icon: pyfa64
version: $PYFA_VERSION
icon: pyfa
version: {{APP_VERSION}}
exec: usr/bin/python3.11
exec_args: "-s $APPDIR/opt/pyfa/pyfa.py $@"

Expand Down Expand Up @@ -54,7 +36,6 @@ AppDir:
- export PYTHONPATH="AppDir/usr/lib/python3.11/site-packages"
- curl -L https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python3.11 get-pip.py
- python3.11 -s -m pip install -U pip setuptools wheel
- python3.11 -s -m pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 -r requirements.txt

runtime:
Expand All @@ -65,3 +46,4 @@ AppDir:
AppImage:
sign-key: None
arch: x86_64
file_name: 'pyfa-{{APP_VERSION}}-linux'

0 comments on commit f60090f

Please sign in to comment.