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

Add AppImageBuilder #80

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
79 changes: 79 additions & 0 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Manually triggered build of mlnet, mlgui and utils binaries and appimage with mlnet+gui

name: Build AppImage

on:
workflow_dispatch

jobs:
build:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think ideally this build part of pipeline should be move to main pipeline, and then here keep only appimage (and use artifacts produced by main build pipeline)

runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends camlp4 libnum-ocaml-dev libminiupnpc-dev libnatpmp-dev libbz2-dev librsvg2-dev libmagic-dev libgtk2.0-dev liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev liblablgtk2-gnome-ocaml-dev libgd-dev

- name: Configure options
run: ./configure --enable-batch --enable-upnp-natpmp --disable-directconnect --disable-fasttrack --disable-gnutella --disable-gnutella2 --enable-gui=newgui2

- name: Build binaries
run: make

- name: Build utils
run: make utils

- name: Upload mlnet binary
uses: actions/upload-artifact@v3
with:
name: mlnet
path: mlnet

- name: Upload binaries + utils
uses: actions/upload-artifact@v3
with:
name: Binaries
path: |
mlnet
mlgui
bt_dht_node
copysources
get_range
make_torrent
mld_hash
subconv
svg_converter
if-no-files-found: warn

- name: Upload mlnet+gui binary
uses: actions/upload-artifact@v3
with:
name: mlnet+gui
path: mlnet+gui
if-no-files-found: warn

# appimage:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: mlnet+gui

- name: Download AppImageBuilder
run: wget https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.0.3/appimage-builder-1.0.3-x86_64.AppImage && chmod +x appimage-builder-1.0.3-x86_64.AppImage
lulol marked this conversation as resolved.
Show resolved Hide resolved

- name: Link recipe since env SOURCE_DIR=. doesn't work
run: ln -s packages/appimage/AppImageBuilder.yml AppImageBuilder.yml

- name: Build AppImage
run: ./appimage-builder-1.0.3-x86_64.AppImage --skip-tests

- name: Upload AppImage
uses: actions/upload-artifact@v3
with:
name: mldonkey_AppImage
path: mldonkey-*.AppImage

106 changes: 106 additions & 0 deletions packages/appimage/AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1

script:
# Download, configure and make
# - git clone https://github.com/ygrek/mldonkey.git
# - cd mldonkey
# - ./configure --enable-batch --enable-upnp-natpmp --disable-directconnect --disable-fasttrack --disable-gnutella --disable-gnutella2 --enable-gui=newgui2 -->
# - make
# Remove any previous build
- rm -rf AppDir | true
lulol marked this conversation as resolved.
Show resolved Hide resolved
# Get application version
# - ./mlnet+gui -v 2>&1 | sed -ne "s#^.*Starting MLDonkey \([^ ]\+\) .*#APP_VERSION=\1#p" >> $BUILDER_ENV
# - cat "$BUILDER_ENV"
# - APP_VERSION=$("$SOURCE_DIR"/mlnet+gui -v 2>&1 | sed -ne "s#^.*Starting MLDonkey \([^ ]\+\) .*#\1#p")
# - echo "$APP_VERSION"
# Make some needed dirs
- mkdir -p "$TARGET_APPDIR"/usr/bin
- mkdir -p "$TARGET_APPDIR"/usr/share/icons/default
- mkdir -p "$TARGET_APPDIR"/usr/share/applications
# Copy the application data into the AppDir
- cp "$SOURCE_DIR"/mlnet+gui "$TARGET_APPDIR"/usr/bin/
- cp "$SOURCE_DIR"/distrib/mldonkey.desktop "$TARGET_APPDIR"/usr/share/applications
- cp "$SOURCE_DIR"/icons/rsvg/type_source_normal.svg "$TARGET_APPDIR"/usr/share/icons/default/mldonkey.svg
# Relocatable by bruteforce patching
lulol marked this conversation as resolved.
Show resolved Hide resolved
- sed -i -e 's#/usr#././#g' "$TARGET_APPDIR"/usr/bin/mlnet+gui
# Create symlink
- ln -s ./usr/bin/mlnet+gui "$TARGET_APPDIR"/mldonkey_gui

AppDir:
path: ./AppDir
app_info:
id: mldonkey
name: mldonkey
icon: mldonkey
# version: {{APP_VERSION}}
# version: ${APP_VERSION}
# version: $APP_VERSION
version: 3.1.7.git
lulol marked this conversation as resolved.
Show resolved Hide resolved
exec: mldonkey_gui
exec_args: $@
apt:
arch:
- amd64
# allow_unauthenticated: true
sources:
- sourceline: 'deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: 'deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse'
- sourceline: 'deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse'
- sourceline: 'deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse'
- sourceline: 'deb http://archive.canonical.com/ubuntu/ focal partner'
include:
- ca-certificates
- libc6
- bzip2
- librsvg2-2
- libmagic1
- libmagic-mgc
- libminiupnpc17
- libnatpmp1
- libgtk2.0-0
- libatk-adaptor
- libgail-common
- libgd3
- perl-base
- dash
- make
files:
include:
- lib64/ld-linux-x86-64.so.2
- /usr/lib/file/libmagic-mgc
exclude:
- usr/share/man
- usr/share/doc/*/ANNOUNCE*
- usr/share/doc/*/AUTHORS*
- usr/share/doc/*/FAQ*
- usr/share/doc/*/HOWTO*
- usr/share/doc/*/NEWS*
- usr/share/doc/*/README*
- usr/share/doc/*/THANKS*
- usr/share/doc/*/TODO*
- usr/share/doc/*/changelog*
- usr/share/doc/*/copyright*
- usr/share/doc/*/examples/*
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
centos-7:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
ubuntu-xenial:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
AppImage:
arch: x86_64
update-information: None
# sign-key: None