]> sigrok.org Git - sigrok-util.git/blame - cross-compile/appimage/sigrok-native-appimage
sigrok-native-appimage: Add $APPIMAGEKIT_OUTDIR.
[sigrok-util.git] / cross-compile / appimage / sigrok-native-appimage
CommitLineData
54207903 1#!/bin/bash
3d2ed47b
UH
2##
3## Copyright (C) 2016 Simon Peter
4## Copyright (C) 2017 Uwe Hermann <uwe@hermann-uwe.de>
5## This file is licensed under the terms of the MIT license.
6##
54207903 7
3d2ed47b
UH
8# Bundle PulseView and its dependencies as an AppImage for x86_64 Linux.
9# Note: This assumes the full sigrok stack has been installed into $PREFIX.
54207903 10
3d2ed47b 11PREFIX=$HOME/sr
54207903 12
a8115a71
UH
13APPIMAGEKIT_OUTDIR=$HOME/AppImageKit/out
14
54207903 15ARCH=x86_64
16
a8115a71
UH
17########################################################################
18# You usually don't have to change anything below this line
19########################################################################
20
3d2ed47b
UH
21APP=PulseView
22LOWERAPP=${APP,,}
23
a8115a71
UH
24export STATIC_FILES=`pwd`/contrib
25
26# Add $APPIMAGEKIT_OUTDIR so we can find all the binaries there.
27export PATH=$APPIMAGEKIT_OUTDIR:$PATH
28
3d2ed47b
UH
29A="./$APP/$APP.AppDir"
30mkdir -p $A/usr/bin $A/usr/lib $A/usr/share
54207903 31cd ./$APP
32
1f369f0c 33. ../contrib/functions.sh
54207903 34
35########################################################################
3d2ed47b 36# Get build products from $PREFIX
54207903 37########################################################################
38
54207903 39cd $APP.AppDir/
40
3d2ed47b 41cp $PREFIX/bin/pulseview usr/bin/
54207903 42chmod a+x usr/bin/*
3d2ed47b
UH
43cp $PREFIX/lib/lib*.so* usr/lib/
44cp -r $PREFIX/share/libsigrokdecode usr/share/
45cp -r $PREFIX/share/sigrok-firmware usr/share/
54207903 46
47# Reduce binary size
48strip usr/bin/*
49strip usr/lib/*
50
51########################################################################
52# AppRun is the main launcher that gets executed when AppImage is run
53########################################################################
54
a8115a71 55cp $APPIMAGEKIT_OUTDIR/AppRun .
54207903 56
57########################################################################
58# Copy desktop and icon file to AppDir for AppRun to pick them up
59########################################################################
60
23c1d906 61cp ../../contrib/pulseview.desktop ../../contrib/sigrok-logo-notext.png .
54207903 62
54207903 63########################################################################
64# Copy in the dependencies that cannot be assumed to be available
65# on all target systems
66########################################################################
67
54207903 68copy_deps
69
70########################################################################
71# Delete stuff that should not go into the AppImage
72########################################################################
73
74delete_blacklisted
75move_lib
76mv ./usr/lib/x86_64-linux-gnu/* usr/lib/
77rm -r ./usr/lib/x86_64-linux-gnu/
78
3d2ed47b
UH
79# Remove some incorrectly/unintentionally copied files.
80rm -r ./home
81
54207903 82########################################################################
83# Determine the version of the app; also include needed glibc version
84########################################################################
85
3d2ed47b 86VER1="NIGHTLY"
54207903 87GLIBC_NEEDED=$(glibc_needed)
88VERSION=$VER1.glibc$GLIBC_NEEDED
89echo $VERSION
90
91########################################################################
92# Patch away absolute paths; it would be nice if they were relative
93########################################################################
94
95patch_usr
96
97########################################################################
98# AppDir complete
99# Now packaging it as an AppImage
100########################################################################
101
102cd ..
103
104generate_appimage