make-OSX-app.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # This script will build LaunchSLClient.app from the .exe, .dll's, and
  3. # other necessary files.
  4. #
  5. # This should be run from the bin directory.
  6. APP_NAME="LaunchSLClient"
  7. # Note that proper form is to copy Frameworks to
  8. # *.app/Contents/Frameworks, but because @executable_path resolves to
  9. # [...]/Resources/bin, and the libraries reference
  10. # @executable_path/../Frameworks, we put frameworks in
  11. # Contents/Resources instead.
  12. FRAMEWORKS_PATH="${APP_NAME}.app/Contents/Resources/Frameworks"
  13. if [ ! -e ${APP_NAME}.exe ]; then
  14. echo "Error: Could not find ${APP_NAME}.exe." >& 2
  15. echo "Have you built it, and are you currently in the bin directory?" >& 2
  16. exit 1
  17. fi
  18. CMDFLAGS="-m console -n ${APP_NAME} -a ${APP_NAME}.exe"
  19. REFERENCES="-r /Library/Frameworks/Mono.framework/Versions/Current/lib/ \
  20. -r Nini.dll \
  21. -r ${APP_NAME}.ini"
  22. if [ -f ${APP_NAME}.icns ]; then
  23. CMDFLAGS="${CMDFLAGS} -i ${APP_NAME}.icns"
  24. else
  25. echo "Warning: no icon file found. Will use default application icon." >&2
  26. fi
  27. if [ -d ${APP_NAME}.app ]; then rm -rf ${APP_NAME}.app; fi
  28. macpack ${REFERENCES} ${CMDFLAGS}
  29. mkdir -p ${FRAMEWORKS_PATH}