trying to get this running in docker

This commit is contained in:
Maxwell Talbot
2020-08-05 20:31:11 +01:00
parent 5059aa0211
commit 1ff6b811a5
5 changed files with 172 additions and 1 deletions

66
.dockerignore Normal file
View File

@@ -0,0 +1,66 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# test builds
dev/test/build/bin/*
# aot snapshots
dev/bin/*
# Generated make files
Makefile
*.make
# Dart stuff
pubspec.lock
.packages
.dart_tool
# OSX stuff
*.DS_Store
# Generated docs
rive/docs
# Analysis results
dev/analysis_report
# Build directories
wasm/build
rive/build/bin
wasm/custom_emcc
# Skia dependencies
skia/dependencies/skia
skia/dependencies/glfw_build
skia/renderer/build/bin

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt-get -y install unzip zip clang cmake ninja-build pkg-config libgtk-3-dev xvfb cargo wget git g++
RUN wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz
RUN tar -xvf premake-5.0.0-alpha15-linux.tar.gz
RUN mv premake5 /usr/bin/
RUN apt-get -y install python
# ADD skia/dependencies/make_dependencies.sh /app/skia/dependencies/make_dependencies.sh
ADD skia/dependencies/make_skia.sh /app/skia/dependencies/make_skia.sh
ADD skia/dependencies/make_glfw.sh /app/skia/dependencies/make_glfw.sh
WORKDIR /app/skia/dependencies
# RUN /app/skia/dependencies/make_dependencies.sh
RUN /app/skia/dependencies/make_skia.sh
RUN /app/skia/dependencies/make_glfw.sh
WORKDIR /app/packages/peon_process
ADD rive /app/rive
ADD skia /app/skia
WORKDIR /app/skia/renderer
# RUN /app/skia/renderer/build.sh

25
skia/dependencies/make_glfw.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
set -e
# GLFW requires CMake
GLFW_REPO=https://github.com/glfw/glfw
# -----------------------------
# Get & Build GLFW
# -----------------------------
if [ ! -d glfw ]; then
echo "Cloning GLFW."
git clone $GLFW_REPO
else
echo "Already have GLFW, update it."
cd glfw && git fetch && git merge master
cd ..
fi
mkdir glfw_build
cd glfw_build
cmake ../glfw -DBUILD_SHARED_LIBS=OFF
make

58
skia/dependencies/make_skia.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/sh
set -e
# Requires depot_tools and git:
# https://skia.org/user/download
# Build notes:
# https://skia.org/user/build
# GLFW requires CMake
SKIA_REPO=https://github.com/google/skia
# -----------------------------
# Get & Build Skia
# -----------------------------
if [ ! -d skia ]; then
echo "Cloning Skia."
git clone $SKIA_REPO
else
echo "Already have Skia, update it."
cd skia && git fetch && git merge master
cd ..
fi
cd skia
python tools/git-sync-deps
bin/gn gen out/Static --args=" \
is_official_build=true \
skia_use_angle=false \
skia_use_dng_sdk=false \
skia_use_egl=false \
skia_use_expat=false \
skia_use_fontconfig=false \
skia_use_freetype=true \
skia_use_system_freetype2=false \
skia_use_icu=false \
skia_use_libheif=false \
skia_use_system_libpng=false \
skia_use_libjpeg_turbo_encode=false \
skia_use_libjpeg_turbo_decode=false \
skia_use_libwebp_encode=false \
skia_use_libwebp_decode=false \
skia_use_lua=false \
skia_use_piex=false \
skia_use_vulkan=false \
skia_use_metal=false \
skia_use_zlib=true \
skia_use_system_zlib=false \
skia_enable_ccpr=true \
skia_enable_gpu=true \
skia_enable_fontmgr_empty=false \
skia_enable_spirv_validation=false \
skia_enable_pdf=false \
skia_use_libpng_encode = true \
skia_use_libpng_decode = true
"
ninja -C out/Static
cd ..

View File

@@ -11,7 +11,7 @@ includedirs {"../include", "../../../rive/include", "../../dependencies/skia", "
"../../dependencies/skia/include/effects", "../../dependencies/skia/include/gpu",
"../../dependencies/skia/include/config"}
links {"Cocoa.framework", "IOKit.framework", "CoreVideo.framework", "rive", "skia"}
links {"rive", "skia"}
libdirs {"../../../rive/build/bin/%{cfg.buildcfg}", "../../dependencies/skia/out/Static"}
files {"../src/**.cpp"}