Browse Source

Fix dalvikvm wrapper

- Just unset LD_LIBRARY_PATH in the dalvikvm wrapper.
- Let the dalvikvm wrapper setup $ANDROID_DATA.
- Avoid using a custom dalvikvm wrapper in dx.
android-5
Fredrik Fornwall 9 years ago
parent
commit
6501186f2b
  1. 4
      packages/dx/build.sh
  2. 8
      packages/dx/dalvikvm-wrapper
  3. 2
      packages/dx/dx
  4. 17
      packages/ecj/ecj
  5. 2
      packages/jack/build.sh
  6. 4
      packages/jack/jack.sh
  7. 7
      packages/termux-tools/build.sh
  8. 8
      packages/termux-tools/dalvikvm

4
packages/dx/build.sh

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html
TERMUX_PKG_DESCRIPTION="Command which takes in class files and reformulates them for usage on Android"
TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION
TERMUX_PKG_BUILD_REVISION=1
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_make_install () {
@ -11,6 +12,5 @@ termux_step_make_install () {
$ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar
install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx
install $TERMUX_PKG_BUILDER_DIR/dalvikvm-wrapper $TERMUX_PREFIX/bin/dalvikvm-wrapper
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/{dx,dalvikvm-wrapper}
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx
}

8
packages/dx/dalvikvm-wrapper

@ -1,8 +0,0 @@
#!/bin/sh
# There needs to be a folder at $ANDROID_DATA/dalvik-cache:
export ANDROID_DATA=@TERMUX_PREFIX@/var/android/
mkdir -p $ANDROID_DATA/dalvik-cache
# Reset LD_LIBRARY_PATH to avoid shared library clashes:
LD_LIBRARY_PATH=/system/lib dalvikvm $@

2
packages/dx/dx

@ -1,6 +1,6 @@
#!/bin/sh
dalvikvm-wrapper
exec dalvikvm \
-Xmx256m \
-cp @TERMUX_PREFIX@/share/dex/dx.jar \
com.android.dx.command.Main $@

17
packages/ecj/ecj

@ -1,10 +1,11 @@
#!/bin/sh
# There needs to be a folder at $ANDROID_DATA/dalvik-cache
export ANDROID_DATA=@TERMUX_PREFIX@/var/android/
mkdir -p $ANDROID_DATA/dalvik-cache
jarpath=@TERMUX_PREFIX@/share/dex/ecj.jar
# -proc:none to disable annotation processing/compiling
# -7 for java 1.7 compatibility
dalvikvm -Xmx256m -cp $jarpath org.eclipse.jdt.internal.compiler.batch.Main -proc:none -7 -cp @TERMUX_PREFIX@/share/java/android.jar $@
# -proc:none to disable annotation processing.
# -7 for java 1.7 compatibility.
dalvikvm -Xmx256m \
-cp @TERMUX_PREFIX@/share/dex/ecj.jar
org.eclipse.jdt.internal.compiler.batch.Main \
-proc:none \
-7 \
-cp @TERMUX_PREFIX@/share/java/android.jar \
$@

2
packages/jack/build.sh

@ -4,7 +4,7 @@
TERMUX_PKG_HOMEPAGE=http://tools.android.com/tech-docs/jackandjill
TERMUX_PKG_DESCRIPTION="Java Android Compiler Kit"
TERMUX_PKG_VERSION="1.1-mr2"
TERMUX_PKG_BUILD_REVISION=3
TERMUX_PKG_BUILD_REVISION=4
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_make () {

4
packages/jack/jack.sh

@ -1,9 +1,5 @@
#!/bin/sh
# There needs to be a folder at $ANDROID_DATA/dalvik-cache
export ANDROID_DATA=@TERMUX_PREFIX@/var/android/
mkdir -p $ANDROID_DATA/dalvik-cache
exec dalvikvm -Xmx256m \
-Djava.io.tmpdir=@TERMUX_PREFIX@/tmp \
-cp @TERMUX_PREFIX@/share/dex/jack.jar com.android.jack.Main \

7
packages/termux-tools/build.sh

@ -1,12 +1,12 @@
TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_VERSION=0.27
TERMUX_PKG_VERSION=0.28
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_make_install () {
# Remove LD_LIBRARY_PATH from environment to avoid conflicting
# with system libraries that am may link against.
for tool in am dalvikvm df getprop logcat ping ping6 ip pm settings; do
for tool in am df getprop logcat ping ping6 ip pm settings; do
WRAPPER_FILE=$TERMUX_PREFIX/bin/$tool
echo '#!/bin/sh' > $WRAPPER_FILE
@ -22,5 +22,6 @@ termux_step_make_install () {
chmod +x $TERMUX_PREFIX/bin/$tool
done
cp -p $TERMUX_PKG_BUILDER_DIR/{su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url} $TERMUX_PREFIX/bin/
cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url} $TERMUX_PREFIX/bin/
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm
}

8
packages/termux-tools/dalvikvm

@ -0,0 +1,8 @@
#!/bin/sh
# There needs to be a folder at $ANDROID_DATA/dalvik-cache
export ANDROID_DATA=@TERMUX_PREFIX@/var/android/
mkdir -p $ANDROID_DATA/dalvik-cache
unset LD_LIBRARY_PATH
exec /system/bin/dalvikvm -Djava.io.tmpdir=@TERMUX_PREFIX@/tmp "$@"
Loading…
Cancel
Save