]> git.lyx.org Git - lyx.git/blobdiff - development/LyX-Mac-binary-release.sh
uk.po: translations for 2.1 from Yuri
[lyx.git] / development / LyX-Mac-binary-release.sh
index 0468dbe65497d1d4e789d10dd4f0671da752abbd..53ee0eba94129582ed0f734d375f2c96f503350d 100644 (file)
@@ -44,14 +44,24 @@ LyXConfigureOptions="--enable-warnings --enable-optimization=-Os --with-x=no"
 LyXConfigureOptions="${LyXConfigureOptions} --disable-stdlib-debug"
 AspellConfigureOptions="--enable-warnings --enable-optimization=-O0 --enable-debug --disable-nls --enable-compile-in-filters --disable-pspell-compatibility"
 HunspellConfigureOptions="--with-warnings --disable-nls --disable-static"
-Qt4ConfigureOptions="${Qt4ConfigureOptions} -opensource -silent -shared -fast -no-exceptions"
+Qt4ConfigureOptions="${QtConfigureOptions} -opensource -silent -shared -fast -no-exceptions"
 Qt4ConfigureOptions="${Qt4ConfigureOptions} -no-webkit -no-qt3support -no-javascript-jit -no-dbus"
 Qt4ConfigureOptions="${Qt4ConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools"
+Qt4DmgSuffix=qt4${Qt4API}.dmg
 
 # stupid special case...
 case "${Qt4Version}:${Qt4API}" in
 4.6*:-carbon)
        ;;
+5.0*)
+       Qt4ConfigureOptions="${QtConfigureOptions} -opensource -silent -shared -fast -no-strip"
+       Qt4ConfigureOptions="${Qt4ConfigureOptions} -no-javascript-jit -no-pkg-config"
+       Qt4ConfigureOptions="${Qt4ConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools"
+       Qt4DmgSuffix=qt5${Qt4API}.dmg
+       ;;
+5.*)
+       Qt4DmgSuffix=qt5${Qt4API}.dmg
+       ;;
 *)
        Qt4ConfigureOptions="${Qt4ConfigureOptions} ${Qt4API}"
        ;;
@@ -60,7 +70,7 @@ esac
 aspell_dictionaries="no"
 hunspell_dictionaries="yes"
 
-gettext_deployment="yes"
+gettext_deployment="no"
 aspell_deployment="yes"
 hunspell_deployment="yes"
 thesaurus_deployment="yes"
@@ -125,6 +135,12 @@ usage() {
        exit 0
 }
 
+NCPU=$(sysctl -n hw.ncpu)
+NCPU=$((NCPU / 2))
+if [ $NCPU -gt 1 ]; then
+       MAKEJOBS=-j${NCPU}
+fi
+
 while [ $# -gt 0 ]; do
        case "${1}" in
        --with-qt4-frameworks=*)
@@ -226,7 +242,6 @@ done
 if [ "${configure_qt4_frameworks}" != "yes" ]; then
        QtInstallDir=${QTDIR:-"/opt/qt4"}
 fi
-QtFrameworkVersion="4"
 
 ARCH_LIST=${ARCH_LIST:-"ppc i386"}
 
@@ -277,7 +292,20 @@ LyxAppPrefix="${LyxAppDir}.app"
 # ---------------------------------
 
 # don't change order here...
-QtLibraries="QtSvg QtXml QtGui QtNetwork QtCore"
+case "${Qt4Version}" in
+5.0.*|5.1.*)
+       QtLibraries="QtSvg QtXml QtPrintSupport QtWidgets QtGui QtNetwork QtConcurrent QtCore"
+       QtFrameworkVersion="5"
+       ;;
+5*)
+       QtLibraries="QtSvg QtXml QtPrintSupport QtMacExtras QtWidgets QtGui QtNetwork QtConcurrent QtCore"
+       QtFrameworkVersion="5"
+       ;;
+*)
+       QtLibraries="QtSvg QtXml QtGui QtNetwork QtCore"
+       QtFrameworkVersion="4"
+       ;;
+esac
 
 DMGNAME="${LyxBase}"
 DMGSIZE="550m"
@@ -309,6 +337,9 @@ case $SDKs in
 esac
 MYCFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
 
+# pkg-config is not usable with this script
+export PKG_CONFIG=""
+
 # These variables define the identifiers of the
 # system (both Intel and PowerPC) to compile for.
 # (Note: darwin8 is 10.4; darwin9 is 10.5.)
