Skip to content

Commit

Permalink
Merge pull request #2 from danielk117/danielk117-patch-1
Browse files Browse the repository at this point in the history
fix build error
  • Loading branch information
danielk117 authored Jan 28, 2024
2 parents a8a34b8 + 0922815 commit d00d572
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ mkdir -p ${STAGING_TO_TARGET_DIR}
write_build_config
[[ ! $? -eq 0 ]] && exit 1

PACKAGES_TO_BUILD="update-libs update-binaries support services music python3 aec-cmdline screen improv getevent"
PACKAGES_TO_BUILD="update-libs update-binaries support services music python3 aec-cmdline satellite screen improv getevent"

for PKGN in $PACKAGES_TO_BUILD; do
process_package $PKGN
Expand Down
3 changes: 2 additions & 1 deletion packages/blue-alsa/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ configure_package() {
--enable-aac \
--enable-ldac \
--enable-ofono \
--enable-aptx --enable-aptx-hd \
--with-sysroot="${STAGING_DIR}"

#--enable-aptx --enable-aptx-hd \ # aptx codec throws build error
}

premake_package() {
Expand Down
84 changes: 44 additions & 40 deletions packages/python3/package.mk
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
PACKAGE_NAME="python3"
PACKAGE_VERSION="3.9.1"
PACKAGE_VERSION="3.9.18"
PACKAGE_SRC="https://www.python.org/ftp/python/${PACKAGE_VERSION}/Python-${PACKAGE_VERSION}.tar.xz"
PACKAGE_DEPENDS="glibc ncurses"

preconfigure_package() {
# build on self host
mkdir -p build-host
cp -a * build-host/
cd build-host
# build on self host
mkdir -p build-host
cp -a * build-host/
cd build-host

./configure
make -j${MAKE_JOBS} python Parser/pgen
make install
./configure
make -j${MAKE_JOBS} python Parser/pgen
make install

if [ $? -gt 0 ]; then
return 1
fi
if [ $? -gt 0 ]; then
return 1
fi

cd ..
cd ..
}

configure_package() {
CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" LDFLAGS="${BUILD_LDFLAGS}" \
CXX="${BUILD_CXX}" CXXFLAGS="${BUILD_CFLAGS}" CPPFLAGS="${BUILD_CFLAGS}" \
PKG_CONFIG_LIBDIR="${BUILD_PKG_CONFIG_LIBDIR}" PKG_CONFIG_SYSROOT_DIR="${BUILD_PKG_CONFIG_SYSROOT_DIR}" \
./configure --build=${MACHTYPE} --host=${BUILD_TARGET} --target=${BUILD_TARGET} \
--prefix=${INSTALL_PREFIX} \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--enable-optimizations \
--with-lto \
--enable-shared \
CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" LDFLAGS="${BUILD_LDFLAGS}" \
CXX="${BUILD_CXX}" CXXFLAGS="${BUILD_CFLAGS}" CPPFLAGS="${BUILD_CFLAGS}" \
PKG_CONFIG_LIBDIR="${BUILD_PKG_CONFIG_LIBDIR}" PKG_CONFIG_SYSROOT_DIR="${BUILD_PKG_CONFIG_SYSROOT_DIR}" \
./configure --build=${MACHTYPE} --host=${BUILD_TARGET} --target=${BUILD_TARGET} \
--prefix=${INSTALL_PREFIX} \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--enable-optimizations \
--with-lto \
--enable-shared \
--disable-ipv6 \
--disable-test-modules \
--without-doc-strings \
--with-ensurepip=no
--with-ensurepip=install
}

make_package() {
make -j${MAKE_JOBS} \
HOSTPYTHON=${PACKAGE_SRC_DIR}/build-host/python \
HOSTPGEN=${PACKAGE_SRC_DIR}/build-host/Parser/pgen \
CROSS_COMPILE_TARGET=yes \
LDFLAGS="${BUILD_LDFLAGS} -static" LINKFORSHARED=" "
make -j${MAKE_JOBS} \
HOSTPYTHON=${PACKAGE_SRC_DIR}/build-host/python \
HOSTPGEN=${PACKAGE_SRC_DIR}/build-host/Parser/pgen \
CROSS_COMPILE_TARGET=yes \
LDFLAGS="${BUILD_LDFLAGS}" LINKFORSHARED=" "
}

install_package() {
make DESTDIR=${STAGING_DIR} install

# optimize size
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/pydoc_data
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/ensurepip
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/pydoc_data
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/ensurepip

rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/asyncio/windows_*.py
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/_osx_support.py
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/asyncio/windows_*.py
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/_osx_support.py

rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/**/test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/*/test

rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/unittest
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/idle_test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/tests
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/unittest
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/idle_test
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/tests

rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/__pycache__
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/__pycache__
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/*/__pycache__
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/*/*/*/__pycache__

rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/__pycache__
rm -rvf /xiaoai/build-packages/staging/armv7/usr/lib/python3.*/**/__pycache__
}

0 comments on commit d00d572

Please sign in to comment.