Skip to content

Commit 10804d2

Browse files
committed
bump to 2.6.0
1 parent df16649 commit 10804d2

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

android/libbladerf/__init__.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1+
# ruff: noqa: RUF012
12
import os
23
import shutil
3-
from typing import Any
4+
from typing import Any, override
45

5-
import sh # type: ignore
6-
from pythonforandroid.archs import Arch # type: ignore
7-
from pythonforandroid.logger import shprint # type: ignore
8-
from pythonforandroid.recipe import NDKRecipe, Recipe # type: ignore
9-
from pythonforandroid.util import current_directory # type: ignore
6+
import sh
7+
from pythonforandroid.archs import Arch
8+
from pythonforandroid.logger import shprint
9+
from pythonforandroid.recipe import NDKRecipe, Recipe
10+
from pythonforandroid.util import current_directory
1011

1112

12-
class LibbladerfRecipe(NDKRecipe): # type: ignore
13+
class LibbladerfRecipe(NDKRecipe):
1314

1415
url = 'git+https://github.com/Nuand/bladeRF.git'
15-
version = 'f81b82aa8e75ee8866d1aede2a09191d92399829'
16-
patches = ('bladerf_android.patch', )
17-
generated_libraries = ('libbladerf.so', )
16+
version = 'bb26efdd207ee185b3f7b72f8835d7e49384ae1c'
17+
generated_libraries = ['libbladerf.so']
18+
patches = ['bladerf_android.patch']
1819
site_packages_name = 'libbladerf'
1920
library_version_major = '2'
20-
library_version_minor = '5'
21-
library_version_patch = '1'
21+
library_version_minor = '6'
22+
library_version_patch = '0'
2223

23-
depends = ('libusb', )
24+
depends = ['libusb']
2425
name = 'libbladerf'
2526

27+
@override
2628
def should_build(self, arch: Arch) -> bool:
2729
return not os.path.exists(os.path.join(self.ctx.get_libs_dir(arch.arch), 'libbladerf.so'))
2830

31+
@override
2932
def prebuild_arch(self, arch: Arch) -> None:
3033
super().prebuild_arch(arch)
3134

@@ -60,19 +63,23 @@ def prebuild_arch(self, arch: Arch) -> None:
6063
os.path.join(self.get_recipe_dir(), 'pre_install.cmake'),
6164
)
6265

63-
def get_recipe_env(self, arch: Arch) -> dict[str, Any]:
64-
env: dict[str, Any] = super().get_recipe_env(arch)
65-
env['LDFLAGS'] += f'-L{self.ctx.get_libs_dir(arch.arch)}'
66+
@override
67+
def get_recipe_env(self, arch: Arch, **kwargs: Any) -> dict[str, Any]:
68+
env: dict[str, Any] = super().get_recipe_env(arch, **kwargs)
69+
env['LDFLAGS'] = env['LDFLAGS'] + f'-L{self.ctx.get_libs_dir(arch.arch)}'
6670

6771
return env
6872

73+
@override
6974
def get_jni_dir(self, arch: Arch) -> str:
7075
return os.path.join(self.get_build_dir(arch.arch), 'android', 'jni')
7176

77+
@override
7278
def get_lib_dir(self, arch: Arch) -> str:
7379
return os.path.join(self.get_build_dir(arch.arch), 'android', 'obj', 'local', arch.arch)
7480

75-
def build_arch(self, arch: Arch, *extra_args: Any) -> None:
81+
@override
82+
def build_arch(self, arch: Arch, *args: Any) -> None:
7683
env = self.get_recipe_env(arch)
7784

7885
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'))
@@ -85,7 +92,7 @@ def build_arch(self, arch: Arch, *extra_args: Any) -> None:
8592
'APP_PLATFORM=android-' + str(self.ctx.ndk_api),
8693
'NDK=' + self.ctx.ndk_dir,
8794
'APP_ABI=' + arch.arch,
88-
*extra_args,
95+
*args,
8996
_env=env,
9097
)
9198

android/libbladerf/jni/libad936x.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ LOCAL_EXPORT_C_INCLUDES := \
3838
$(LIBAD936X_ROOT_ABS)/host/common/thirdparty/ad9361/sw/ \
3939
${LIBAD936X_ROOT_ABS}/thirdparty/no-OS_local/platform_bladerf2/ \
4040
${LIBAD936X_ROOT_ABS}/fpga_common/src/ \
41-
${LIBAD936X_ROOT_ABS}/firmware_common/
41+
${LIBAD936X_ROOT_ABS}/firmware_common/ \
42+
${LIBAD936X_ROOT_ABS}/host/common/include/ \
43+
${LIBAD936X_ROOT_ABS}host/build/common/thirdparty/ad936x/ \
44+
${LIBAD936X_ROOT_ABS}/thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2/
4245

4346
LOCAL_CFLAGS := \
4447
-I${LIBAD936X_ROOT_ABS}/thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2 \

android/libbladerf/jni/libbladerf.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ LOCAL_CFLAGS := \
105105
-I$(LIBBLADERF_ROOT_ABS)/firmware_common \
106106
-I$(LIBBLADERF_ROOT_ABS)/android/libusb \
107107
-DLIBBLADERF_SEARCH_PREFIX="" \
108+
-DNUAND_MODIFICATIONS \
108109
-DLOGGING_ENABLED
109110

110111
LOCAL_LDFLAGS := -pthread

0 commit comments

Comments
 (0)