Class: Libpng::OHOS::Recipe
- Defined in:
- lib/libpng/ohos/recipe.rb
Overview
OHOS-specific libpng build recipe. Inherits the standard download/compile/install flow from Libpng::Recipe and layers on:
- NDK discovery + download (idempotent, ~1.5GB cached across runs)
- Static zlib built with the same OHOS toolchain
- CMake flags: -DCMAKE_TOOLCHAIN_FILE=<ohos.toolchain.cmake>
-DOHOS_ARCH=arm64-v8a -DOHOS_PLATFORM=OHOS
-DZLIB_LIBRARY=<static libz.a>
- Post-install code signing via OHOS::CodeSigner
The standard recipe already maps aarch64-linux-ohos to the right
cpu_type, cmake_system_name, and target_format, so those are not
overridden here.
Constant Summary
Constants inherited from Recipe
Recipe::LIBPNG_SHA256, Recipe::LIBPNG_URL, Recipe::ROOT
Instance Method Summary collapse
- #configure_defaults ⇒ Object
-
#cook ⇒ Object
Ensures NDK is downloaded and static zlib is built before the libpng CMake configure runs.
-
#initialize ⇒ Recipe
constructor
A new instance of Recipe.
- #install ⇒ Object
Methods inherited from Recipe
#checkpoint, #cook_if_not, #execute, for_target, #message, ohos_target?, #verify_libs
Constructor Details
Instance Method Details
#configure_defaults ⇒ Object
40 41 42 |
# File 'lib/libpng/ohos/recipe.rb', line 40 def configure_defaults super + ohos_toolchain_flags + zlib_flags end |
#cook ⇒ Object
Ensures NDK is downloaded and static zlib is built before the libpng CMake configure runs. MiniPortile's #cook is idempotent (checks downloaded?/configured?/installed?), so calling @zlib.cook on every libpng cook is cheap when nothing changed.
32 33 34 35 36 37 38 |
# File 'lib/libpng/ohos/recipe.rb', line 32 def cook @ndk.download unless @ndk.exist? raise 'OHOS NDK setup failed; see ext/ohos/setup-ndk.sh output' unless @ndk.exist? @zlib.cook super end |
#install ⇒ Object
44 45 46 47 |
# File 'lib/libpng/ohos/recipe.rb', line 44 def install super each_built_lib { |path| sign_lib(path) } end |