Skip to content

Commit

Permalink
vfxplatform wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Oct 1, 2023
1 parent 7799ed8 commit e39307a
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/scripts/Dockerfile.vfx

This file was deleted.

13 changes: 13 additions & 0 deletions src/scripts/Dockerfile.vfxplatform
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# VFX Reference Platform
FROM centos:centos7.9.2009

RUN yum -y update
RUN yum -y install centos-release-scl
RUN yum -y group install "Development Tools"
RUN yum -y install pulseaudio-libs-devel wget git yasm python3 fontconfig-devel zlib-devel autoconf automake xz devtoolset-7 llvm-toolset-7 tree curl libICE-devel libSM-devel libX11-devel libXau-devel libXdamage-devel libXext-devel libXfixes-devel libXi-devel libXxf86vm-devel libdrm-devel libxcb-devel mesa-libGL-devel xorg-x11-proto-devel
RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN echo "source scl_source enable devtoolset-7" >> /root/.bashrc

# WIP
# COPY build_vfx.sh /
# CMD [ "bash", "./build_vfx.sh" ]
241 changes: 241 additions & 0 deletions src/scripts/build_vfxplatform_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
#!/bin/bash
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

set -e -x

source /opt/rh/devtoolset-7/enable
gcc -v

CWD=`pwd`
SDK=${SDK:-"/opt/friction"}
SRC=${SDK}/src
DIST=${DIST:-"/mnt"}
JOBS=${JOBS:-4}

XKBCOMMON_V=0.7.1
QT_V=5.12.12
QSCINTILLA_V=2.14.1
GPERF_V=4df0b85
PELF_V=0.17.0
CMAKE_V=3.27.6
UNWIND_V=1.4.0

NINJA_BIN=${SDK}/bin/ninja
CMAKE_BIN=${SDK}/bin/cmake
PELF_BIN=${SDK}/bin/patchelf
QMAKE_BIN=${SDK}/bin/qmake

GPERF_DIR=${SDK}/gperftools
GPERF_LIB=${GPERF_DIR}/.libs/libtcmalloc.a

export PATH="${SDK}/bin:${PATH}"
export PKG_CONFIG_PATH="${SDK}/lib/pkgconfig"

if [ ! -d "${SDK}" ]; then
mkdir -p "${SDK}/lib"
mkdir -p "${SDK}/bin"
(cd "${SDK}"; ln -sf lib lib64)
fi

if [ ! -d "${SRC}" ]; then
mkdir -p "${SRC}"
fi

STATIC_CFLAGS="-fPIC"
DEFAULT_CFLAGS="-I${SDK}/include"
DEFAULT_LDFLAGS="-L${SDK}/lib"
COMMON_CONFIGURE="--prefix=${SDK}"
SHARED_CONFIGURE="${COMMON_CONFIGURE} --enable-shared --disable-static"
STATIC_CONFIGURE="${COMMON_CONFIGURE} --disable-shared --enable-static"
DEFAULT_CONFIGURE="${SHARED_CONFIGURE}"

# patchelf
if [ ! -f "${PELF_BIN}" ]; then
cd ${SRC}
PELF_SRC=patchelf-${PELF_V}
rm -rf ${PELF_SRC} || true
tar xf ${DIST}/${PELF_SRC}.tar.bz2
cd ${PELF_SRC}
./configure ${COMMON_CONFIGURE}
make -j${JOBS}
make install
fi # patchelf

# cmake
if [ ! -f "${CMAKE_BIN}" ]; then
cd ${SRC}
CMAKE_SRC=cmake-${CMAKE_V}
rm -rf ${CMAKE_SRC} || true
tar xf ${DIST}/${CMAKE_SRC}.tar.gz
cd ${CMAKE_SRC}
./configure ${COMMON_CONFIGURE} -- -DCMAKE_USE_OPENSSL=OFF
make -j${JOBS}
make install
fi # cmake

# libunwind
if [ ! -f "${SDK}/lib/pkgconfig/libunwind.pc" ]; then
cd ${SRC}
UNWIND_SRC=libunwind-${UNWIND_V}
rm -rf ${UNWIND_SRC} || true
tar xf ${DIST}/${UNWIND_SRC}.tar.gz
cd ${UNWIND_SRC}
./configure ${STATIC_CONFIGURE} --disable-minidebuginfo --disable-tests
make -j${JOBS}
make install
fi # libunwind

# gperftools
if [ ! -f "${GPERF_LIB}" ]; then
cd ${SRC}
GPERF_SRC=gperftools-${GPERF_V}
rm -rf ${GPERF_SRC} || true
rm -rf ${GPERF_DIR} || true
tar xf ${DIST}/${GPERF_SRC}.tar.xz
mv ${GPERF_SRC} ${GPERF_DIR}
cd ${GPERF_DIR}
./autogen.sh
CFLAGS="${DEFAULT_CFLAGS}" \
CXXFLAGS="${DEFAULT_CFLAGS}" \
LDFLAGS="${DEFAULT_LDFLAGS} -lunwind" \
./configure ${STATIC_CONFIGURE} --enable-libunwind
make -j${JOBS}
fi # gperftools

# libxkbcommon
if [ ! -f "${SDK}/lib/pkgconfig/xkbcommon.pc" ]; then
cd ${SRC}
XKB_SRC=libxkbcommon-${XKBCOMMON_V}
rm -rf ${XKB_SRC} || true
tar xf ${DIST}/${XKB_SRC}.tar.xz
cd ${XKB_SRC}
./configure ${DEFAULT_CONFIGURE} --disable-docs
make -j${JOBS}
make install
fi # libxkbcommon

