Skip to content

Commit 4981670

Browse files
committed
update recipies
1 parent 270d824 commit 4981670

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

android/libhackrf/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,21 @@ def get_recipe_env(self, arch):
4545
def get_jni_dir(self, arch):
4646
return os.path.join(self.get_build_dir(arch.arch), 'android', 'jni')
4747

48+
def get_lib_dir(self, arch):
49+
return os.path.join(self.get_build_dir(arch.arch), 'android', 'obj', 'local', arch.arch)
50+
4851
def build_arch(self, arch, *extra_args):
4952
env = self.get_recipe_env(arch)
53+
54+
shutil.copyfile(os.path.join(self.ctx.get_libs_dir(arch.arch), 'libusb1.0.so'), os.path.join(self.get_build_dir(arch.arch), 'android', 'jni', 'libusb1.0.so'))
55+
5056
with current_directory(self.get_build_dir(arch.arch)):
5157
shprint(
5258
sh.Command(os.path.join(self.ctx.ndk_dir, 'ndk-build')),
5359
'NDK_PROJECT_PATH=' + self.get_build_dir(arch.arch) + '/android',
60+
'APP_PLATFORM=android-' + str(self.ctx.ndk_api),
61+
'NDK='+self.ctx.ndk_dir,
62+
'APP_ABI=' + arch.arch,
5463
*extra_args,
5564
_env=env
5665
)

android/libhackrf/jni/libhackrf.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ LOCAL_CFLAGS := \
3636
-fvisibility=hidden \
3737
-pthread
3838

39-
LOCAL_LDLIBS := -llog
39+
LOCAL_LDLIBS := -L$(LOCAL_PATH) -lusb1.0 -llog
4040

4141
LOCAL_MODULE := libhackrf
4242

android/libusb/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def should_build(self, arch):
2020
def get_jni_dir(self, arch):
2121
return os.path.join(self.get_build_dir(arch.arch), 'android', 'jni')
2222

23+
def get_lib_dir(self, arch):
24+
return os.path.join(self.get_build_dir(arch.arch), 'android', 'obj', 'local', arch.arch)
25+
2326
def build_arch(self, arch, *extra_args):
2427
env = self.get_recipe_env(arch)
2528
with current_directory(self.get_build_dir(arch.arch)):

0 commit comments

Comments
 (0)