Skip to content

Flutter: Update Version #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 0flutter-imx8-aarch64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/* && \
bash /root/build-flutter.sh

COPY build-flutter_app.sh /root/
RUN bash /root/build-flutter_app.sh

CMD ["/bin/bash"]
11 changes: 3 additions & 8 deletions 0flutter-imx8-aarch64/build-flutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
cd /root
git clone https://github.com/sony/flutter-elinux
cd flutter-elinux
git checkout 87bfe8229849f81ff8fd4cb6e7fb6c63903fd56f
git checkout 4c1998ac7419a8da2ab7636c6f18bbbcaf601821
mv /root/flutter-elinux /opt/
export PATH=/opt/flutter-elinux/bin:$PATH
echo "export PATH=$PATH" > /etc/environment
Expand All @@ -29,17 +29,12 @@ cd /root

git clone https://github.com/sony/flutter-embedded-linux
cd flutter-embedded-linux
git checkout 047c0d1133c64f34076f5bc6f62a9919d53add61
git checkout f1de80f92b03704d54317bb70cf94ec0c87ba24a
mkdir /root/flutter-embedded-linux/build
cd /root/flutter-embedded-linux/build

cp /opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/libflutter_engine.so /root/flutter-embedded-linux/build/
cmake -DUSER_PROJECT_PATH=examples/flutter-wayland-client -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

cd /root
git clone https://github.com/flutter/gallery
cd /root/gallery
git checkout 312e0cbd271c5da57256f874ae45f87d15103890
flutter-elinux config --enable-linux-desktop
flutter-elinux build linux --debug

15 changes: 15 additions & 0 deletions 0flutter-imx8-aarch64/build-flutter_app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Build Flutter
set -ex

export PATH=/opt/flutter-elinux/bin:$PATH
echo "export PATH=$PATH" > /etc/environment
export LD_LIBRARY_PATH=/opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/

cd /root
git clone https://github.com/flutter/gallery
cd /root/gallery
git checkout 1dfcd617a260e4468f0883d7dfbfdfe3d021f7b3
flutter-elinux config --enable-linux-desktop
flutter-elinux build linux --debug

Binary file added flutter-imx8-dev/.Dockerfile.un~
Binary file not shown.
69 changes: 69 additions & 0 deletions flutter-imx8-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2021 Foundries.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# For testing in the LmP
# docker build --tag hub.foundries.io/lmp/xkiosk-imx8:latest .
# docker run -it --rm --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' -v /run/user/63:/run/user/63 -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore --entrypoint /bin/bash hub.foundries.io/lmp/xkiosk-imx8:latest
# /start.sh
# or
# docker run -it --rm --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' -v /run/user/63:/run/user/63 -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore hub.foundries.io/lmp/xkiosk-imx8:latest
FROM 0flutter-imx8-aarch64:1.0 AS build

LABEL maintainer="Raul Munoz <raul@foundries.io>"
ENV DEBIAN_FRONTEND noninteractive

COPY [ \
"imx8-libs.sh", \
"patches/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch", \
"/root/"]

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
meson \
autoconf \
patch \
libpciaccess-dev \
libxkbcommon0 \
automake && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
bash /root/imx8-libs.sh

ENV WAYLAND_USER="weston"
ENV XDG_RUNTIME_DIR="/run/user/63"
ENV WAYLAND_DISPLAY="wayland-0"

ENV FIO_HOME /home/weston
ENV FIO_USERID 63
ENV FIO_USERNAME weston

ENV LD_LIBRARY_PATH=/opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/
ENV LC_ALL="en_US.UTF-8"
ENV PATH="/opt/flutter-elinux/bin:${PATH}"

RUN groupadd -g 61 render && \
if [ ! "${FIO_USERID}" = "0" ]; then \
groupadd -g ${FIO_USERID} ${FIO_USERNAME}; \
useradd -d ${FIO_HOME} -s /bin/bash -m ${FIO_USERNAME} -u ${FIO_USERID} -g ${FIO_USERID} -G video,render; \
fi

RUN cp /opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/libflutter_engine.so /root/flutter-embedded-linux/build/
COPY --chown=${FIO_USERNAME} start.sh /

#USER ${FIO_USERNAME}
WORKDIR /root

