X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2FLyX-Mac-binary-release.sh;h=075677b37e3e91d84899b5a086787df886b81b17;hb=fc23deacd9da5c9720ca61827a18f796a8622eed;hp=05cb757db577a80b6dc6a2cda85503292f40b5c3;hpb=95e600cc1601399002cc798c7db97955f4240edd;p=lyx.git diff --git a/development/LyX-Mac-binary-release.sh b/development/LyX-Mac-binary-release.sh index 05cb757db5..075677b37e 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" @@ -65,12 +65,14 @@ case "${QtVersion}:${QtAPI}" in QtConfigureOptions="${QtConfigureOptions} -nomake examples -nomake demos -nomake docs -nomake tools" QtMajorVersion=qt5 ;; -5.6*) +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 -skip qtdeclarative" + QtConfigureOptions="${QtConfigureOptions} -skip qtquickcontrols" + QtConfigureOptions="${QtConfigureOptions} -skip qttools" + QtConfigureOptions="${QtConfigureOptions} -skip qtdeclarative" QtMajorVersion=qt5 ;; 5.*) @@ -104,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" @@ -200,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 @@ -265,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 @@ -343,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" ;; *) @@ -387,7 +395,7 @@ case $SDKs in esac MYCFLAGS="-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. @@ -401,17 +409,29 @@ if [ "${configure_qt_frameworks}" != "yes" -a -d "${QtSourceDir}" -a ! \( -d "${ "${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... @@ -602,7 +622,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() { @@ -610,6 +630,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 # ------------------------------------- @@ -676,7 +704,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 @@ -739,6 +767,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 @@ -764,11 +793,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" } # ------------------------- @@ -912,28 +943,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"