Skip to content

Commit

Permalink
Try to update testing
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-hellings committed Mar 17, 2020
1 parent 753936d commit ed35be3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 38 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,12 @@ src/examples/ipc-interface.xml
win*/binaries/
win32/nsis/xiphos*.exe
win32/po/messages.mo

# Files involved in testing builds
sword-*
gtkhtml-4.10.0*
enchant-2.patch
docker-build
build_scripts
biblesync-1.2.0*
before_scripts
64 changes: 26 additions & 38 deletions .travis.yml
Expand Up @@ -60,8 +60,9 @@ requires:

debian:
- appstream-util
- libbiblesync-dev
- cmake
- cpp
- g++
- desktop-file-utils
- fp-utils
- gsettings-desktop-schemas-dev
Expand All @@ -79,6 +80,7 @@ requires:
- libwebkit2gtk-4.0-dev
- libxml2-dev
- libxml2-utils
- make
- python-dev
- swig
- uuid-dev
Expand Down Expand Up @@ -109,7 +111,7 @@ requires:
ubuntu:
- appstream-util
- cmake
- cpp
- g++
- desktop-file-utils
- fp-utils
- gsettings-desktop-schemas-dev
Expand All @@ -128,6 +130,7 @@ requires:
- libwebkit2gtk-4.0-dev
- libxml2-dev
- libxml2-utils
- make
- python-dev
- swig
- uuid-dev
Expand All @@ -139,42 +142,35 @@ variables:

before_scripts:
- |
if [ "${DISTRO_NAME}" != "fedora" ];then
# build biblesync from source
cd ${START_DIR}
curl -Ls -o biblesync-1.2.0.tar.gz https://github.com/karlkleinpaste/biblesync/archive/1.2.0.tar.gz
tar xf biblesync-1.2.0.tar.gz
cd biblesync-1.2.0
mkdir -p build
cd build
cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=/usr/lib ..
if [ $CPU_COUNT -gt 1 ]; then
make -j $CPU_COUNT
else
make
fi
make install
START_DIR="$(pwd)"
if [ "${DISTRO_NAME}" == "ubuntu" -o "${DISTRO_NAME}" == "debian" ]; then
# build gtkhtml4 from source
cd ${START_DIR}
cd "${START_DIR}"
curl -Ls -o gtkhtml-4.10.0.tar.xz https://download.gnome.org/sources/gtkhtml/4.10/gtkhtml-4.10.0.tar.xz
curl -Ls -o enchant-2.patch "https://aur.archlinux.org/cgit/aur.git/plain/enchant-2.patch?h=gtkhtml4"
tar xf gtkhtml-4.10.0.tar.xz
cd gtkhtml-4.10.0
if [ "${DISTRO_NAME}" == "archlinux" ];then
patch -Np0 -i ../enchant-2.patch
autoreconf -i
patch -Np0 -i ../enchant-2.patch
autoreconf -i
fi
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/gtkhtml4 --localstatedir=/var --disable-static
if [ $CPU_COUNT -gt 1 ]; then
make -j $CPU_COUNT
else
make
fi
make -j2
make install
fi
if [ "${DISTRO_NAME}" == "debian" -o "${DISTRO_NAME}" == "ubuntu" ];then
if [ "${DISTRO_NAME}" == "ubuntu" ];then
# build biblesync from source
cd "${START_DIR}"
curl -Ls -o biblesync-1.2.0.tar.gz https://github.com/karlkleinpaste/biblesync/archive/1.2.0.tar.gz
tar xf biblesync-1.2.0.tar.gz
cd biblesync-1.2.0
mkdir -p build
cd build
cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=/usr/lib ..
make -j2
make install
# update sword from 1.7.3 to 1.8.1
cd ${START_DIR}
cd "${START_DIR}"
curl -Ls -o sword-1.8.1.tar.gz https://www.crosswire.org/ftpmirror/pub/sword/source/v1.8/sword-1.8.1.tar.gz
curl -Ls -o sword-1.8.1-cmake.diff https://src.fedoraproject.org/rpms/sword/raw/master/f/sword-1.8.1-cmake.diff
curl -Ls -o sword-1.8.1-icu61.diff https://src.fedoraproject.org/rpms/sword/raw/master/f/sword-1.8.1-icu61.diff
Expand All @@ -184,14 +180,10 @@ before_scripts:
patch -p1 -i ../sword-1.8.1-cmake.diff
patch -p1 -i ../sword-1.8.1-icu61.diff
patch -p1 -i ../sword-1.8.1-swig.diff
mkdir build
mkdir -p build
cd build
cmake -DLIBSWORD_LIBRARY_TYPE="Shared" -DSYSCONF_INSTALL_DIR='/etc' -DSWORD_BUILD_TESTS="Yes" -DSWORD_BINDINGS="Python" -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib/x86_64-linux-gnu ..
if [ $CPU_COUNT -gt 1 ]; then
make -j $CPU_COUNT
else
make
fi
make -j2

This comment has been minimized.

Copy link
@alerque

alerque Mar 17, 2020

Contributor

On Travis I'm pretty sure you can set this with with nproc: make -j $(nproc), but an even better way would be to export MAKEFLAGS with this value early on so all make invocations use it. If you can't run that in env→global (you might be able to) I know you can do it in before_install: export MAKEFLAGS+=-j$(nproc). Then you can run just plain make here and elsewhere.

This comment has been minimized.

Copy link
@greg-hellings

greg-hellings Mar 17, 2020

Author Contributor

Ah, that seems more cross-platform compatible than the old "${CPU_COUNT}" that's exported in Travis but was causing issues elsewhere.

make install
fi
Expand All @@ -200,8 +192,4 @@ build_scripts:
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DGTKHTML=ON ..
if [ $CPU_COUNT -gt 1 ]; then
make -j $CPU_COUNT
else
make
fi
make -j2

3 comments on commit ed35be3

@karlkleinpaste
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be merged as it stands, or wait for an update to generalize the -j usage?

@greg-hellings
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged this a while ago. I just went with -j2 as we're only in test containers here. I don't know of any that offer more than 2 CPUs to free builds (Travis, GitHub Actions, and last I checked Circle CI give you 2 CPUs). We can make it more generic in the future if we desire to do so, but it doesn't seem that important.

@karlkleinpaste
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

um, sorry, from the email where i first saw this, i was thinking that this was due for a merge. never mind...

Please sign in to comment.