From c5ebf4ac4114d1caf9f6bf63239a14e7e744f621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Thu, 2 May 2024 17:13:27 +0200 Subject: [PATCH] Update Linux SDK: * Build and bundle libxcb and xcb-util libs * Every distro has these libraries, but some (Ubuntu!) don't ship them as default. I would prefer to not distribute system libraries, but I also don't want issue reports regarding failure to launch due to missing whatever * Qt prior to 5.15 included the xcb-util libraries * https://github.com/AppImage/appimage.github.io/pull/3339 * Update appimagetool (bfe6e0c) * Update AppImage runtime (1bb1157) --- src/scripts/Dockerfile.vfxplatform | 7 +- src/scripts/build_vfxplatform_package.sh | 33 +++--- src/scripts/build_vfxplatform_sdk01.sh | 2 +- src/scripts/build_vfxplatform_sdk02.sh | 125 ++++++++++++++++++++--- src/scripts/run_vfxplatform.sh | 2 +- 5 files changed, 135 insertions(+), 34 deletions(-) diff --git a/src/scripts/Dockerfile.vfxplatform b/src/scripts/Dockerfile.vfxplatform index ad28e290c..5027da8f2 100644 --- a/src/scripts/Dockerfile.vfxplatform +++ b/src/scripts/Dockerfile.vfxplatform @@ -4,16 +4,21 @@ 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 rpmdevtools git yasm python3 fontconfig-devel zlib-devel autoconf automake xz devtoolset-7 llvm-toolset-7.0 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 xcb-proto libxcb-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel +RUN yum -y install pulseaudio-libs-devel wget rpmdevtools git yasm python3 fontconfig-devel zlib-devel autoconf automake xz devtoolset-7 llvm-toolset-7.0 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 xcb-proto libxcb-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xorg-x11-util-macros RUN ln -sf /usr/bin/python3 /usr/bin/python RUN rm -f /usr/lib64/pkgconfig/libpng.pc RUN rm -f /usr/lib64/pkgconfig/libpng15.pc +RUN rm -f /usr/lib64/pkgconfig/*xcb*.pc RUN rm -f /usr/include/png.h RUN rm -f /usr/include/pngconf.h RUN rm -f /usr/include/pnglibconf.h RUN sed -i '/.private/d' /usr/lib64/pkgconfig/freetype2.pc RUN echo "source scl_source enable devtoolset-7" >> /root/.bashrc +RUN echo "#!/bin/sh" > /usr/bin/desktop-file-validate +RUN echo "exit 0" >> /usr/bin/desktop-file-validate +RUN chmod +x /usr/bin/desktop-file-validate + COPY build_vfxplatform.sh /root/ COPY build_vfxplatform_sdk01.sh /root/ COPY build_vfxplatform_sdk02.sh /root/ diff --git a/src/scripts/build_vfxplatform_package.sh b/src/scripts/build_vfxplatform_package.sh index 6e67823e0..5aa22d4d9 100755 --- a/src/scripts/build_vfxplatform_package.sh +++ b/src/scripts/build_vfxplatform_package.sh @@ -26,8 +26,9 @@ BUILD=${BUILD:-"${HOME}"} VERSION=${VERSION:-""} APPID="graphics.friction.Friction" FRICTION_PKG=friction-${VERSION} -PKG_RPM=${PKG_RPM:-1} -PKG_APP=${PKG_APP:-1} + +APPIMAGETOOL=bfe6e0c +APPIMAGERUNTIME=1bb1157 if [ "${VERSION}" = "" ]; then echo "Missing version" @@ -159,23 +160,18 @@ for pdir in ${PLUGS}; do done # RPM -if [ "${PKG_RPM}" = 1 ]; then cd ${BUILD} tar cvf ${FRICTION_PKG}.tar ${FRICTION_PKG} - if [ ! -d "${HOME}/rpmbuild/SOURCES" ]; then mkdir -p ${HOME}/rpmbuild/SOURCES fi - mv ${FRICTION_PKG}.tar ${HOME}/rpmbuild/SOURCES/ cat ${BUILD}/friction/src/scripts/vfxplatform.spec | sed 's/__FRICTION_PKG_VERSION__/'${PKG_VERSION}'/g;s/__FRICTION_VERSION__/'${VERSION}'/g;s/__APPID__/'${APPID}'/g' > rpm.spec - rpmbuild -bb rpm.spec cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/${VERSION}/ -fi # Portable -FRICTION_PORTABLE=${FRICTION_PKG}-linux-X11-x86_64 +FRICTION_PORTABLE=${FRICTION_PKG}-portable-linux-x86_64 FRICTION_PORTABLE_DIR=${BUILD}/${FRICTION_PORTABLE} cd ${BUILD} rm -f ${FRICTION_PORTABLE_DIR} || true @@ -186,14 +182,12 @@ mv opt/friction/* . rm -rf opt share/doc ln -sf bin/friction . ) - cd ${BUILD} tar cvf ${FRICTION_PORTABLE}.tar ${FRICTION_PORTABLE} bzip2 -9 ${FRICTION_PORTABLE}.tar cp -a ${FRICTION_PORTABLE}.tar.bz2 ${DISTFILES}/builds/${VERSION}/ # AppImage -if [ "${PKG_APP}" = 1 ]; then (cd ${FRICTION_PORTABLE_DIR} ; rm -f friction mkdir usr @@ -203,14 +197,17 @@ ln -sf usr/share/applications/${APPID}.desktop . ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png . ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png .DirIcon ) -if [ ! -f "${DISTFILES}/appimagetool.tar.bz2" ]; then - (cd ${DISTFILES} ; - wget https://download.friction.graphics/distfiles/misc/appimagetool.tar.bz2 - ) -fi -tar xf ${DISTFILES}/appimagetool.tar.bz2 -ARCH=x86_64 ./appimagetool/AppRun ${FRICTION_PORTABLE} +tar xf ${DISTFILES}/linux/appimagetool-${APPIMAGETOOL}.tar.bz2 +ARCH=x86_64 ./appimagetool/AppRun --verbose --runtime-file=${DISTFILES}/linux/runtime-x86_64-${APPIMAGERUNTIME}.bin ${FRICTION_PORTABLE} + +# TODO +# FRICTION_ISO=${FRICTION_PKG}-x86_64.squashfs +# FRICTION_APP=${FRICTION_PKG}-test-x86_64.AppImage +# mksquashfs ${FRICTION_PORTABLE} ${FRICTION_ISO} -comp zstd -root-owned -noappend -b 1M -mkfs-time 0 +# cat ${DISTFILES}/linux/runtime-x86_64-${APPIMAGERUNTIME}.bin > ${FRICTION_APP} +# cat ${FRICTION_ISO} >> ${FRICTION_APP} +# chmod a+x ${FRICTION_ISO} + cp -a *.AppImage ${DISTFILES}/builds/${VERSION}/ -fi echo "FRICTION PACKAGE DONE" diff --git a/src/scripts/build_vfxplatform_sdk01.sh b/src/scripts/build_vfxplatform_sdk01.sh index f0c081a84..476b3c85d 100755 --- a/src/scripts/build_vfxplatform_sdk01.sh +++ b/src/scripts/build_vfxplatform_sdk01.sh @@ -106,7 +106,7 @@ 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 + tar xf ${DIST}/linux/${UNWIND_SRC}.tar.gz cd ${UNWIND_SRC} CC=clang CXX=clang++ ./configure ${DEFAULT_CONFIGURE} --disable-minidebuginfo --disable-tests make -j${MKJOBS} diff --git a/src/scripts/build_vfxplatform_sdk02.sh b/src/scripts/build_vfxplatform_sdk02.sh index f30abec97..e95a5d7dd 100755 --- a/src/scripts/build_vfxplatform_sdk02.sh +++ b/src/scripts/build_vfxplatform_sdk02.sh @@ -27,13 +27,23 @@ SDK=${SDK:-"/opt/friction"} SRC=${SDK}/src DIST=${DIST:-"/mnt"} MKJOBS=${MKJOBS:-32} +SRC_SUFFIX=tar.xz -XKBCOMMON_V=0.7.1 QT_V=5.15.13 QSCINTILLA_V=2.14.1 PELF_V=0.17.0 CMAKE_V=3.26.3 +XCB_V=1.17.0 +XCB_UTIL_V=0.4.1 +XCB_CURSOR_V=0.1.4 +XCB_ERRORS_V=1.0.1 +XCB_IMAGE_V=0.4.1 +XCB_KEYSYMS_V=0.4.1 +XCB_RENDERUTIL_V=0.3.10 +XCB_WM_V=0.4.2 +XKBCOMMON_V=0.8.4 + NINJA_BIN=${SDK}/bin/ninja CMAKE_BIN=${SDK}/bin/cmake PELF_BIN=${SDK}/bin/patchelf @@ -60,52 +70,141 @@ COMMON_CONFIGURE="--prefix=${SDK}" SHARED_CONFIGURE="${COMMON_CONFIGURE} --enable-shared --disable-static" STATIC_CONFIGURE="${COMMON_CONFIGURE} --disable-shared --enable-static" DEFAULT_CONFIGURE="${SHARED_CONFIGURE}" +XCB_CONFIGURE=${DEFAULT_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 + tar xf ${DIST}/linux/${PELF_SRC}.tar.bz2 cd ${PELF_SRC} ./configure ${COMMON_CONFIGURE} make -j${MKJOBS} make install fi # patchelf -# cmake -if [ ! -f "${CMAKE_BIN}" ]; then +# xcb +if [ ! -f "${SDK}/lib/pkgconfig/xcb.pc" ]; then + # https://github.com/pypa/pip/issues/10219#issuecomment-888127061 + export LANG="en_US.UTF-8" + export LC_ALL="en_US.UTF-8" + # proto cd ${SRC} - CMAKE_SRC=cmake-${CMAKE_V} - rm -rf ${CMAKE_SRC} || true - tar xf ${DIST}/mxe/pkg/${CMAKE_SRC}.tar.gz - cd ${CMAKE_SRC} - ./configure ${COMMON_CONFIGURE} -- -DCMAKE_USE_OPENSSL=OFF + XCB_PROTO_SRC=xcb-proto-${XCB_V} + rm -rf ${XCB_PROTO_SRC} || true + tar xf ${DIST}/x11/${XCB_PROTO_SRC}.${SRC_SUFFIX} + cd ${XCB_PROTO_SRC} + ./configure ${XCB_CONFIGURE} make -j${MKJOBS} make install -fi # cmake + mv ${SDK}/share/pkgconfig/* ${SDK}/lib/pkgconfig/ + # lib + cd ${SRC} + XCB_SRC=libxcb-${XCB_V} + rm -rf ${XCB_SRC} || true + tar xf ${DIST}/x11/${XCB_SRC}.${SRC_SUFFIX} + cd ${XCB_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # util + cd ${SRC} + XCB_UTIL_SRC=xcb-util-${XCB_UTIL_V} + rm -rf ${XCB_UTIL_SRC} || true + tar xf ${DIST}/x11/${XCB_UTIL_SRC}.${SRC_SUFFIX} + cd ${XCB_UTIL_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # errors + cd ${SRC} + XCB_ERRORS_SRC=xcb-util-errors-${XCB_ERRORS_V} + rm -rf ${XCB_ERRORS_SRC} || true + tar xf ${DIST}/x11/${XCB_ERRORS_SRC}.${SRC_SUFFIX} + cd ${XCB_ERRORS_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # image + cd ${SRC} + XCB_IMAGE_SRC=xcb-util-image-${XCB_IMAGE_V} + rm -rf ${XCB_IMAGE_SRC} || true + tar xf ${DIST}/x11/${XCB_IMAGE_SRC}.${SRC_SUFFIX} + cd ${XCB_IMAGE_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # keysyms + cd ${SRC} + XCB_KEYSYMS_SRC=xcb-util-keysyms-${XCB_KEYSYMS_V} + rm -rf ${XCB_KEYSYMS_SRC} || true + tar xf ${DIST}/x11/${XCB_KEYSYMS_SRC}.${SRC_SUFFIX} + cd ${XCB_KEYSYMS_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # renderutil + cd ${SRC} + XCB_RENDERUTIL_SRC=xcb-util-renderutil-${XCB_RENDERUTIL_V} + rm -rf ${XCB_RENDERUTIL_SRC} || true + tar xf ${DIST}/x11/${XCB_RENDERUTIL_SRC}.${SRC_SUFFIX} + cd ${XCB_RENDERUTIL_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # cursor + cd ${SRC} + XCB_CURSOR_SRC=xcb-util-cursor-${XCB_CURSOR_V} + rm -rf ${XCB_CURSOR_SRC} || true + tar xf ${DIST}/x11/${XCB_CURSOR_SRC}.${SRC_SUFFIX} + cd ${XCB_CURSOR_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install + # wm + cd ${SRC} + XCB_WM_SRC=xcb-util-wm-${XCB_WM_V} + rm -rf ${XCB_WM_SRC} || true + tar xf ${DIST}/x11/${XCB_WM_SRC}.${SRC_SUFFIX} + cd ${XCB_WM_SRC} + ./configure ${XCB_CONFIGURE} + make -j${MKJOBS} + make install +fi # xcb # 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 + tar xf ${DIST}/x11/${XKB_SRC}.${SRC_SUFFIX} cd ${XKB_SRC} ./configure ${DEFAULT_CONFIGURE} --disable-docs make -j${MKJOBS} make install fi # libxkbcommon +# cmake +if [ ! -f "${CMAKE_BIN}" ]; then + cd ${SRC} + CMAKE_SRC=cmake-${CMAKE_V} + rm -rf ${CMAKE_SRC} || true + tar xf ${DIST}/mxe/pkg/${CMAKE_SRC}.tar.gz + cd ${CMAKE_SRC} + ./configure ${COMMON_CONFIGURE} --parallel=${MKJOBS} -- -DCMAKE_USE_OPENSSL=OFF + make -j${MKJOBS} + make install +fi # cmake + # qt if [ ! -f "${QMAKE_BIN}" ]; then cd ${SRC} QT_SRC="qt-everywhere-src-${QT_V}" QT_TAR_SRC="qt-everywhere-opensource-src-${QT_V}" rm -rf ${QT_SRC} || true - tar xf ${DIST}/${QT_TAR_SRC}.tar.xz + tar xf ${DIST}/${QT_TAR_SRC}.${SRC_SUFFIX} cd ${QT_SRC} - #(cd qtbase ; patch -p1 < ${DIST}/hidpi.patch) ./configure \ -prefix ${SDK} \ -c++std c++17 \ diff --git a/src/scripts/run_vfxplatform.sh b/src/scripts/run_vfxplatform.sh index 023305043..cac36f052 100755 --- a/src/scripts/run_vfxplatform.sh +++ b/src/scripts/run_vfxplatform.sh @@ -28,7 +28,7 @@ TAG=${TAG:-""} MKJOBS=${MKJOBS:-32} ONLY_SDK=${ONLY_SDK:-0} DOWNLOAD_SDK=${DOWNLOAD_SDK:-0} -SDK_VERSION="20240424" +SDK_VERSION="20240501" TAR_VERSION=${TAR_VERSION:-""} DOCKER="docker run"