taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

twister.sh (1977B)


      1 #!/bin/bash
      2 # This file is part of GNU Taler
      3 # (C) 2026 Taler Systems S.A.
      4 #
      5 # GNU Taler is free software; you can redistribute it and/or modify it under the
      6 # terms of the GNU General Public License as published by the Free Software
      7 # Foundation; either version 3, or (at your option) any later version.
      8 #
      9 # GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
     10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 #
     13 # You should have received a copy of the GNU General Public License along with
     14 # GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 #
     16 # Build taler-twister on the emulator host.
     17 #
     18 # It has to be built *there* and not in the workspace's shared prefix, because
     19 # that is where the driver runs and where the proxy has to listen.  It needs no
     20 # Taler libraries of its own -- GNUnet's util/json/curl, libmicrohttpd, jansson,
     21 # zlib and libcurl are all it links against, and a Debian with the gnunet-dev
     22 # packages has every one of them -- so --with-gnunet=/usr is usually right and
     23 # nothing from ~/target is involved.
     24 #
     25 # Usage: twister.sh <path-to-a-twister-checkout-or-tarball> [prefix]
     26 
     27 set -eu
     28 
     29 SRC=${1:?usage: twister.sh <twister-src> [prefix]}
     30 PREFIX=${2:-/tmp/twister-build/inst}
     31 BUILD=${POS_TWISTER_BUILD:-/tmp/twister-build/src}
     32 
     33 for p in gnunetutil libmicrohttpd jansson libcurl zlib; do
     34     pkg-config --exists "$p" ||
     35         { echo "twister.sh: missing $p (install the -dev package)" >&2; exit 1; }
     36 done
     37 
     38 mkdir -p "$BUILD"
     39 if [ -d "$SRC" ]; then
     40     tar -C "$SRC" --exclude=.git -cf - . | tar -C "$BUILD" -xf -
     41 else
     42     tar -C "$BUILD" -xf "$SRC"
     43 fi
     44 
     45 cd "$BUILD"
     46 ./bootstrap
     47 ./configure --with-gnunet="${POS_GNUNET_PREFIX:-/usr}" --prefix="$PREFIX"
     48 make -j"$(nproc)"
     49 make install
     50 
     51 echo
     52 echo "built: $PREFIX/bin/taler-twister-service"
     53 echo "point the driver at it with POS_TWISTER_PREFIX=$PREFIX"