Skip to content

Commit

Permalink
docker: Support Arch Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 21, 2023
1 parent 9c6e936 commit a20adfa
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/scripts/Dockerfile.arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM archlinux:base-devel

RUN pacman --noconfirm -Syu clang git curl libtool autoconf automake cmake python ninja fontconfig freetype2 ffmpeg qscintilla-qt5 qt5-base qt5-imageformats qt5-multimedia qt5-svg qt5-tools qt5-wayland qt5-declarative libunwind

COPY build_docker.sh /
COPY PKGBUILD /
CMD [ "bash", "./build_docker.sh" ]
21 changes: 21 additions & 0 deletions src/scripts/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pkgname=friction
pkgver=__VERSION__
pkgrel=1
pkgdesc="Friction Motion Graphics"
arch=('x86_64')
url="https://friction.graphics"
license=('GPL3')
depends=('fontconfig'
'ffmpeg'
'qscintilla-qt5'
'qt5-base'
'qt5-imageformats'
'qt5-multimedia'
'qt5-svg'
'qt5-declarative'
'libunwind')

package() {
mkdir $pkgdir/usr
cp -a $srcdir/../friction-__VERSION__-Linux/* $pkgdir/usr/
}
43 changes: 35 additions & 8 deletions src/scripts/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# Deploy Friction on Ubuntu, Fedora, RHEL.
# Deploy Friction on Ubuntu, Fedora, RHEL, Arch.

set -e -x
g++ --version
Expand Down Expand Up @@ -55,11 +55,13 @@ if [ "${DISTRO_ID}" = "fedora" ]; then
DISTRO_ID="fc"
elif [ "${DISTRO_ID}" = "ubuntu" ]; then
DISTRO_ID="ubuntu"
elif [ "${DISTRO_ID}" = "arch" ]; then
DISTRO_ID="arch"
else
DISTRO_ID="el"
fi

if [ "${DISTRO_ID}" != "ubuntu" ]; then
if [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]; then
# ffmpeg with clang forces latomic, that won't work
# an easy check in configure should do, but for now just disable clang
# not that important anyway, as long as skia is built with clang we are ok
Expand All @@ -73,6 +75,9 @@ if [ "${DISTRO_ID}" = "fc" ]; then
elif [ "${DISTRO_ID}" = "ubuntu" ]; then
DISTRO_VERSION="${DISTRO_VERSION_ID}"
DISTRO_PRETTY="Ubuntu Linux ${DISTRO_VERSION}"
elif [ "${DISTRO_ID}" = "arch" ]; then
DISTRO_VERSION="${DISTRO_VERSION_ID}"
DISTRO_PRETTY="Arch Linux ${DISTRO_VERSION}"
else
DISTRO_VERSION="${DISTRO_VERSION_ID:0:1}"
DISTRO_PRETTY="Enterprise Linux ${DISTRO_VERSION}"
Expand Down Expand Up @@ -118,7 +123,7 @@ QSCINTILLA_URL="https://www.riverbankcomputing.com/static/Downloads/QScintilla"
FFMPEG_URL="https://ffmpeg.org/releases"
UNWIND_URL="http://download.savannah.nongnu.org/releases/libunwind"

if [ "${DISTRO_ID}" != "ubuntu" ]; then
if [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]; then
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

Expand Down Expand Up @@ -172,7 +177,7 @@ fi
# fi
#fi

if [ "${DISTRO_ID}" != "ubuntu" ]; then
if [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]; then

if [ ! -f "${FRICTION_SRC_DIR}/QScintilla_src-${QSCINTILLA_V}/src/libqscintilla2_qt5.a" ]; then
if [ -d "${FRICTION_SRC_DIR}/QScintilla_src-${QSCINTILLA_V}" ]; then
Expand Down Expand Up @@ -239,7 +244,7 @@ if [ "${HAS_LOCAL_CACHE}" = 0 ]; then
(cd /usr ; tar cvvfJ ${FRICTION_DIST}/local-build-${DID}${COMPILER}.tar.xz local)
fi

fi # [ "${DISTRO_ID}" != "ubuntu" ]
fi # [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]

if [ ! -f "${FRICTION_SRC_DIR}/gperftools/.libs/libtcmalloc.a" ]; then
if [ ! -f "${FRICTION_DIST}/gperftools.tar.xz" ]; then
Expand Down Expand Up @@ -311,7 +316,7 @@ mkdir build
cd build

CMAKE_EXTRA=""
if [ "${DISTRO_ID}" != "ubuntu" ]; then
if [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]; then
CMAKE_EXTRA="-DSTATIC_FFMPEG=ON"
CMAKE_EXTRA="${CMAKE_EXTRA} -DQSCINTILLA_INCLUDE_DIRS=${FRICTION_SRC_DIR}/QScintilla_src-${QSCINTILLA_V}/src"
CMAKE_EXTRA="${CMAKE_EXTRA} -DQSCINTILLA_LIBRARIES_DIRS=${FRICTION_SRC_DIR}/QScintilla_src-${QSCINTILLA_V}/src"
Expand Down Expand Up @@ -340,20 +345,38 @@ fi
cmake --build .

PKG_EXT="deb"
if [ "${DISTRO_ID}" != "ubuntu" ]; then
if [ "${DISTRO_ID}" = "fc" ] || [ "${DISTRO_ID}" = "el" ]; then
PKG_EXT="rpm"
cpack -G RPM
elif [ "${DISTRO_ID}" = "arch" ]; then
PKG_EXT="tar.xz"
cpack -G TXZ
else
cpack -G DEB
fi

OPKG="friction.${PKG_EXT}"
PKG="friction-${DID}${COMPILER}.${PKG_EXT}"

if [ "${DISTRO_ID}" = "arch" ]; then
mkdir -p pkgbuild
chmod 777 pkgbuild
(cd pkgbuild ;
tar xvf ../friction-${VERSION}-Linux.${PKG_EXT}
cat /PKGBUILD | sed 's/__VERSION__/'${VERSION}'/g' > PKGBUILD
sudo -u nobody makepkg
)
PKG_EXT="pkg.tar.zst"
OPKG="friction-${VERSION}-1-x86_64.pkg.tar.zst"
cp pkgbuild/${OPKG} .
fi

if [ "${REL}" = 1 ]; then
PKG="friction-${VERSION}-${DID}${COMPILER}.${PKG_EXT}"
elif [ "${SNAP}" = 1 ]; then
PKG="friction-${TIMESTAMP}-${BRANCH}-${COMMIT}-${DID}${COMPILER}.${PKG_EXT}"
fi
mv friction.${PKG_EXT} ${PKG}
mv ${OPKG} ${PKG}

FRICTION_PKG_DIR="${FRICTION_OUT_DIR}/${YEAR}/${MONTH}"
if [ "${REL}" = 1 ]; then
Expand All @@ -366,4 +389,8 @@ fi

cp ${PKG} ${FRICTION_PKG_DIR}/

if [ "${DISTRO_ID}" = "arch" ]; then
cp pkgbuild/*.pkg.* ${FRICTION_PKG_DIR}/
fi

echo "BUILD DONE: ${FRICTION_PKG_DIR}/${PKG}"
4 changes: 4 additions & 0 deletions src/scripts/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ JAMMY=${JAMMY:-1}
LUNAR=${LUNAR:-1}
EL=${EL:-1}
FC=${FC:-1}
AL=${AL:-0}

if [ "${SNAP}" = 1 ]; then
REL=0
Expand Down Expand Up @@ -110,3 +111,6 @@ fi
if [ "${FC}" = 1 ]; then
$DOCKER friction-fedora
fi
if [ "${AL}" = 1 ]; then
$DOCKER friction-arch
fi

0 comments on commit a20adfa

Please sign in to comment.