Skip to content
Permalink
Browse files

Version fix, bundling fixes and other fixes.

Fixed version generation for about window and file name.

Fixed libraries bundling and loading.

Fixed Psi configuration to use qtwebengine. Configuration parameter
changed from --enable-webkit to --enable-webengine.
  • Loading branch information...
pztrn committed Jun 15, 2017
1 parent 563277f commit 4d9e0428b73d549eb79e7cc914d93d2cbf223b94
@@ -82,4 +82,21 @@ as normal user!"
export MACOSX_DEPLOYMENT_TARGET=10.9
export QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9
export QMAKESPEC="macx-clang"

# Libraries path.
export DYLD_LIBRARY_PATH="${DEPS_ROOT}/lib:${DYLD_LIBRARY_PATH}"

# Type of source. Can be "snapshot" or "git"
SOURCE_TYPE=""

# Build from snapshot sources of Psi, or from git?
if [ ${BUILD_FROM_SNAPSHOT} -eq 1 ]; then
SOURCE_TYPE="snapshot"
PSI_SOURCE_DIR="${PSI_DIR}/psi/snapshot"
else
SOURCE_TYPE="git"
PSI_SOURCE_DIR="${PSI_DIR}/psi/git"
fi

log "Psi sources directory: '${PSI_SOURCE_DIR}'"
}
@@ -21,8 +21,8 @@ function compile_sources()
# to ./configure later (including CONF_OPTS).
log "Creating configure parameters..."
local configure_opts="${CONF_OPTS} --disable-sparkle --with-idn-inc=${DEPS_ROOT}/include/ --with-idn-lib=${DEPS_ROOT}/lib --with-qca-inc=${DEPS_ROOT}/lib/qca-qt5.framework/Versions/Current/Headers --with-qca-lib=${DEPS_ROOT}/lib --with-qjdns-inc=${DEPS_ROOT}/include/ --with-qjdns-lib=${DEPS_ROOT}/lib --with-zlib-inc=${DEPS_ROOT}/include/ --with-zlib-lib=${DEPS_ROOT}/lib --with-growl=${DEPS_ROOT}/lib/"
if [ ${ENABLE_WEBKIT} -eq 1 ]; then
local configure_opts="${configure_opts} --enable-webkit"
if [ ${ENABLE_WEBENGINE} -eq 1 ]; then
local configure_opts="${configure_opts} --with-webkit=QtWebEngine"
fi

log "Configuring Psi+"
@@ -80,14 +80,14 @@ function copy_libraries()

install_name_tool -change "${DEPS_ROOT}/lib/libz.1.dylib" "@executable_path/../Frameworks/libz.dylib" "${PSIAPP_DIR}/Contents/Frameworks/libz.dylib"

# In case of fire.
install_name_tool -change "/usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib" "@executable_path/../Frameworks/libgpg-error.dylib" "${PSIAPP_DIR}/Contents/Frameworks/libgcrypt.dylib"

# OTR.
cp -f "${DEPS_ROOT}/lib/libgpg-error.dylib" "${PSIAPP_DIR}/Contents/Frameworks/"
cp -f "${DEPS_ROOT}/lib/libgcrypt.dylib" "${PSIAPP_DIR}/Contents/Frameworks/"
cp -f "${DEPS_ROOT}/lib/libotr.dylib" "${PSIAPP_DIR}/Contents/Frameworks/"

# In case of fire.
install_name_tool -change "/usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib" "@executable_path/../Frameworks/libgpg-error.dylib" "${PSIAPP_DIR}/Contents/Frameworks/libgcrypt.dylib"

install_name_tool -id "@executable_path/../Frameworks/libgpg-error.dylib" "${PSIAPP_DIR}/Contents/Frameworks/libgpg-error.dylib"

install_name_tool -id "@executable_path/../Frameworks/libgcrypt.dylib" "${PSIAPP_DIR}/Contents/Frameworks/libgcrypt.dylib"
@@ -18,12 +18,6 @@ function create_directories()
mkdir -p "${DEPS_ROOT}" || die "Can't create work directory ${DEPS_ROOT}!"
fi

# Directory for build process.
if [ -d "${PSI_DIR}/build" ]; then
log "Build directory exists, removing..."
rm -rf "${PSI_DIR}/build"
fi

log "Creating build directory: '${PSI_DIR}/build'"
mkdir -p "${PSI_DIR}/build"

@@ -42,4 +36,10 @@ function create_directories()
mkdir -p "${PSIBUILD_LOGS_PATH}/deps"
mkdir -p "${PSIBUILD_LOGS_PATH}/plugins"

