standalone linux app nearly ready

also made several fixes that apply to the OSX app
This commit is contained in:
Joey Hess 2012-09-28 19:08:13 -04:00
parent f0d75cd928
commit e88e3ba85b
11 changed files with 187 additions and 20 deletions

23
standalone/linux/README Normal file
View file

@ -0,0 +1,23 @@
To start the git-annex webapp, run the git-annex-webapp script in this
directory.
To enter an environment with git-annex in PATH, use runshell
This should work on any Linux system of the appropriate architecture.
More or less. There are no external dependencies, except for glibc.
Any recent-ish version of glibc should work (2.13 is ok; so is 2.11).
How it works: This directory contains a lot of libraries and programs
that git-annex needs. But it's not a chroot. Instead, runshell sets
PATH and LD_LIBRARY_PATH to point to the stuff in this directory.
The glibc libs are not included. Instead, it runs with the host system's
glibc. We trust that glibc's excellent backwards and forward compatability
is good enough to run binaries that were linked for a newer or older
version. Of course, this could fail. Particularly if the binaries try to
use some new glibc feature. But hopefully not.
Why not bundle glibc too? I've not gotten it to work! The host system's
ld-linux.so will be used for sure, as that's hardcoded into the binaries.
When I tried including libraries from glibc in here, everything segfaulted.

View file

@ -0,0 +1,25 @@
#!/bin/sh
base="$(dirname $0)"
if [ ! -d "$base" ]; then
echo "** cannot find base directory (I seem to be $0)" >&2
exit 1
fi
if [ ! -e "$base/runshell" ]; then
echo "** cannot find $base/runshell" >&2
exit 1
fi
# Get absolute path to base, to avoid breakage when things change directories.
orig="$(pwd)"
cd "$base"
base="$(pwd)"
cd "$orig"
# If this is a standalone app, set a variable that git-annex can use to
# install itself.
if [ -e "$base/bin/git-annex" ]; then
GIT_ANNEX_APP_BASE="$base"
export GIT_ANNEX_APP_BASE
fi
"$base/runshell" git-annex webapp "$@"

View file

@ -0,0 +1,43 @@
libanl-.*.so
libutil-.*.so
libnss_hesiod-.*.so
libcrypt-.*.so
libnss_compat-.*.so
libm-.*.so
libr.so
libpcprofile.so
libnss_nis-.*.so
libSegFault.so
libpthread-.*.so
librt-.*.so
libnss_dns-.*.so
libdl-.*.so
libBrokenLocale-.*.so
libnss_nisplus-.*.so
libthread_db-1.0.so
libmemusage.so
libcidn-.*.so
libnss_files-.*.so
libnsl-.*.so
libc-.*.so
ld-.*.so
libnss_nis.so
libthread_db.so
libanl.so
libr.so
libnss_compat.so
libm.so
libnss_dns.so
libpthread.so
libc.so
librt.so
libcidn.so
libnss_nisplus.so
libnsl.so
libutil.so
libBrokenLocale.so
ld-linux.so
libnss_files.so
libdl.so
libnss_hesiod.so
libcrypt.so

48
standalone/linux/runshell Executable file
View file

@ -0,0 +1,48 @@
#!/bin/sh
# Runs a shell command (or interactive shell) using the binaries and
# libraries bundled with this app.
set -e
base="$(dirname $0)"
if [ ! -d "$base" ]; then
echo "** cannot find base directory (I seem to be $0)" >&2
exit 1
fi
if [ ! -e "$base/bin/git-annex" ]; then
echo "** base directory $base does not contain bin/git-annex" >&2
exit 1
fi
if [ ! -e "$base/bin/git" ]; then
echo "** base directory $base does not contain bin/git" >&2
exit 1
fi
# Get absolute path to base, to avoid breakage when things change directories.
orig="$(pwd)"
cd "$base"
base="$(pwd)"
cd "$orig"
# Put our binaries first, to avoid issues with out of date or incompatable
# system binaries.
PATH=$base/bin:$PATH
export PATH
for lib in $(cat $base/libdirs); do
LD_LIBRARY_PATH="$base/$lib:$LD_LIBRARY_PATH"
done
export LD_LIBRARY_PATH
GIT_EXEC_PATH=$base/git-core
export GIT_EXEC_PATH
if [ "$1" ]; then
cmd="$1"
shift 1
exec "$cmd" "$@"
else
$SHELL
fi