ENTRYPOINT ["/start.sh"]
69 changes: 69 additions & 0 deletions flutter-imx8-dev/Dockerfile~
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2021 Foundries.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# For testing in the LmP
# docker build --tag hub.foundries.io/lmp/xkiosk-imx8:latest .
# docker run -it --rm --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' -v /run/user/63:/run/user/63 -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore --entrypoint /bin/bash hub.foundries.io/lmp/xkiosk-imx8:latest
# /start.sh
# or
# docker run -it --rm --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' -v /run/user/63:/run/user/63 -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore hub.foundries.io/lmp/xkiosk-imx8:latest
FROM hub.foundries.io/ew2022/0flutter-imx8-aarch64 AS build

LABEL maintainer="Raul Munoz <raul@foundries.io>"
ENV DEBIAN_FRONTEND noninteractive

COPY [ \
"imx8-libs.sh", \
"patches/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch", \
"/root/"]

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
meson \
autoconf \
patch \
libpciaccess-dev \
libxkbcommon0 \
automake && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
bash /root/imx8-libs.sh

ENV WAYLAND_USER="weston"
ENV XDG_RUNTIME_DIR="/run/user/63"
ENV WAYLAND_DISPLAY="wayland-0"

ENV FIO_HOME /home/weston
ENV FIO_USERID 63
ENV FIO_USERNAME weston

ENV LD_LIBRARY_PATH=/opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/
ENV LC_ALL="en_US.UTF-8"
ENV PATH="/opt/flutter-elinux/bin:${PATH}"

RUN groupadd -g 61 render && \
if [ ! "${FIO_USERID}" = "0" ]; then \
groupadd -g ${FIO_USERID} ${FIO_USERNAME}; \
useradd -d ${FIO_HOME} -s /bin/bash -m ${FIO_USERNAME} -u ${FIO_USERID} -g ${FIO_USERID} -G video,render; \
fi

RUN cp /opt/flutter-elinux/flutter/bin/cache/artifacts/engine/elinux-arm64-debug/libflutter_engine.so /root/flutter-embedded-linux/build/
COPY --chown=${FIO_USERNAME} start.sh /

#USER ${FIO_USERNAME}
WORKDIR /root

ENTRYPOINT ["/start.sh"]
2 changes: 2 additions & 0 deletions flutter-imx8-dev/docker-build.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SKIP_ARCHS="arm amd64"
MANIFEST_PLATFORMS="linux/arm64"
21 changes: 21 additions & 0 deletions flutter-imx8-dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.6'

services:
flutter-imx8-dev:
image: hub.foundries.io/ew2022/flutter-imx8-dev:latest
restart: always
tty: true
read_only: true
network_mode: "host"
tmpfs:
- /run
- /var/lock
- /var/log
- /tmp
volumes:
- /run/user/63:/run/user/63
- /dev/dri:/dev/dri
- /dev/galcore:/dev/galcore
device_cgroup_rules:
- 'c 199:* rmw'
- 'c 226:* rmw'
32 changes: 32 additions & 0 deletions flutter-imx8-dev/imx8-libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -ex

#Installing libdrm-imx
cd /root/
git clone -b libdrm-imx-2.4.102 http://source.codeaurora.org/external/imx/libdrm-imx.git
cd /root/libdrm-imx/
git checkout 40ea53973b99b7df07f472318918a8c2b310e4a7
patch -f -p1 < /root/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch
meson --prefix /usr --buildtype plain -Damdgpu=true -Dcairo-tests=false -Detnaviv=true -Dexynos=false -Dfreedreno=true -Dfreedreno-kgsl=false -Dinstall-test-programs=true -Dintel=true -Dlibkms=true -Dman-pages=false -Dnouveau=true -Domap=true -Dradeon=true -Dtegra=false -Dudev=false -Dvalgrind=false -Dvc4=true -Dvivante=true -Dvmwgfx=true build/
ninja -C build/ install

