Skip to content

Commit 32f5ef9

Browse files
author
krp97
committed
[WideVine] Improvements for WideVine recipe
Until now, the widevine libraries have been built in debug mode regardless of any options. This change brings in the possibility to specify a build type. Additionally, the unit test executable has been split into seperate option.
1 parent 56217e2 commit 32f5ef9

2 files changed

Lines changed: 48 additions & 8 deletions

File tree

package/widevine/Config.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@ config BR2_PACKAGE_WIDEVINE
66
Widevine DRM solution provides the capability to license, securely distribute and protect
77
playback of content on any consumer device.
88

9+
if BR2_PACKAGE_WIDEVINE
10+
config BR2_PACKAGE_WIDEVINE_INSTALL_UT
11+
bool "Unit tests"
12+
help
13+
Install a unit test binary "widevine_ce_cdm_unittest" on the target device.
14+
15+
choice BR2_PACKAGE_WIDEVINE_BUILD_TYPE
16+
prompt "Build type"
17+
default BR2_PACKAGE_WIDEVINE_BUILD_TYPE_RELEASE
18+
help
19+
Select the type of build you want to use.
20+
21+
config BR2_PACKAGE_WIDEVINE_BUILD_TYPE_DEBUG
22+
bool "Debug"
23+
24+
config BR2_PACKAGE_WIDEVINE_BUILD_TYPE_RELEASE
25+
bool "Release"
26+
27+
endchoice
28+
29+
endif
30+
931
config BR2_PACKAGE_HAS_WIDEVINE
1032
bool
1133

package/widevine/widevine.mk

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ else
2323
export WV_BOARD=dummy
2424
endif #BR2_PACKAGE_WIDEVINE_SOC_RPI
2525

26+
27+
2628
export WV_CC=$(TARGET_CC)
2729
export WV_CXX=$(TARGET_CXX)
2830
export WV_AR=$(TARGET_AR)
@@ -33,24 +35,40 @@ export WV_STAGING = $(STAGING_DIR)
3335
export WV_STAGING_NATIVE = $(STAGING_DIR)
3436
export WV_PROTOBUF_CONFIG = source
3537

38+
39+
ifeq ($(BR2_ENABLE_DEBUG),y)
40+
WIDEVINE_BUILD_DIR=Debug
41+
else ifeq ($($(BR2_PACKAGE_WIDEVINE_BUILD_TYPE_DEBUG)),y)
42+
WIDEVINE_BUILD_DIR=Debug
43+
else
44+
WIDEVINE_BUILD_TYPE_OPTION=-r
45+
WIDEVINE_BUILD_DIR=Release
46+
endif
47+
3648
define WIDEVINE_CONFIGURE_CMDS
3749
(cd $(@D);rm -rf out; rm -rf Makefile;\
3850
find . -name \*.mk -delete;\
3951
find . -name \*.pyc -delete;\
40-
./build.py $(WIDEVINE_ARCHITECTURE) )
52+
./build.py $(WIDEVINE_ARCHITECTURE) $(WIDEVINE_BUILD_TYPE_OPTION))
53+
endef
54+
55+
ifeq ($(BR2_PACKAGE_WIDEVINE_INSTALL_UT),y)
56+
define WIDEVINE_UNIT_TEST_INSTALL
57+
$(INSTALL) -D $(@D)/out/$(WIDEVINE_ARCHITECTURE)/$(WIDEVINE_BUILD_DIR)/widevine_ce_cdm_unittest $(TARGET_DIR)/usr/bin
4158
endef
59+
endif
4260

4361
define WIDEVINE_INSTALL_TARGET_CMDS
44-
cp $(@D)/out/$(WIDEVINE_ARCHITECTURE)/Debug/widevine_ce_cdm_unittest $(TARGET_DIR)/usr/bin
45-
cp $(@D)/out/$(WIDEVINE_ARCHITECTURE)/Debug/lib*/lib*.so $(TARGET_DIR)/usr/lib/
62+
$(call WIDEVINE_UNIT_TEST_INSTALL)
63+
$(INSTALL) -Ds --strip-program=$(TARGET_STRIP) \
64+
$(@D)/out/$(WIDEVINE_ARCHITECTURE)/$(WIDEVINE_BUILD_DIR)/lib*/lib*.so \
65+
$(TARGET_DIR)/usr/lib/
4666
endef
4767

4868
define WIDEVINE_INSTALL_STAGING_CMDS
49-
cp $(@D)/out/$(WIDEVINE_ARCHITECTURE)/Debug/lib*/lib*.so $(STAGING_DIR)/usr/lib/
50-
cp $(@D)/cdm/include/*.h $(STAGING_DIR)/usr/include
51-
cp $(@D)/core/include/*.h $(STAGING_DIR)/usr/include
52-
# mkdir -p $(STAGING_DIR)/usr/include/host
53-
# cp $(@D)/cdm/src/host/$(WIDEVINE_ARCHITECTURE)/*.h $(STAGING_DIR)/usr/include/host
69+
$(INSTALL) -D $(@D)/out/$(WIDEVINE_ARCHITECTURE)/$(WIDEVINE_BUILD_DIR)/lib*/lib*.so $(STAGING_DIR)/usr/lib/
70+
$(INSTALL) -D $(@D)/cdm/include/*.h $(STAGING_DIR)/usr/include
71+
$(INSTALL) -D $(@D)/core/include/*.h $(STAGING_DIR)/usr/include
5472
endef
5573

5674
$(eval $(generic-package))

0 commit comments

Comments
 (0)