# qt
if [ ! -f "${QMAKE_BIN}" ]; then
cd ${SRC}
QT_SRC="qt-everywhere-src-${QT_V}"
rm -rf ${QT_SRC} || true
tar xf ${DIST}/${QT_SRC}.tar.xz
cd ${QT_SRC}
(cd qtbase ; patch -p1 < ${DIST}/hidpi.patch)
./configure \
-prefix ${SDK} \
-c++std c++11 \
-qtlibinfix Friction \
-opengl desktop \
-release \
-shared \
-opensource \
-confirm-license \
-optimize-size \
-strip \
-pulseaudio \
-fontconfig \
-system-freetype \
-qt-pcre \
-qt-zlib \
-qt-xcb \
-qt-libpng \
-no-mtdev \
-no-syslog \
-no-pch \
-no-glib \
-no-dbus \
-no-avx2 \
-no-avx512 \
-no-gif \
-no-ico \
-no-tiff \
-no-webp \
-no-jasper \
-no-libjpeg \
-no-ssl \
-no-cups \
-no-mng \
-no-gstreamer \
-no-alsa \
-no-sql-db2 \
-no-sql-ibase \
-no-sql-mysql \
-no-sql-oci \
-no-sql-odbc \
-no-sql-psql \
-no-sql-sqlite2 \
-no-sql-sqlite \
-no-sql-tds \
-no-gtk \
-no-eglfs \
-no-kms \
-no-linuxfb \
-nomake examples \
-nomake tests \
-skip qt3d \
-skip qtactiveqt \
-skip qtcanvas3d \
-skip qtcharts \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtgraphicaleffects \
-skip qtlocation \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtquickcontrols \
-skip qtquickcontrols2 \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtserialbus \
-skip qtserialport \
-skip qtspeech \
-skip qttools \
-skip qtvirtualkeyboard \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebglplugin \
-skip qtwebsockets \
-skip qtwebview \
-skip qtx11extras \
-skip qtxmlpatterns \
-skip qttools
make -j${JOBS}
make install
fi # qt

# qscintilla
if [ ! -f "${SDK}/lib/libqscintilla2_qt5.so" ]; then
cd ${SRC}
QSC_SRC="QScintilla_src-${QSCINTILLA_V}"
rm -rf ${QSC_SRC}
tar xf ${DIST}/${QSC_SRC}.tar.gz
cd ${QSC_SRC}/src
${SDK}/bin/qmake CONFIG+=release
make -j${JOBS}
cp -a libqscintilla2_qt5* ${SDK}/lib/
cp -a Qsci ${SDK}/include/
fi # qscintilla

echo "SDK DONE"
89 changes: 89 additions & 0 deletions src/scripts/build_vfxplatform_skia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

set -e -x

source /opt/rh/llvm-toolset-7/enable
clang -v

CWD=`pwd`
SDK=${SDK:-"/opt/friction"}
SRC=${SDK}/src
DIST=${DIST:-"/mnt"}
JOBS=${JOBS:-4}

NINJA_V=1.11.1
GN_V=82d673ac
SKIA_V=4fcb5c225a

NINJA_BIN=${SDK}/bin/ninja
GN_BIN=${SDK}/bin/gn
SKIA_DIR=${SDK}/skia
SKIA_LIB=${SKIA_DIR}/out/build/libskia.a

export PATH="${SDK}/bin:${PATH}"

if [ ! -d "${SDK}" ]; then
mkdir -p "${SDK}/lib"
mkdir -p "${SDK}/bin"
(cd "${SDK}"; ln -sf lib lib64)
fi

if [ ! -d "${SRC}" ]; then
mkdir -p "${SRC}"
fi

# ninja
if [ ! -f "${NINJA_BIN}" ]; then
cd ${SRC}
NINJA_SRC=ninja-${NINJA_V}
rm -rf ${NINJA_SRC} || true
tar xf ${DIST}/${NINJA_SRC}.tar.gz
cd ${NINJA_SRC}
./configure.py --bootstrap
cp -a ninja ${NINJA_BIN}
fi # ninja

# gn
if [ ! -f "${GN_BIN}" ]; then
cd ${SRC}
GN_SRC=gn-${GN_V}
rm -rf ${GN_SRC} || true
tar xf ${DIST}/${GN_SRC}.tar.xz
cd ${GN_SRC}
python build/gen.py
${NINJA_BIN} -C out
cp -a out/gn ${GN_BIN}
fi # gn

# skia
if [ ! -f "${SKIA_LIB}" ]; then
cd ${SRC}
SKIA_SRC=skia-${SKIA_V}
rm -rf ${SKIA_SRC} || true
rm -rf ${SKIA_DIR} || true
tar xf ${DIST}/${SKIA_SRC}.tar.xz
mv ${SKIA_SRC} ${SKIA_DIR}
cd ${SKIA_DIR}
${GN_BIN} gen out/build --args='is_official_build=true is_debug=false cc="clang" cxx="clang++" extra_cflags=["-Wno-error"] target_os="linux" target_cpu="x64" skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_dng_sdk=false'
${NINJA_BIN} -C out/build -j${JOBS} skia
fi # skia

echo "SKIA DONE"

0 comments on commit e39307a

Please sign in to comment.