Fredrik Fornwall
9 years ago
18 changed files with 41 additions and 38 deletions
@ -1,11 +1,14 @@ |
|||||
TERMUX_PKG_HOMEPAGE=http://termux.com/add-ons/api/ |
TERMUX_PKG_HOMEPAGE=http://termux.com/add-ons/api/ |
||||
TERMUX_PKG_DESCRIPTION="Termux API commands" |
TERMUX_PKG_DESCRIPTION="Termux API commands" |
||||
TERMUX_PKG_VERSION=0.7 |
TERMUX_PKG_VERSION=0.8 |
||||
|
|
||||
termux_step_make_install () { |
termux_step_make_install () { |
||||
mkdir -p $TERMUX_PREFIX/bin |
mkdir -p $TERMUX_PREFIX/bin |
||||
for file in `ls $TERMUX_PKG_BUILDER_DIR/* | grep -v build.sh | grep -v termux-api.c`; do |
local TERMUX_API_BINARY=$TERMUX_PREFIX/libexec/termux-api |
||||
cp $file $TERMUX_PREFIX/bin |
cd $TERMUX_PKG_BUILDER_DIR |
||||
|
for file in `ls termux-* | grep -v termux-api.c`; do |
||||
|
sed "s|@TERMUX_API@|$TERMUX_API_BINARY|" $file > $TERMUX_PREFIX/bin/$file |
||||
|
chmod +x $TERMUX_PREFIX/bin/$file |
||||
done |
done |
||||
$CC $CFLAGS -std=c11 -Wall -Wextra -pedantic -Werror $LDFLAGS $TERMUX_PKG_BUILDER_DIR/termux-api.c -o $TERMUX_PREFIX/bin/termux-api |
$CC $CFLAGS -std=c11 -Wall -Wextra -pedantic -Werror $LDFLAGS termux-api.c -o $TERMUX_API_BINARY |
||||
} |
} |
||||
|
@ -1,3 +1,3 @@ |
|||||
#!/system/bin/sh |
#!/bin/sh |
||||
|
|
||||
termux-api CameraInfo |
@TERMUX_API@ CameraInfo |
||||
|
@ -1,3 +1,3 @@ |
|||||
#!/system/bin/sh |
#!/bin/sh |
||||
|
|
||||
termux-api Clipboard |
@TERMUX_API@ Clipboard |
||||
|
@ -1,4 +1,4 @@ |
|||||
#!/system/bin/sh |
#!/bin/sh |
||||
|
|
||||
TEXT=`cat -` |
TEXT=`cat -` |
||||
termux-api Clipboard --es text "$TEXT" |
@TERMUX_API@ Clipboard --es text "$TEXT" |
||||
|
@ -1,10 +1,10 @@ |
|||||
#!/system/bin/sh |
#!/bin/sh |
||||
set -e -u |
set -e -u |
||||
|
|
||||
if [ "$#" != "0" ]; then |
if [ "$#" != "0" ]; then |
||||
echo "usage: termux-contact-list" |
echo "usage: termux-contact-list" |
||||
echo "List all contacts." |
echo "List all contacts." |
||||
exit 1 |
exit |
||||
fi |
fi |
||||
|
|
||||
termux-api ContactList |
@TERMUX_API@ ContactList |
||||
|
@ -1,3 +1,3 @@ |
|||||
#!/system/bin/sh |
#!/bin/sh |
||||
|
|
||||
termux-api TextToSpeech --es engine LIST_AVAILABLE |
@TERMUX_API@ TextToSpeech --es engine LIST_AVAILABLE |
||||
|
Loading…
Reference in new issue