cmusatyalab / diamond-android

Android library for running Diamond filters
http://diamond.cs.cmu.edu/
Eclipse Public License 1.0
55 stars 8 forks source link

Small Project Idea: ARM package manager #34

Open bamos opened 9 years ago

bamos commented 9 years ago

Hi @bgilbert @theonewolf and @wenluhu - just brainstorming here. I've been compiling a lot of utility libraries for ARM in addition to the ones in here, such as tune2fs, mknod, and gammaray. Mostly, I can build them fine with the snippet below, but other times a small diff of the original source is required, or I need to link other static ARM libraries. I've been thinking that a simple ARM package manager to build executables and static libraries from the original source would be helpful to run non-standard C programs on Android. The benefit of centralizing this is that people wouldn't have to manually build or chain together dependencies as I've done in https://github.com/cmusatyalab/diamond-android/blob/master/diamond-android-library/jni/build.sh.

Is this a sane idea? Do you all have any thoughts on this?

if [[ ! -d toolchain ]]; then
  # Using NDK r10b.
  $ANDROID_NDK/build/tools/make-standalone-toolchain.sh \
    --platform=android-18 \
    --toolchain=arm-linux-androideabi-4.8 \
    --install-dir=$PWD/toolchain
fi

# Add the standalone toolchain to the path.
pathadd() { PATH="${PATH:+"$PATH:"}$1"; }
pathadd "$PWD/toolchain/bin"
command -v arm-linux-androideabi-gcc &> /dev/null || exit -1
export SYSROOT=$PWD/toolchain/sysroot
export CC="arm-linux-androideabi-gcc --sysroot=$SYSROOT"
export CXX=arm-linux-androideabi-g++
export LD=arm-linux-androideabi-ld
export RANLIB=arm-linux-androideabi-ranlib
export AR=arm-linux-androideabi-ar
export CROSS_PREFIX=arm-linux-androideabi-
export CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=neon'
export LDFLAGS='-Wl,--fix-cortex-a8'

./configure --enable-static --host=arm-linux || die "Configure failed."
make -j8 bin/gray-crawler || die "Make failed."
bgilbert commented 9 years ago

When you say "package manager", I think of something like dpkg or rpm, and of course Android already has one: the Play Store. If you're talking about a cross-package build system with dependency resolution, then yes, that might be useful. Is jhbuild a good fit?

bamos commented 9 years ago

jhbuild docs: https://developer.gnome.org/jhbuild/3.12/jhbuild.html

From reading the intro, jhbuild looks useful. I'll further look into later, thanks.

bamos commented 9 years ago

Possibly related: