Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(appimage): upgrade to Python 3.8.18 #704

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions scripts/create-appimage.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/sh
#
# This file is part of REANA.
# Copyright (C) 2022 CERN.
# Copyright (C) 2022, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

set -o errexit
set -o nounset

if [ $# -eq 0 ]; then
echo "Usage: $0 <version>"
echo
Expand All @@ -25,30 +28,30 @@ if ! [ -x "$(command -v convert)" ]; then
fi

download_python_appimage () {
wget https://github.com/niess/python-appimage/releases/download/python3.8/python3.8.12-cp38-cp38-manylinux1_x86_64.AppImage
chmod +x python3.8.12-cp38-cp38-manylinux1_x86_64.AppImage
wget https://github.com/niess/python-appimage/releases/download/python3.8/python3.8.18-cp38-cp38-manylinux1_x86_64.AppImage
chmod +x python3.8.18-cp38-cp38-manylinux1_x86_64.AppImage
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod a+x appimagetool-x86_64.AppImage
}

extract_python_appimage () {
./python3.8.12-cp38-cp38-manylinux1_x86_64.AppImage --appimage-extract
./python3.8.18-cp38-cp38-manylinux1_x86_64.AppImage --appimage-extract
}

install_reana_client_into_python_appimage () {
./squashfs-root/AppRun -m pip install --no-cache-dir "reana-client==$version"
}

modify_python_appimage_to_run_reana_client_by_default () {
sed -i -e 's|/opt/python3.8/bin/python3.8|/usr/bin/reana-client|g' ./squashfs-root/AppRun
(cd squashfs-root && ln -sf usr/bin/reana-client AppRun)
}

test_modified_python_appimage () {
./squashfs-root/AppRun --help
}

edit_desktop_file () {
mv squashfs-root/usr/share/applications/python3.8.12.desktop squashfs-root/usr/share/applications/reana-client.desktop
mv squashfs-root/usr/share/applications/python3.8.18.desktop squashfs-root/usr/share/applications/reana-client.desktop
sed -i -e 's|^Name=.*|Name=reana-client|g' squashfs-root/usr/share/applications/*.desktop
sed -i -e 's|^Exec=.*|Exec=reana-client|g' squashfs-root/usr/share/applications/*.desktop
sed -i -e 's|^Icon=.*|Icon=reana-client|g' squashfs-root/usr/share/applications/*.desktop
Expand All @@ -75,7 +78,7 @@ test_created_reana_client_appimage () {

clean_after_ourselves () {
rm -rf logo-reana.png squashfs-root
rm -rf appimagetool-x86_64.AppImage python3.8.12-cp38-cp38-manylinux1_x86_64.AppImage
rm -rf appimagetool-x86_64.AppImage python3.8.18-cp38-cp38-manylinux1_x86_64.AppImage
}

download_python_appimage
Expand Down
Loading