Skip to content

Commit 8b61e9c

Browse files
committed
updated android installer
1 parent f318b14 commit 8b61e9c

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

android/libhackrf/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class LibhackrfRecipe(NDKRecipe):
1414
generated_libraries = ['libhackrf.so']
1515
site_packages_name = 'libhackrf'
1616
version = '2024.02.1'
17+
library_release = '2024.02.1'
18+
library_version = '0.9'
1719
depends = ['libusb']
1820
name = 'libhackrf'
1921

@@ -58,6 +60,8 @@ def build_arch(self, arch, *extra_args):
5860
sh.Command(os.path.join(self.ctx.ndk_dir, 'ndk-build')),
5961
'NDK_PROJECT_PATH=' + self.get_build_dir(arch.arch) + '/android',
6062
'APP_PLATFORM=android-' + str(self.ctx.ndk_api),
63+
'LIBRARY_VERSION=' + self.library_version,
64+
'LIBRARY_RELEASE=' + self.library_release,
6165
'NDK='+self.ctx.ndk_dir,
6266
'APP_ABI=' + arch.arch,
6367
*extra_args,

android/libhackrf/jni/libhackrf.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ LOCAL_EXPORT_C_INCLUDES := $(LIBUSB_ROOT_ABS)/host/libhackrf/src
3333

3434
LOCAL_CFLAGS := \
3535
-I$(LIBHACKRF_ROOT_ABS)/android/libusb \
36-
-fvisibility=hidden \
36+
-DLIBRARY_VERSION=\"$(LIBRARY_VERSION)\" \
37+
-DLIBRARY_RELEASE=\"$(LIBRARY_RELEASE)\" \
3738
-pthread
3839

3940
LOCAL_LDLIBS := -L$(LOCAL_PATH) -lusb1.0 -llog

android/python_hackrf/__init__.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class PythonHackrfRecipe(CythonRecipe):
88
url = 'https://github.com/GvozdevLeonid/python_hackrf/releases/download/v.{version}/python_hackrf-{version}.tar.gz'
9-
depends = ['python3', 'setuptools', 'numpy', 'libusb', 'libhackrf']
9+
depends = ['python3', 'setuptools', 'numpy', 'pyjnius', 'libhackrf']
1010
site_packages_name = 'python_hackrf'
1111
name = 'python_hackrf'
1212
version = '1.1.1'
@@ -15,24 +15,12 @@ def get_recipe_env(self, arch):
1515
env = super().get_recipe_env(arch)
1616

1717
libhackrf_recipe = Recipe.get_recipe('libhackrf', arch)
18-
libusb_recipe = Recipe.get_recipe('libusb', arch)
1918

2019
libhackrf_h_dir = os.path.join(libhackrf_recipe.get_build_dir(arch), 'host', 'libhackrf', 'src')
21-
libusb_h_dir = os.path.join(libusb_recipe.get_build_dir(arch), 'libusb')
2220

2321
env['LDFLAGS'] += f' -L{self.ctx.get_libs_dir(arch.arch)}'
24-
env['CFLAGS'] += f' -I{libusb_h_dir} -I{libhackrf_h_dir}'
22+
env['CFLAGS'] += f' -I{libhackrf_h_dir}'
2523

2624
return env
2725

28-
def prebuild_arch(self, arch):
29-
super().prebuild_arch(arch)
30-
31-
if not os.path.exists(os.path.join(self.get_build_dir(arch.arch), 'python_hackrf', 'pylibhackrf', 'hackrf.c')):
32-
libhackrf_recipe = Recipe.get_recipe('libhackrf', arch)
33-
34-
shutil.copy(os.path.join(libhackrf_recipe.get_build_dir(arch), 'host', 'libhackrf', 'src', 'hackrf.h'), os.path.join(self.get_build_dir(arch.arch), 'python_hackrf', 'pylibhackrf'))
35-
shutil.copy(os.path.join(libhackrf_recipe.get_build_dir(arch), 'host', 'libhackrf', 'src', 'hackrf.c'), os.path.join(self.get_build_dir(arch.arch), 'python_hackrf', 'pylibhackrf'))
36-
37-
3826
recipe = PythonHackrfRecipe()

0 commit comments

Comments
 (0)