Skip to content

Commit

Permalink
added Dockerfile and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Jul 22, 2022
1 parent 0cdf68a commit 605d476
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ EXTRA_DIST = bootstrap.sh AUTHORS TODO NEWS README.md codemeta.json

ChangeLog: NEWS
git pull; git2cl > ChangeLog

docker:
docker build -t foliautils:latest .

docker-dev:
docker build -t foliautils:dev --build-arg VERSION=development .

deps:
./build-deps.sh

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ Contents of this distribution:
- Sources
- Licensing information ( COPYING )
- Build system based on GNU Autotools
- Dockerfile

Dependencies:
To be able to succesfully build libfolia from source, you need the following dependencies:
To be able to succesfully build foliautils from source, you need the following dependencies:

- ticcutils (https://github.com/LanguageMachines/ticcutils)
- libfolia (https://github.com/LanguageMachines/libfolia)
- ucto (https://github.com/LanguageMachines/ucto)
Expand All @@ -77,3 +79,11 @@ dependencies installed:
- $ ./configure
- $ make
- $ make install

If you want to automatically download and install the latest stable versions of
the required dependencies, then run `./build-deps.sh` prior to the above. You
can pass a target directory prefix as first argument and you may need to
prepend `sudo` to ensure you can install there. The dependencies are:

A `Dockerfile` for a container build is also available, specify `--build-arg VERSION=development` if you want the latest
development version instead.
38 changes: 38 additions & 0 deletions build-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

# Builds necessary dependencies from source

set -e

[ -z "$VERSION" ] && VERSION=stable
[ -z "$PREFIX" ] && [ -n "$1" ] && PREFIX=$1
[ -z "$PREFIX" ] && PREFIX=/usr/local

if [ "$VERSION" = "stable" ]; then
echo "------------------------------------------------------------------------">&2
echo " Building latest stable release of main dependencies from source.">&2
echo "------------------------------------------------------------------------">&2
else
echo "------------------------------------------------------------------------">&2
echo " Building development versions of main dependencie from source.">&2
echo " (This is experimental and may contain bugs! DO NOT PUBLISH!)">&2
echo "-----------------------------------------------------------------------">&2
fi

PWD="$(pwd)"
BUILDDIR="$(mktemp -dt "build-deps.XXXXXX")"
cd "$BUILDDIR"
BUILD_SOURCES="LanguageMachines/ticcutils LanguageMachines/libfolia LanguageMachines/uctodata LanguageMachines/ucto"
for SUFFIX in $BUILD_SOURCES; do \
NAME="$(basename "$SUFFIX")"
git clone "https://github.com/$SUFFIX"
cd "$NAME"
REF=$(git tag -l | grep -E "^v?[0-9]+(\.[0-9])*" | sort -t. -k 1.2,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
if [ "$VERSION" = "stable" ] && [ -n "$REF" ]; then
git -c advice.detachedHead=false checkout "$REF"
fi
sh ./bootstrap.sh && ./configure --prefix "$PREFIX" && make && make install
cd ..
done
cd "$PWD"
[ -n "$BUILDDIR" ] && rm -Rf "$BUILDDIR"

0 comments on commit 605d476

Please sign in to comment.