Skip to content
Permalink
Browse files

Build 32-bit appimagetool and appimaged in Travis CI

This commit builds both appimagetool and appimaged inside a 32-bit
CentOS container in Travis CI.

Some notes:

- The `install-build-deps.sh` script has been heavily modified to
  correctly install 32-bit dependencies on both Ubuntu and CentOS (which
  doesn't support `devtoolset` in 32-bit).

- AppImage generation now runs inside a Docker container. As a
  consequence, we had to pass `--cap-add SYS_ADMIN --device
  /dev/fuse:/dev/fuse:mrw` to make FUSE work fine inside the container.

- `$HOME/.gnupg` is mapped to `/root/.gnupg` in the container to
  correctly handle GPG signing.

See: #304
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
  • Loading branch information...
Juan Cruz Viotti
Juan Cruz Viotti committed Dec 2, 2016
1 parent 6a7293f commit 5e3dbd45c31742bb5f7dc4fd160ce423bdc41c1c
Showing with 43 additions and 12 deletions.
  1. +8 −4 .travis.yml
  2. +11 −2 getsection.c
  3. +24 −6 install-build-deps.sh
@@ -5,8 +5,8 @@ services:
- docker

env:
# - DOCKER_IMAGE=toopher/centos-i386:centos6 # Pull request welcome that makes this work
- DOCKER_IMAGE=library/centos:6.8
- ARCH=i686 DOCKER_IMAGE=toopher/centos-i386:centos6
- ARCH=x86_64 DOCKER_IMAGE=library/centos:6.8

script:
- rm -rf data.tar.g* .gnu* || true
@@ -19,8 +19,12 @@ script:
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- find ./out/appimagetool.AppDir/
- find ./out/appimaged.AppDir/
- ( cd out/ ; ./appimagetool.AppDir/AppRun ./appimagetool.AppDir/ -s -v -u "zsync|https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage.zsync" )
- ( cd out/ ; ./appimagetool-x86_64.AppImage ./appimaged.AppDir/ -s -v -u "zsync|https://github.com/probonopd/AppImageKit/releases/download/continuous/appimaged-x86_64.AppImage.zsync" )
- docker run --cap-add SYS_ADMIN --device /dev/fuse:/dev/fuse:mrw -i -v ${PWD}/out:/out -v $HOME/.gnupg:/root/.gnupg "$DOCKER_IMAGE" /bin/bash -c
"yum -y install fuse fuse-libs &&
cd /out &&
./appimagetool.AppDir/AppRun ./appimagetool.AppDir/ -s -v -u \"zsync|https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage.zsync\"
appimagetool-$ARCH.AppImage &&
./appimagetool-$ARCH.AppImage ./appimaged.AppDir/ -s -v -u \"zsync|https://github.com/probonopd/AppImageKit/releases/download/continuous/appimaged-$ARCH.AppImage.zsync\" appimaged-$ARCH.AppImage"
- sudo apt-get install equivs
- ( cd out ; equivs-build ../appimaged.ctl )
- rm -rf out/appimaged out/appimagetool out/validate out/digest out/mksquashfs || true
@@ -11,12 +11,21 @@ int get_elf_section_offset_and_lenghth(char* fname, char* section_name, unsigned
{
uint8_t *data;
int i;
Elf64_Ehdr *elf;
Elf64_Shdr *shdr;
int fd = open(fname, O_RDONLY);
data = mmap(NULL, lseek(fd, 0, SEEK_END), PROT_READ, MAP_SHARED, fd, 0);

#ifdef __i386__
Elf32_Ehdr *elf;
Elf32_Shdr *shdr;
elf = (Elf32_Ehdr *) data;
shdr = (Elf32_Shdr *) (data + elf->e_shoff);
#else // Default to x86_64
Elf64_Ehdr *elf;
Elf64_Shdr *shdr;
elf = (Elf64_Ehdr *) data;
shdr = (Elf64_Shdr *) (data + elf->e_shoff);
#endif

char *strTab = (char *)(data + shdr[elf->e_shstrndx].sh_offset);
for(i = 0; i < elf->e_shnum; i++) {
if(strcmp(&strTab[shdr[i].sh_name], section_name) == 0) {
@@ -1,30 +1,48 @@
#!/bin/bash

set -e

# Install build dependencies; TODO: Support systems that do not use apt-get (Pull Requests welcome!)

ARCH=$(uname -p)
if [ "$ARCH" == "i686" ]; then
ARCH=i386
fi

if [ -e /usr/bin/apt-get ] ; then
apt-get update
sudo apt-get -y install zsync git libarchive-dev autoconf libtool make gcc libtool libfuse-dev \
liblzma-dev libglib2.0-dev libssl-dev libinotifytools0-dev liblz4-dev equivs
# libtool-bin might be required in newer distributions but is not available in precise
sudo cp resources/liblz4.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
sudo cp resources/liblz4.pc /usr/lib/$ARCH-linux-gnu/pkgconfig/
fi

if [ -e /usr/bin/yum ] ; then
# Install and enable EPEL and Devtoolset-4 by Software Collections
# https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/
yum -y install centos-release-scl-rh epel-release
yum -y install devtoolset-4-gcc.x86_64
if [ "$ARCH" == "x86_64" ]; then
yum -y install centos-release-scl-rh epel-release
yum -y install devtoolset-4-gcc.$ARCH
fi

# Install and enable Autotools by Pavel Raiskup
# https://www.softwarecollections.org/en/scls/praiskup/autotools/
rpm -ivh https://www.softwarecollections.org/en/scls/praiskup/autotools/epel-6-x86_64/download/praiskup-autotools-epel-6-x86_64.noarch.rpm
rpm -ivh https://www.softwarecollections.org/en/scls/praiskup/autotools/epel-6-$ARCH/download/praiskup-autotools-epel-6-$ARCH.noarch.rpm
yum -y install autotools-latest # 19 MB

rpm -ivh ftp://fr2.rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/zsync-0.6.2-1.el6.rf.x86_64.rpm
if [ "$ARCH" == "x86_64" ]; then
rpm -ivh ftp://fr2.rpmfind.net/linux/dag/redhat/el6/en/$ARCH/dag/RPMS/zsync-0.6.2-1.el6.rf.$ARCH.rpm
fi
if [ "$ARCH" == "i386" ]; then
rpm -ivh ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/uibmz:/opsi:/opsi40-testing/CentOS_CentOS-6/i386/zsync-0.6.1-6.2.i386.rpm
fi

yum -y install epel-release
yum -y install git wget make binutils fuse glibc-devel glib2-devel libarchive3-devel fuse-devel zlib-devel patch openssl-static openssl-devel vim-common # inotify-tools-devel lz4-devel
. /opt/rh/devtoolset-4/enable

if [ "$ARCH" == "x86_64" ]; then
. /opt/rh/devtoolset-4/enable
fi
. /opt/rh/autotools-latest/enable

# Unlike Ubuntu, CentOS does not provide .a, so we need to build it

0 comments on commit 5e3dbd4

Please sign in to comment.
You can’t perform that action at this time.