#Installing imx-gpu-viv
cd /root/
wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-gpu-viv-6.4.3.p1.4-aarch64.bin
sh /root/imx-gpu-viv-6.4.3.p1.4-aarch64.bin --auto-accept --force
cp -ra /root/imx-gpu-viv-6.4.3.p1.4-aarch64/gpu-core/etc/* /etc/
cp -ra /root/imx-gpu-viv-6.4.3.p1.4-aarch64/gpu-core/usr/lib/*.so* /usr/lib/aarch64-linux-gnu/
cp -ra /root/imx-gpu-viv-6.4.3.p1.4-aarch64/gpu-core/usr/lib/wayland/* /usr/lib/aarch64-linux-gnu/
cp -ra /root/imx-gpu-viv-6.4.3.p1.4-aarch64/gpu-core/usr/include/* /usr/include/

#Installing imx-gpu-g2d
wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-gpu-g2d-6.4.3.p1.4-aarch64.bin
sh /root/imx-gpu-g2d-6.4.3.p1.4-aarch64.bin --auto-accept --force
cp -ra /root/imx-gpu-g2d-6.4.3.p1.4-aarch64/g2d/usr/include/* /usr/include/
cp -ra /root/imx-gpu-g2d-6.4.3.p1.4-aarch64/g2d/usr/lib/* /usr/lib/aarch64-linux-gnu/

#Removing files
rm -rf /root/libdrm-imx*
rm -rf /root/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch
rm -rf /root/imx-gpu-g2d-6.4.3.p1.4-aarch64*
rm -rf /root/imx-gpu-viv-6.4.3.p1.4-aarch64*
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
From 45f48f8a5de59c04b0510c23853772bc970f411e Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Thu, 9 Jan 2020 01:01:35 +0000
Subject: [PATCH] meson: add libdrm-vivante to the meson meta data

Upstream libdrm added the option to use meason as the buildsystem.
Integrate Vivante into the relevant meson build information.

Upstream-Status: Pending

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
meson.build | 14 +++++++++++++
meson_options.txt | 7 +++++++
vivante/meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+)
create mode 100644 vivante/meson.build

diff --git a/meson.build b/meson.build
index e292554a..f4740634 100644
--- a/meson.build
+++ b/meson.build
@@ -157,6 +157,15 @@ if _vc4 != 'false'
with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
endif

+with_vivante = false
+_vivante = get_option('vivante')
+if _vivante == 'true'
+ if not with_atomics
+ error('libdrm_vivante requires atomics.')
+ endif
+ with_vivante = true
+endif
+
# XXX: Apparently only freebsd and dragonfly bsd actually need this (and
# gnu/kfreebsd), not openbsd and netbsd
with_libkms = false
@@ -312,6 +321,7 @@ install_headers(
'include/drm/savage_drm.h', 'include/drm/sis_drm.h',
'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h',
'include/drm/via_drm.h', 'include/drm/virtgpu_drm.h',
+ 'include/drm/vivante_drm.h',
subdir : 'libdrm',
)
if with_vmwgfx
@@ -362,6 +372,9 @@ endif
if with_etnaviv
subdir('etnaviv')
endif
+if with_vivante
+ subdir('vivante')
+endif
if with_man_pages
subdir('man')
endif
@@ -382,5 +395,6 @@ message(' EXYNOS API @0@'.format(with_exynos))
message(' Freedreno API @0@ (kgsl: @1@)'.format(with_freedreno, with_freedreno_kgsl))
message(' Tegra API @0@'.format(with_tegra))
message(' VC4 API @0@'.format(with_vc4))
+message(' Vivante API @0@'.format(with_etnaviv))
message(' Etnaviv API @0@'.format(with_etnaviv))
message('')
diff --git a/meson_options.txt b/meson_options.txt
index 8af33f1c..dc69563d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -95,6 +95,13 @@ option(
choices : ['true', 'false', 'auto'],
description : '''Enable support for vc4's KMS API.''',
)
+option(
+ 'vivante',
+ type : 'combo',
+ value : 'false',
+ choices : ['true', 'false', 'auto'],
+ description : '''Enable support for vivante's propriatary experimental KMS API.''',
+)
option(
'etnaviv',
type : 'combo',
diff --git a/vivante/meson.build b/vivante/meson.build
new file mode 100644
index 00000000..f6adb598
--- /dev/null
+++ b/vivante/meson.build
@@ -0,0 +1,50 @@
+# Copyright © 2017-2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+libdrm_vivante = shared_library(
+ 'drm_vivante',
+ [
+ files(
+ 'vivante_bo.c',
+ ),
+ config_file
+ ],
+ include_directories : [inc_root, inc_drm],
+ link_with : libdrm,
+ c_args : libdrm_c_args,
+ dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops],
+ version : '1.0.0',
+ install : true,
+)
+
+pkg.generate(
+ name : 'libdrm_vivante',
+ libraries : libdrm_vivante,
+ subdirs : ['.', 'libdrm'],
+ version : meson.project_version(),
+ requires_private : 'libdrm',
+ description : 'Userspace interface to Vivante kernel DRM services',
+)
+
+ext_libdrm_vivante = declare_dependency(
+ link_with : [libdrm, libdrm_vivante],
+ include_directories : [inc_drm, include_directories('.')],
+)
--
2.20.1

Loading