Build with an ffmpeg that includes libdav1d.
[dcpomatic.git] / platform / osx / make_dmg.sh
index a48b1e6aeb299b143668ff1f3932624a2af8461f..f997af8175713f2ce2e2cf08b8ae9cb95783acf3 100644 (file)
@@ -7,7 +7,14 @@ SYNTAX="make_dmg.sh <environment> <builddir> <apple-id> <apple-password> <arch1>
 # Don't set -e here as egrep (used a few times) returns 1 if no matches
 # were found.
 
-version=`git describe --tags --abbrev=0 | sed -e "s/v//"`
+# Use a tag if what we've built is exactly on one
+version=$(git describe --tags --abbrev=0 --match=v2.*.* --exact-match 2> /dev/null)
+if [ "$?" == "0" ]; then
+       version=$(echo $version | sed -e "s/^v//")
+else
+       # Otherwise use <branch>-<commit>
+       version="$(basename $(git name-rev --name-only HEAD))-$(git rev-parse --short HEAD)"
+fi
 
 # DMG size in megabytes
 DMG_SIZE=256
@@ -174,6 +181,7 @@ function copy_libs {
     copy_lib_env libfribidi "$dest"
     copy_lib_env libgio "$dest"
     copy_lib_env libz "$dest"
+       copy_lib_env libdav1d "$dest"
 }
 
 # @param #1 directory to copy to
@@ -262,7 +270,7 @@ function relink_relative {
 
        for arch in $arch1_name $arch2_name; do
                for obj in "${linkers[@]}"; do
-                       deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"`
+                       deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|@rpath|boost|libicu|libssh)"`
                        changes=""
                        for dep in $deps; do
                                base=`basename $dep`
@@ -314,8 +322,12 @@ function make_dmg {
     local pkg="$2"
     local full_name="$3"
     local exes="$4"
-    tmp_dmg=dcpomatic_tmp.dmg
-    dmg="$full_name $version.dmg"
+       tmp_dmg=dcpomatic_tmp.dmg
+       if [ "$ARCH2" == "" ]; then
+               dmg="$full_name $version macOS10.8+.dmg"
+       else
+               dmg="$full_name $version macOS10.10+.dmg"
+       fi
     vol_name=DCP-o-matic-$version
 
        find "$appdir/Contents/Frameworks" -iname "*.dylib" -type f -print0 | while IFS= read -r -d '' f; do