@@ -332,7 +363,7 @@ if [ "${configure_qt4_frameworks}" != "yes" -a -d "${Qt4SourceDir}" -a ! \( -d "
                echo configure options:
                echo ${Qt4ConfigureOptions} ${ARCHS} -prefix "${QtInstallDir}"
                echo yes | "${Qt4SourceDir}"/configure ${Qt4ConfigureOptions} ${ARCHS} -prefix "${QtInstallDir}"
-               make && make install
+               make ${MAKEJOBS} && make install
        )
        cd "${QtInstallDir}" && (
                mkdir -p include
@@ -588,7 +619,6 @@ build_lyx() {
                        export QT4_CORE_LIBS="-framework QtCore"
                        export QT4_FRONTEND_CFLAGS="-FQtGui"
                        export QT4_FRONTEND_LIBS="-framework QtGui"
-                       export PKG_CONFIG=""
                        CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtCore.framework/Headers"
                        CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtGui.framework/Headers"
                fi
@@ -603,7 +633,7 @@ build_lyx() {
                        ${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} \
                        ${LyXConfigureOptions}\
                        --enable-build-type=rel && \
-               make -j2 && make install${strip}
+               make ${MAKEJOBS} && make install${strip}
                for file in ${LYX_FILE_LIST} ; do
                        if [ -f "${LYX_BUNDLE_PATH}/${file}" ]; then
                                mv "${LYX_BUNDLE_PATH}/${file}"\
@@ -652,7 +682,7 @@ Translations = translations
 EOF
        if [ ! -d "${condir}/PlugIns" ]; then
                mkdir -p "${condir}/PlugIns"
-               find "${source}/plugins" -name \*.dylib -print | while read libname ; do
+               find "${source}/plugins" -name \*.dylib -print | grep -v _debug.dylib | while read libname ; do
                        echo Copy plugin "${libname}"
                        dylib=$(basename "${libname}")
                        dirname=$(dirname "${libname}")
@@ -773,6 +803,7 @@ set_bundle_display_options() {
        LYX_Y_POSITION=$Y_POSITION
        APP_X_POSITION=$((3 * X_BOUNDS / 4))
        APP_Y_POSITION=$Y_POSITION
+       WITH_DOCUMENTS=$(test -d "${1}/Documents" && echo true || echo false)
        osascript <<-EOF
        tell application "Finder"
         set f to POSIX file ("${1}" as string) as alias
@@ -788,11 +819,13 @@ set_bundle_display_options() {
             delay 1 -- sync
             set icon size of the icon view options of container window to 64
             set arrangement of the icon view options of container window to not arranged
-            set position of item "Documents" to {$LYX_X_POSITION,0}
+            if ${WITH_DOCUMENTS} then
+               set position of item "Documents" to {$LYX_X_POSITION,0}
+            end if
             set position of item "${LyxName}.app" to {$LYX_X_POSITION,$LYX_Y_POSITION}
             set position of item "Applications" to {$APP_X_POSITION,$APP_Y_POSITION}
             set background picture of the icon view options\
-                                       of container window to file "background.png" of folder "Pictures"
+               of container window to file "background.png" of folder "Pictures"
             set the bounds of the container window to {0, 0, $X_BOUNDS, $Y_BOUNDS}
             update without registering applications
             delay 5 -- sync
@@ -857,9 +890,9 @@ build_package() {
        test -n "${DMGLocation}" && (
                make_dmg "${DMGLocation}"
                if [ -d "${QtInstallDir}/lib/QtCore.framework/Versions/${QtFrameworkVersion}" -a "yes" = "${qt4_deployment}" ]; then
-                       rm -f "${DMGLocation}/${DMGNAME}+qt4.dmg"
-                       echo move to "${DMGLocation}/${DMGNAME}+qt4${Qt4API}.dmg"
-                       mv "${DMGLocation}/${DMGNAME}.dmg" "${DMGLocation}/${DMGNAME}+qt4${Qt4API}.dmg"
+                       rm -f "${DMGLocation}/${DMGNAME}+${Qt4DmgSuffix}"
+                       echo move to "${DMGLocation}/${DMGNAME}+${Qt4DmgSuffix}"
+                       mv "${DMGLocation}/${DMGNAME}.dmg" "${DMGLocation}/${DMGNAME}+${Qt4DmgSuffix}"
                fi
        )
 }