Permalink
Browse files

Add script to download from bintray; plus small docker build changes

  • Loading branch information...
ids1024 committed Sep 3, 2018
1 parent 787b54c commit fda872be2e5cd8a96ab2faaeabf51f2746dcaf4d
Showing with 33 additions and 4 deletions.
  1. +17 −3 README.md
  2. +1 −0 build-words-docker.sh
  3. +14 −0 fetch-words-bintray.sh
  4. +1 −1 words/build-words.sh
@@ -5,6 +5,8 @@ Whitaker's Words for Android
[`words`](http://archives.nd.edu/whitaker/words.htm) is a dictionary and morphological analysis tool by Colonel William Whitaker for Latin that accepts words of any form and gives the case/tense/etc. along with a short definition. This app provides a native Android interface that wraps the original command line program.
This app is on [Google Play](https://play.google.com/store/apps/details?id=com.ids1024.whitakerswords).
License
-------
@@ -13,13 +15,25 @@ Whitaker's Ada code is under the license in the [`words.LICENSE`](words.LICENSE)
Compiling
---------
### Building the words executable and data files
### Donloading or building the words executable and data files
Building the Ada code is problematic, since Android's NDK only supports C and C++. The `words` directory has scripts for building a copy of GCC with Ada support, targeting Android. Moreover, it has data files that need to be build, and potentially differ by architecture. So the build script here uses `qemu` to generate those.
To provide such I toolchain, I've built a [docker image](https://hub.docker.com/r/ids1024/ada-android/), which you can download and use, or [build yourself](https://github.com/ids1024/ada-android-docker) (given enough CPU time and disk space).
To provide such I toolchain, I've built a [docker image](https://hub.docker.com/r/ids1024/ada-android/), which you can download and use, or [build yourself](https://github.com/ids1024/ada-android-docker) (given enough CPU time and disk space). Prebuilt copies of words, automatically built by Travis CI, are available on [Bintray](https://bintray.com/ids1024/whitakers-words-android/master).
To compile this app, you'll need to obtain a copy of words in one of two ways:
Download prebuilt words from Bintray:
```bash
./fetch-words-bintray
```
Or, download the docker image and build words:
You can run `./build-words-docker.sh` to download the docker image and build words.
```bash
./build-words-docker.sh
```
### Compiling the app
@@ -8,6 +8,7 @@ sudo docker pull $IMAGE
# Disable seccomp for 'personality' syscall, which is used by bionic (in qemu)
sudo docker run \
--rm \
-v "$PWD/words:/words" \
-w /words \
-u $(id -u):$(id -g) \
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
version=$(curl https://bintray.com/api/v1/packages/ids1024/whitakers-words-android/master | \
python -c 'import json, sys; print(json.load(sys.stdin)["latest_version"])')
rm -f words.tar.xz
curl -L https://dl.bintray.com/ids1024/whitakers-words-android/words-$version.tar.xz -o words.tar.xz
rm -rf src/main/assets/words
mkdir -p src/main/assets
tar xf words.tar.xz -C src/main/assets
echo "Words extracted to src/main/assets/words from $version on bintray."
@@ -36,7 +36,7 @@ cd words-build
echo G | qemu-arm ./makedict
echo G | qemu-arm ./makestem
echo G | qemu-arm ./makeefil
echo G | qemu-arm ./makeinfl
echo G | qemu-arm ./makeinfl | sed '/\*\*\*\*/d'
echo "Copying output to 'words'..."
mkdir ../words

0 comments on commit fda872b

Please sign in to comment.