465 lines
16 KiB
Bash
465 lines
16 KiB
Bash
#!/usr/bin/env bash
|
|||
|
|
#
|
||
|
|
# SPDX-License-Identifier: GPL-2.0
|
||
|
|
#
|
||
|
|
# Copyright (c) 2026 AMLOGIC
|
||
|
|
#
|
||
|
|
# Libge2d build script for AMLbian
|
||
|
|
# This script builds libge2d library for Amlogic SoCs
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
# Get script directory
|
||
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
|
|
AMLBIAN_DIR="$(dirname "${SCRIPT_DIR}")"
|
||
|
|
BUILD_DIR="${AMLBIAN_DIR}/../build"
|
||
|
|
|
||
|
|
# Source common functions
|
||
|
|
if [[ -f "${AMLBIAN_DIR}/lib/function-common.sh" ]]; then
|
||
|
|
source "${AMLBIAN_DIR}/lib/function-common.sh"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# ==============================================================================
|
||
|
|
# Section 2: Default Configuration
|
||
|
|
# ==============================================================================
|
||
|
|
|
||
|
|
BOARD="${BOARD:-s6-bq201}"
|
||
|
|
DEB_VERSION="${LIBGE2D_VERSION:-1.0}"
|
||
|
|
ARCH="${ARCH:-arm64}"
|
||
|
|
|
||
|
|
# ==============================================================================
|
||
|
|
# Section 4: Libge2d Build Functions
|
||
|
|
# ==============================================================================
|
||
|
|
|
||
|
|
function amlbian_checkout_toolchain() {
|
||
|
|
|
||
|
|
display_alert "Ignore check toolchain after set_external_toolchain in common setting"
|
||
|
|
return 0
|
||
|
|
|
||
|
|
# # Check default gcc version before switching toolchain
|
||
|
|
# local need_new_toolchain=1
|
||
|
|
# local default_gcc_version=""
|
||
|
|
|
||
|
|
# # Try to get default gcc version
|
||
|
|
# if command -v gcc &> /dev/null; then
|
||
|
|
# default_gcc_version=$(aarch64-linux-gnu-gcc --version | head -n1 | grep -oP '\d+\.\d+\.\d+' | head -n1)
|
||
|
|
# display_alert "TOOLCHAIN" "Default gcc version: ${default_gcc_version}" "info"
|
||
|
|
|
||
|
|
# # Check if version is >= 5.1.0
|
||
|
|
# if [[ -n "${default_gcc_version}" ]]; then
|
||
|
|
# # Simple version comparison
|
||
|
|
# local major_version=$(echo "${default_gcc_version}" | cut -d. -f1)
|
||
|
|
# local minor_version=$(echo "${default_gcc_version}" | cut -d. -f2)
|
||
|
|
|
||
|
|
# if [[ ${major_version} -gt 5 ]] || ([[ ${major_version} -eq 5 ]] && [[ ${minor_version} -ge 1 ]]); then
|
||
|
|
# display_alert "TOOLCHAIN" "Default gcc version ${default_gcc_version} >= 5.1.0, no need for new toolchain" "info"
|
||
|
|
# need_new_toolchain=0
|
||
|
|
# else
|
||
|
|
# display_alert "TOOLCHAIN" "Default gcc version ${default_gcc_version} < 5.1.0, will try new toolchain" "info"
|
||
|
|
# fi
|
||
|
|
# fi
|
||
|
|
# else
|
||
|
|
# display_alert "TOOLCHAIN" "gcc not found in PATH" "warn"
|
||
|
|
# fi
|
||
|
|
|
||
|
|
# # Only switch to new toolchain if needed
|
||
|
|
# if [[ ${need_new_toolchain} -eq 1 ]]; then
|
||
|
|
# #local new_toolchain_path="/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin"
|
||
|
|
# local new_toolchain_path="/opt/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin"
|
||
|
|
# if [[ -d "${new_toolchain_path}" ]]; then
|
||
|
|
# display_alert "TOOLCHAIN" "Using new toolchain from: ${new_toolchain_path}" "info"
|
||
|
|
# export PATH="${new_toolchain_path}:${PATH}"
|
||
|
|
# # Check if gcc exists in the new toolchain
|
||
|
|
# if [[ -f "${new_toolchain_path}/aarch64-linux-gnu-gcc" ]]; then
|
||
|
|
# display_alert "TOOLCHAIN" "Found cross-compiler: ${new_toolchain_path}/aarch64-linux-gnu-gcc" "info"
|
||
|
|
# else
|
||
|
|
# display_alert "TOOLCHAIN" "Cross-compiler not found in new toolchain, using default" "warn"
|
||
|
|
# fi
|
||
|
|
# else
|
||
|
|
# display_alert "TOOLCHAIN" "New toolchain directory not found: ${new_toolchain_path}" "warn"
|
||
|
|
# fi
|
||
|
|
# fi
|
||
|
|
}
|
||
|
|
|
||
|
|
function __unset_libge2d_config {
|
||
|
|
# Clean up any environment variables set during build
|
||
|
|
unset EXTRA_OEMAKE
|
||
|
|
unset SYSROOT
|
||
|
|
unset CFLAGS
|
||
|
|
unset CXXFLAGS
|
||
|
|
unset LDFLAGS
|
||
|
|
}
|
||
|
|
|
||
|
|
function __libge2d_prepare_source {
|
||
|
|
local build_dir="${1}"
|
||
|
|
|
||
|
|
local aml_comp_path="$(amlbian_get_aml_comp_dir)"
|
||
|
|
if [[ -z "${aml_comp_path}" ]] || [[ ! -d "${aml_comp_path}" ]]; then
|
||
|
|
display_alert "LIBGE2D" "aml-comp not found: ${aml_comp_path}" "err"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
local source_dir="${aml_comp_path}/hardware/amlogic/libge2d"
|
||
|
|
|
||
|
|
if [[ ! -d "${source_dir}" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Source directory not found: ${source_dir}" "err"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Copying source from ${source_dir} to ${build_dir}" "info"
|
||
|
|
|
||
|
|
# 清空构建目录
|
||
|
|
rm -rf "${build_dir}"
|
||
|
|
mkdir -p "${build_dir}"
|
||
|
|
|
||
|
|
# 复制源代码到构建目录
|
||
|
|
cp -r "${source_dir}"/* "${build_dir}/" 2>/dev/null || true
|
||
|
|
|
||
|
|
# Check for necessary source files
|
||
|
|
if [[ ! -f "${build_dir}/Makefile" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Makefile not found in source" "err"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Source prepared successfully" "success"
|
||
|
|
}
|
||
|
|
|
||
|
|
function __libge2d_build_depend {
|
||
|
|
local build_dir="${1}"
|
||
|
|
|
||
|
|
local dependencies=("libion")
|
||
|
|
|
||
|
|
# libion
|
||
|
|
local libion_dir="${BUILD_DIR}/.tmp/libion-build-${ARCH:-arm64}"
|
||
|
|
if [ -z "${libion_dir}" ] || [ ! -d "${libion_dir}" ]; then
|
||
|
|
display_alert "LIBGE2D" "libion not found in ${BUILD_DIR}/.tmp build." "info"
|
||
|
|
display_alert "AMLOGIC" "TODO>> Start build libion " "info"
|
||
|
|
|
||
|
|
if ! (
|
||
|
|
source "${SCRIPT_DIR}/build-libion.sh"
|
||
|
|
); then
|
||
|
|
display_alert "ERROR" "build-libion failed" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [ -z "${libion_dir}" ] || [ ! -d "${libion_dir}" ]; then
|
||
|
|
display_alert "ERROR" "libion build finished but directory still not found" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "libion dir: ${libion_dir}" "info"
|
||
|
|
|
||
|
|
# copy
|
||
|
|
local ionmem_head_flags="-I${libion_dir}/build/include -I${libion_dir}/build/include/ion"
|
||
|
|
export CPPFLAGS="${CPPFLAGS} -I${libion_dir}/build/include -I${libion_dir}/build/include/ion"
|
||
|
|
export CFLAGS="${CFLAGS} -I${libion_dir}/build/include -I${libion_dir}/build/include/ion"
|
||
|
|
export CXXFLAGS="${CXXFLAGS} -I${libion_dir}/build/include -I${libion_dir}/build/include/ion"
|
||
|
|
|
||
|
|
export LDFLAGS="${LDFLAGS} -L${libion_dir}/build"
|
||
|
|
}
|
||
|
|
|
||
|
|
function __libge2d_build {
|
||
|
|
local build_dir="${1}"
|
||
|
|
local install_dir="${2}"
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Starting libge2d build..." "info"
|
||
|
|
|
||
|
|
# 检查源目录
|
||
|
|
if [[ ! -d "${build_dir}" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Build directory not found: ${build_dir}" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 设置编译环境
|
||
|
|
ARCH="${ARCH:-arm64}"
|
||
|
|
CROSS_COMPILE="${CROSS_COMPILE:-aarch64-linux-gnu-}"
|
||
|
|
# SYSROOT="${SYSROOT:-/opt/arm64-sysroot}"
|
||
|
|
|
||
|
|
export ARCH="${ARCH}"
|
||
|
|
export CROSS_COMPILE="${CROSS_COMPILE}"
|
||
|
|
|
||
|
|
amlbian_checkout_toolchain
|
||
|
|
|
||
|
|
__libge2d_build_depend
|
||
|
|
|
||
|
|
export CFLAGS="${CFLAGS} \
|
||
|
|
-I${build_dir}/libge2d/include \
|
||
|
|
-I${build_dir}/libge2d/kernel-headers/linux \
|
||
|
|
-fPIC"
|
||
|
|
|
||
|
|
export CXXFLAGS="${CFLAGS}"
|
||
|
|
|
||
|
|
# 创建输出目录
|
||
|
|
local out_dir="${build_dir}/output"
|
||
|
|
mkdir -p "${out_dir}"
|
||
|
|
|
||
|
|
# Fix Makefile linking order (as in original script)
|
||
|
|
cd "${build_dir}"
|
||
|
|
if [[ -f "Makefile" ]]; then
|
||
|
|
# Fix linking order and add LDFLAGS to the test program linking commands
|
||
|
|
sed -i 's/\$(CC) \$(CFLAGS) -L\$(LIBDIR) -L\$(OUT_DIR) -lpthread -lge2d/\$(CC) \$(CFLAGS) \$(LDFLAGS) -L\$(LIBDIR) -L\$(OUT_DIR) -lpthread -lge2d/' Makefile
|
||
|
|
sed -i 's/-lpthread -lge2d \$(addsuffix .c,\$(FEATURE_TEST))/\$(addsuffix .c,$(FEATURE_TEST)) -lpthread -lge2d -lion/' Makefile
|
||
|
|
sed -i 's/-lpthread -lge2d \$(addsuffix .c,\$(CHIP_CHECK))/\$(addsuffix .c,$(CHIP_CHECK)) -lpthread -lge2d -lion/' Makefile
|
||
|
|
display_alert "LIBGE2D" "Fixed Makefile linking order and added LDFLAGS" "debug"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Fix libge2d/Makefile to use LDFLAGS and add library search paths
|
||
|
|
if [[ -f "${build_dir}/libge2d/Makefile" ]]; then
|
||
|
|
# Add LDFLAGS to the linking command
|
||
|
|
sed -i 's/\$(CC) \$(CFLAGS) -shared -fPIC/\$(CC) \$(CFLAGS) \$(LDFLAGS) -shared -fPIC/' "${build_dir}/libge2d/Makefile"
|
||
|
|
# Fix linking order: move -lion after object files
|
||
|
|
sed -i 's/-lion -o \$(OUT_DIR)\/\$(LIB) \$(OBJS)/-o \$(OUT_DIR)\/\$(LIB) \$(OBJS) -lion/' "${build_dir}/libge2d/Makefile"
|
||
|
|
display_alert "LIBGE2D" "Added LDFLAGS and fixed linking order in libge2d/Makefile" "debug"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Set build flags based on EXTRA_OEMAKE from .bb file
|
||
|
|
local EXTRA_OEMAKE="OUT_DIR=${out_dir} LIBGE2D_STAGING_DIR=${out_dir} CROSS=${CROSS_COMPILE} TARGET_DIR=${out_dir} STAGING_DIR=${out_dir} DESTDIR=${out_dir} INSTALL_DIR=${out_dir}/usr/lib"
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Building libge2d library..." "info"
|
||
|
|
|
||
|
|
cd "${build_dir}"
|
||
|
|
|
||
|
|
# 编译命令,使用EXTRA_OEMAKE参数
|
||
|
|
make ${EXTRA_OEMAKE} \
|
||
|
|
CC="${CROSS_COMPILE}gcc" \
|
||
|
|
CFLAGS="${CFLAGS}" \
|
||
|
|
LDFLAGS="${LDFLAGS}" \
|
||
|
|
ARCH="${ARCH}" \
|
||
|
|
-j$(nproc) \
|
||
|
|
all 2>&1 | tee "${out_dir}/make.log" || {
|
||
|
|
display_alert "LIBGE2D" "Build failed" "err"
|
||
|
|
return 1
|
||
|
|
}
|
||
|
|
|
||
|
|
# Verify build output
|
||
|
|
if [[ ! -f "${out_dir}/libge2d.so" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Library file not found: ${out_dir}/libge2d.so" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [[ ! -f "${out_dir}/ge2d_feature_test" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Test program not found: ${out_dir}/ge2d_feature_test" "warning"
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Build completed successfully" "success"
|
||
|
|
return 0
|
||
|
|
}
|
||
|
|
|
||
|
|
function __libge2d_install {
|
||
|
|
local build_dir="${1}"
|
||
|
|
local install_dir="${2}"
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Installing libge2d library..." "info"
|
||
|
|
|
||
|
|
# Get SYSROOT from build environment or use default
|
||
|
|
local SYSROOT="${SYSROOT:-/opt/arm64-sysroot}"
|
||
|
|
|
||
|
|
local out_dir="${build_dir}/output"
|
||
|
|
|
||
|
|
if [[ ! -d "${out_dir}" ]]; then
|
||
|
|
display_alert "LIBGE2D" "Output directory not found: ${out_dir}" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 创建安装目录结构
|
||
|
|
mkdir -p "${install_dir}/usr/include"
|
||
|
|
mkdir -p "${install_dir}/usr/lib"
|
||
|
|
mkdir -p "${install_dir}/usr/bin"
|
||
|
|
|
||
|
|
# 安装库文件
|
||
|
|
if [[ -f "${out_dir}/libge2d.so" ]]; then
|
||
|
|
install -m 0644 -D "${out_dir}/libge2d.so" "${install_dir}/usr/lib/"
|
||
|
|
display_alert "LIBGE2D" "Library installed to ${install_dir}/usr/lib/" "info"
|
||
|
|
else
|
||
|
|
display_alert "LIBGE2D" "libge2d.so not found in output directory" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 安装头文件
|
||
|
|
display_alert "LIBGE2D" "Installing headers..." "info"
|
||
|
|
|
||
|
|
local header_files=("aml_ge2d.h" "ge2d_port.h")
|
||
|
|
for header_file in "${header_files[@]}"; do
|
||
|
|
if [[ -f "${build_dir}/libge2d/include/${header_file}" ]]; then
|
||
|
|
install -m 0644 -D "${build_dir}/libge2d/include/${header_file}" "${install_dir}/usr/include/"
|
||
|
|
display_alert "LIBGE2D" "Header installed: ${header_file}" "debug"
|
||
|
|
else
|
||
|
|
display_alert "LIBGE2D" "Header file not found: ${build_dir}/libge2d/include/${header_file}" "warning"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
# 安装二进制文件
|
||
|
|
display_alert "LIBGE2D" "Installing binaries..." "info"
|
||
|
|
|
||
|
|
if [[ -f "${out_dir}/ge2d_feature_test" ]]; then
|
||
|
|
install -m 0755 -D "${out_dir}/ge2d_feature_test" "${install_dir}/usr/bin/"
|
||
|
|
display_alert "LIBGE2D" "Binary installed: ge2d_feature_test" "debug"
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [[ -f "${out_dir}/ge2d_chip_check" ]]; then
|
||
|
|
install -m 0755 -D "${out_dir}/ge2d_chip_check" "${install_dir}/usr/bin/"
|
||
|
|
display_alert "LIBGE2D" "Binary installed: ge2d_chip_check" "debug"
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Installation completed" "success"
|
||
|
|
return 0
|
||
|
|
}
|
||
|
|
|
||
|
|
function __libge2d_create_deb {
|
||
|
|
local build_dir="${1}"
|
||
|
|
local install_dir="${2}"
|
||
|
|
|
||
|
|
# 设置必要的变量
|
||
|
|
local pkg_name="libge2d"
|
||
|
|
local version="${DEB_VERSION}"
|
||
|
|
local architecture="${ARCH}"
|
||
|
|
local maintainer="Armbian Build <build@armbian.com>"
|
||
|
|
local description="GE2D (Graphics Engine 2D) library for Amlogic SoCs"
|
||
|
|
local description_long="This package provides the GE2D (Graphics Engine 2D) library for Amlogic SoCs. GE2D is a hardware-accelerated 2D graphics engine that supports various 2D operations like rotation, scaling, blending, and format conversion."
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Creating Debian package for ${pkg_name} ${version}..." "info"
|
||
|
|
|
||
|
|
# 创建Debian包控制文件
|
||
|
|
local deb_dir="${build_dir}/deb/${pkg_name}-${version}"
|
||
|
|
local debian_dir="${deb_dir}/DEBIAN"
|
||
|
|
|
||
|
|
mkdir -p "${debian_dir}"
|
||
|
|
|
||
|
|
# 将安装目录的内容复制到debian-root
|
||
|
|
if [[ -d "${install_dir}" ]] && [[ "$(ls -A "${install_dir}")" ]]; then
|
||
|
|
cp -r "${install_dir}"/* "${deb_dir}/" 2>/dev/null || true
|
||
|
|
display_alert "LIBGE2D" "Copied installed files to ${deb_dir}" "info"
|
||
|
|
else
|
||
|
|
display_alert "LIBGE2D" "No installed files found in ${install_dir}" "warn"
|
||
|
|
return 0
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 创建control文件
|
||
|
|
cat > "${debian_dir}/control" <<EOF
|
||
|
|
Package: ${pkg_name}
|
||
|
|
Version: ${version}
|
||
|
|
Architecture: ${architecture}
|
||
|
|
Maintainer: ${maintainer}
|
||
|
|
Description: ${description}
|
||
|
|
${description_long}
|
||
|
|
Depends: libc6, libion
|
||
|
|
Section: libs
|
||
|
|
Priority: optional
|
||
|
|
EOF
|
||
|
|
|
||
|
|
# 创建postinst脚本,用于更新ldconfig
|
||
|
|
cat > "${debian_dir}/postinst" <<EOF
|
||
|
|
#!/bin/sh
|
||
|
|
set -e
|
||
|
|
|
||
|
|
if [ "\$1" = "configure" ]; then
|
||
|
|
# 更新ldconfig缓存
|
||
|
|
if command -v ldconfig >/dev/null 2>&1; then
|
||
|
|
ldconfig
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "Libge2d library installed successfully"
|
||
|
|
fi
|
||
|
|
|
||
|
|
exit 0
|
||
|
|
EOF
|
||
|
|
|
||
|
|
chmod 755 "${debian_dir}/postinst"
|
||
|
|
|
||
|
|
# 创建prerm脚本
|
||
|
|
cat > "${debian_dir}/prerm" <<EOF
|
||
|
|
#!/bin/sh
|
||
|
|
set -e
|
||
|
|
|
||
|
|
if [ "\$1" = "remove" ] || [ "\$1" = "deconfigure" ]; then
|
||
|
|
# Update ldconfig
|
||
|
|
if command -v ldconfig >/dev/null 2>&1; then
|
||
|
|
ldconfig
|
||
|
|
fi
|
||
|
|
echo "Removing libge2d library"
|
||
|
|
fi
|
||
|
|
|
||
|
|
exit 0
|
||
|
|
EOF
|
||
|
|
|
||
|
|
chmod 755 "${debian_dir}/prerm"
|
||
|
|
|
||
|
|
display_alert "LIBGE2D" "Building Debian package..." "info"
|
||
|
|
|
||
|
|
# 构建Debian包
|
||
|
|
cd "${build_dir}/deb"
|
||
|
|
dpkg-deb --build "${pkg_name}-${version}"
|
||
|
|
|
||
|
|
local deb_file="${pkg_name}-${version}.deb"
|
||
|
|
if [[ -f "${deb_file}" ]]; then
|
||
|
|
local output_dir="${BUILD_DIR}/output"
|
||
|
|
mkdir -p "${output_dir}"
|
||
|
|
mv "${deb_file}" "${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb"
|
||
|
|
display_alert "LIBGE2D" "Debian package created: ${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb" "success"
|
||
|
|
else
|
||
|
|
display_alert "LIBGE2D" "Failed to build Debian package" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
return 0
|
||
|
|
}
|
||
|
|
|
||
|
|
function amlbian_build_libge2d {
|
||
|
|
if ! is_unit_enabled "libge2d"; then
|
||
|
|
display_alert "[SKIP] >> libge2d disable in BUILD_UNITS" "" "info"
|
||
|
|
return
|
||
|
|
fi
|
||
|
|
display_alert "AMLOGIC: Building libge2d ${DEB_VERSION} ${BOARD}" "info"
|
||
|
|
|
||
|
|
# Define all directory paths (in .tmp directory)
|
||
|
|
local build_root="${BUILD_DIR}/.tmp/libge2d-build-${ARCH:-arm64}"
|
||
|
|
local build_dir="${build_root}/build" # Build directory with source code
|
||
|
|
local install_dir="${build_root}/install" # Install directory
|
||
|
|
|
||
|
|
rm -rf "${build_root}"
|
||
|
|
|
||
|
|
# 创建目录
|
||
|
|
mkdir -p "${build_dir}" "${install_dir}"
|
||
|
|
|
||
|
|
display_alert "AMLOGIC: build_dir ${build_dir}" "info"
|
||
|
|
display_alert "AMLOGIC: install_dir ${install_dir}" "info"
|
||
|
|
display_alert "AMLOGIC: output_dir ${BUILD_DIR}/output" "info"
|
||
|
|
|
||
|
|
# 准备源代码
|
||
|
|
__libge2d_prepare_source "${build_dir}"
|
||
|
|
|
||
|
|
# 构建
|
||
|
|
if ! __libge2d_build "${build_dir}" "${install_dir}"; then
|
||
|
|
display_alert "AMLOGIC: Libge2d build failed" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 安装到安装目录
|
||
|
|
if ! __libge2d_install "${build_dir}" "${install_dir}"; then
|
||
|
|
display_alert "AMLOGIC: Libge2d installation failed" "err"
|
||
|
|
return 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
display_alert "AMLOGIC: Creating Debian package..." "info"
|
||
|
|
__libge2d_create_deb "${build_dir}" "${install_dir}"
|
||
|
|
|
||
|
|
__unset_libge2d_config
|
||
|
|
|
||
|
|
return 0
|
||
|
|
}
|
||
|
|
|
||
|
|
# ==============================================================================
|
||
|
|
# Section 5: Main
|
||
|
|
# ==============================================================================
|
||
|
|
|
||
|
|
display_alert "AMLIbian Libge2d Build Script" "Version: ${DEB_VERSION}, Board: ${BOARD}" "info"
|
||
|
|
|
||
|
|
amlbian_build_libge2d
|
||
|
|
|
||
|
|
display_alert "AMLOGIC: Libge2d build completed" "${BUILD_DIR}/output" "info"
|
||
|
|
|
||
|
|
# ==============================================================================
|
||
|
|
# End of build-libge2d.sh
|
||
|
|
# ==============================================================================
|