Add appimage build

This commit is contained in:
roborg-codes 2023-01-01 19:23:24 +02:00
parent ceeaeab94b
commit 5764e8ec70
5 changed files with 60 additions and 0 deletions

4
appimage/entrypoint.sh Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
{{ python-executable }} "${APPDIR}/opt/python{{ python-version }}/bin/thefuck" "$@"

View File

@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -e
BUILD_DIR="$(git rev-parse --show-toplevel)/build"
mkdir -p "$BUILD_DIR"
docker build .. -f ./thefuck-appimage.Dockerfile -t tmp/thefuck-appimage --no-cache --force-rm
docker run --rm -v "$BUILD_DIR":/result tmp/thefuck-appimage
echo "Done. Appimage saved in $BUILD_DIR directory: $(ls -sh1 "$BUILD_DIR")"

View File

@ -0,0 +1,20 @@
FROM python:3.8-slim-buster
VOLUME /result
RUN apt update && \
apt install -y git file gpg && \
pip install git+https://github.com/niess/python-appimage pip-tools pipreqs && \
mkdir -p /result
ADD . /thefuck
WORKDIR /thefuck/thefuck
RUN pipreqs --savepath=requirements.in &&\
pip-compile && \
rm ./requirements.in && \
sed -i -e '1 i\\/thefuck' requirements.txt && \
mv ./requirements.txt /thefuck/appimage
WORKDIR /thefuck
RUN python -m python_appimage build app -p 3.8 /thefuck/appimage
CMD cp /thefuck/thefuck-x86_64.AppImage /result

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>thefuck</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>thefuck</name>
<summary>thefuck app running python {{ python-fullversion }}</summary>
<description>
<p>Magnificent app which corrects your previous console command.</p>
</description>
<launchable type="desktop-id">thefuck.desktop</launchable>
<url type="homepage">https://github.com/nvbn/thefuck</url>
<provides>
<binary>python{{ python-version }}</binary>
</provides>
</component>

8
appimage/thefuck.desktop Normal file
View File

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=thefuck
Exec=thefuck
Comment=Magnificent app which corrects your previous console command.
Icon=python
Categories=System;Utility;
Terminal=true