Skip to content

Commit a037354

Browse files
authored
Merge branch 'master' into feature/added_missing_include
2 parents 82f2dd0 + 7bd1c72 commit a037354

File tree

19 files changed

+6312
-57
lines changed

19 files changed

+6312
-57
lines changed

AppDirAssistant.AppDir/usr/bin/AppImageKit/AppImage.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22

33

4-
# probono 11-2010
4+
# probono 11-2010, 04-2013, 07-2016
55

66

77
import os, sys, subprocess, hashlib, urllib, tempfile, shutil
@@ -40,9 +40,9 @@ def __init__(self, path):
4040
self.path = os.path.normpath(os.path.abspath(path))
4141
self.path_md5 = hashlib.md5('file://' + urllib.quote(self.path)).hexdigest()
4242
self.is_appimage = False
43-
self.iconfile_path = os.path.expanduser('~/.thumbnails/normal/') + self.path_md5 + '.png'
44-
desktopfiles_location = xxdg.BaseDirectory.xdg_data_home + "/applications/appimage/"
45-
self.desktopfile_path = desktopfiles_location + self.path_md5 + ".desktop" # TODO: factor out
43+
self.iconfile_path = os.path.expanduser('~/.cache/thumbnails/normal/') + self.path_md5 + '.png'
44+
desktopfiles_location = xxdg.BaseDirectory.xdg_data_home + "/applications/" # Subdirectory does not work on GNOME 3
45+
self.desktopfile_path = desktopfiles_location + "appimage-" + self.path_md5 + ".desktop" # TODO: factor out
4646

4747
def check_whether_is_appimage(self):
4848
"Checks whether the file is an AppImage. TODO: Speed up by not using file"
@@ -91,10 +91,14 @@ def install_desktop_integration(self, parentifthreaded=None):
9191
print "* Installing %s" % (self.desktopfile_path)
9292
#f = open(desktopfile_path, "w")
9393
f = tempfile.NamedTemporaryFile(delete=False)
94-
f.write(self.get_file(self.get_desktop_filename()))
94+
string = self.get_file(self.get_desktop_filename()).replace("X-GNOME-FullName", "X-AppImage-Original-GNOME-FullName").replace("Name[", "X-AppImage-Original-Name[") # Don't use localized names, since we want the filename as the name
95+
print string
96+
f.write(string)
9597
f.close()
9698
desktop = xxdg.DesktopEntry.DesktopEntry()
9799
desktop.parse(f.name)
100+
desktop.set("X-AppImage-Original-Name", desktop.get("Name"))
101+
desktop.set("Name", os.path.basename(self.path))
98102
desktop.set("X-AppImage-Original-Exec", desktop.get("Exec"))
99103
desktop.set("X-AppImage-Original-Icon", desktop.get("Icon"))
100104
try:
@@ -112,8 +116,9 @@ def install_desktop_integration(self, parentifthreaded=None):
112116
os.chmod(f.name, 0755)
113117
print self.desktopfile_path
114118
shutil.move(f.name, self.desktopfile_path) # os.rename fails when tmpfs is mounted at /tmp
115-
if os.env("KDE_SESSION_VERSION") == "4":
116-
timesavers.run_shell_command("kbuildsycoca4") # Otherwise KDE4 ignores the menu
119+
if "KDE_SESSION_VERSION" in os.environ:
120+
if os.environ["KDE_SESSION_VERSION"] == "4":
121+
timesavers.run_shell_command("kbuildsycoca4") # Otherwise KDE4 ignores the menu
117122

118123
def uninstall_desktop_integration(self):
119124
if os.path.isfile(self.desktopfile_path):

AppImageAssistant.AppDir/package

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ elf = os.path.realpath(os.path.dirname(__file__)) + "/runtime"
8989
s = open(elf, 'rb')
9090
f = open(destinationfile, 'rb+')
9191
f.write(bytes(s.read()))
92+
print("ok")
93+
print("Embedding magic number 0x414901 at offset 8...")
94+
f.seek(8)
95+
f.write('\x41\x49\x01')
9296
f.close()
9397
s.close()
9498
print("ok")

