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