-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6619cfa
commit 6626ed8
Showing
6 changed files
with
275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
m4_include(`paths.m4')m4_dnl | ||
m4_include(`packages.m4')m4_dnl | ||
|
||
m4_dnl Include Debian base preparation steps | ||
m4_dnl This ensures all common steps are shared by all toolchains | ||
m4_include(`debian-toolchain-base.m4')m4_dnl | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
bc \ | ||
cpio \ | ||
rsync \ | ||
g++ && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV MIYOO_ROOT=/opt/miyoo HOST=arm-miyoo-linux-uclibcgnueabi | ||
|
||
local_package(toolchain) | ||
|
||
ENV PREFIX=${MIYOO_ROOT}/${HOST}/sysroot/usr | ||
|
||
# Use configure CFLAGS | ||
ENV \ | ||
def_binaries(`${MIYOO_ROOT}/bin/${HOST}-', `ar, as, c++filt, ld, nm, objcopy, objdump, ranlib, readelf, strings, strip') \ | ||
def_binaries(`${MIYOO_ROOT}/bin/${HOST}-', `gcc, cpp, c++') \ | ||
CC=${MIYOO_ROOT}/bin/$HOST-gcc \ | ||
def_aclocal(`${PREFIX}') \ | ||
def_pkg_config(`${PREFIX}') \ | ||
PKG_CONFIG_SYSROOT_DIR=${MIYOO_ROOT}/${HOST}/sysroot \ | ||
PATH=$PATH:${PREFIX}/bin \ | ||
CFLAGS="-march=armv5te -mtune=arm926ej-s -ffast-math -fomit-frame-pointer -ffunction-sections -fdata-sections" \ | ||
CXXFLAGS="-march=armv5te -mtune=arm926ej-s -ffast-math -fomit-frame-pointer -ffunction-sections -fdata-sections" \ | ||
LDFLAGS="-Wl,--as-needed,--gc-sections" | ||
|
||
# zlib is already installed in original toolchain | ||
|
||
# libpng is already installed in original toolchain | ||
|
||
# libjpeg is already installed in original toolchain | ||
|
||
# giflib is already installed in original toolchain | ||
|
||
# libmad is already installed in original toolchain | ||
|
||
# libogg is already installed in original toolchain | ||
|
||
# libvorbis is already installed in original toolchain | ||
|
||
# libvorbisidec is already installed in original toolchain | ||
|
||
# libtheora is already installed in original toolchain | ||
|
||
# flac is already installed in original toolchain | ||
|
||
helpers_package(faad2) | ||
|
||
helpers_package(mpeg2dec) | ||
|
||
helpers_package(a52dec) | ||
|
||
# curl is already installed in original toolchain | ||
|
||
# freetype is already installed in original toolchain | ||
|
||
# fribidi is already installed in original toolchain | ||
|
||
# sdl is already installed in original toolchain | ||
|
||
# sdl_net is already installed in original toolchain | ||
|
||
helpers_package(fluidlite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#! /bin/sh | ||
|
||
MIYOO_VERSION=1.0 | ||
# This version depends on Miyoo devel package | ||
BUILDROOT_VERSION=2018.02.9 | ||
|
||
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | ||
HELPERS_DIR=$PACKAGE_DIR/../.. | ||
. $HELPERS_DIR/functions.sh | ||
|
||
do_make_bdir | ||
|
||
do_http_fetch devel "https://github.com/steward-fu/miyoo/releases/download/v${MIYOO_VERSION}/devel.zip" 'unzip' | ||
cd .. | ||
|
||
do_http_fetch buildroot- "https://buildroot.org/downloads/buildroot-${BUILDROOT_VERSION}.tar.gz" 'tar xzf' | ||
do_patch buildroot | ||
|
||
num_cpus=$(nproc || grep -c ^processor /proc/cpuinfo || echo 1) | ||
MAKEOPTS="-j${num_cpus}" | ||
|
||
# We will cleanup defconfig to have a small build just enough for us | ||
WHITELIST=$(cat <<-"EOF" | ||
UCLIBC | ||
BUSYBOX.* | ||
BZIP2 | ||
GETTEXT | ||
MESA3D.* | ||
SDL | ||
SDL_FBCON | ||
SDL_NET | ||
SDL2 | ||
SDL2_X11 | ||
SDL2_NET | ||
XORG7 | ||
XLIB_.* | ||
ALSA_LIB.* | ||
LIBMAD | ||
LIBVORBIS | ||
TREMOR | ||
FREETYPE | ||
GIFLIB | ||
JPEG | ||
LIBDRM.* | ||
LIBGLU | ||
LIBPNG | ||
TSLIB | ||
LIBTHEORA | ||
LIBCURL | ||
LIBFRIBIDI | ||
LIBICONV | ||
NCURSES.* | ||
READLINE | ||
LIBJPEG | ||
EOF | ||
) | ||
|
||
lighten() { | ||
# Update configuration | ||
make olddefconfig | ||
|
||
# Backup our full configuration | ||
cp .config .config.full | ||
|
||
# Build in our build directory | ||
sed -i '/^BR2_HOST_DIR=.*/d' ".config" | ||
|
||
# Remove all packages | ||
sed -i '/^BR2_PACKAGE/d' ".config" | ||
# Remove some other settings | ||
sed -i 's/^BR2_TARGET_ROOTFS_TAR=y$/# BR2_TARGET_ROOTFS_TAR is not set/' ".config" | ||
sed -i 's/^BR2_PACKAGE_HOST_PATCHELF=y$/# BR2_PACKAGE_HOST_PATCHELF is not set/' ".config" | ||
|
||
# Add whitelisted packages which are already enabled | ||
echo "$WHITELIST" | while read pkg; do | ||
grep "^BR2_PACKAGE_$pkg=" ".config.full" >> ".config" || true | ||
done | ||
|
||
# It seems that the config file hasn't these enabled while the toolchain has | ||
echo "BR2_PACKAGE_FLAC=y" >> ".config" | ||
echo "BR2_PACKAGE_NCURSES_WCHAR=y" >> ".config" | ||
|
||
# Fixup everything | ||
make olddefconfig | ||
} | ||
|
||
cp ../devel/config_buildroot-${BUILDROOT_VERSION} .config | ||
|
||
# Lighten build process by removing useless packages for us | ||
lighten | ||
|
||
FORCE_UNSAFE_CONFIGURE=1 make sdk | ||
|
||
mkdir -p "$(basename "${MIYOO_ROOT}")" | ||
mv output/host "${MIYOO_ROOT}" | ||
|
||
cp .config "${MIYOO_ROOT}"/ | ||
|
||
"${MIYOO_ROOT}/relocate-sdk.sh" | ||
|
||
# Cleanup the build | ||
rm -rf output | ||
|
||
do_clean_bdir |
47 changes: 47 additions & 0 deletions
47
toolchains/miyoo/packages/toolchain/patches-buildroot/0000-fix-make-4.3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 9e2128bf5072e5f2fd69e2fc0239558782dfc677 Mon Sep 17 00:00:00 2001 | ||
From: "Yann E. MORIN" <yann.morin.1998@free.fr> | ||
Date: Wed, 4 Mar 2020 14:40:37 +0100 | ||
Subject: [PATCH] Makefile: work around a bug in newly released make 4.3 | ||
|
||
Several users of rolling-release distributions have been reporting on | ||
IRC that Buildroot is broken now that they have switched to the newly | ||
released make 4.3. | ||
|
||
It turns out that the constructs we use to generated and include the | ||
internal br2-external related fragments is no longer working with | ||
make-4.3. | ||
|
||
Indeed, an upstream bug report [0] seems to imply that it so far was | ||
working by chance. There has been no further feedback, whether this is | ||
really considered a fix for a previous ill-defined behaviour, or an | ||
actual regression... | ||
|
||
In the meantime, we add a workaround, suggested in that same bug report, | ||
that fixes the issue for make 4.3, and that should not break on older | ||
make versions either (verified on all relevant versions: from 3.81, | ||
3.82, 4.0, 4.1, and 4.2). | ||
|
||
[0] https://savannah.gnu.org/bugs/?57676 | ||
|
||
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> | ||
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> | ||
Tested-by: Mircea Gliga <mgliga@bitdefender.com> | ||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com> | ||
--- | ||
Makefile | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/Makefile b/Makefile | ||
index 31624f77a2d..09e769f6130 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -188,6 +188,9 @@ ifneq ($(BR2_EXTERNAL_ERROR),) | ||
$(error $(BR2_EXTERNAL_ERROR)) | ||
endif | ||
|
||
+# Workaround bug in make-4.3: https://savannah.gnu.org/bugs/?57676 | ||
+$(BASE_DIR)/.br-external.mk:; | ||
+ | ||
# To make sure that the environment variable overrides the .config option, | ||
# set this before including .config. | ||
ifneq ($(BR2_DL_DIR),) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM toolchains/miyoo AS toolchain | ||
|
||
m4_include(`paths.m4')m4_dnl | ||
|
||
m4_include(`debian-builder-base.m4')m4_dnl | ||
|
||
ENV MIYOO_ROOT=/opt/miyoo HOST=arm-miyoo-linux-uclibcgnueabi | ||
|
||
COPY --from=toolchain ${MIYOO_ROOT} ${MIYOO_ROOT}/ | ||
|
||
ENV PREFIX=${MIYOO_ROOT}/${HOST}/sysroot/usr | ||
|
||
# We add PATH here for *-config and platform specific binaries | ||
# *FLAGS are already set in configure script | ||
ENV \ | ||
def_binaries(`${MIYOO_ROOT}/bin/${HOST}-', `ar, as, c++filt, ld, nm, objcopy, objdump, ranlib, readelf, strings, strip') \ | ||
def_binaries(`${MIYOO_ROOT}/bin/${HOST}-', `gcc, cpp, c++') \ | ||
CC=${MIYOO_ROOT}/bin/$HOST-gcc \ | ||
def_aclocal(`${PREFIX}') \ | ||
def_pkg_config(`${PREFIX}') \ | ||
PKG_CONFIG_SYSROOT_DIR=${MIYOO_ROOT}/${HOST}/sysroot \ | ||
PATH=$PATH:${PREFIX}/bin | ||
|
||
m4_include(`run-buildbot.m4')m4_dnl |