2018-03-02 14:06:03 +00:00
|
|
|
#!/bin/bash
|
2018-03-02 19:22:37 +00:00
|
|
|
|
2023-06-25 12:00:30 +00:00
|
|
|
# This only works on AlmaLinux 8 with Qt 6.5.x. At least the following
|
|
|
|
# packages must be installed:
|
|
|
|
|
|
|
|
# attr
|
|
|
|
# autoconf
|
|
|
|
# bash
|
|
|
|
# boost-devel
|
|
|
|
# createrepo
|
2018-06-24 14:28:57 +00:00
|
|
|
# desktop-file-utils
|
|
|
|
# docbook-style-xsl
|
|
|
|
# fdupes
|
|
|
|
# file-devel
|
|
|
|
# flac
|
|
|
|
# flac-devel
|
2023-06-25 12:00:30 +00:00
|
|
|
# fmt-devel
|
2018-06-24 14:28:57 +00:00
|
|
|
# fuse
|
|
|
|
# fuse-libs
|
2023-06-25 12:00:30 +00:00
|
|
|
# gcc-c++
|
|
|
|
# gcc-toolset-11-annobin-plugin-gcc
|
|
|
|
# gcc-toolset-11-gcc-c++
|
2018-06-24 14:28:57 +00:00
|
|
|
# gettext-devel
|
2023-06-25 12:00:30 +00:00
|
|
|
# git
|
2018-06-24 14:28:57 +00:00
|
|
|
# glibc-devel
|
2023-06-25 12:00:30 +00:00
|
|
|
# gmp-devel
|
2018-06-24 14:28:57 +00:00
|
|
|
# gtest-devel
|
2023-06-25 12:00:30 +00:00
|
|
|
# hicolor-icon-theme
|
|
|
|
# libdvdread-devel
|
2018-06-24 14:28:57 +00:00
|
|
|
# libogg-devel
|
|
|
|
# libstdc++-devel
|
|
|
|
# libvorbis-devel
|
|
|
|
# libxslt
|
|
|
|
# make
|
2023-06-25 12:00:30 +00:00
|
|
|
# moreutils
|
2020-08-21 13:15:23 +00:00
|
|
|
# pcre2-devel
|
2018-06-24 14:28:57 +00:00
|
|
|
# pkgconfig
|
|
|
|
# po4a
|
2023-06-25 12:00:30 +00:00
|
|
|
# rpm-build
|
|
|
|
# rpmlint
|
|
|
|
# ruby
|
|
|
|
# rubygem-rake
|
|
|
|
# strace
|
|
|
|
# sudo
|
|
|
|
# vim
|
2018-06-24 14:28:57 +00:00
|
|
|
# wget
|
|
|
|
# zlib-devel
|
2023-06-25 12:00:30 +00:00
|
|
|
# zsh
|
2019-01-26 12:31:27 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
# This must be run from inside an unpacked MKVToolNix source
|
|
|
|
# directory. You can run it from inside a git checkout, but make sure
|
|
|
|
# to that submodules have been initialized and updated.
|
|
|
|
|
2018-06-25 16:08:11 +00:00
|
|
|
set -e
|
|
|
|
set -x
|
2018-06-24 14:28:57 +00:00
|
|
|
|
|
|
|
if [[ ! -e /dev/fuse ]]; then
|
|
|
|
sudo mknod --mode=0666 /dev/fuse c 10 229
|
2018-03-02 14:06:03 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
TOP_DIR="$(readlink -f ${0})"
|
|
|
|
TOP_DIR="${TOP_DIR%/*}/../.."
|
|
|
|
cd "${TOP_DIR}"
|
|
|
|
TOP_DIR="${PWD}"
|
2018-06-25 16:08:30 +00:00
|
|
|
RELEASE_VERSION=0
|
2021-05-25 11:31:28 +00:00
|
|
|
QTVERSION="latest"
|
2018-06-25 20:27:18 +00:00
|
|
|
APP="mkvtoolnix-gui"
|
|
|
|
APP_DIR="${TOP_DIR}/appimage/${APP}.AppDir"
|
|
|
|
|
|
|
|
function display_help {
|
|
|
|
cat <<EOF
|
|
|
|
MKVToolNix AppImage build script
|
|
|
|
|
|
|
|
Syntax:
|
|
|
|
|
|
|
|
build.sh [-B|--no-build] [-q|--qt <Qt version>] [-r|--release-version]
|
|
|
|
[-h|--help]
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2022-04-11 21:39:34 +00:00
|
|
|
--no-build don't run 'configure' and './drake clean'; only
|
2023-11-11 18:32:18 +00:00
|
|
|
possible if 'build-config' exists
|
2018-06-25 20:27:18 +00:00
|
|
|
--qt <Qt version> build against this Qt version (default: $QTVERSION)
|
|
|
|
--release-version don't built the version number via 'git describe'
|
|
|
|
even if '.git' directory is present
|
|
|
|
--help display help
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
2018-06-25 16:08:30 +00:00
|
|
|
|
|
|
|
while [[ -n $1 ]]; do
|
|
|
|
case $1 in
|
|
|
|
-B|--no-build) NO_BUILD=1 ;;
|
|
|
|
-q|--qt) QTVERSION=$2 ; shift ;;
|
|
|
|
-r|--release-version) RELEASE_VERSION=1 ;;
|
2018-06-25 20:27:18 +00:00
|
|
|
-h|--help) display_help ;;
|
2018-06-25 16:08:30 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
QTDIR="${HOME}/opt/qt/${QTVERSION}/gcc_64"
|
2018-06-25 16:08:30 +00:00
|
|
|
NO_GLIBC_VERSION=1
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2023-06-24 16:23:42 +00:00
|
|
|
if git rev-parse --show-toplevel &> /dev/null && [[ $RELEASE_VERSION == 0 ]]; then
|
2018-10-26 08:15:26 +00:00
|
|
|
# If revision is a tag: release-28.2.0
|
|
|
|
# If it isn't: release-28.1.0-7-g558fbc986
|
2018-06-26 18:07:31 +00:00
|
|
|
VERSION="$(git describe --tags | sed -e 's/release-//')"
|
2019-10-11 08:46:07 +00:00
|
|
|
if [[ $VERSION != *-*-* ]]; then
|
2018-10-26 08:15:26 +00:00
|
|
|
VERSION=${VERSION}-0-g0
|
2018-10-23 20:19:07 +00:00
|
|
|
fi
|
2018-06-26 18:07:31 +00:00
|
|
|
NUM=${VERSION%-*}
|
|
|
|
NUM=${NUM##*-}
|
2019-10-11 19:41:11 +00:00
|
|
|
VERSION="${VERSION%%-*}-z$(printf '%03d' ${NUM})-${VERSION##*-}"
|
2018-06-25 16:08:30 +00:00
|
|
|
else
|
|
|
|
VERSION="$(perl -ne 'next unless m/^AC_INIT/; s{.*?,\[}{}; s{\].*}{}; print; exit' ${TOP_DIR}/configure.ac)"
|
|
|
|
fi
|
2018-06-24 14:28:57 +00:00
|
|
|
JOBS=$(nproc)
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2023-06-24 16:26:28 +00:00
|
|
|
functions_sh="${TOP_DIR}/packaging/appimage/functions.sh"
|
|
|
|
if [[ ! -f "${functions_sh}" ]]; then
|
|
|
|
wget -O "${functions_sh}" -q https://raw.githubusercontent.com/AppImage/AppImages/master/functions.sh
|
|
|
|
fi
|
|
|
|
source "${functions_sh}"
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
if [[ ! -f configure ]]; then
|
|
|
|
./autogen.sh
|
|
|
|
fi
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2024-04-24 09:02:40 +00:00
|
|
|
boost_dir=
|
|
|
|
EXTRA_INCLUDES=
|
|
|
|
EXTRA_LIBS=
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
export PKG_CONFIG_PATH="${QTDIR}/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
|
|
|
export LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
|
|
|
|
export LDFLAGS="-L${QTDIR}/lib ${LDFLAGS}"
|
2023-06-25 12:00:30 +00:00
|
|
|
export PATH="${QTDIR}/bin:${PATH}"
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2024-04-24 09:02:40 +00:00
|
|
|
if [[ -f /etc/centos-release ]]; then
|
|
|
|
devtoolset=$(ls -1d /opt/rh/*toolset-* | tail -n 1)
|
|
|
|
export CC=${devtoolset}/root/bin/gcc
|
|
|
|
export CXX=${devtoolset}/root/bin/g++
|
|
|
|
|
|
|
|
boost_dir=/srv/build/opt/almalinux/8/boost
|
|
|
|
EXTRA_INCLUDES=${boost_dir}/include
|
|
|
|
EXTRA_LIBS=${boost_dir}/lib
|
|
|
|
|
|
|
|
LD_LIBRARY_PATH="${boost_dir}/lib:${LD_LIBRARY_PATH}"
|
|
|
|
fi
|
|
|
|
|
2018-06-25 16:08:30 +00:00
|
|
|
if [[ ( ! -f build-config ) && ( "$NO_BUILD" != 1 ) ]]; then
|
2018-06-25 15:45:17 +00:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2024-04-24 09:02:40 +00:00
|
|
|
--enable-optimization \
|
|
|
|
--with-extra-includes=${EXTRA_INCLUDES} \
|
|
|
|
--with-extra-libs=${EXTRA_LIBS}
|
2018-06-25 15:45:17 +00:00
|
|
|
|
2022-04-11 21:39:34 +00:00
|
|
|
./drake clean
|
2018-06-25 15:45:17 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-25 20:27:18 +00:00
|
|
|
rm -rf "${APP_DIR}" out
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2022-04-11 21:39:34 +00:00
|
|
|
./drake -j${JOBS} apps:mkvtoolnix-gui
|
|
|
|
./drake -j${JOBS}
|
|
|
|
./drake install DESTDIR="${APP_DIR}"
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2019-10-11 09:10:53 +00:00
|
|
|
cd appimage/${APP}.AppDir
|
|
|
|
|
|
|
|
cp "${TOP_DIR}/packaging/appimage/select-binary.sh" AppRun
|
|
|
|
chmod 0755 AppRun
|
|
|
|
|
|
|
|
cd usr
|
2018-06-25 15:45:17 +00:00
|
|
|
|
|
|
|
# Qt plugins
|
2023-06-25 12:01:21 +00:00
|
|
|
mkdir -p bin/{iconengines,imageformats,multimedia,platforms,platforminputcontexts,tls}
|
2022-04-25 16:59:21 +00:00
|
|
|
cp ${QTDIR}/plugins/iconengines/*svg*.so bin/iconengines/
|
|
|
|
cp ${QTDIR}/plugins/imageformats/*svg*.so bin/imageformats/
|
2023-06-25 12:00:30 +00:00
|
|
|
cp ${QTDIR}/plugins/multimedia/libgst*.so bin/multimedia/
|
2018-06-25 15:45:17 +00:00
|
|
|
cp ${QTDIR}/plugins/platforms/libq{minimal,offscreen,wayland,xcb}*.so bin/platforms/
|
2023-06-25 12:01:21 +00:00
|
|
|
cp ${QTDIR}/plugins/platforminputcontexts/lib*.so bin/platforminputcontexts/
|
2023-06-25 12:00:30 +00:00
|
|
|
cp ${QTDIR}/plugins/tls/libqopensslbackend.so bin/tls/
|
2018-06-25 15:45:17 +00:00
|
|
|
|
|
|
|
find bin -type f -exec strip {} \+
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
mkdir -p lib lib64
|
|
|
|
chmod u+rwx lib lib64
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
copy_deps
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
find -type d -exec chmod u+w {} \+
|
|
|
|
|
|
|
|
mkdir all_libs
|
|
|
|
mv ./home all_libs
|
|
|
|
mv ./lib* all_libs
|
|
|
|
mv ./usr all_libs
|
2024-04-24 09:02:40 +00:00
|
|
|
if [[ -n ${boost_dir} ]]; then
|
|
|
|
cp ${boost_dir}/lib/libboost* all_libs
|
|
|
|
fi
|
2018-06-24 14:28:57 +00:00
|
|
|
mkdir lib
|
2023-06-25 12:00:30 +00:00
|
|
|
# inefficient loop due to the same lib potentially being present in
|
|
|
|
# several directories & mv throwing a fit about it ("will not
|
|
|
|
# overwrite just-created…")
|
|
|
|
for lib in `find all_libs -type f` ; do
|
|
|
|
mv $lib lib/
|
|
|
|
done
|
2018-06-24 14:28:57 +00:00
|
|
|
rm -rf all_libs
|
|
|
|
|
|
|
|
# dlopen()ed by libQt5Network
|
|
|
|
if [[ -f /etc/centos-release ]]; then
|
|
|
|
cp -f /lib64/libssl.so.* lib/
|
|
|
|
cp -f /lib64/libcrypto.so.* lib/
|
|
|
|
else
|
|
|
|
cp -f /lib/x86_64-linux-gnu/libssl.so.1.0.0 lib
|
|
|
|
cp -f /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 lib
|
|
|
|
fi
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
delete_blacklisted
|
2018-03-02 14:06:03 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
cd ..
|
2018-06-25 20:27:18 +00:00
|
|
|
|
|
|
|
cp ./usr/share/icons/hicolor/256x256/apps/mkvtoolnix-gui.png .
|
2018-06-24 14:28:57 +00:00
|
|
|
cp ./usr/share/applications/org.bunkus.mkvtoolnix-gui.desktop mkvtoolnix-gui.desktop
|
2018-06-25 20:27:18 +00:00
|
|
|
|
2018-06-24 14:28:57 +00:00
|
|
|
fix_desktop mkvtoolnix-gui.desktop
|
|
|
|
|
2024-04-24 09:02:40 +00:00
|
|
|
rm -rf ./usr/srv
|
|
|
|
|
2018-03-02 14:06:03 +00:00
|
|
|
cd ..
|
|
|
|
generate_type2_appimage
|