diff --git a/src/scripts/Dockerfile.jammy b/src/scripts/Dockerfile.jammy index 3c24eaa3f..f52145b36 100644 --- a/src/scripts/Dockerfile.jammy +++ b/src/scripts/Dockerfile.jammy @@ -3,7 +3,7 @@ FROM ubuntu:jammy ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev +RUN apt install -y curl build-essential file clang git cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev COPY build_docker.sh / CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.lunar b/src/scripts/Dockerfile.lunar deleted file mode 100644 index 46d953510..000000000 --- a/src/scripts/Dockerfile.lunar +++ /dev/null @@ -1,9 +0,0 @@ -FROM ubuntu:lunar - -ARG DEBIAN_FRONTEND=noninteractive -RUN apt update -y -RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev - -COPY build_docker.sh / -CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.mantic b/src/scripts/Dockerfile.mantic index ad104b86b..aac0d1b90 100644 --- a/src/scripts/Dockerfile.mantic +++ b/src/scripts/Dockerfile.mantic @@ -3,7 +3,7 @@ FROM ubuntu:mantic ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libglx-mesa0 libglx-dev libxcb-glx0-dev libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev +RUN apt install -y curl build-essential file clang git cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libglx-mesa0 libglx-dev libxcb-glx0-dev libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev COPY build_docker.sh / CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/build_docker.sh b/src/scripts/build_docker.sh index c619294c9..16a28f28f 100755 --- a/src/scripts/build_docker.sh +++ b/src/scripts/build_docker.sh @@ -21,7 +21,6 @@ # Deploy Friction on Ubuntu. set -e -x -g++ --version clang++ --version cmake --version python --version @@ -29,21 +28,8 @@ qmake-qt5 --version || qmake --version env cat /etc/os-release -SNAP=${SNAP:-0} REL=${REL:-0} MKJOBS=${MKJOBS:-4} -CLANG=${CLANG:-1} - -if [ "${REL}" = 0 ] && [ "${SNAP}" = 0 ]; then - echo "REL or SNAP?" - exit 1 -fi - -if [ "${REL}" = 1 ]; then - SNAP=0 -elif [ "${SNAP}" = 1 ]; then - REL=0 -fi DISTRO_ID=`cat /etc/os-release | sed '/^ID=/!d;s/ID=//;s/"//g'` if [ "${DISTRO_ID}" != "ubuntu" ]; then @@ -59,7 +45,6 @@ FRICTION_DIR="${FRICTION_ROOT}/friction" FRICTION_SRC_DIR="${FRICTION_DIR}/src" FRICTION_OUT_DIR="/snapshots" -FRICTION_DIST="${FRICTION_OUT_DIR}/distfiles" FRICTION_BRANCH=${FRICTION_BRANCH:-""} FRICTION_COMMIT=${FRICTION_COMMIT:-""} FRICTION_TAG=${FRICTION_TAG:-""} @@ -75,29 +60,16 @@ elif [ "${FRICTION_TAG}" != "" ]; then FRICTION_COMMIT="" fi -GPERF_V="4df0b85" -SKIA_V="5ae542b872" - -SF_NET_SRC="https://sourceforge.net/projects/friction/files/source" - -COMPILER="" -if [ "${CLANG}" = 1 ]; then - #COMPILER="-clang" - export CC=clang - export CXX=clang++ -fi +export CC=clang +export CXX=clang++ if [ ! -d "${FRICTION_ROOT}" ]; then mkdir -p ${FRICTION_ROOT} fi -if [ ! -d "${FRICTION_DIST}" ]; then - mkdir -p ${FRICTION_DIST} -fi - if [ ! -d "${FRICTION_SRC_DIR}" ]; then cd ${FRICTION_ROOT} - git clone https://github.com/friction2d/friction + git clone --recurse-submodules https://github.com/friction2d/friction if [ "${FRICTION_BRANCH}" != "" ]; then (cd friction; git checkout ${FRICTION_BRANCH}) fi @@ -107,57 +79,7 @@ if [ ! -d "${FRICTION_SRC_DIR}" ]; then if [ "${FRICTION_TAG}" != "" ]; then (cd friction; git checkout tags/${FRICTION_TAG}) fi - (cd friction; git submodule update -i docs) -fi - -if [ ! -f "${FRICTION_SRC_DIR}/gperftools/.libs/libtcmalloc.a" ]; then - if [ ! -f "${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/gperftools-${GPERF_V}.tar.xz/download" --output ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz - fi - if [ -d "${FRICTION_SRC_DIR}/gperftools-${GPERF_V}" ]; then - rm -rf ${FRICTION_SRC_DIR}/gperftools-${GPERF_V} - fi - if [ -d "${FRICTION_SRC_DIR}/gperftools" ]; then - rm -rf ${FRICTION_SRC_DIR}/gperftools - fi - cd ${FRICTION_SRC_DIR} - tar xf ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz - mv gperftools-${GPERF_V} gperftools - cd gperftools - if [ -f "${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz" ]; then - tar xf ${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz - else - ./autogen.sh - ./configure --disable-shared - make -j${MKJOBS} - tar cvvfJ ${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz . - fi -fi - -if [ ! -f "${FRICTION_SRC_DIR}/skia/out/build/libskia.a" ]; then - if [ ! -f "${FRICTION_DIST}/skia-${SKIA_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/skia-${SKIA_V}.tar.xz/download" --output ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz - fi - if [ -d "${FRICTION_SRC_DIR}/skia-${SKIA_V}" ]; then - rm -rf ${FRICTION_SRC_DIR}/skia-${SKIA_V} - fi - if [ -d "${FRICTION_SRC_DIR}/skia" ]; then - rm -rf ${FRICTION_SRC_DIR}/skia - fi - cd ${FRICTION_SRC_DIR} - tar xf ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz - mv skia-${SKIA_V} skia - cd skia - if [ -f "${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz" ]; then - tar xf ${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz - else - if [ ! -f "bin/gn" ]; then - (cd bin ; python3 fetch-gn) - fi - bin/gn 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=true skia_use_system_freetype2=true skia_use_system_libjpeg_turbo=true skia_use_system_libpng=true skia_use_system_libwebp=true skia_use_system_zlib=true skia_use_system_icu=true skia_use_system_harfbuzz=true skia_use_dng_sdk=false' - ninja -C out/build -j${MKJOBS} skia - tar cvvfJ ${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz out - fi + #(cd friction; git submodule update -i docs) fi cd ${FRICTION_DIR} @@ -173,14 +95,11 @@ fi mkdir build cd build -CMAKE_EXTRA="-DUSE_SKIA_SYSTEM_LIBS=ON" -if [ "${CLANG}" = 1 ]; then - CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang" -fi +CMAKE_EXTRA="-DCMAKE_BUILD_TYPE=Release -DUSE_SKIA_SYSTEM_LIBS=ON" +CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang" if [ "${REL}" = 1 ]; then cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ -DFRICTION_OFFICIAL_RELEASE=ON \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` @@ -188,7 +107,6 @@ else cmake -G Ninja \ -DGIT_COMMIT=${COMMIT} \ -DGIT_BRANCH=${BRANCH} \ - -DCMAKE_BUILD_TYPE=Release \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` VERSION="${VERSION}-dev-${COMMIT}" @@ -199,7 +117,7 @@ PKG_EXT="deb" cpack -G DEB OPKG="friction.${PKG_EXT}" -PKG="friction-${VERSION}-${DID}${COMPILER}.${PKG_EXT}" +PKG="friction-${VERSION}-${DID}.${PKG_EXT}" mv ${OPKG} ${PKG} FRICTION_PKG_DIR="${FRICTION_OUT_DIR}/${VERSION}" diff --git a/src/scripts/run_docker.sh b/src/scripts/run_docker.sh index 1bae743e9..08a6ce68e 100755 --- a/src/scripts/run_docker.sh +++ b/src/scripts/run_docker.sh @@ -22,29 +22,20 @@ set -e -x CWD=`pwd` -REL=${REL:-1} -SNAP=${SNAP:-0} +REL=${REL:-0} BRANCH=${BRANCH:-""} COMMIT=${COMMIT:-""} TAG=${TAG:-""} MKJOBS=${JOBS:-4} -CLANG=${CLANG:-1} JAMMY=${JAMMY:-1} -LUNAR=${LUNAR:-1} MANTIC=${MANTIC:-1} - -if [ "${SNAP}" = 1 ]; then - REL=0 -elif [ "${REL}" = 1 ]; then - SNAP=0 -fi +NOBLE=${NOBLE:-0} MOUNT_DIR="snapshots" -SF_NET_SRC="https://sourceforge.net/projects/friction/files/source" - DOCKER_MOUNT="-t --mount type=bind,source=${CWD}/${MOUNT_DIR},target=/${MOUNT_DIR}" -DOCKER="docker run -e REL=${REL} -e SNAP=${SNAP} -e MKJOBS=${JOBS} -e CLANG=${CLANG}" +DOCKER="docker run -e REL=${REL} -e MKJOBS=${JOBS}" + if [ "${BRANCH}" != "" ]; then DOCKER="${DOCKER} -e FRICTION_BRANCH=${BRANCH}" fi @@ -56,28 +47,12 @@ if [ "${TAG}" != "" ]; then fi DOCKER="${DOCKER} ${DOCKER_MOUNT}" -FRICTION_DIST="${CWD}/snapshots/distfiles" - -GPERF_V="4df0b85" -SKIA_V="5ae542b872" - -if [ ! -d "${FRICTION_DIST}" ]; then - mkdir -p ${FRICTION_DIST} -fi - -if [ ! -f "${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/gperftools-${GPERF_V}.tar.xz/download" --output ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz -fi -if [ ! -f "${FRICTION_DIST}/skia-${SKIA_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/skia-${SKIA_V}.tar.xz/download" --output ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz -fi - if [ "${JAMMY}" = 1 ]; then $DOCKER friction-jammy fi -if [ "${LUNAR}" = 1 ]; then - $DOCKER friction-lunar -fi if [ "${MANTIC}" = 1 ]; then $DOCKER friction-mantic fi +if [ "${NOBLE}" = 1 ]; then + $DOCKER friction-noble +fi