From 0729f6481dd61d4f98ea534d651d7f1b9a7d5d4b Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Sun, 24 Mar 2019 16:25:03 -0400 Subject: AppImage packaging Disabled by default. To kick the the tires: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy sudo chmod +x linuxdeploy-x86_64.AppImage Enable VPP_BUILD_APPIMAGE e.g. in ccmake make build | make build-release The vpp AppImage lands in .../install-xxx-native/VPP-x86_64.AppImage. To run it: ./VPP-x86_64.AppImage vpp unix interactive To run it (as root) and inhale the usual startup.conf: sudo ./VPP-x86_64.AppImage \${HERE}/bin/vpp -c \${HERE}/etc/vpp/startup.conf To run vppctl, or any of the usual vpp binaries: ./VPP-x86_64.AppImage vppctl [etc] Change-Id: Ide8cf4658cbb56f1d36a1ce7fc8f7338f8d38278 Signed-off-by: Dave Barach --- src/CMakeLists.txt | 2 +- src/tools/appimage/AppRun | 14 +++++ src/tools/appimage/CMakeLists.txt | 27 +++++++++ src/tools/appimage/vpp.desktop | 11 ++++ src/tools/appimage/vpp.png | Bin 0 -> 22242 bytes src/tools/appimage/vpp.svg | 112 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 165 insertions(+), 1 deletion(-) create mode 100755 src/tools/appimage/AppRun create mode 100644 src/tools/appimage/CMakeLists.txt create mode 100644 src/tools/appimage/vpp.desktop create mode 100644 src/tools/appimage/vpp.png create mode 100644 src/tools/appimage/vpp.svg (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d467da7549a..248d7b8d39e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,6 +98,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(SUBDIRS vppinfra svm vlib vlibmemory vlibapi vnet vpp vat vcl plugins vpp-api tools/vppapigen tools/g2 tools/elftool tools/perftool cmake pkg + tools/appimage ) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(SUBDIRS vppinfra) @@ -141,4 +142,3 @@ pr("Host processor" "${CMAKE_HOST_SYSTEM_PROCESSOR}") pr("Target processor" "${CMAKE_SYSTEM_PROCESSOR}") pr("Prefix path" "${CMAKE_PREFIX_PATH}") pr("Install prefix" "${CMAKE_INSTALL_PREFIX}") - diff --git a/src/tools/appimage/AppRun b/src/tools/appimage/AppRun new file mode 100755 index 00000000000..b4c243c2038 --- /dev/null +++ b/src/tools/appimage/AppRun @@ -0,0 +1,14 @@ +#!/bin/sh +SELF=$(readlink -f "$0") +HERE=${SELF%/*} +export PATH="${HERE}/usr/bin/:${HERE}/usr/sbin/:${HERE}/usr/games/:${HERE}/bin/:${HERE}/sbin/${PATH:+:$PATH}" +export LD_LIBRARY_PATH="${HERE}/usr/lib/:${HERE}/usr/lib/i386-linux-gnu/:${HERE}/usr/lib/x86_64-linux-gnu/:${HERE}/usr/lib32/:${HERE}/usr/lib64/:${HERE}/lib/:${HERE}/lib/i386-linux-gnu/:${HERE}/lib/x86_64-linux-gnu/:${HERE}/lib32/:${HERE}/lib64/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" +export PYTHONPATH="${HERE}/usr/share/pyshared/${PYTHONPATH:+:$PYTHONPATH}" +export XDG_DATA_DIRS="${HERE}/usr/share/${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" +export PERLLIB="${HERE}/usr/share/perl5/:${HERE}/usr/lib/perl5/${PERLLIB:+:$PERLLIB}" +export GSETTINGS_SCHEMA_DIR="${HERE}/usr/share/glib-2.0/schemas/${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}" +export QT_PLUGIN_PATH="${HERE}/usr/lib/qt4/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt4/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt4/plugins/:${HERE}/usr/lib32/qt4/plugins/:${HERE}/usr/lib64/qt4/plugins/:${HERE}/usr/lib/qt5/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt5/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt5/plugins/:${HERE}/usr/lib32/qt5/plugins/:${HERE}/usr/lib64/qt5/plugins/${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}" +# EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1) +# exec "${EXEC}" "$@" +# So you can run vppctl, etc. +eval exec $* diff --git a/src/tools/appimage/CMakeLists.txt b/src/tools/appimage/CMakeLists.txt new file mode 100644 index 00000000000..1b83656dbf8 --- /dev/null +++ b/src/tools/appimage/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2018 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +option(VPP_BUILD_APPIMAGE "Build VPP AppImage" OFF) +if(VPP_BUILD_APPIMAGE) + install(FILES AppRun DESTINATION . + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_WRITE GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + install(FILES vpp.desktop DESTINATION .) + install(FILES vpp.png DESTINATION .) + install(FILES vpp.svg DESTINATION share/icons/hicolor/scalable/vpp.svg) + install(CODE "EXECUTE_PROCESS(COMMAND ln -s . ./usr + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})") + install(CODE "EXECUTE_PROCESS( + COMMAND linuxdeploy --appdir vpp --output appimage + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/..)") +endif() diff --git a/src/tools/appimage/vpp.desktop b/src/tools/appimage/vpp.desktop new file mode 100644 index 00000000000..008965c8905 --- /dev/null +++ b/src/tools/appimage/vpp.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=VPP +Exec=vpp %F +Icon=vpp +Type=Application +Categories=Network; +Comment=Vector Packet Processor +Name[en]=VPP +Terminal=false +StartupNotify=true +NoDisplay=false diff --git a/src/tools/appimage/vpp.png b/src/tools/appimage/vpp.png new file mode 100644 index 00000000000..ef78981dd2d Binary files /dev/null and b/src/tools/appimage/vpp.png differ diff --git a/src/tools/appimage/vpp.svg b/src/tools/appimage/vpp.svg new file mode 100644 index 00000000000..58b901e8c0a --- /dev/null +++ b/src/tools/appimage/vpp.svg @@ -0,0 +1,112 @@ + + + + + + + + + + image/svg+xml + + + + + + + V P P + -- cgit 1.2.3-korg