Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.4 KiB

3 years ago
  1. set -e
  2. APP_NAME=${1:-DeskewGui}
  3. APP_TITLE=${2:-Deskew GUI}
  4. BUNDLE_ID=${3:-net.galfarslair.deskewgui}
  5. COPYRIGHT=${4:-© 2019 Marek Mauder}
  6. ICON_PATH=${5:-"../Gui/deskewgui.icns"}
  7. ICON_NAME=$(basename $ICON_PATH .icns)
  8. TIFFLIB_BIN=../_internal/TiffLibBins-macOS
  9. RELEASE_DIR=../_internal/MacRelease
  10. CONTENT_DIR=$RELEASE_DIR/$APP_NAME.app/Contents
  11. mkdir -p $RELEASE_DIR
  12. rm -rf $RELEASE_DIR/*
  13. # build executables
  14. rm -f ../Bin/deskew-mac
  15. rm -f ../Gui/deskewgui
  16. lazbuild --build-mode=Release-macOS -q --no-write-project ../deskew.lpi
  17. lazbuild --build-mode=Release-macOS -q --no-write-project ../Gui/deskewgui.lpi
  18. # app bundle contents
  19. mkdir -p $CONTENT_DIR/MacOS
  20. mkdir $CONTENT_DIR/Resources
  21. cp ../Bin/deskew-mac $CONTENT_DIR/MacOS/
  22. cp ../Gui/deskewgui $CONTENT_DIR/MacOS/
  23. if [ -d $TIFFLIB_BIN ]; then
  24. cp $TIFFLIB_BIN/*.dylib $CONTENT_DIR/MacOS/
  25. fi
  26. chmod 755 $CONTENT_DIR/MacOS/*.*
  27. cp $ICON_PATH $CONTENT_DIR/Resources/
  28. chmod 644 $CONTENT_DIR/Resources/$ICON_NAME.icns
  29. echo "APPL????" > $CONTENT_DIR/PkgInfo
  30. # app bundle props
  31. cat <<EOT >> $CONTENT_DIR/Info.plist
  32. <?xml version="1.0" encoding="UTF-8"?>
  33. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  34. <plist version="1.0">
  35. <dict>
  36. <key>CFBundleDevelopmentRegion</key>
  37. <string>English</string>
  38. <key>CFBundleExecutable</key>
  39. <string>deskewgui</string>
  40. <key>CFBundleDisplayName</key>
  41. <string>$APP_TITLE</string>
  42. <key>CFBundleName</key>
  43. <string>$APP_TITLE</string>
  44. <key>CFBundleIdentifier</key>
  45. <string>$BUNDLE_ID</string>
  46. <key>CFBundleIconFile</key>
  47. <string>$ICON_NAME</string>
  48. <key>CFBundleInfoDictionaryVersion</key>
  49. <string>6.0</string>
  50. <key>CFBundlePackageType</key>
  51. <string>APPL</string>
  52. <key>CFBundleSignature</key>
  53. <string>desk</string>
  54. <key>CSResourcesFileMapped</key>
  55. <true/>
  56. <key>NSHumanReadableCopyright</key>
  57. <string>$COPYRIGHT</string>
  58. <key>NSHighResolutionCapable</key>
  59. <true/>
  60. </dict>
  61. </plist>
  62. EOT
  63. # update version from Lazarus project file
  64. source ./get_gui_versions.sh
  65. plutil -insert CFBundleShortVersionString -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist
  66. plutil -insert CFBundleVersion -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist
  67. # create DMG from folder
  68. DMG_NAME=$APP_NAME-$MAJOR_VER.$MINOR_VER.dmg
  69. hdiutil create -srcfolder $RELEASE_DIR -volname $APP_NAME -format UDZO -ov $RELEASE_DIR/$DMG_NAME
  70. echo "Finished OK!"