forked from facontidavide/PlotJuggler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for building AppImage via docker
- Loading branch information
1 parent
97bf27e
commit 0e0a993
Showing
4 changed files
with
54 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dockerfile | ||
.git/ |
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
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,10 +1,17 @@ | ||
#Download base image ubuntu 18.04 | ||
FROM ubuntu:18.04 | ||
FROM ubuntu:22.04 as builder | ||
|
||
RUN apt update | ||
RUN apt-get update && \ | ||
apt-get -y install cmake build-essential wget file qtbase5-dev libqt5svg5-dev libqt5websockets5-dev libqt5opengl5-dev libqt5x11extras5-dev libprotoc-dev libzmq3-dev liblz4-dev libzstd-dev libmosquittopp-dev | ||
|
||
RUN apt install cmake git build-essential qtbase5-dev libqt5svg5-dev libqt5websockets5-dev libqt5opengl5-dev libqt5x11extras5-dev nano qt5-default -y && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt clean | ||
RUN mkdir -p /opt/plotjuggler | ||
COPY . /opt/plotjuggler | ||
RUN mkdir /opt/plotjuggler/build | ||
WORKDIR /opt/plotjuggler/build | ||
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr | ||
RUN make -j `nproc` | ||
RUN make install DESTDIR=AppDir | ||
RUN /opt/plotjuggler/appimage/AppImage.sh | ||
|
||
FROM scratch as exporter | ||
COPY --from=builder /opt/plotjuggler/build/PlotJuggler-x86_64.AppImage / | ||
|
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,33 @@ | ||
#!/bin/bash | ||
|
||
APPDIRPATH=../build/AppDir | ||
|
||
# Uses linuxdeploy with linuxdeploy-plugin-qt to generate an AppImage | ||
LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | ||
LINUXDEPLOY_QT_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" | ||
|
||
LINUXDEPLOY_APPIMAGE="linuxdeploy-x86_64.AppImage" | ||
LINUXDEPLOY_QT_APPIMAGE="linuxdeploy-plugin-qt-x86_64.AppImage" | ||
|
||
# Get and extract linuxdeploy AppImage. Extraction is necessary since we are in a container without FUSE support | ||
wget ${LINUXDEPLOY_URL} | ||
chmod +x ${LINUXDEPLOY_APPIMAGE} | ||
mkdir linuxdeploy/ | ||
mv ${LINUXDEPLOY_APPIMAGE} linuxdeploy/ | ||
cd linuxdeploy | ||
./${LINUXDEPLOY_APPIMAGE} --appimage-extract | ||
cd - | ||
|
||
# Same for the plugin | ||
wget ${LINUXDEPLOY_QT_URL} | ||
chmod +x ${LINUXDEPLOY_QT_APPIMAGE} | ||
mkdir linuxdeploy-plugin-qt/ | ||
mv ${LINUXDEPLOY_QT_APPIMAGE} linuxdeploy-plugin-qt/ | ||
cd linuxdeploy-plugin-qt | ||
./${LINUXDEPLOY_QT_APPIMAGE} --appimage-extract | ||
# Rename the plugin to match linuxdeploy's expected format | ||
mv squashfs-root/AppRun squashfs-root/linuxdeploy-plugin-qt | ||
cd - | ||
|
||
PATH=$PATH:linuxdeploy-plugin-qt/squashfs-root ./linuxdeploy/squashfs-root/AppRun --appdir $APPDIRPATH -d ../PlotJuggler.desktop -i ../plotjuggler.png --plugin qt --output appimage | ||
|