From 16e9630b79f0a7a90c6cedb6781175bb8b337dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 29 Apr 2017 12:11:08 +0200 Subject: New upstream version 4.3.0 --- distribution/osx/CMakeLists.txt | 51 +---- distribution/osx/bundle/Info.plist.in | 4 + distribution/osx/gtk-bundle/CMakeLists.txt | 20 ++ distribution/osx/gtk-bundle/Drag-to-Copy-Arrow.png | Bin 0 -> 2171 bytes .../osx/gtk-bundle/XTrackCAD-help/CMakeLists.txt | 14 ++ .../XTrackCAD-help/Contents/CMakeLists.txt | 5 + .../Contents/Resources/CMakeLists.txt | 12 ++ .../Contents/Resources/en.lproj/CMakeLists.txt | 10 + .../Contents/Resources/en.lproj/InfoPlist.strings | 2 + .../Contents/Resources/icon_16x16.png | Bin 0 -> 673 bytes .../XTrackCAD-help/info-xtrkcad-help.plist.in | 36 ++++ distribution/osx/gtk-bundle/gtk-bundle.README | 44 +++++ distribution/osx/gtk-bundle/info-xtrkcad.plist | 34 ++++ distribution/osx/gtk-bundle/info-xtrkcad.plist.in | 34 ++++ distribution/osx/gtk-bundle/toc.js | 67 +++++++ distribution/osx/gtk-bundle/xtrkcad-bundler.sh | 84 ++++++++ distribution/osx/gtk-bundle/xtrkcad-launcher.sh | 214 +++++++++++++++++++++ distribution/osx/gtk-bundle/xtrkcad-logo.icns | Bin 0 -> 1337741 bytes .../osx/gtk-bundle/xtrkcad-template.dmg.zip | Bin 0 -> 3990654 bytes distribution/osx/gtk-bundle/xtrkcad.bundle | 132 +++++++++++++ distribution/posix/CMakeLists.txt | 2 + distribution/posix/xtrkcad.spec | 4 +- 22 files changed, 721 insertions(+), 48 deletions(-) create mode 100644 distribution/osx/gtk-bundle/CMakeLists.txt create mode 100644 distribution/osx/gtk-bundle/Drag-to-Copy-Arrow.png create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/CMakeLists.txt create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/Contents/CMakeLists.txt create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/CMakeLists.txt create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/CMakeLists.txt create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/InfoPlist.strings create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/icon_16x16.png create mode 100644 distribution/osx/gtk-bundle/XTrackCAD-help/info-xtrkcad-help.plist.in create mode 100644 distribution/osx/gtk-bundle/gtk-bundle.README create mode 100644 distribution/osx/gtk-bundle/info-xtrkcad.plist create mode 100644 distribution/osx/gtk-bundle/info-xtrkcad.plist.in create mode 100644 distribution/osx/gtk-bundle/toc.js create mode 100755 distribution/osx/gtk-bundle/xtrkcad-bundler.sh create mode 100755 distribution/osx/gtk-bundle/xtrkcad-launcher.sh create mode 100644 distribution/osx/gtk-bundle/xtrkcad-logo.icns create mode 100644 distribution/osx/gtk-bundle/xtrkcad-template.dmg.zip create mode 100644 distribution/osx/gtk-bundle/xtrkcad.bundle (limited to 'distribution') diff --git a/distribution/osx/CMakeLists.txt b/distribution/osx/CMakeLists.txt index 5269250..2561fae 100644 --- a/distribution/osx/CMakeLists.txt +++ b/distribution/osx/CMakeLists.txt @@ -3,53 +3,12 @@ GET_TARGET_PROPERTY(XTRKCAD_LOCATION xtrkcad LOCATION) CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake" @ONLY) INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake") -# Handle some external dependencies that can't be detected automatically ... -SET(MACPORTS_DIR "/opt/local" CACHE PATH "Root directory containing installed MacPort packages") -MARK_AS_ADVANCED(MACPORTS_DIR) - -INSTALL(DIRECTORY - ${MACPORTS_DIR}/lib/gtk-2.0 - DESTINATION lib - USE_SOURCE_PERMISSIONS - ) - -INSTALL(DIRECTORY - ${MACPORTS_DIR}/etc/gtk-2.0 - DESTINATION etc - USE_SOURCE_PERMISSIONS - ) - -INSTALL(DIRECTORY - ${MACPORTS_DIR}/lib/pango - DESTINATION lib - USE_SOURCE_PERMISSIONS - ) - -INSTALL(DIRECTORY - ${MACPORTS_DIR}/lib/gdk-pixbuf-2.0 - DESTINATION lib - USE_SOURCE_PERMISSIONS - ) - -INSTALL(FILES - ${MACPORTS_DIR}/etc/pango/pangorc - ${MACPORTS_DIR}/etc/pango/pango.modules - DESTINATION etc/pango - ) - -INSTALL(FILES - ${MACPORTS_DIR}/etc/fonts/fonts.conf - ${MACPORTS_DIR}/etc/fonts/fonts.dtd - DESTINATION etc/fonts - ) - -INSTALL(FILES - ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libxml2.2.dylib - ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libz.1.dylib - ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libiconv.2.dylib - DESTINATION lib -) # Generate bundles ... ADD_SUBDIRECTORY(bundle) +# Add replacement bundle technique ... +FILE(COPY gtk-bundle/ DESTINATION gtk-bundle ) + +ADD_SUBDIRECTORY(gtk-bundle) + diff --git a/distribution/osx/bundle/Info.plist.in b/distribution/osx/bundle/Info.plist.in index ba946ee..e8beb97 100644 --- a/distribution/osx/bundle/Info.plist.in +++ b/distribution/osx/bundle/Info.plist.in @@ -8,6 +8,10 @@ XTrackCAD CFBundleGetInfoString @XTRKCAD_VERSION@ + CFBundleHelpBookFolder + XTrackCAD.help + CFBundleHelpBookName + org.xtrkcad.help CFBundleIconFile XTrackCAD LSMinimumSystemVersion diff --git a/distribution/osx/gtk-bundle/CMakeLists.txt b/distribution/osx/gtk-bundle/CMakeLists.txt new file mode 100644 index 0000000..4aa1150 --- /dev/null +++ b/distribution/osx/gtk-bundle/CMakeLists.txt @@ -0,0 +1,20 @@ +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Info-xtrkcad.plist.in ${CMAKE_CURRENT_BINARY_DIR}/info-xtrkcad.plist @ONLY) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xtrkcad-template.dmg.zip ${CMAKE_CURRENT_BINARY_DIR}/xtrkcad-template-dmg.zip COPYONLY) + +FILE(MAKE_DIRECTORY share) +FILE(MAKE_DIRECTORY bin) + +INSTALL ( +FILES ${CMAKE_CURRENT_BINARY_DIR}/info-xtrkcad.plist +DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help +) +INSTALL ( +FILES ${CMAKE_CURRENT_SOURCE_DIR}/toc.js +DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help/Contents/Resources/en.lproj +) + +ADD_SUBDIRECTORY(XTrackCAD-help) + + + diff --git a/distribution/osx/gtk-bundle/Drag-to-Copy-Arrow.png b/distribution/osx/gtk-bundle/Drag-to-Copy-Arrow.png new file mode 100644 index 0000000..4031d45 Binary files /dev/null and b/distribution/osx/gtk-bundle/Drag-to-Copy-Arrow.png differ diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/CMakeLists.txt b/distribution/osx/gtk-bundle/XTrackCAD-help/CMakeLists.txt new file mode 100644 index 0000000..c25d0e1 --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/CMakeLists.txt @@ -0,0 +1,14 @@ + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Info-xtrkcad-help.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) + +FILE(MAKE_DIRECTORY share) + +INSTALL ( + FILES ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help/Contents +) + +ADD_SUBDIRECTORY(Contents) + + + diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/CMakeLists.txt b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/CMakeLists.txt new file mode 100644 index 0000000..eb44cea --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/CMakeLists.txt @@ -0,0 +1,5 @@ + +ADD_SUBDIRECTORY(Resources) + + + diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/CMakeLists.txt b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/CMakeLists.txt new file mode 100644 index 0000000..275bb02 --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/CMakeLists.txt @@ -0,0 +1,12 @@ + +MAKE_DIRECTORY (${CMAKE_INSTALL_PREFIX}/${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help/shrd) + +INSTALL ( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/icon_16x16.png + DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help/Contents/Resources + ) + +ADD_SUBDIRECTORY(en.lproj) + + + diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/CMakeLists.txt b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/CMakeLists.txt new file mode 100644 index 0000000..4ac56f7 --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/CMakeLists.txt @@ -0,0 +1,10 @@ + + +INSTALL( + + FILES ${CMAKE_CURRENT_SOURCE_DIR}/InfoPlist.strings + DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/XTrackCAD.help/Contents/Resources/en.lproj + ) + + + diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/InfoPlist.strings b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..b024970 --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +"CFBundleName" = "XTrackCAD Help" +"HPDBookTitle" = "XTrackCAD Help" diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/icon_16x16.png b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/icon_16x16.png new file mode 100644 index 0000000..ed29bd5 Binary files /dev/null and b/distribution/osx/gtk-bundle/XTrackCAD-help/Contents/Resources/icon_16x16.png differ diff --git a/distribution/osx/gtk-bundle/XTrackCAD-help/info-xtrkcad-help.plist.in b/distribution/osx/gtk-bundle/XTrackCAD-help/info-xtrkcad-help.plist.in new file mode 100644 index 0000000..4d149d6 --- /dev/null +++ b/distribution/osx/gtk-bundle/XTrackCAD-help/info-xtrkcad-help.plist.in @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en_us + CFBundleIdentifier + org.xtrkcad.help + CFInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundlePackageName + XTrackCAD + CFBundleShortVersionString + @XTRKCAD_VERSION@ + CFBundleVersion + @XTRKCAD_VERSION@ + CFBundleDisplayName + XTrackCAD-Help + HPDBookAccessPath + index.html + HPDBookIconPath + icon_16x16.png + HPDBookIndexPath + XTrackCAD.helpindex + HPDBookKBDProduct + xtrkcad1 + HPDBookTitle + XTrackCAD Help + HPDBookType + 3 + HPDBookTopicListCSSPath + xtrkcad_lin.css + + diff --git a/distribution/osx/gtk-bundle/gtk-bundle.README b/distribution/osx/gtk-bundle/gtk-bundle.README new file mode 100644 index 0000000..139cec7 --- /dev/null +++ b/distribution/osx/gtk-bundle/gtk-bundle.README @@ -0,0 +1,44 @@ +Readme for gtk-bundle directory. +Created 12-1-2016 by Adam Richards + +Date: Dec-2016. + +The gtk-bundle technique replaces prior bundle techniques for OSX. + +Prerequisites: +This directory produces files only for use with the gtk-mac-bundler tool (G-M-B). +That tool is available as a MacPort and should be installed with +"sudo port install gtk-mac-bundler" +The bundler also requires a prior Macports install of GTK +"sudo port install webkit-gtk" +and that was the GTK level was used to build the xtrkcad binary. + +The ccmake process will place a copy of the binary in the /bin build subdirectory +for use by G-M-B. It also copies over the resource share libraries into a subdirectory. + +Process: +Once ccmake has been run "make" followed by "make install", the G-M-B tool is run +pointing at the xtrkcad.bundle file. +"cd /gtk-bundle" +"gtk-mac-bundler xtrkcad-bundle" + +Output: +G-M-B produces an .app bundle that is a self-contained executable +from the binary xtrkcad in gtk-bundle/bin. It recursively rewires all the link pointers to be +self-referential - that is, to point within the bundle. + +It uses the xtrkcad.plist to set properties of the app, including the +icon from the .icns file. It sets the pre-run script to be xtrkcad-launcher.sh + +Next Steps: +Once this xtrkcad.app file has been created, it can be moved to wherever is desirable +- such as the Application folder. The app does not have dependencies on GTK components +from MACPorts like the binary does - it is standalone. + +To produce an installable image from the .app, the disk utility can be used to create +a RW image .dmg that the .app can be copied into. + +NOTE - +It is expected that as long as the GTK level used in build can run on the OSX level used +in build, the app bundle will work without necessarily having to be rebuilt for each OSX +level. \ No newline at end of file diff --git a/distribution/osx/gtk-bundle/info-xtrkcad.plist b/distribution/osx/gtk-bundle/info-xtrkcad.plist new file mode 100644 index 0000000..d9d9bd3 --- /dev/null +++ b/distribution/osx/gtk-bundle/info-xtrkcad.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + XtrkCAD + CFBundleGetInfoString + 4.24a, (C) 1997-2016 The XtrkCAD Team http://www.xtrkcad.org + CFBundleIconFile + xtrkcad-logo.icns + CFBundleIdentifier + org.xtrkcad + CFBundleHelpBookFolder + XTrackCAD.help + CFBundleHelpBookName + XTrackCAD Help + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 4.3.beta1 + CFBundleSignature + ???? + CFBundleVersion + 4.3.beta1 + NSHumanReadableCopyright + Copyright 1997 - 2016 The The XtrkCAD Team, GNU General Public License. + LSMinimumSystemVersion + 10.10 + + diff --git a/distribution/osx/gtk-bundle/info-xtrkcad.plist.in b/distribution/osx/gtk-bundle/info-xtrkcad.plist.in new file mode 100644 index 0000000..94fc56a --- /dev/null +++ b/distribution/osx/gtk-bundle/info-xtrkcad.plist.in @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + XtrkCAD + CFBundleGetInfoString + 4.24a, (C) 1997-2016 The XtrkCAD Team http://www.xtrkcad.org + CFBundleIconFile + xtrkcad-logo.icns + CFBundleIdentifier + org.xtrkcad + CFBundleHelpBookFolder + XTrackCAD.help + CFBundleHelpBookName + XTrackCAD Help + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + @XTRKCAD_VERSION@ + CFBundleSignature + ???? + CFBundleVersion + @XTRKCAD_VERSION@ + NSHumanReadableCopyright + Copyright 1997 - 2016 The The XtrkCAD Team, GNU General Public License. + LSMinimumSystemVersion + 10.10 + + diff --git a/distribution/osx/gtk-bundle/toc.js b/distribution/osx/gtk-bundle/toc.js new file mode 100644 index 0000000..4767236 --- /dev/null +++ b/distribution/osx/gtk-bundle/toc.js @@ -0,0 +1,67 @@ + diff --git a/distribution/osx/gtk-bundle/xtrkcad-bundler.sh b/distribution/osx/gtk-bundle/xtrkcad-bundler.sh new file mode 100755 index 0000000..54928b0 --- /dev/null +++ b/distribution/osx/gtk-bundle/xtrkcad-bundler.sh @@ -0,0 +1,84 @@ +#!/bin/sh -x + +echo "Starting Xtrkcad-bundler" "@0" + +# Script to create Mac DMGs. +# Created 12/1/2016 +# Author Adam Richards + +version="Version" + +while getopts "v:i:h" option; do + case "${option}" in + v) version="${OPTARG}";; + i) installib="${OPTARG}";; + h) usage;; + *) usage;; + esac +done +shift "$((OPTIND-1))" + +usage() { + echo "xtrkcad-bundler -i Cmake_Install_Lib [-v Version]"; + echo " -v Version - will be appended to 'xtrkcad' in the image name"; + echo " -i Cmake_Install_Lib where the binary and share files were placed by Make"; + exit 1; + + } + +if [ -z "${installib}" ]; then + usage; + exit 1; +fi + +#copy in all shares +echo "copying shares from build to share directory" +cp -R "${installib}/share/" "share/" + +#copy in binary +echo "copying binaries from build to bin directory" +cp "${installib}/bin/xtrkcad" "bin" +cp "${installib}/bin/helphelper" "bin" + +echo "executing gtk-mac-bundler" +gtk-mac-bundler xtrkcad.bundle + +#Build dmg using template +echo "making a copy of the tenplate" +rm -f xtrkcad-template.dmg + +unzip -o xtrkcad-template.dmg.zip + +echo "mounting template copy" +rm -rf dmg +mkdir -p dmg + +hdiutil attach xtrkcad-template.dmg -quiet -noautoopen -mountpoint dmg + +#copy in bundle +echo "copying in bundle" +rm -rf "dmg/xtrkcad.app" +cp -R "bin/xtrkcad.app" "dmg/xtrkcad.app" + +#convert dmg to RO +echo "closing image" +#dev_dmg='hdiutil info | grep "dmg" | grep "Apple_HFS"' && \ +hdiutil detach dmg -force +master="xtrkcad-OSX-${version}" +rm -rf "${master}".dmg +echo "making image RO and compressed" +hdiutil convert xtrkcad-template.dmg -format UDZO -imagekey zlib-level=9 -o "${master}" + +# compress the output + +rm -f "${master}".dmg.tar.gz + +tar -cvzf "${master}".dmg.tar.gz "${master}".dmg + +mv -f "${master}".dmg.tar.gz "${installib}"/bin + +rm -rf dmg + +echo "Tarball output image file ${master}.tar.gz is in ${installib}/bin directory" + +exit 0 \ No newline at end of file diff --git a/distribution/osx/gtk-bundle/xtrkcad-launcher.sh b/distribution/osx/gtk-bundle/xtrkcad-launcher.sh new file mode 100755 index 0000000..30988e5 --- /dev/null +++ b/distribution/osx/gtk-bundle/xtrkcad-launcher.sh @@ -0,0 +1,214 @@ +#!/bin/sh -x +# +# Author: Aaron Voisine +# Inkscape Modifications: Michael Wybrow +# XTrackCAD Modifications: Timothy M. Shead + +if test "x$GTK_DEBUG_LAUNCHER" != x; then + set -x +fi + +if test "x$GTK_DEBUG_GDB" != x; then + EXEC="gdb --args" +else + EXEC=exec +fi + +name=`basename "$0"` +tmp="$0" +tmp=`dirname "$tmp"` +tmp=`dirname "$tmp"` +bundle=`dirname "$tmp"` +bundle_contents="$bundle"/Contents +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_bin="$bundle_res"/bin +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +# check X installed +if type -p "X" & > /dev/null; then + echo "XQuartz installed" + else + echo "XQuartz not installed" + osascript -e 'display dialog "XQuartz is not installed, please install it from XQuartz.org" buttons "OK" default button 1 with title "Stop"' + exit 1 +fi + +#XTRKCAD_BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/XTrackCAD//'`" +XTRKCAD_BUNDLE="$bundle" +XTRKCAD_RESOURCES="$XTRKCAD_BUNDLE/Contents/Resources" +XTRKCAD_TEMP="/tmp/xtrkcad/$UID" +XTRKCAD_ETC="$XTRKCAD_TEMP/etc" + +export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" +export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" +export PANGO_LIBDIR="$bundle_lib" +export PANGO_SYSCONFDIR="$bundle_etc" + +export XDG_CONFIG_DIRS="$bundle_etc"/xdg +export XDG_DATA_DIRS="$bundle_data" +export GTK_DATA_PREFIX="$bundle_res" +export GTK_EXE_PREFIX="$bundle_res" +export GTK_PATH="$bundle_res" + +export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" +XTRKCAD_PANGO_RC_FILE="$XTRKCAD_RESOURCES/etc/pango/pangorc" + +I18NDIR="$bundle_data/locale" +# Set the locale-related variables appropriately: +unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE + +# Has a language ordering been set? +# If so, set LC_MESSAGES and LANG accordingly; otherwise skip it. +# First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW. +APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' ` +if test "$APPLELANGUAGES"; then + # A language ordering exists. + # Test, item per item, to see whether there is an corresponding locale. + for L in $APPLELANGUAGES; do + #test for exact matches: + if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then + export LANG=$L + break + fi + #This is a special case, because often the original strings are in US + #English and there is no translation file. + if test "x$L" == "xen_US"; then + export LANG=$L + break + fi + #OK, now test for just the first two letters: + if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then + export LANG=${L:0:2} + break + fi + #Same thing, but checking for any english variant. + if test "x${L:0:2}" == "xen"; then + export LANG=$L + break + fi; + done +fi +unset APPLELANGUAGES L + +# If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists. +APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder` +if test -z ${LANG} -a -n $APPLECOLLATION; then + if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then + export LANG=${APPLECOLLATION:0:2} + fi +fi +if test ! -z $APPLECOLLATION; then + export LC_COLLATE=$APPLECOLLATION +fi +unset APPLECOLLATION + +# Continue by attempting to find the Locale preference. +APPLELOCALE=`defaults read .GlobalPreferences AppleLocale` + +if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then + if test -z $LANG; then + export LANG="${APPLELOCALE:0:5}" + fi + +elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then + export LANG="${APPLELOCALE:0:2}" +fi + +#Next we need to set LC_MESSAGES. If at all possilbe, we want a full +#5-character locale to avoid the "Locale not supported by C library" +#warning from Gtk -- even though Gtk will translate with a +#two-character code. +if test -n $LANG; then +#If the language code matches the applelocale, then that's the message +#locale; otherwise, if it's longer than two characters, then it's +#probably a good message locale and we'll go with it. + if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then + export LC_MESSAGES=$LANG +#Next try if the Applelocale is longer than 2 chars and the language +#bit matches $LANG + elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then + export LC_MESSAGES=${APPLELOCALE:0:5} +#Fail. Get a list of the locales in $PREFIX/share/locale that match +#our two letter language code and pick the first one, special casing +#english to set en_US + elif test $LANG == "en"; then + export LC_MESSAGES="en_US" + else + LOC=`find $PREFIX/share/locale -name $LANG???` + for L in $LOC; do + export LC_MESSAGES=$L + done + fi +else +#All efforts have failed, so default to US english + export LANG="en_US" + export LC_MESSAGES="en_US" +fi +CURRENCY=`echo $APPLELOCALE | sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'` +if test "x$CURRENCY" != "x"; then +#The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to. + if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then + if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then + export LC_MONETARY=$LC_MESSAGES + fi + fi + if test -z "$LC_MONETARY"; then + FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;` + if test -n "$FILES"; then + export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'` + fi + fi +fi +#No currency value means that the AppleLocale governs: +if test -z "$LC_MONETARY"; then + LC_MONETARY=${APPLELOCALE:0:5} +fi +#For Gtk, which only looks at LC_ALL: +export LC_ALL=$LC_MESSAGES + +unset APPLELOCALE FILES LOC + +echo "XTrackCAD: Starting $0" +echo "XTrackCAD: XTRKCAD_BUNDLE: $XTRKCAD_BUNDLE" + +# Setup temporary runtime files +# -rf "$XTRKCAD_TEMP" + +# Because the bundle could be located anywhere at runtime, we have to +# create temporary copies of the Pango configuration files that +# reflect our current location +#mkdir -p "$XTRKCAD_ETC/gtk-2.0" +#sed -e 's|/opt/local|'"$XTRKCAD_RESOURCES|g" "$XTRKCAD_RESOURCES/etc/gtk-2.0/gdk-pixbuf.loaders" > "$XTRKCAD_GDK_PIXBUF_MODULE_FILE" +#sed -e 's|/opt/local|'"$XTRKCAD_RESOURCES|g" "$XTRKCAD_RESOURCES/etc/gtk-2.0/gtk.immodules" > "$XTRKCAD_GTK_IM_MODULE_FILE" +#mkdir -p "$XTRKCAD_ETC/pango" +#sed -e 's|/opt/local/etc|'"$XTRKCAD_ETC|g" "$XTRKCAD_RESOURCES/etc/pango/pangorc" > "$XTRKCAD_ETC/pango/pangorc" +#sed -e 's|/opt/local|\"'"$XTRKCAD_RESOURCES|g" -e "s/\.so/.so\"/g" "$XTRKCAD_RESOURCES/etc/pango/pango.modules" > "$XTRKCAD_ETC/pango/pango.modules" + +#export "DYLD_LIBRARY_PATH=$XTRKCAD_RESOURCES/lib" +#export "FONTCONFIG_PATH=$XTRKCAD_RESOURCES/etc/fonts" +#export "GDK_PIXBUF_MODULE_FILE=$XTRKCAD_GDK_PIXBUF_MODULE_FILE" +#export "GTK_IM_MODULE_FILE=$XTRKCAD_GTK_IM_MODULE_FILE" +export "PANGO_RC_FILE=$XTRKCAD_PANGO_RC_FILE" +export "PATH=$XTRKCAD_RESOURCES/bin:$PATH" +export "XTRKCADLIB=$XTRKCAD_RESOURCES/xtrkcad" + +#export +#exec "$XTRKCAD_BUNDLE/Contents/MacOS/XtrkCAD-bin" + +# Extra arguments can be added in environment.sh. +EXTRA_ARGS= +if test -f "$bundle_res/environment.sh"; then + source "$bundle_res/environment.sh" +fi + +# Strip out the argument added by the OS. +if /bin/expr "x$1" : '^x-psn_' > /dev/null; then + shift 1 +fi + +$EXEC "$XTRKCAD_BUNDLE/Contents/MacOS/XtrkCAD-bin" "$@" + +echo "XTrackCAD: Finishing $0" + diff --git a/distribution/osx/gtk-bundle/xtrkcad-logo.icns b/distribution/osx/gtk-bundle/xtrkcad-logo.icns new file mode 100644 index 0000000..23213e1 Binary files /dev/null and b/distribution/osx/gtk-bundle/xtrkcad-logo.icns differ diff --git a/distribution/osx/gtk-bundle/xtrkcad-template.dmg.zip b/distribution/osx/gtk-bundle/xtrkcad-template.dmg.zip new file mode 100644 index 0000000..bb6972a Binary files /dev/null and b/distribution/osx/gtk-bundle/xtrkcad-template.dmg.zip differ diff --git a/distribution/osx/gtk-bundle/xtrkcad.bundle b/distribution/osx/gtk-bundle/xtrkcad.bundle new file mode 100644 index 0000000..2259ea2 --- /dev/null +++ b/distribution/osx/gtk-bundle/xtrkcad.bundle @@ -0,0 +1,132 @@ + + + + + + /opt/local + + + + ${project}/bin + + + + + + + + + + ${project}/xtrkcad-launcher.sh + + + + + + gtk+-2.0 + + + + ${project}/info-xtrkcad.plist + + ${project}/bin/xtrkcad + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so + + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so + + + + + ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so + + + + + + + + + + + + + ${prefix}/share/glib-2.0/schemas + + + ${prefix}/etc/xdg + + + + + + + ${project}/share/xtrkcad + + + + + + ${project}/xtrkcad-logo.icns + + + + ${project}/bin/helphelper + + + + ${project}/share/xtrkcad/XTrackCAD.help + + + diff --git a/distribution/posix/CMakeLists.txt b/distribution/posix/CMakeLists.txt index 8263645..7a0ee50 100644 --- a/distribution/posix/CMakeLists.txt +++ b/distribution/posix/CMakeLists.txt @@ -25,6 +25,8 @@ SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/locale/*" "/usr/local/share/locale" "/usr/local/share/locale/*" + "/usr/share/applications" + "/usr/share/pixmaps" ) SET(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}////changelog.txt") diff --git a/distribution/posix/xtrkcad.spec b/distribution/posix/xtrkcad.spec index 0d78736..f94976a 100644 --- a/distribution/posix/xtrkcad.spec +++ b/distribution/posix/xtrkcad.spec @@ -1,7 +1,7 @@ Summary: XTrkCad Name: xtrkcad -Version: 4.2.3 -Release: 1%{?dist} +Version: 4.2.4a +Release: 4%{?dist} License: GPL Group: Applications/Engineering Vendor: XTrkCad Fork Project -- cgit v1.2.3