aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-03-03 23:17:03 +0000
committerneonloop2021-03-03 23:17:03 +0000
commit9cd70be8d87cd2258b46c77de051460e50edf786 (patch)
treee5ddddffb9904fcbf7c1a994c246a98174d80333
downloadtrimui-toolchain-9cd70be8d87cd2258b46c77de051460e50edf786.tar.gz
trimui-toolchain-9cd70be8d87cd2258b46c77de051460e50edf786.tar.bz2
trimui-toolchain-9cd70be8d87cd2258b46c77de051460e50edf786.zip
Initial commit
-rw-r--r--.gitignore2
-rw-r--r--Dockerfile37
-rw-r--r--Makefile14
-rw-r--r--README.md12
-rw-r--r--defconfig6
-rw-r--r--libpng12.patch113
6 files changed, 184 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b4d5d53
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.build
+workspace/* \ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1ff49bb
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,37 @@
+FROM ubuntu:16.04
+
+RUN apt-get -y update \
+ && apt-get -y install bzip2 bc cpio g++ make patch perl python unzip rsync wget locales \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
+ locale-gen
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
+
+RUN useradd -d /home/trimui -m -s /bin/bash -U trimui
+RUN ln -s /home/trimui/buildroot/output/host/usr /opt/trimui-toolchain
+
+USER trimui
+WORKDIR /home/trimui
+
+ENV BR_VER 2016.05
+ENV BR_DIR buildroot-${BR_VER}
+ENV BR_TAR ${BR_DIR}.tar.bz2
+ENV BR_URL https://buildroot.org/downloads/${BR_TAR}
+RUN echo ${BR_DIR} && wget ${BR_URL} && ls -l && tar xf ${BR_TAR} && rm -f ${BR_TAR}
+RUN ln -s ${BR_DIR} buildroot
+
+WORKDIR /home/trimui/buildroot
+COPY libpng12.patch libpng12.patch
+RUN patch -p0 < libpng12.patch
+
+COPY defconfig defconfig
+
+RUN make defconfig BR2_DEFCONFIG=./defconfig && make toolchain libpng sdl sdl_image bzip2
+
+VOLUME /home/trimui/workspace
+WORKDIR /home/trimui/workspace
+
+CMD ["/bin/bash"]
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..678c804
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+WORKSPACE_DIR := $(shell pwd)/workspace
+
+shell: .build
+ docker run -it --rm -v $(WORKSPACE_DIR):/home/trimui/workspace trimui-toolchain /bin/bash
+.PHONY: shell
+
+.build: Dockerfile defconfig *.patch
+ docker build -t trimui-toolchain .
+ touch .build
+
+.PHONY: clean
+clean:
+ docker rmi trimui-toolchain
+ rm .build
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0515b54
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+# trimui toolchain Docker image
+
+## Installation
+
+With Docker installed and running, `make shell` builds the toolchain and drops into a shell inside the container. The container's `~/workspace` is bound to `./workspace` by default. The toolchain is located at `/opt/trimui-toolchain` inside the container, libraries are in `/opt/trimui-toolchain/arm-buildroot-linux-gnueabi/sysroot/usr/lib/`.
+
+After building the first time, unless a dependency of the image has changed, `make shell` will skip building and drop into the shell.
+
+## Workflow:
+
+- On your host machine, clone repositories into `./workspace` and make changes as usual.
+- In the container shell, find the repository in `~/workspace` and build as usual.
diff --git a/defconfig b/defconfig
new file mode 100644
index 0000000..2530ecb
--- /dev/null
+++ b/defconfig
@@ -0,0 +1,6 @@
+BR2_arm=y
+BR2_ENABLE_DEBUG=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_GCC_VERSION_6_X=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_HOST_GDB=y
diff --git a/libpng12.patch b/libpng12.patch
new file mode 100644
index 0000000..7b584aa
--- /dev/null
+++ b/libpng12.patch
@@ -0,0 +1,113 @@
+diff -Nu ./package/libpng-old/0001-disable-tools.patch ./package/libpng/0001-disable-tools.patch
+--- ./package/libpng-old/0001-disable-tools.patch 2016-05-31 14:52:36.000000000 -0700
++++ ./package/libpng/0001-disable-tools.patch 1969-12-31 16:00:00.000000000 -0800
+@@ -1,30 +0,0 @@
+-Disable the new pngfix and png-fix-itxt tools: they take up space, fail to
+-build on some oddball toolchain configurations and aren't expected/needed
+-in a non-interactive embedded system.
+-
+-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+-
+-diff -Nura libpng-1.6.10.orig/Makefile.am libpng-1.6.10/Makefile.am
+---- libpng-1.6.10.orig/Makefile.am 2014-03-17 08:51:25.812005079 -0300
+-+++ libpng-1.6.10/Makefile.am 2014-03-17 09:14:28.807586433 -0300
+-@@ -10,7 +10,7 @@
+- check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage
+-
+- # Utilities - installed
+--bin_PROGRAMS= pngfix png-fix-itxt
+-+bin_PROGRAMS=
+-
+- # This ensures that pnglibconf.h gets built at the start of 'make all' or
+- # 'make check', but it does not add dependencies to the individual programs,
+-diff -Nura libpng-1.6.10.orig/Makefile.in libpng-1.6.10/Makefile.in
+---- libpng-1.6.10.orig/Makefile.in 2014-03-17 08:51:25.807005070 -0300
+-+++ libpng-1.6.10/Makefile.in 2014-03-17 09:14:44.846617623 -0300
+-@@ -87,7 +87,7 @@
+- host_triplet = @host@
+- check_PROGRAMS = pngtest$(EXEEXT) pngunknown$(EXEEXT) \
+- pngstest$(EXEEXT) pngvalid$(EXEEXT) pngimage$(EXEEXT)
+--bin_PROGRAMS = pngfix$(EXEEXT) png-fix-itxt$(EXEEXT)
+-+bin_PROGRAMS =
+- @PNG_ARM_NEON_TRUE@am__append_1 = arm/arm_init.c\
+- @PNG_ARM_NEON_TRUE@ arm/filter_neon.S arm/filter_neon_intrinsics.c
+-
+diff -Nu ./package/libpng-old/0002-ignore-symbol-prefix.patch ./package/libpng/0002-ignore-symbol-prefix.patch
+--- ./package/libpng-old/0002-ignore-symbol-prefix.patch 2016-05-31 14:52:36.000000000 -0700
++++ ./package/libpng/0002-ignore-symbol-prefix.patch 1969-12-31 16:00:00.000000000 -0800
+@@ -1,48 +0,0 @@
+-From dbfea83a7436cbac34cc883ab2b7befacaf02c40 Mon Sep 17 00:00:00 2001
+-From: Danomi Manchego <danomimanchego123@gmail.com>
+-Date: Tue, 23 Jun 2015 13:54:42 -0400
+-Subject: libpng: don't append prefix to symbol names in version script
+-
+-Even if Blackfin GNU toolchain add prefix '_' to all symbols,
+-symbol prefix is not accepted in the link flag --version-script.
+-Don't append prefix in the symbols in the version script file.
+-
+-Original patch by: Sonic Zhang <sonic.zhang@analog.com>
+-
+-Rebase to apply cleanly.
+-
+-Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+----
+- Makefile.am | 2 +-
+- Makefile.in | 2 +-
+- 2 files changed, 2 insertions(+), 2 deletions(-)
+-
+-diff --git a/Makefile.am b/Makefile.am
+-index dcc5439..e543c81 100644
+---- a/Makefile.am
+-+++ b/Makefile.am
+-@@ -231,7 +231,7 @@ contrib/tools/pngfix.o: pnglibconf.h
+- # interfering with the symbol file format.
+- SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
+- -DPNGLIB_VERSION='@PNGLIB_VERSION@'\
+-- -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
+-+ -DSYMBOL_PREFIX=''\
+- -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
+-
+- if DO_PNG_PREFIX
+-diff --git a/Makefile.in b/Makefile.in
+-index 975f931..a3e0552 100644
+---- a/Makefile.in
+-+++ b/Makefile.in
+-@@ -747,7 +747,7 @@ SUFFIXES = .chk .out
+- # interfering with the symbol file format.
+- SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0' \
+- -DPNGLIB_VERSION='@PNGLIB_VERSION@' \
+-- -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' -DPNG_NO_USE_READ_MACROS \
+-+ -DSYMBOL_PREFIX='' -DPNG_NO_USE_READ_MACROS \
+- -DPNG_BUILDING_SYMBOL_TABLE $(am__append_5)
+-
+- # EXT_LIST is a list of the possibly library directory extensions, this exists
+---
+-1.7.9.5
+-
+diff -Nu ./package/libpng-old/libpng.hash ./package/libpng/libpng.hash
+--- ./package/libpng-old/libpng.hash 2016-05-31 14:52:36.000000000 -0700
++++ ./package/libpng/libpng.hash 2021-03-03 00:00:17.556346157 -0800
+@@ -1,3 +1,3 @@
+-# From http://sourceforge.net/projects/libpng/files/libpng16/1.6.21/
+-md5 3bacb4728f6694a64ad9052769d6a4ce libpng-1.6.21.tar.xz
+-sha1 978b2f4e007eda56032001493ddb97d20f0ab291 libpng-1.6.21.tar.xz
++# From http://sourceforge.net/projects/libpng/files/libpng12/older-releases/1.2.56/
++md5 868562bd1c58b76ed8703f135a2e439a libpng-1.2.56.tar.xz
++sha1 29027aeca860048936ebbaec6cdae1148fe05698 libpng-1.2.56.tar.xz
+diff -Nu ./package/libpng-old/libpng.mk ./package/libpng/libpng.mk
+--- ./package/libpng-old/libpng.mk 2021-03-02 23:25:16.434196378 -0800
++++ ./package/libpng/libpng.mk 2021-03-02 23:23:50.473816232 -0800
+@@ -4,10 +4,10 @@
+ #
+ ################################################################################
+
+-LIBPNG_VERSION = 1.6.21
+-LIBPNG_SERIES = 16
++LIBPNG_VERSION = 1.2.56
++LIBPNG_SERIES = 12
+ LIBPNG_SOURCE = libpng-$(LIBPNG_VERSION).tar.xz
+-LIBPNG_SITE = http://downloads.sourceforge.net/project/libpng/libpng${LIBPNG_SERIES}/$(LIBPNG_VERSION)
++LIBPNG_SITE = http://downloads.sourceforge.net/project/libpng/libpng${LIBPNG_SERIES}/older-releases/$(LIBPNG_VERSION)
+ LIBPNG_LICENSE = libpng license
+ LIBPNG_LICENSE_FILES = LICENSE
+ LIBPNG_INSTALL_STAGING = YES