# Psi sources
if [ ! -d "${PSI_DIR}/psi" ]; then
log "Creating directory for Psi sources..."
mkdir -p "${PSI_DIR}/psi"
obtain_sources
fi
}
@@ -0,0 +1,36 @@
#####################################################################
# This function will create version string for about window and
# DMG file.
#####################################################################

function create_version_string() {
# Create version string.
log "Creating version string for about dialog..."
# Snapshotted thing already have everything for version string.
PSI_BUILD=`cd "${PSI_SOURCE_DIR}/admin" && ./git_revnumber.sh`
PSI_REVISION=`cd "${PSI_SOURCE_DIR}" && git rev-parse --short HEAD`
PSI_PLUS_REVISION=`cd "${PSI_DIR}/plus" && git rev-parse --short HEAD`
VERSION_STRING_RAW="${PSI_VERSION}.${PSI_BUILD}"

VERSION_STRING="${VERSION_STRING_RAW} ($(date +"%Y-%m-%d"), Psi:${PSI_REVISION}, Psi+:${PSI_PLUS_REVISION}"
if [ "${ENABLE_WEBENGINE}" -eq "1" ]; then
VERSION_STRING="${VERSION_STRING}, webengine)"
else
VERSION_STRING="${VERSION_STRING})"
fi

# Add qt5 note to VERSION_STRING_RAW as we support only it on macs.
# Should be removed at version 2.0 :).
# Also add note about webengine usage.
if [ "${ENABLE_WEBENGINE}" -eq "1" ]; then
VERSION_STRING_RAW="${VERSION_STRING_RAW}-qt5-webengine"
else
VERSION_STRING_RAW="${VERSION_STRING_RAW}-qt5"
fi

log "Version string: ${VERSION_STRING}"
log "Raw version string (will be used e.g. in filename): ${VERSION_STRING_RAW}"

# Just a build date.
BUILD_DATE=`date +'%Y-%m-%d'`
}
@@ -11,7 +11,7 @@ function make_bundle() {
# Compose filename for DMG file.
# Version string for usage in filename should contain webkit flag.
# This how resulted DMG will be named.
DMG_FILENAME="psi-plus-${VERSION_STRING_RAW}-qt${QT_VERSION_MAJOR}-${SOURCE_TYPE}-${BUILD_DATE}-macosx.dmg"
DMG_FILENAME="psi-plus-${VERSION_STRING_RAW}-${SOURCE_TYPE}-${BUILD_DATE}-macosx.dmg"

mkdir template
hdiutil attach "${TEMPLATE_DMG}" -noautoopen -quiet -mountpoint "template"
@@ -4,28 +4,8 @@
function obtain_sources()
{
log "Getting sources..."
# Psi sources
if [ ! -d "${PSI_DIR}/psi" ]; then
log "Creating directory for Psi sources..."
mkdir -p "${PSI_DIR}/psi"
fi
log "Getting Psi sources..."
# Type of source. Can be "snapshot" or "git"
SOURCE_TYPE=""

# Build from snapshot sources of Psi, or from git?
if [ ${BUILD_FROM_SNAPSHOT} -eq 1 ]; then
SOURCE_TYPE="snapshot"
PSI_SOURCE_DIR="${PSI_DIR}/psi/snapshot"
else
SOURCE_TYPE="git"
PSI_SOURCE_DIR="${PSI_DIR}/psi/git"
fi

log "Psi sources directory: '${PSI_SOURCE_DIR}'"

# Just a build date.
BUILD_DATE=`date +'%Y-%m-%d'`
log "Getting Psi sources..."

# Separate clone-pull algo for Psi sources.
if [ ! -d "${PSI_SOURCE_DIR}/.git" ]; then
@@ -20,12 +20,12 @@ function parse_cli_parameters()
fi

# Webkit build.
if [ "${cliparams/enable-webkit}" != "${cliparams}" ]; then
log "Enabling Webkit build"
ENABLE_WEBKIT=1
if [ "${cliparams/enable-webengine}" != "${cliparams}" ]; then
log "Enabling WebEngine build"
ENABLE_WEBENGINE=1
else
log "Will not build webkit version"
ENABLE_WEBKIT=0
log "Will not build WebEngine version"
ENABLE_WEBENGINE=0
fi

# All translations.
@@ -5,33 +5,16 @@ function prepare_sources()
{
log "Preparing sources..."

# Directory for build process.
if [ -d "${PSI_DIR}/build" ]; then
log "Build directory exists, removing..."
rm -rf "${PSI_DIR}/build"
fi

# Copy data to build directory.
log "Copying sources to build directory..."
cp -a "${PSI_SOURCE_DIR}/" "${PSI_DIR}/build"

# Create version string.
log "Creating version string for about dialog..."
# Snapshotted thing already have everything for version string.
if [ "${SOURCE_TYPE}" == "git" ]; then
PSI_REVISION=`cd "${PSI_SOURCE_DIR}" && git describe --tags | cut -d - -f 2`
PSI_PLUS_REVISION=`cd "${PSI_DIR}/plus" && git describe --tags | cut -d - -f 2`
PSI_PLUS_TAG=`cd "${PSI_DIR}/plus" && git describe --tags | cut -d - -f 1`
VERSION_STRING_RAW="${PSI_PLUS_TAG}.${PSI_PLUS_REVISION}.${PSI_REVISION}"
if [ ${ENABLE_WEBKIT} -eq 1 ]; then
VERSION_STRING_RAW="${VERSION_STRING_RAW}-webkit"
fi
else
VERSION_STRING_RAW=`cd "${PSI_SOURCE_DIR}" && git describe --tags | cut -d - -f 2`
if [ ${ENABLE_WEBKIT} -eq 1 ]; then
VERSION_STRING_RAW="${VERSION_STRING_RAW}-webkit"
fi
fi
VERSION_STRING="${VERSION_STRING_RAW} ($(date +"%Y-%m-%d"))"

log "Version string: ${VERSION_STRING}"
log "Raw version string (will be used e.g. in filename): ${VERSION_STRING_RAW}"
echo ${VERSION_STRING} > "${PSI_DIR}/build/version"

log "Removing default plugins, they do not work as expected"
rm -rf "${PSI_DIR}/build/src/plugins/generic"

@@ -89,7 +72,7 @@ function prepare_sources()

sed -i "" "s/build\/admin\/build\/deps\/qca-qt5\/include/deps_root\/lib\/qca-qt5.framework\/Versions\/Current\/Headers/" psi.pro

if [ ${ENABLE_WEBKIT} == 1 ]; then
if [ ${ENABLE_WEBENGINE} == 1 ]; then
sed -i "" "s/psi-plus-mac.xml/psi-plus-wk-mac.xml/" src/applicationinfo.cpp
fi

@@ -127,4 +110,7 @@ function prepare_sources()
if [ ${QT_VERSION_MAJOR} -eq 5 ]; then
echo "INCLUDEPATH += ${PSI_DIR}/build/admin/build/deps/qca-qt5/include" >> "${PSI_DIR}/build/psi.pro"
fi

# Version string.
echo ${VERSION_STRING} > "${PSI_DIR}/build/version"
}
@@ -45,7 +45,7 @@ TRANSLATIONS_TO_INSTALL="en"
# Do not change them until you know what are you doing!
CONF_OPTS="--disable-qdbus --enable-whiteboarding --disable-xss --verbose --release"

# Psi version.
# Psi base version.
PSI_VERSION="1.0"

# Disabled plugins.
@@ -63,8 +63,8 @@ DISABLED_PLUGINS="screenshotplugin"
BUILD_FROM_SNAPSHOT=0

# Enable Webkit build?
# Controlled with "--enable-webkit" parameter.
ENABLE_WEBKIT=0
# Controlled with "--enable-webengine" parameter.
ENABLE_WEBENGINE=0

# Bundle translations?
# Controlled with "--bundle-all-translations" parameter.
@@ -132,6 +132,7 @@ source "${SCRIPT_PATH}/modules/compile_sources.module.sh"
source "${SCRIPT_PATH}/modules/copy_libraries.module.sh"
source "${SCRIPT_PATH}/modules/copy_resources.module.sh"
source "${SCRIPT_PATH}/modules/create_directories.module.sh"
source "${SCRIPT_PATH}/modules/create_version_string.module.sh"
source "${SCRIPT_PATH}/modules/install_build_deps.module.sh"
source "${SCRIPT_PATH}/modules/logger.module.sh"
source "${SCRIPT_PATH}/modules/make_bundle.module.sh"
@@ -218,7 +219,7 @@ Feature options:
--enable-dev-plugins Build unstable (dev) plugins.
--enable-webkit Build webkit version. By default non-webkit
--enable-webengine Build webengine version. By default non-webengine
version will be built.
ENVIRONMENT VARIABLES
@@ -239,8 +240,9 @@ case $1 in
parse_cli_parameters $@
check_environment
check_tools_presence
create_directories
create_version_string
if [ "${SKIP_BUILD}" != "1" ]; then
create_directories
install_build_deps
build_dependencies
obtain_sources

0 comments on commit 4d9e042

Please sign in to comment.
You can’t perform that action at this time.