2015-07-19 05:55:15 +00:00
#!/bin/zsh
set -e
set -x
2016-03-27 09:14:06 +00:00
export SCRIPT_PATH = ${ 0 : a : h }
2015-09-29 18:01:14 +00:00
source ${ SCRIPT_PATH } /config.sh
2018-06-16 19:47:29 +00:00
source ${ SCRIPT_PATH } /specs.sh
2015-07-19 05:55:15 +00:00
2017-03-23 18:10:25 +00:00
if type -p drake & > /dev/null; then
RAKE = drake
else
RAKE = rake
fi
2018-06-16 19:47:29 +00:00
if [ [ ${ spec_qtbase [1] } = = *everywhere* ] ] ; then
QTTYPE = everywhere
else
QTTYPE = opensource
fi
2015-07-19 05:55:15 +00:00
function fail {
echo $@
exit 1
}
2018-06-16 19:47:29 +00:00
function verify_checksum {
local file = $1
local expected_checksum = $2
local allow_failure = $3
local actual_checksum
actual_checksum = $( openssl dgst -sha256 < ${ file } | sed -e 's/.* //' )
if [ [ ${ actual_checksum } != ${ expected_checksum } ] ] ; then
if [ [ ${ allow_failure :- 0 } = = 1 ] ] ; then
return 1
fi
fail " File checksum failed: ${ file } SHA256 expected ${ expected_checksum } actual ${ actual_checksum } "
fi
}
function retrieve_file {
local spec_name = " spec_ $1 "
local -a spec = ( ${ (P)spec_name } )
local file = ${ spec [1] }
local url = ${ spec [2] }
local expected_checksum = ${ spec [3] }
file = ${ SRCDIR } /${ file }
if [ [ -f ${ file } ] ] ; then
if verify_checksum ${ file } ${ expected_checksum } 1; then
return
fi
echo " Warning: file ${ file } exists but has the wrong checksum; retrieving anew "
rm ${ file }
fi
if [ [ ! -f ${ file } ] ] ; then
curl -L ${ url } > ${ file }
fi
verify_checksum ${ file } ${ expected_checksum }
}
2015-07-19 05:55:15 +00:00
function build_tarball {
local package = ${ PWD : t }
if [ [ -n $SHARED ] ] package = " ${ package } -shared "
2015-09-29 18:01:14 +00:00
$DEBUG ${ SCRIPT_PATH } /myinstall.sh build package $package $@
2015-07-19 05:55:15 +00:00
}
function build_package {
2018-06-16 19:47:29 +00:00
retrieve_file $1
local FUNC_NAME = $1
local SPEC_NAME = " spec_ $1 "
local -a SPEC = ( ${ (P)SPEC_NAME } )
local FILE = ${ SPEC [1] }
2015-07-19 05:55:15 +00:00
shift
local PACKAGE = ${ ${ FILE %.* } %.tar }
local DIR = ${ DIR :- $PACKAGE }
case ${ FILE ##*. } in
2016-12-18 14:48:16 +00:00
xz| lzma) COMPRESSION = J ; ;
bz2) COMPRESSION = j ; ;
gz) COMPRESSION = z ; ;
tar) COMPRESSION = ; ;
*) echo Unknown compression for ${ FILE } ; exit 1 ; ;
2015-07-19 05:55:15 +00:00
esac
cd $CMPL
if [ [ -z $NO_EXTRACTION ] ] ; then
$DEBUG rm -rf ${ DIR }
$DEBUG tar x${ COMPRESSION } f ${ SRCDIR } /${ FILE }
fi
$DEBUG cd ${ DIR }
2018-06-16 19:47:29 +00:00
local patch_dir = ${ SCRIPT_PATH } /${ FUNC_NAME } -patches
if [ [ -d ${ patch_dir } ] ] ; then
for PART in ${ patch_dir } /*.patch ; do
patch -p1 < ${ PART }
done
fi
2015-07-19 05:55:15 +00:00
if [ [ -z $NO_CONFIGURE ] ] ; then
2018-06-16 19:47:29 +00:00
saved_CFLAGS = ${ CFLAGS }
saved_CXXFLAGS = ${ CXXFLAGS }
saved_LDFLAGS = ${ LDFLAGS }
export CFLAGS = " ${ CFLAGS } -I ${ TARGET } /include "
export LDFLAGS = " ${ LDFLAGS } -L ${ TARGET } /lib "
if [ [ ( -n ${ CONFIGURE } ) || ( -x ./configure ) ] ] ; then
$DEBUG ${ CONFIGURE :- ./configure } $@
if [ [ -z $NO_MAKE ] ] ; then
$DEBUG make
build_tarball
fi
else
mkdir mtx-build
cd mtx-build
$DEBUG cmake .. $@
if [ [ -z $NO_MAKE ] ] ; then
$DEBUG make
build_tarball command "make DESTDIR=TMPDIR install"
fi
cd ..
2015-07-19 05:55:15 +00:00
fi
2018-06-16 19:47:29 +00:00
CFLAGS = ${ saved_CFLAGS }
CXXFLAGS = ${ saved_CXXFLAGS }
LDFLAGS = ${ saved_LDFLAGS }
2015-07-19 05:55:15 +00:00
fi
}
mkdir -p $CMPL
function build_autoconf {
2018-06-16 19:47:29 +00:00
build_package autoconf --prefix= ${ TARGET }
2015-07-19 05:55:15 +00:00
}
function build_automake {
2018-06-16 19:47:29 +00:00
build_package automake --prefix= ${ TARGET }
2015-07-19 05:55:15 +00:00
}
function build_pkgconfig {
2018-06-16 19:47:29 +00:00
build_package pkgconfig \
--prefix= ${ TARGET } \
--with-pc-path= ${ TARGET } /lib/pkgconfig \
--with-internal-glib \
--enable-static \
--enable-shared= no
}
function build_libiconv {
build_package libiconv \
ac_cv_prog_AWK = /usr/bin/awk \
ac_cv_path_GREP = /usr/bin/grep \
ac_cv_path_SED = /usr/bin/sed \
--prefix= ${ TARGET } \
--enable-static \
--docdir= ${ prefix } /share/doc/${ name } \
--without-libiconv-prefix \
--without-libintl-prefix \
--disable-nls \
--enable-extra-encodings \
--enable-shared= no
2015-07-19 05:55:15 +00:00
}
2018-01-15 18:32:33 +00:00
function build_cmake {
2018-06-16 19:47:29 +00:00
build_package cmake --prefix= ${ TARGET }
2018-01-15 18:32:33 +00:00
}
2015-07-19 05:55:15 +00:00
function build_ogg {
2018-06-16 19:47:29 +00:00
build_package ogg \
--prefix= ${ TARGET } \
--disable-shared \
--enable-static
2015-07-19 05:55:15 +00:00
}
function build_vorbis {
2018-06-16 19:47:29 +00:00
build_package vorbis \
--prefix= ${ TARGET } \
--with-ogg-libraries= ${ TARGET } /lib \
--with-ogg-includes= ${ TARGET } /include/ \
--enable-static \
--disable-shared
2015-07-19 05:55:15 +00:00
}
function build_flac {
2018-06-16 19:47:29 +00:00
build_package flac \
--prefix= ${ TARGET } \
--disable-asm-optimizations \
--disable-xmms-plugin \
--with-ogg-libraries= ${ TARGET } /lib \
--with-ogg-includes= ${ TARGET } /include/ \
--with-libiconv-prefix= ${ TARGET } \
--enable-static \
--disable-shared
2015-07-19 05:55:15 +00:00
}
function build_zlib {
2018-06-16 19:47:29 +00:00
build_package zlib \
--prefix= ${ TARGET } \
--static
2015-07-19 05:55:15 +00:00
}
function build_gettext {
2018-06-16 19:47:29 +00:00
build_package gettext \
--prefix= ${ TARGET } \
--disable-csharp \
--disable-native-java \
--disable-openmp \
--without-emacs \
2015-07-19 05:55:15 +00:00
--without-libexpat-prefix \
--without-libxml2-prefix \
2018-06-16 19:47:29 +00:00
--with-included-gettext \
--with-included-glib \
--with-included-libcroco \
--with-included-libunistring \
--with-included-libxml \
--enable-static \
--disable-shared
2015-07-19 05:55:15 +00:00
}
function build_ruby {
build_package ruby-2.1.6.tar.bz2 --prefix= ${ TARGET } \
--enable-static --disable-shared
}
function build_boost {
2016-12-18 14:48:16 +00:00
local -a args properties
2015-07-19 05:55:15 +00:00
2016-12-18 14:48:16 +00:00
args = ( --reconfigure -sICONV_PATH= /usr -j$DRAKETHREADS --prefix= TMPDIR/${ TARGET } --libdir= TMPDIR/${ TARGET } /lib)
properties = ( toolset = clang link = static variant = release)
if [ [ -n $CXXFLAGS ] ] properties += ( cxxflags = " ${ (q)CXXFLAGS } " )
if [ [ -n $LDFLAGS ] ] properties += ( linkflags = " ${ (q)LDFLAGS } " )
2015-07-19 05:55:15 +00:00
2018-06-16 19:47:29 +00:00
NO_MAKE = 1 CONFIGURE = ./bootstrap.sh build_package boost \
2016-12-18 14:48:16 +00:00
--with-toolset= clang
build_tarball command " ./b2 ${ args } ${ properties } install "
}
2018-01-15 18:32:33 +00:00
function build_cmark {
2018-06-16 19:47:29 +00:00
build_package cmark \
2018-01-15 18:32:33 +00:00
-DCMAKE_INSTALL_PREFIX= ${ TARGET } \
-DCMARK_TESTS= OFF \
-DCMARK_STATIC= ON \
-DCMARK_SHARED= OFF
2018-06-16 19:47:29 +00:00
}
function build_openssl {
NO_CONFIGURE = 1 build_package openssl
./Configure \
--prefix= ${ TARGET } \
-L${ TARGET } /lib \
no-krb5 \
--openssldir= ${ TARGET } /etc/openssl \
shared \
zlib \
darwin64-x86_64-cc
make
$DEBUG build_tarball command "make INSTALL_PREFIX=TMPDIR install"
}
2018-01-15 18:32:33 +00:00
2018-06-16 19:47:29 +00:00
function build_curl {
build_package curl \
--prefix= ${ TARGET } \
--disable-silent-rules \
--enable-ipv6 \
--without-brotli \
--without-cyassl \
--without-gnutls \
--without-gssapi \
--without-libmetalink \
--without-librtmp \
--without-libssh2 \
--without-nghttp2 \
--without-nss \
--without-polarssl \
--without-spnego \
--without-darwinssl \
--disable-ares \
--disable-ldap \
--disable-ldaps \
--with-zlib= ${ TARGET } \
--with-ssl= ${ TARGET } \
--with-ca-path= ${ TARGET } /etc/openssl/certs
2018-01-15 18:32:33 +00:00
}
2015-07-19 05:55:15 +00:00
function build_qtbase {
local -a args
args = ( --prefix= ${ TARGET } -opensource -confirm-license -release
2016-12-18 14:48:16 +00:00
-c++std c++14
2017-08-20 13:14:21 +00:00
-force-pkg-config -pkg-config -nomake examples -nomake tests
2015-07-19 05:55:15 +00:00
-no-glib -no-dbus -no-sql-mysql -no-sql-sqlite -no-sql-odbc -no-sql-psql -no-sql-tds
2017-08-20 13:14:21 +00:00
-no-openssl -no-cups -no-feature-cups
# -no-feature-printer
2015-07-19 05:55:15 +00:00
-no-feature-printpreviewwidget -no-feature-printdialog -no-feature-printpreviewdialog)
args += ( -no-framework)
2015-08-15 10:35:30 +00:00
if [ [ -z $SHARED_QT ] ] args += ( -static)
2015-07-19 05:55:15 +00:00
2018-06-16 19:47:29 +00:00
local package = qtbase-${ QTTYPE } -src-${ QTVER }
2016-12-18 14:48:16 +00:00
local saved_CXXFLAGS = $CXXFLAGS
2016-12-28 19:00:03 +00:00
export CXXFLAGS = " ${ QT_CXXFLAGS } "
2016-12-18 14:48:16 +00:00
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
NO_CONFIGURE = 1 build_package qtbase
2016-12-18 14:48:16 +00:00
$DEBUG ./configure ${ args }
2015-07-19 05:55:15 +00:00
# find . -name Makefile| xargs perl -pi -e 's{-fvisibility=hidden|-fvisibility-inlines-hidden}{}g'
$DEBUG make
# cd ${CMPL}/${package}
build_tarball command "make INSTALL_ROOT=TMPDIR install"
2016-12-18 14:48:16 +00:00
CXXFLAGS = $saved_CXXFLAGS
2015-07-19 05:55:15 +00:00
}
function build_qttools {
local -a tools to_install
2017-08-20 09:10:39 +00:00
tools = ( linguist/lrelease linguist/lconvert linguist/lupdate macdeployqt)
2015-07-19 05:55:15 +00:00
to_install = ( )
2018-06-16 19:47:29 +00:00
local package = qttools-${ QTTYPE } -src-${ QTVER }
2016-12-18 14:48:16 +00:00
local saved_CXXFLAGS = $CXXFLAGS
2016-12-28 19:00:03 +00:00
export CXXFLAGS = " ${ QT_CXXFLAGS } "
2016-12-18 14:48:16 +00:00
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qttools
2015-07-19 05:55:15 +00:00
for tool ( $tools ) {
2017-08-20 09:10:39 +00:00
to_install += ( $PWD /bin/${ tool ##*/ } )
pushd src/$tool
2015-07-19 05:55:15 +00:00
qmake
make
popd
}
# cd ${CMPL}/${package}
build_tarball command " mkdir -p TMPDIR/ ${ TARGET } /bin && cp -v $to_install TMPDIR/ ${ TARGET } /bin/ "
2016-12-18 14:48:16 +00:00
CXXFLAGS = $saved_CXXFLAGS
2015-07-19 05:55:15 +00:00
}
function build_qttranslations {
2016-12-18 14:48:16 +00:00
local saved_CXXFLAGS = $CXXFLAGS
2016-12-28 19:00:03 +00:00
export CXXFLAGS = " ${ QT_CXXFLAGS } "
2016-12-18 14:48:16 +00:00
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qttranslations
2015-07-19 05:55:15 +00:00
$DEBUG make
build_tarball command "make INSTALL_ROOT=TMPDIR install"
2016-12-18 14:48:16 +00:00
CXXFLAGS = $saved_CXXFLAGS
2015-07-19 05:55:15 +00:00
}
function build_qtmacextras {
2016-12-18 14:48:16 +00:00
local saved_CXXFLAGS = $CXXFLAGS
2016-12-28 19:00:03 +00:00
export CXXFLAGS = " ${ QT_CXXFLAGS } "
2016-12-18 14:48:16 +00:00
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qtmacextras
2015-07-19 05:55:15 +00:00
$DEBUG make
build_tarball command "make INSTALL_ROOT=TMPDIR install"
2016-12-18 14:48:16 +00:00
CXXFLAGS = $saved_CXXFLAGS
2015-07-19 05:55:15 +00:00
}
2017-04-05 12:51:38 +00:00
function build_qtmultimedia {
local saved_CXXFLAGS = $CXXFLAGS
export CXXFLAGS = " ${ QT_CXXFLAGS } "
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qtmultimedia
2017-04-05 12:51:38 +00:00
$DEBUG make
build_tarball command "make INSTALL_ROOT=TMPDIR install"
CXXFLAGS = $saved_CXXFLAGS
}
2017-08-20 13:14:21 +00:00
function build_qtsvg {
local saved_CXXFLAGS = $CXXFLAGS
export CXXFLAGS = " ${ QT_CXXFLAGS } "
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qtsvg
2017-08-20 13:14:21 +00:00
$DEBUG make
build_tarball command "make INSTALL_ROOT=TMPDIR install"
CXXFLAGS = $saved_CXXFLAGS
}
function build_qtimageformats {
local saved_CXXFLAGS = $CXXFLAGS
export CXXFLAGS = " ${ QT_CXXFLAGS } "
export QMAKE_CXXFLAGS = " ${ CXXFLAGS } "
2018-06-16 19:47:29 +00:00
CONFIGURE = qmake NO_MAKE = 1 build_package qtimageformats
2017-08-20 13:14:21 +00:00
$DEBUG make
build_tarball command "make INSTALL_ROOT=TMPDIR install"
CXXFLAGS = $saved_CXXFLAGS
}
function build_qt {
build_qtbase
build_qtmultimedia
build_qtsvg
build_qtimageformats
build_qttools
build_qttranslations
}
2015-07-19 05:55:15 +00:00
function build_configured_mkvtoolnix {
if [ [ -z ${ MTX_VER } ] ] fail Variable MTX_VER not set
dmgbase = ${ CMPL } /dmg-${ MTX_VER }
dmgcnt = $dmgbase /MKVToolNix-${ MTX_VER } .app/Contents
dmgmac = $dmgcnt /MacOS
local -a args
args = (
2018-06-16 19:47:29 +00:00
--prefix= $dmgmac
--bindir= $dmgmac
--datarootdir= $dmgmac
--with-extra-libs= ${ TARGET } /lib
--with-extra-includes= ${ TARGET } /include
2017-02-19 15:46:31 +00:00
--with-boost-libdir= ${ TARGET } /lib
--with-docbook-xsl-root= ${ DOCBOOK_XSL_ROOT_DIR }
2015-08-18 20:21:42 +00:00
--disable-debug
2015-07-19 05:55:15 +00:00
)
2015-08-15 10:35:30 +00:00
if [ [ -z $SHARED_QT ] ] args += ( --enable-static-qt)
2015-07-19 05:55:15 +00:00
./configure \
2016-03-28 16:17:46 +00:00
LDFLAGS = " $LDFLAGS -framework CoreFoundation -headerpad_max_install_names " \
2017-01-08 20:18:56 +00:00
CXXFLAGS = "-fvisibility=hidden -fvisibility-inlines-hidden" \
2015-07-19 05:55:15 +00:00
${ args }
2015-08-15 12:11:17 +00:00
grep -q 'USE_QT.*yes' build-config
2015-07-19 05:55:15 +00:00
}
function build_mkvtoolnix {
if [ [ -z ${ MTX_VER } ] ] fail Variable MTX_VER not set
dmgbase = ${ CMPL } /dmg-${ MTX_VER }
dmgcnt = $dmgbase /MKVToolNix-${ MTX_VER } .app/Contents
dmgmac = $dmgcnt /MacOS
NO_MAKE = 1 NO_CONFIGURE = 1 build_package mkvtoolnix-${ MTX_VER } .tar.xz
build_configured_mkvtoolnix
2017-03-23 18:10:25 +00:00
${ RAKE } clean
${ RAKE } -j ${ DRAKETHREADS }
2015-07-19 05:55:15 +00:00
}
function build_dmg {
if [ [ -z ${ MTX_VER } ] ] fail Variable MTX_VER not set
2018-06-25 15:59:11 +00:00
if [ [ -f packaging/macos/unlock_keychain.sh ] ] packaging/macos/unlock_keychain.sh
2017-08-20 18:02:31 +00:00
2015-07-19 05:55:15 +00:00
dmgbase = ${ CMPL } /dmg-${ MTX_VER }
2017-08-20 13:24:28 +00:00
dmgapp = $dmgbase /MKVToolNix-${ MTX_VER } .app
dmgcnt = $dmgapp /Contents
2015-07-19 05:55:15 +00:00
dmgmac = $dmgcnt /MacOS
2016-10-24 18:16:08 +00:00
latest_link = ${ CMPL } /latest
rm -f ${ latest_link }
2015-07-19 05:55:15 +00:00
if [ [ -z $DMG_NO_CD ] ] cd ${ CMPL } /mkvtoolnix-${ MTX_VER }
rm -rf $dmgbase
2017-03-23 18:10:25 +00:00
${ RAKE } install prefix = ${ dmgcnt }
2015-08-15 10:35:30 +00:00
test -f ${ dmgmac } /mkvtoolnix-gui
2015-07-19 05:55:15 +00:00
2018-02-24 10:01:48 +00:00
strip ${ dmgcnt } /MacOS/mkv{ merge,info,extract,propedit,toolnix-gui}
2015-10-06 19:42:17 +00:00
2017-04-05 11:28:25 +00:00
mv ${ dmgmac } /mkvtoolnix/sounds ${ dmgmac } /sounds
rmdir ${ dmgmac } /mkvtoolnix
2015-07-19 05:55:15 +00:00
cp README.md $dmgbase /README.txt
cp COPYING $dmgbase /COPYING.txt
2016-12-29 18:23:36 +00:00
cp NEWS.md $dmgbase /NEWS.txt
2015-07-19 05:55:15 +00:00
cat > $dmgbase /README.MacOS.txt <<EOF
MKVToolNix – Mac OS specific notes
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Configuration files are stored in ~/.config/bunkus.org and temporary
files are stored in the folder automatically set via TMPDIR.
This build works only with Mac OS X 10.9 and higher.
If you need the command line tools then copy mkvextract, mkvinfo,
mkvmerge and mkvproedit from ./MKVToolNix-${ MTX_VER } /Contents/MacOS/
to /usr/local/bin
EOF
2015-08-15 16:27:44 +00:00
mkdir -p $dmgcnt /Resources
2017-08-20 14:59:21 +00:00
cp share/icons/macos/MKVToolNix.icns $dmgcnt /Resources/MKVToolNix.icns
2015-07-19 05:55:15 +00:00
for file in ${ TARGET } /translations/qtbase_*.qm; do
lang = ${ ${ file %.qm } ##*_ }
lcdir = ${ dmgmac } /locale/${ lang } /LC_MESSAGES
if [ [ -d ${ lcdir } ] ] cp -v ${ file } ${ lcdir } /
done
2015-07-20 18:59:28 +00:00
ln -s /Applications ${ dmgbase } /
2015-07-19 05:55:15 +00:00
cat <<EOF > $dmgcnt /PkgInfo
APPL????
EOF
cat <<EOF > $dmgcnt /Info.plist
<?xml version = "1.0" encoding = "UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version = "1.0" >
<dict>
<key>LSEnvironment</key>
<dict>
<key>LANG</key>
<string>en_US.UTF-8</string>
</dict>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleExecutable</key> <string>mkvtoolnix-gui</string>
<key>Properties</key>
<dict>
<key>file.encoding</key> <string>UTF-8</string>
</dict>
<key>CFBundleInfoDictionaryVersion</key> <string>${ MTX_VER } </string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CSResourcesFileMapped</key> <true/>
<key>CFBundleVersion</key> <string>MKVToolNix-${ MTX_VER } </string>
<key>CFBundleShortVersionString</key> <string>${ MTX_VER } </string>
<key>NSPrincipalClass</key> <string>NSApplication</string>
2017-01-08 20:18:56 +00:00
<key>LSMinimumSystemVersion</key> <string>${ MACOSX_DEPLOYMENT_TARGET } </string>
2015-07-19 05:55:15 +00:00
<key>CFBundleName</key> <string>MKVToolNix</string>
<key>CFBundleIconFile</key> <string>MKVToolNix.icns</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<!-- Here goes the file formats your app can read -->
</array>
<key>CFBundleTypeIconFile</key> <string>MKVToolNix.icns</string>
<key>CFBundleTypeName</key> <string>MKVToolNix-${ MTX_VER } </string>
<key>CFBundleTypeRole</key> <string>Editor</string>
<key>LSIsAppleDefaultForType</key> <true/>
<key>LSTypeIsPackage</key> <false/>
</dict>
</array>
</dict>
</plist>
EOF
2017-08-22 10:48:33 +00:00
mkdir -p ${ dmgmac } /libs
cp -v -a ${ TARGET } /lib/libQt5{ Concurrent*.dylib,Core*.dylib,Gui*.dylib,Multimedia*.dylib,Network*.dylib,PrintSupport*.dylib,Widgets*.dylib} ${ dmgmac } /libs/
2017-08-20 13:24:28 +00:00
2017-04-05 12:02:24 +00:00
for plugin ( audio mediaservice platforms playlistformats) cp -v -R ${ TARGET } /plugins/${ plugin } ${ dmgmac } /
2015-07-19 05:55:15 +00:00
2018-02-24 10:01:48 +00:00
for FILE ( ${ dmgmac } /**/*.dylib( .) ${ dmgmac } /{ mkvinfo,mkvtoolnix-gui} ) {
2015-07-19 05:55:15 +00:00
otool -L ${ FILE } | \
grep -v : | \
grep -v @executable_path | \
awk '/libQt/ { print $1 }' | { \
while read LIB ; do
2017-08-22 10:48:33 +00:00
install_name_tool -change ${ LIB } @executable_path/libs/${ LIB : t } ${ FILE }
2015-07-19 05:55:15 +00:00
done
}
}
2017-08-20 14:59:21 +00:00
if [ [ -n ${ SIGNATURE_IDENTITY } ] ] ; then
typeset -a non_executables
for FILE ( ${ dmgcnt } /**/*( .) ) {
if [ [ ${ FILE } != */MacOS/mkv* ] ] non_executables += ( ${ FILE } )
}
2017-08-20 13:24:28 +00:00
2017-08-20 14:59:21 +00:00
codesign --force --sign ${ SIGNATURE_IDENTITY } ${ non_executables }
codesign --force --sign ${ SIGNATURE_IDENTITY } ${ dmgmac } /mkv*( .)
fi
2017-08-20 13:24:28 +00:00
2017-08-21 14:26:13 +00:00
if [ [ -n $DMG_NO_DMG ] ] return
2015-10-06 19:58:44 +00:00
volumename = MKVToolNix-${ MTX_VER }
if [ [ $DMG_PRE = = 1 ] ] ; then
local build_number_file = $HOME /net/home/prog/video/mingw/src/uc/build-number
local build = $( < $build_number_file )
let build = $build +1
echo $build > $build_number_file
2016-10-24 18:16:08 +00:00
volumename = MKVToolNix-${ MTX_VER } -build$( date '+%Y%m%d' ) -${ build } -$( git rev-parse --short HEAD)
2015-10-06 19:58:44 +00:00
fi
dmgname = ${ CMPL } /MKVToolNix-${ MTX_VER } .dmg
dmgbuildname = ${ CMPL } /${ volumename } .dmg
rm -f ${ dmgname } ${ dmgbuildname }
hdiutil create -srcfolder ${ dmgbase } -volname ${ volumename } \
2015-07-19 05:55:15 +00:00
-fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDZO -imagekey zlib-level= 9 \
${ CMPL } /MKVToolNix-${ MTX_VER }
2017-08-14 20:21:28 +00:00
2017-08-20 14:59:21 +00:00
if [ [ -n ${ SIGNATURE_IDENTITY } ] ] codesign --force -s ${ SIGNATURE_IDENTITY } ${ dmgname }
2017-08-14 20:21:28 +00:00
2015-10-06 19:58:44 +00:00
if [ [ ${ dmgname } != ${ dmgbuildname } ] ] mv ${ dmgname } ${ dmgbuildname }
2016-10-24 18:16:08 +00:00
ln -s ${ dmgbuildname } ${ latest_link }
2015-07-19 05:55:15 +00:00
}
2017-01-08 20:18:56 +00:00
if [ [ -z $MTX_VER ] ] ; then
MTX_VER = $( awk -F, '/AC_INIT/ { gsub("[][]", "", $2); print $2 }' < ${ SCRIPT_PATH } /../../configure.ac)
fi
2015-07-19 05:55:15 +00:00
if [ [ -z $@ ] ] ; then
build_autoconf
build_automake
build_pkgconfig
2018-06-16 19:47:29 +00:00
build_libiconv
2018-01-15 18:32:33 +00:00
build_cmake
2015-07-19 05:55:15 +00:00
build_ogg
build_vorbis
build_flac
2016-12-28 19:00:03 +00:00
build_zlib
2015-07-19 05:55:15 +00:00
build_gettext
2018-01-15 18:32:33 +00:00
build_cmark
2015-07-19 05:55:15 +00:00
build_boost
2017-08-20 13:14:21 +00:00
build_qt
2016-12-28 19:00:03 +00:00
build_ruby
2015-07-19 05:55:15 +00:00
build_configured_mkvtoolnix
else
while [ [ -n $1 ] ] ; do
build_$1
shift;
done
fi