Skip to content

Commit 68a6d6c

Browse files
committed
added swift recipe
1 parent 09c73e0 commit 68a6d6c

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

recipes/swift/extra/Android.mk

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
include $(CLEAR_VARS)
4+
5+
LOCAL_MODULE := libevent2
6+
7+
LOCAL_SRC_FILES := libevent2/lib/libevent.a
8+
LOCAL_EXPORT_C_INCLUDES := libevent2/include
9+
LOCAL_C_INCLUDES := libevent2/include
10+
11+
include $(PREBUILT_STATIC_LIBRARY)
12+
13+
LOCAL_MODULE := swift
14+
LOCAL_SRC_FILES := swift.cpp sha1.cpp compat.cpp sendrecv.cpp send_control.cpp hashtree.cpp bin.cpp binmap.cpp binheap.cpp channel.cpp transfer.cpp httpgw.cpp statsgw.cpp cmdgw.cpp avgspeed.cpp availability.cpp
15+
16+
LOCAL_CFLAGS += -D__NEW__
17+
18+
LOCAL_STATIC_LIBRARIES := libevent2
19+
20+
#include $(BUILD_SHARED_LIBRARY)
21+
include $(BUILD_EXECUTABLE)

recipes/swift/recipe.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
#TODO get a release version if possible
4+
VERSION_swift=
5+
DEPS_swift=()
6+
URL_swift=https://nodeload.github.com/triblerteam/libswift/zip/4123e6579309cd65a5ba3800e0b674f348c62bfb
7+
MD5_swift=99cf78ea0b4aeb23a2439dd886f00f8f
8+
FILENAME_swift=4123e6579309cd65a5ba3800e0b674f348c62bfb
9+
EXTRACT_swift=$BUILD_PATH/swift/libswift-$FILENAME_swift
10+
BUILD_swift=$BUILD_PATH/swift/swift
11+
RECIPE_swift=$RECIPES_PATH/swift
12+
13+
function prebuild_swift() {
14+
true
15+
}
16+
17+
function build_swift() {
18+
if [ ! -d "$BUILD_swift" ]; then
19+
cd $BUILD_PATH/swift
20+
mkdir -p swift
21+
unzip $PACKAGES_PATH/$FILENAME_swift
22+
rm -Rf swift/jni
23+
mv $EXTRACT_swift swift/jni
24+
25+
# Use differend Android.mk to create a binary instead of a library
26+
cp $RECIPE_swift/extra/Android.mk swift/jni/Android.mk
27+
fi
28+
29+
cd $BUILD_swift
30+
mkdir -p libs
31+
32+
if [ -f "$BUILD_PATH/libs/swift" ]; then
33+
#return
34+
true
35+
fi
36+
37+
push_arm
38+
39+
#FIXME get it so you don't have to download the jni module manually
40+
export LDFLAGS=$LIBLINK
41+
try ndk-build -C $BUILD_swift/jni
42+
unset LDFLAGS
43+
44+
#TODO find out why it's libevent.so and not libswift.so
45+
try cp -a $BUILD_swift/libs/$ARCH/libevent $LIBS_PATH/swift
46+
47+
pop_arm
48+
}
49+
50+
function postbuild_swift() {
51+
true
52+
}
53+

0 commit comments

Comments
 (0)