"Fossies" - the Fresh Open Source Software Archive

Member "yudit-3.0.7/build-for-macos.sh" (7 Jun 2020, 1977 Bytes) of package /linux/misc/yudit-3.0.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "build-for-macos.sh": 3.0.5_vs_3.0.7.

    1 #!/bin/bash
    2 # When you run this program, it will create an installer for mac.
    3 #
    4 # Make sure you also have XCode installed before running this script,
    5 # otherwise yudit may not compile.
    6 #
    7 # Gaspar Sinai <gaspar@yudit.org> Tokyo 2020-05-10
    8 #
    9 APPNAME=Yudit
   10 APPVERSION="3.0.7"
   11 
   12 BUILD_NAME="unsigned"
   13 if [ -f addon/yudit_sedy/yudit_sedy.h ]
   14 then
   15 BUILD_NAME="sedy"
   16 fi
   17 
   18 check_error () {
   19     echo "error: $2" >&2
   20     exit 1
   21 } 
   22 
   23 #make distclean
   24 rm -rf target
   25 
   26 # Make a proper unsigned app.
   27 rm -rf ./macos/Yudit.app
   28 cp -R ./macos/Yudit.app.signed ./macos/Yudit.app
   29 rm -rf ./macos/Yudit.app/Contents/_CodeSignature
   30 
   31 export DESTDIR="$(pwd)/target"
   32 export PREFIX="/Applications/${APPNAME}.app/Contents/MacOS"
   33 export MACOSDIR="${DESTDIR}/${PREFIX}"
   34 
   35 mkdir -p $DESTDIR/Applications || check_error $? "Failed to create $DESTDIR/Applications/"
   36 ln -s /Applications/ $DESTDIR/Applications/Applications || check_error $? "Failed to create symlink"
   37 cp -R ./macos/Yudit.app $DESTDIR/Applications/ || check_error $? "Failed to copy to $DESTDIR/Applicaions/Yudit.app"
   38 
   39 ./configure --prefix=${PREFIX} || check_error $? "configure failed."
   40 make -j 16 || check_error $? "make failed."
   41 # uses DESTDIR
   42 make install || check_error $? "make install failed."
   43 # play safe if DESTDIR is / just move
   44 
   45 cp $MACOSDIR/bin/yudit $MACOSDIR/Yudit
   46 
   47 cp -R ./macos/dot_background $DESTDIR/Applications/.background || check_error $? "Failed to copy installer background"
   48 # Resources and icons are in the bundle macos/Yudit.app bundle
   49 
   50 #cp COPYING.TXT  $DESTDIR || check_error $? "can not copy COPYING.TXT"
   51 echo "creating package"
   52 hdiutil create -volname Yudit -srcfolder $DESTDIR/Applications/ -ov -format UDZO ./target/yudit-${APPVERSION}.x86_64-${BUILD_NAME}.dmg ||check_error $? "Failed to create disk image."
   53 
   54 # codesign --force --sign "Developer ID Application: <identityIdentifier>" ./target/yudit-${APPVERSION}-${BUILD_NAME}.x86_64.dmg
   55 
   56 echo "Your disk image is: target/yudit-${APPVERSION}.x86_64-${BUILD_NAME}.dmg"