AppImageAssistant.AppDir/testappimage

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
#
4-
# Test an AppDir or AppImage on a given ISO or squashfs base system
4+
# Test an AppDir or AppImage on a given ISO or squashfs or ext3 base system
55
# TODO: Check https://github.com/FGrose/livecd-tools/blob/liveimage-mount/tools/liveimage-mount
66
#
77

@@ -51,6 +51,13 @@ if [ ${1: -4} == ".sfs" ] ; then
5151
mount -o loop,ro "$ISO" /tmp/$PREF/unionfs/root
5252
fi
5353

54+
# If ext3 was provided, then assume it contains a rootfs use just that
55+
THEFS="$1"
56+
if [ ${1: -4} == "ext3" ] ; then
57+
ISO="$1"
58+
mount -o loop,ro "$ISO" /tmp/$PREF/unionfs/root
59+
fi
60+
5461
echo ""
5562
echo "===================================================="
5663
echo ""
@@ -81,6 +88,12 @@ if [ -e /tmp/$PREF/iso/*-read-only.* ] ; then
8188
mount "$THEFS" /tmp/$PREF/unionfs/root -o loop,ro || exit 1
8289
fi
8390

91+
# In case of puppy-like ISOs
92+
if [ -e /tmp/$PREF/iso/puppy_*.sfs ] ; then
93+
THEFS=$(ls /tmp/$PREF/iso/puppy_*.sfs | head -n 1)
94+
mount "$THEFS" /tmp/$PREF/unionfs/root -o loop,ro || exit 1
95+
fi
96+
8497
trap atexit EXIT
8598

8699
atexit()
@@ -142,7 +155,7 @@ rm -rf /etc/pango
142155
mkdir -p /etc/pango
143156
pango-querymodules > '/etc/pango/pango.modules' 2>/dev/null # otherwise only squares instead of text
144157
[ -f /si-chroot ] && ln -s /lib/ld-lsb.so.3 /lib/ld-linux.so.2
145-
LD_LIBRARY_PATH=$MNT/usr/lib:$MNT/usr/lib32:$MNT/usr/lib64:$MNT/lib/:$LD_LIBRARY_PATH ldd $MNT/usr/bin/* $MNT/usr/lib/* 2>/dev/null | grep "not found" | sort | uniq
158+
# LD_LIBRARY_PATH=$MNT/usr/lib:$MNT/usr/lib32:$MNT/usr/lib64:$MNT/lib/:$LD_LIBRARY_PATH ldd $MNT/usr/bin/* $MNT/usr/lib/* 2>/dev/null | grep "not found" | sort | uniq
146159
export HOME="/root"
147160
export LANG="en_EN.UTF-8"
148161
# export QT_PLUGIN_PATH=./lib/qt4/plugins ###################### !!!
@@ -152,9 +165,9 @@ export QT_DEBUG_PLUGINS=1
152165
dbus-uuidgen --ensure ; dbus-launch # Needed for CentOS 6.7 to launch apps that talk to dbus
153166
if [ -f $MNT/usr/lib/qt5/plugins/platforms/libqxcb.so ] ; then
154167
export LD_LIBRARY_PATH=$MNT/usr/lib/:$LD_LIBRARY_PATH
155-
ldd $MNT/usr/lib/qt5/plugins/platforms/libqxcb.so | grep not
168+
##ldd $MNT/usr/lib/qt5/plugins/platforms/libqxcb.so | grep not
156169
fi
157-
find $MNT/usr/lib -type f -exec sh -c 'ldd {} | grep "not found"' 2>/dev/null \;
170+
##find $MNT/usr/lib -type f -exec sh -c 'ldd {} | grep "not found"' 2>/dev/null \;
158171
if [ $(which $RUN_COMMAND) ] ; then
159172
exec $RUN_INSIDE
160173
else

AppImageUpdate.AppDir/README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,43 @@ echo "zsync|https://resin-production-downloads.s3.amazonaws.com/etcher/latest/Et
132132

133133
**Step 2: Upload the AppImage and the AppImage.zsync to an URL that matches the URL specified in the update information**
134134

135-
You would have to copy both `Etcher-linux-x64.AppImage.zsync` and `Etcher-linux-x64.AppImage.zsync` to `https://resin-production-downloads.s3.amazonaws.com/etcher/latest/` for this to work.
135+
You would have to copy both `Etcher-linux-x64.AppImage` and `Etcher-linux-x64.AppImage.zsync` to `https://resin-production-downloads.s3.amazonaws.com/etcher/latest/` for this to work.
136136

137-
When you have a new version, simply put the updated `Etcher-linux-x64.AppImage.zsync` and `Etcher-linux-x64.AppImage.zsync` at the *same* location.
137+
When you have a new version, simply put the updated `Etcher-linux-x64.AppImage` and `Etcher-linux-x64.AppImage.zsync` at the *same* location.
138138

139139
At this point, AppImageUpdate should work. AppImageUpdate is really just an example GUI around the (work-in-progress but useable) [appimageupdate](https://github.com/probonopd/AppImageKit/blob/master/AppImageUpdate.AppDir/usr/bin/appimageupdate) bash script. You could put `appimageupdate` (and its dependency [zsync_curl](https://github.com/probonopd/zsync-curl)) inside `usr/bin` of the AppImage, and call `appimageupdate` from within your app and even have a little GUI around it; or reimplement it in the language of your app.
140140

141+
## Other example
142+
143+
```
144+
# Let's use ".AppImage" as the standard suffix
145+
mv krita-3.0-x86_64.appimage Krita-3.0-x86_64.AppImage
146+
147+
# Note that there is no "3" in the URL and no "3.0"
148+
# as this URL must always point to the latest/current zsync file
149+
URL="zsync|http://files.kde.org/krita/linux/Krita-latest-x86_64.AppImage.zsync"
150+
151+
wget https://github.com/probonopd/AppImageKit/raw/master/AppImageUpdate.AppDir/usr/bin/appimageupdate
152+
wget https://github.com/probonopd/zsync-curl/releases/download/_binaries/zsync_curl
153+
chmod a+x zsync_curl
154+
PATH=.:$PATH bash appimageupdate Krita-3.0-x86_64.AppImage set $URL
155+
156+
# Should say:
157+
# "Changed to zsync|http://files.kde.org/krita/linux/Krita-latest-x86_64.AppImage.zsync"
158+
159+
sudo apt install zsync
160+
zsyncmake Krita-3.0-x86_64.AppImage
161+
mv Krita-3.0-x86_64.AppImage.zsync Krita-latest-x86_64.AppImage.zsync
162+
163+
# Now upload Krita-3.0-x86_64.AppImage and Krita-latest-x86_64.AppImage.zsync to
164+
# http://files.kde.org/krita/linux/
165+
166+
# Check whether appimageupdate finds the stuff on the server by running on the client:
167+
PATH=.:$PATH bash appimageupdate ./Krita-3.0-x86_64.AppImage
168+
169+
# Assuming that 3.0.1 comes out, repeat the steps with 3.0.1
170+
```
171+
141172
## TODO
142173

143174
* Implement a GUI

AppImageUpdate.AppDir/usr/bin/appimageupdate

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ if [ "$TYPE" == "zsync" ] ; then
140140
# downloads and reuse the data already downloaded.
141141
ZSYNC_URL=$(echo "${APPLICATION_USED}" | cut -d "|" -f 2) # Get the URL of the zsync file
142142
# Get the file with zsync using $1 as an input file
143-
zsync_curl -# -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') && finished
143+
zsync_curl -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') && finished
144144
NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!!
145-
chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file
145+
chmod --reference="${ISO}.zs-old" "${NEWFILE}" # Set the same permissions as for the original file
146146
gpg_check
147147
elif [ "$TYPE" == "bintray-zsync" ] ; then
148148
cd $(dirname "${ISO}")
@@ -172,7 +172,7 @@ elif [ "$TYPE" == "bintray-zsync" ] ; then
172172
# Get the file with zsync using $1 as an input file
173173
zsync_curl -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') && finished
174174
NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!!
175-
chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file
175+
chmod --reference="${ISO}.zs-old" "${NEWFILE}" # Set the same permissions as for the original file
176176
gpg_check
177177

178178
elif [ "$TYPE" == "" ] ; then
@@ -187,6 +187,6 @@ else
187187
exit 1
188188
fi
189189

190-
rm *.zs-old 2>/dev/null || true
190+
rm "${ISO}.zs-old" "${ISO}.asc" 2>/dev/null || true
191191

192192
echo "Successfully updated to version ${VERSION}"

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AppImageKit [![Build Status](https://travis-ci.org/probonopd/AppImageKit.svg?branch=master)](https://travis-ci.org/probonopd/AppImageKit) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/probonopd/AppImageKit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1+
# AppImageKit [![discourse](https://img.shields.io/badge/forum-discourse-orange.svg)](http://discourse.appimage.org) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/probonopd/AppImageKit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![irc](https://img.shields.io/badge/IRC-%23AppImage%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=AppImage)
22

33
Copyright (c) 2004-16 Simon Peter <probono@puredarwin.org> and contributors.
44

@@ -12,7 +12,7 @@ conveniently handling AppImages.
1212

1313
https://en.wikipedia.org/wiki/AppImage
1414

15-
This document describes the AppImage format and AppImageKit. It is intended to describe the philosophy behind the AppImage format and the concrete implementation. This document is not a formal specification, since the AppImage format is not frozen yet but in the process of being specified more formally. Contributors are encouraged to comment on this document and propose formal format descriptions.
15+
This document describes the AppImage format and AppImageKit. It is intended to describe the philosophy behind the AppImage format and the concrete implementation. This document is not a formal specification, since the AppImage format is not frozen yet but in the process of being specified more formally at https://github.com/AppImage/AppImageSpec. Contributors are encouraged to comment.
1616

1717
Significant upstream projects have started providing AppImages of releases and/or nightly/continuous builds, see this [list of upstream-provided AppImages](https://github.com/probonopd/AppImageKit/wiki/AppImages#upstream-appimages).
1818

@@ -37,7 +37,7 @@ With the introduction of Mac OS X, arguably the first UNIX-based operating syste
3737

3838
Open Source operating systems, such as the most prominent Linux distributions, mostly use package managers for everything. While this is perceived superior to Windows and the Mac by many Linux enthusiasts, it also creates a number of disadvantages:
3939

40-
1. __Centralization__ Some organization decides what is "in" a distribution and what is not. By definition, software "in" a distribution is easier to install and manage that software that is not.
40+
1. __Centralization__ Some organization decides what is "in" a distribution and what is not. By definition, software "in" a distribution is easier to install and manage than software that is not.
4141
2. __Duplication of effort__ In traditional systems, each application is compiled specifically for each target operating system. This means that one piece of software has to be compiled many, many times on many, many systems using much, much power and time
4242
3. __Need to be online__ Most package managers are created with connected computers in the mind, making it really cumbersome to "just fetch an app" on an online system, and copy it over to another system that is not connected to the Internet.
4343

@@ -65,7 +65,7 @@ The AppImage format has been created with specific objectives in mind.
6565

6666
1. __Be Simple__. AppImage is intended to be a very simple format that is easy to understand, create, and manage.
6767
2. __Maintain binary compatibility__. AppImage is a format for binary software distribution. Software packaged as AppImage is intended to be as binary-compatible as possible with as many systems as possible. The need for (re-)compilation of software should be greatly reduced.
68-
3. __Be distribution-agostic__. An AppImage should run on all base operating systems (distributions) that it was created for (and later versions). For example, you could target Ubuntu 9.10, openSUSE 11.2, and Fedora 13 (and later versions) at the same time, without having to create and maintain separate packages for each target system.
68+
3. __Be distribution-agnostic__. An AppImage should run on all base operating systems (distributions) that it was created for (and later versions). For example, you could target Ubuntu 9.10, openSUSE 11.2, and Fedora 13 (and later versions) at the same time, without having to create and maintain separate packages for each target system.
6969
4. __Remove the need for installation__. AppImages contain the app in a format that allows it to run directly from the archive, without having to be installed first. This is comparable to a Live CD. Before Live CDs, operating systems had to be installed first before they could be used.
7070
5. __Keep apps compressed all the time__. Since the application remains packaged all the time, it is never uncompressed on the hard disk. The computer uncompresses the application on-the-fly while accessing it. Since decompression is faster than reading from hard disk on most systems, this has a speed advantage in addition to saving space. Also, the time needed for installation is entirely removed.
7171
6. __Allow to put apps anywhere__. AppImages are "relocatable", thus allowing the user to store and execute them from any location (including CD-ROMs, DVDs, removable disks, USB sticks).
@@ -196,6 +196,32 @@ AppImages can be updated using [AppImageUpdate](https://github.com/probonopd/App
196196

197197
For the full story, read [this](https://github.com/probonopd/AppImageKit/blob/master/AppImageUpdate.AppDir/README.md).
198198

199+
## Sandboxing
200+
201+
[Firejail](https://github.com/netblue30/firejail/) is a low-overhead sandbox that provides native support for the AppImage format. Written in C with virtually no dependencies, Firejail runs on any Linux computer with a 3.x kernel version or newer.
202+
203+
To run an AppImage inside a Firejail sandbox, run it like this:
204+
205+
```
206+
$ firejail --appimage Krita-3.0-x86_64.AppImage
207+
```
208+
209+
or with some basic X11 and network sandboxing:
210+
211+
```
212+
$ firejail --appimage --net=none --x11 Krita-3.0-x86_64.AppImage
213+
```
214+
215+
These are the main features of AppImage/Firejail combination ([source](https://firejail.wordpress.com/documentation-2/appimage-support/)):
216+
* State of the art software packaging and sandboxing technology
217+
* The only requirement to run the sandboxed application is a Linux kernel version 3 or newer – there are no dependencies, no 200MB runtimes to download and install
218+
* Network and X11 sandboxing available today!
219+
* Graphical user interface and auditing capabilities
220+
* Low runtime overhead – we do not increase the attack surface of the software environment by running daemons in the background
221+
* It can be used in parallel with other security frameworks such as Grsecurity, AppArmor, SELinux
222+
223+
It is also possible to use the [Bubblewrap](https://github.com/probonopd/AppImageKit/blob/master/sandbox/README.md) sandbox to run AppImages.
224+
199225
## Support
200226

201227
I support open source projects that wish to distribute their software as an AppImage. For closed source applications, I offer AppImage packaging and testing as a service.

ROADMAP.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# AppImageKit roadmap
2+
3+
Volunteers wanted for the following topics. Feel free to send a PR that adds your name to list item(s).
4+
5+
## Downloading appimages from some kind of software catalog websites and app centers
6+
7+
* Define formal AppImage spec (probonopd)
8+
* Work on tool that lets one extract metadata like application name, author, license, etc. from an AppImage hosted somewhere without having to download it (think "Google for AppImages")
9+
* Get AppImage downloads into KDE Discover
10+
* Write GNOME Software plugin for AppImage
11+
12+
## Running appimage and browsing its content via file roller/ark or any other archive tool
13+
14+
* Follow up with upstream projects and/or send PRs
15+
* file-roller
16+
* ark (DONE)
17+
18+
## Upgrading appimage via right click
19+
20+
* Make zsync_curl use subsequent range requests rather than requesting multiple ranges at once; otherwise Akamai is broken
21+
* Make AppImageUpdate not need the curl binary but expand zsync_curl to include the required curl functionality
22+
* Possibly replace the AppImageUpdate bash script by C code, e.g., in zsync_curl
23+
* Qt GUI in addition to the Vala/GTK 3 one
24+
25+
## Desktop integration
26+
27+
* Resurrect appimaged (probonopd; contact me if you want to take this over)
28+
* Sandbox using firejail (see the sandbox GUI integration experiments in this repository)
29+
* Test/use GNOME portals
30+
31+
## IDE/build tool integration
32+
* Someone familiar with Qt (= not me, probono) should have a deep look at http://code.qt.io/cgit/qt/qttools.git/tree/src/macdeployqt/ and see if the same can be done to generate an AppImage

depgraph/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# depgraph
2+
3+
Draws a chart of dependencies based on the information in debian repositories.
4+
5+
[Example](https://github.com/probonopd/AppImageKit/blob/master/depgraph/marble.svg)

0 commit comments

Comments
 (0)