]> sigrok.org Git - sigrok-util.git/blame - cross-compile/appimage/sigrok-native-appimage
sigrok-native-appimage: Use local copies of .depktop and icon.
[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
13ARCH=x86_64
14
3d2ed47b
UH
15APP=PulseView
16LOWERAPP=${APP,,}
17
18A="./$APP/$APP.AppDir"
19mkdir -p $A/usr/bin $A/usr/lib $A/usr/share
54207903 20cd ./$APP
21
22wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
23. ./functions.sh
24
25########################################################################
3d2ed47b 26# Get build products from $PREFIX
54207903 27########################################################################
28
54207903 29cd $APP.AppDir/
30
3d2ed47b 31cp $PREFIX/bin/pulseview usr/bin/
54207903 32chmod a+x usr/bin/*
3d2ed47b
UH
33cp $PREFIX/lib/lib*.so* usr/lib/
34cp -r $PREFIX/share/libsigrokdecode usr/share/
35cp -r $PREFIX/share/sigrok-firmware usr/share/
54207903 36
37# Reduce binary size
38strip usr/bin/*
39strip usr/lib/*
40
41########################################################################
42# AppRun is the main launcher that gets executed when AppImage is run
43########################################################################
44
45get_apprun
46
47########################################################################
48# Copy desktop and icon file to AppDir for AppRun to pick them up
49########################################################################
50
23c1d906 51cp ../../contrib/pulseview.desktop ../../contrib/sigrok-logo-notext.png .
54207903 52
54207903 53########################################################################
54# Copy in the dependencies that cannot be assumed to be available
55# on all target systems
56########################################################################
57
54207903 58copy_deps
59
60########################################################################
61# Delete stuff that should not go into the AppImage
62########################################################################
63
64delete_blacklisted
65move_lib
66mv ./usr/lib/x86_64-linux-gnu/* usr/lib/
67rm -r ./usr/lib/x86_64-linux-gnu/
68
3d2ed47b
UH
69# Remove some incorrectly/unintentionally copied files.
70rm -r ./home
71
54207903 72########################################################################
73# Determine the version of the app; also include needed glibc version
74########################################################################
75
3d2ed47b 76VER1="NIGHTLY"
54207903 77GLIBC_NEEDED=$(glibc_needed)
78VERSION=$VER1.glibc$GLIBC_NEEDED
79echo $VERSION
80
81########################################################################
82# Patch away absolute paths; it would be nice if they were relative
83########################################################################
84
85patch_usr
86
87########################################################################
88# AppDir complete
89# Now packaging it as an AppImage
90########################################################################
91
92cd ..
93
94generate_appimage