X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2FLyX-Mac-binary-release.sh;h=80c1d7e786e5758f16dca4b88c728033f9586145;hb=29265ce702070f9d9486aca35856446f3a690d1b;hp=9f13ce1b3359feea60f02481af2cf83360ec6ac7;hpb=5a3c9247d8d1de1f5f27b63539d80e8871d56f36;p=lyx.git diff --git a/development/LyX-Mac-binary-release.sh b/development/LyX-Mac-binary-release.sh index 9f13ce1b33..80c1d7e786 100644 --- a/development/LyX-Mac-binary-release.sh +++ b/development/LyX-Mac-binary-release.sh @@ -21,7 +21,7 @@ ASpellVersion=${ASpellVersion:-"0.60.6.1"} ASpellSource="aspell-${ASpellVersion}" ASpellLibrary="libaspell.15.dylib" -HunSpellVersion=${HunSpellVersion:-"1.3.2"} +HunSpellVersion=${HunSpellVersion:-"1.3.3"} HunSpellSource="hunspell-${HunSpellVersion}" HunSpellLibrary="libhunspell-1.3.0.dylib" @@ -35,7 +35,7 @@ unset DYLD_LIBRARY_PATH LD_LIBRARY_PATH # the aspell sources placed in a sibling directory (variable ASpellSource) # * for hunspell support: # the hunspell sources placed in a sibling directory (variable HunSpellSource) -# * for dictionary deployment (per default thesauri only): +# * for dictionary deployment (only hunspell dicts and mythes thesauri are deployed per default): # - aspell: the dictionary files of macports (in /opt/local/share/aspell and /opt/local/lib/aspell-0.60) # - hunspell: the dictionary files in the sibling directory dictionaries/dicts # - mythes: the data and idx files in the sibling directory dictionaries/thes @@ -55,6 +55,9 @@ case "${QtVersion}:${QtAPI}" in QtConfigureOptions="${QtConfigureOptions} -fast -no-exceptions" QtConfigureOptions="${QtConfigureOptions} -no-webkit -no-qt3support -no-javascript-jit -no-dbus" QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools" + for arch in ${ARCH_LIST} ; do + QTARCHS="${QTARCHS} -arch ${arch}" + done ;; 5.0*) QtConfigureOptions="${QtConfigureOptions} -fast -no-strip" @@ -62,12 +65,23 @@ case "${QtVersion}:${QtAPI}" in QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools" QtMajorVersion=qt5 ;; +5.6*|5.7*) + QtConfigureOptions="${QtConfigureOptions} -no-strip" + QtConfigureOptions="${QtConfigureOptions} -no-kms -no-pkg-config" + QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake tools" + QtConfigureOptions="${QtConfigureOptions} -skip qtconnectivity -skip qtscript" + QtConfigureOptions="${QtConfigureOptions} -skip qtquickcontrols" + QtConfigureOptions="${QtConfigureOptions} -skip qttools" + QtConfigureOptions="${QtConfigureOptions} -skip qtdeclarative" + QtMajorVersion=qt5 + ;; 5.*) QtConfigureOptions="${QtConfigureOptions} -no-strip" QtConfigureOptions="${QtConfigureOptions} -no-kms -no-pkg-config" QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake tools" QtConfigureOptions="${QtConfigureOptions} -skip qtquick1 -skip qtwebkit -skip qtconnectivity -skip qtscript" - QtConfigureOptions="${QtConfigureOptions} -skip qtquickcontrols -skip qtdeclarative" + QtConfigureOptions="${QtConfigureOptions} -skip qtquickcontrols" +# QtConfigureOptions="${QtConfigureOptions} -skip qtdeclarative" QtMajorVersion=qt5 ;; *) @@ -75,6 +89,9 @@ case "${QtVersion}:${QtAPI}" in QtConfigureOptions="${QtConfigureOptions} -no-webkit -no-qt3support -no-javascript-jit -no-dbus" QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools" QtConfigureOptions="${QtConfigureOptions} ${QtAPI}" + for arch in ${ARCH_LIST} ; do + QTARCHS="${QTARCHS} -arch ${arch}" + done ;; esac @@ -89,11 +106,11 @@ thesaurus_deployment="yes" qt_deployment="yes" # auto detect Xcode location -if [ -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then - DEVELOPER_SDKS="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" - XCODE_DEVELOPER="/Applications/Xcode.app/Contents/Developer" +DEVELOPER_SDKS=$(dirname $(xcrun --show-sdk-path)) +if [ -n "${DEVELOPER_SDKS}" ]; then + XCODE_DEVELOPER=$(dirname $(dirname $(xcrun --show-sdk-platform-path))) MACOSX_DEPLOYMENT_TARGET="10.7" # Lion support is default - SDKROOT="${DEVELOPER_SDKS}/MacOSX10.7.sdk" # Lion build is default + SDKROOT="${DEVELOPER_SDKS}/MacOSX$(xcrun --show-sdk-version).sdk" # use default SDK elif [ -d "/Developer/SDKs" ]; then DEVELOPER_SDKS="/Developer/SDKs" XCODE_DEVELOPER="/Developer" @@ -185,11 +202,12 @@ while [ $# -gt 0 ]; do export OBJC=gcc-4.0 export CXX=g++-4.0 ;; - 10.5|10.6|10.7|10.8|10.9|10.10) - SDKROOT="${DEVELOPER_SDKS}/MacOSX${SDKROOT}.sdk" - ;; *) - usage + SDKROOT="${DEVELOPER_SDKS}/MacOSX${SDKROOT}.sdk" + if [ ! -d "${SDKROOT}" ]; then + echo Invalid SDKROOT given: "${SDKROOT}" + usage --help=short + fi ;; esac shift @@ -250,10 +268,19 @@ while [ $# -gt 0 ]; do hunspell_deployment="no" shift ;; + --only-qt*=*) + QtOnlyPackage=$(echo ${1}|cut -d= -f2) + shift + ;; --only-package=*) LyxOnlyPackage=$(echo ${1}|cut -d= -f2) shift ;; + --enable-cxx11) + LyXConfigureOptions="${LyXConfigureOptions} ${1}" + EnableCXX11="--enable-cxx11" + shift + ;; --*) LyXConfigureOptions="${LyXConfigureOptions} ${1}" shift @@ -328,12 +355,8 @@ case "${QtVersion}" in QtLibraries="QtSvg QtXml QtPrintSupport QtWidgets QtGui QtNetwork QtConcurrent QtCore" QtFrameworkVersion="5" ;; -5.2.*|5.3.*|5.4.*) - QtLibraries="QtSvg QtXml QtPrintSupport QtMacExtras QtWidgets QtGui QtNetwork QtConcurrent QtCore" - QtFrameworkVersion="5" - ;; 5*) - QtLibraries="QtSvg QtXml QtPrintSupport QtDBus QtMacExtras QtWidgets QtGui QtNetwork QtConcurrent QtCore" + QtLibraries="QtSvg QtXml QtPrintSupport QtMacExtras QtWidgets QtGui QtNetwork QtConcurrent QtCore" QtFrameworkVersion="5" ;; *) @@ -371,8 +394,9 @@ case $SDKs in ;; esac MYCFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" +MYLDFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" -if [ "${configure_qt_frameworks}" != "yes" -a -d "${QtSourceDir}" -a ! \( -d "${QtBuildDir}" -a -d "${QtInstallDir}" \) ]; then +build_qt() { echo Build Qt library ${QtSourceDir} if [ "${QtInstallDir}" = "${QtBuildDir}" ]; then echo Bad install directory for Qt. @@ -381,25 +405,34 @@ if [ "${configure_qt_frameworks}" != "yes" -a -d "${QtSourceDir}" -a ! \( -d "${ fi ( mkdir -p "${QtBuildDir}" && cd "${QtBuildDir}" - for arch in ${ARCH_LIST} ; do - ARCHS="${ARCHS} -arch ${arch}" - done echo configure options: - echo ${QtConfigureOptions} ${ARCHS} -prefix "${QtInstallDir}" - "${QtSourceDir}"/configure ${QtConfigureOptions} ${ARCHS} -prefix "${QtInstallDir}" + echo ${QtConfigureOptions} ${QTARCHS} -prefix "${QtInstallDir}" + "${QtSourceDir}"/configure ${QtConfigureOptions} ${QTARCHS} -prefix "${QtInstallDir}" make -j1 && make -j1 install ) -fi -if [ -d "${QtInstallDir}" -a ! -f "${QtInstallDir}"/include/QtCore ]; then - cd "${QtInstallDir}" && ( - mkdir -p include - cd include - for libnm in ${QtLibraries} ; do - test -d ${libnm} -o -L ${libnm} || \ - ( ln -s ../lib/${libnm}.framework/Headers ${libnm} && echo Link to framework ${libnm} ) - done - ) -fi + if [ -d "${QtInstallDir}" -a ! -f "${QtInstallDir}"/include/QtCore ]; then + cd "${QtInstallDir}" && ( + mkdir -p include + cd include + for libnm in ${QtLibraries} ; do + test -d ${libnm} -o -L ${libnm} || \ + ( ln -s ../lib/${libnm}.framework/Headers ${libnm} && echo Link to framework ${libnm} ) + done + ) + fi +} + +case ${QtOnlyPackage:-"no"} in +y*) + build_qt + exit 0 + ;; +*) + if [ "${configure_qt_frameworks}" != "yes" -a -d "${QtSourceDir}" -a ! \( -d "${QtBuildDir}" -a -d "${QtInstallDir}" \) ]; then + build_qt + fi + ;; +esac if [ -d "${LibMagicSourceDir}" -a ! -f "${LibMagicInstallHdr}" ]; then # we have a private libmagic (file(1)) source tree at hand... @@ -424,7 +457,7 @@ if [ -d "${LibMagicSourceDir}" -a ! -f "${LibMagicInstallHdr}" ]; then for arch in ${ARCH_LIST} ; do CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS - LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS + LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYLDFLAGS}"; export LDFLAGS "${LibMagicSourceDir}/configure"\ --prefix="${LibMagicInstallDir}"\ ${LibMagicConfigureOptions} @@ -486,7 +519,7 @@ if [ -d "${HunSpellSourceDir}" -a ! -f "${HunSpellInstallHdr}" ]; then for arch in ${ARCH_LIST} ; do make distclean CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS - LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS + LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYLDFLAGS}"; export LDFLAGS "${HunSpellSourceDir}/configure"\ --prefix="${HunSpellInstallDir}"\ ${HunspellConfigureOptions} @@ -549,7 +582,7 @@ if [ -d "${ASpellSourceDir}" -a ! -f "${ASpellInstallHdr}" -a "yes" = "${aspell_ for arch in ${ARCH_LIST} ; do make distclean CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS - LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS + LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYLDFLAGS}"; export LDFLAGS CXXFLAGS=-g "${ASpellSourceDir}/configure"\ --prefix="${ASpellInstallDir}"\ ${AspellConfigureOptions} @@ -590,7 +623,7 @@ framework_name() { echo "Frameworks/${1}.framework" } -LYX_FILE_LIST="lyx lyxclient tex2lyx" +LYX_FILE_LIST="lyx lyxclient tex2lyx lyxconvert" BUNDLE_PATH="Contents/MacOS" LYX_BUNDLE_PATH="${LyxAppPrefix}/${BUNDLE_PATH}" build_lyx() { @@ -598,6 +631,14 @@ build_lyx() { if [ -n "${LyxAppZip}" -a -f "${LyxAppZip}" ]; then rm "${LyxAppZip}"; fi if [ -d "${LyxAppPrefix}" ]; then rm -rf "${LyxAppPrefix}"; fi + case "${EnableCXX11}" in + "--enable-cxx11") + export CC=cc + export CXX="c++ -stdlib=libc++" + export CXXFLAGS=-std=c++11 + ;; + esac + # ------------------------------------- # Automate configure check # ------------------------------------- @@ -637,7 +678,7 @@ build_lyx() { mkdir -p "${LyxBuildDir}" && cd "${LyxBuildDir}" CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}" - LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}" + LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYLDFLAGS}" if [ "$configure_qt_frameworks" = "yes" ]; then export QT_CORE_CFLAGS="-FQtCore" @@ -664,7 +705,7 @@ build_lyx() { mv "${LYX_BUNDLE_PATH}/${file}"\ "${LYX_BUNDLE_PATH}/${file}-${arch}" else - echo ERROR: Cannot build and install LyX for ${arch}. + echo ERROR: Cannot build and install ${file} for ${arch}. exit 1 fi done @@ -680,7 +721,7 @@ content_directory() { installname() { echo install_name_tool "$@" - install_name_tool "$@" + install_name_tool "$@" || exit 1 } private_framework() { @@ -727,6 +768,7 @@ EOF test -d "${condir}/${fwdir}" || ( echo Copy framework "${source}/lib/"$(basename "${fwdir}") cp -pR "${source}/lib/"$(basename "${fwdir}") "${condir}/${fwdir}" + rm -f "${condir}/${fwdir}/${version}${libnm}"_debug installname -id "@executable_path/../${fwdir}/${version}${libnm}" "${condir}/${fwdir}/${version}${libnm}" find "${condir}/PlugIns" "${condir}/"$(dirname "${fwdir}") -name Headers -prune -o -type f -print | while read filename ; do if [ "${filename}" != "${target}" ]; then @@ -734,7 +776,7 @@ EOF # pattern match for: /path/to/qt/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.6.0, current version 4.6.2) case "${library}" in *@rpath/*"${libnm}"*"("*version*")"*) - echo rpath based name for ${libnm} is ok. + # echo rpath based name for ${libnm} is ok. ;; *"${libnm}"*"("*version*")"*) installname -change\ @@ -752,11 +794,13 @@ EOF "@executable_path/../${fwdir}/${version}${libnm}"\ "${target}" done - if [ ! -d "${condir}/translations" ]; then - mkdir -p "${condir}/translations" + if [ -d "${source}"/translations ]; then + if [ ! -d "${condir}/translations" ]; then + mkdir -p "${condir}/translations" + fi + echo Copy Qt translations to "${condir}/translations" + cp -p "${source}"/translations/qt_*.qm "${condir}/translations" fi - echo Copy Qt translations to "${condir}/translations" - cp -p "${source}"/translations/qt_*.qm "${condir}/translations" } # ------------------------- @@ -900,28 +944,27 @@ make_dmg() { test -d /Volumes/"${LyxBase}" && rmdir /Volumes/"${LyxBase}" # Mount the disk image - hdiutil attach "${DMGNAME}.sparseimage" + DEVICES=$(hdiutil attach "${DMGNAME}.sparseimage" | cut -f 1) # Obtain device information - DEVS=$(hdiutil attach "${DMGNAME}.sparseimage" | cut -f 1) - DEV=$(echo $DEVS | cut -f 1 -d ' ') - VOLUME=$(mount |grep ${DEV} | cut -f 3 -d ' ') + DEVICE=$(echo $DEVICES | cut -f 1 -d ' ') + VOLUME=$(mount |grep ${DEVICE} | cut -f 3 -d ' ') # copy in the application bundle - cp -Rp "${LyxAppDir}.app" "${VOLUME}/${LyxName}.app" + ditto --hfsCompression "${LyxAppDir}.app" "${VOLUME}/${LyxName}.app" # copy in background image mkdir -p "${VOLUME}/Pictures" - cp "${DmgBackground}" "${VOLUME}/Pictures/background.png" + ditto --hfsCompression "${DmgBackground}" "${VOLUME}/Pictures/background.png" # symlink applications ln -s /Applications/ "${VOLUME}"/Applications - test -d "${DocumentationDir}" && cp -r "${DocumentationDir}" "${VOLUME}" + test -d "${DocumentationDir}" && ditto --hfsCompression "${DocumentationDir}" "${VOLUME}" set_bundle_display_options "${VOLUME}" ${BG_W} ${BG_H} ${XCODE_DEVELOPER}/Tools/SetFile -a C "${VOLUME}" mv "${VOLUME}/Pictures" "${VOLUME}/.Pictures" # Unmount the disk image - hdiutil detach ${DEV} + hdiutil detach ${DEVICE} # Convert the disk image to read-only hdiutil convert "${DMGNAME}.sparseimage" -format UDBZ -o "${DMGNAME}.dmg"