Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QEverCloud and use system browser for OAuth (with ability to also use QtWebEngine or QtWebKit) #197

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ qrc_*.*
# Vim backup files
*~

# Vim temporary files
.*.swp

# Nixnote database backup files
*.nnex

Expand Down Expand Up @@ -72,4 +75,5 @@ testsrc/qmake-build-*

/_build_dir_.txt


# Autogenerated VersionInfo.h header in build dir
VersionInfo.h
48 changes: 28 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: cpp
compiler: gcc
sudo: require
dist: xenial
dist: focal

before_install:
- sudo add-apt-repository ppa:nixnote/nixnote2-stable -y
- sudo apt-get update -qq

install:
Expand All @@ -13,35 +12,44 @@ install:
wget curl make pkg-config \
libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev libcurl4-openssl-dev \
libpoppler-qt5-dev libqt5webkit5-dev qt5-qmake qttools5-dev-tools libqt5sql5-sqlite \
libhunspell-dev \
nixnote2-tidy
libhunspell-dev libtidy-dev libqt5positioning5-plugins

script:
- #ls -lR /opt/tidy56
- export TIDY_LIB_DIR=/usr/lib/nixnote2/tidy
- export PKG_CONFIG_PATH=$TIDY_LIB_DIR/pkgconfig
- echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
- echo qmake CONFIG+=release PREFIX=/usr QMAKE_RPATHDIR+=$TIDY_LIB_DIR
- echo qmake CONFIG+=release PREFIX=/usr
- |
qmake CONFIG+=release PREFIX=/usr QMAKE_RPATHDIR+=$TIDY_LIB_DIR &&
qmake CONFIG+=release PREFIX=/usr &&
ls -l ./development &&
make -j$(nproc) &&
make INSTALL_ROOT=appdir -j$(nproc) install &&
find appdir/ &&
qmake testsrc/tests.pro CONFIG+=release PREFIX=/usr QMAKE_RPATHDIR+=$TIDY_LIB_DIR &&
qmake testsrc/tests.pro CONFIG+=release PREFIX=/usr &&
make &&
./qmake-build-release-t/tests -platform offscreen
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
- chmod a+x linuxdeployqt*.AppImage
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
- ./linuxdeployqt*.AppImage --appimage-extract
- export PATH=$(readlink -f ./squashfs-root/usr/bin/):$PATH
- ./squashfs-root/usr/bin/appimagetool appdir/

- |
wget -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" && \
chmod a+x ./linuxdeploy-x86_64.AppImage && \
./linuxdeploy-x86_64.AppImage --appimage-extract && \
mv squashfs-root linuxdeploy && \
mv linuxdeploy/AppRun linuxdeploy/linuxdeploy
- |
wget -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" && \
chmod a+x ./linuxdeploy-plugin-qt-x86_64.AppImage && \
./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract && \
mv squashfs-root linuxdeploy-plugin-qt && \
mv linuxdeploy-plugin-qt/AppRun linuxdeploy-plugin-qt/linuxdeploy-plugin-qt
- |
wget -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" && \
chmod a+x appimagetool-x86_64.AppImage && \
./appimagetool-x86_64.AppImage --appimage-extract && \
mv squashfs-root appimagetool && \
mv appimagetool/AppRun appimagetool/appimagetool
- export PATH=linuxdeploy:linuxdeploy-plugin-qt:appimagetool:$PATH
- linuxdeploy --desktop-file=./appdir/usr/share/applications/nixnote2.desktop --appdir=appdir --plugin qt
- rm -f appdir/usr/lib/libnss3.so
- rm -f appdir/usr/lib/libnssutil3.so
- appimagetool -n appdir

after_success:
- find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- #wget -c https://raw.githubusercontent.com/robert7/uploadtool/temp/upload.sh
- |
Expand Down
2 changes: 1 addition & 1 deletion development/build-dependencies-ubuntu-2004.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ sudo apt-get -y install git-core qt5-default build-essential \
# ./development/build-with-qmake.sh debug noclean /usr/lib/nixnote2/tidy
# then binary is in: ./qmake-build-debug/nixnote2
# cd appdir
# ./usr/appdir/nixnote2
# ./usr/appdir/nixnote2
36 changes: 3 additions & 33 deletions development/build-with-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ PROJECTBRANCH=${1}
PROJECTDIR=`pwd`
set -xe

# note: all with DOCKERMODIFIER != "" is highly experimental and needs "someway" to include webkit binaries
# so without it will fail
#DOCKERMODIFIER=_qt562

DOCKERTAG=nixnote2/xenial${DOCKERMODIFIER}
DOCKERFILE=./development/docker/Dockerfile.ubuntu_xenial${DOCKERMODIFIER}
DOCKERTAG=nixnote2/focal
DOCKERFILE=./development/docker/Dockerfile.ubuntu_focal

function error_exit {
echo "$0: ***********error_exit***********"
Expand All @@ -33,12 +29,6 @@ cd $PROJECTDIR
docker build -t ${DOCKERTAG} -f ${DOCKERFILE} ./development/docker

# stop after creating the image (e.g. you want to do the build manually)
if [ ! -z ${DOCKERMODIFIER} ] ; then
echo "Docker image ${DOCKERTAG} created.. "
echo "DOCKERMODIFIER set to $DOCKERMODIFIER .. you need to provide webkit manually.."
exit 1
fi

if [ ! -d appdir ] ; then
mkdir appdir || error_exit "mkdir appdir"
fi
Expand All @@ -53,33 +43,13 @@ if [ ! -d docker-build-${BUILD_TYPE} ]; then
fi

# start container (note: each call creates new container)



# to try manually:
# DOCKERTAG=..
# docker run --rm -it ${DOCKERTAG} /bin/bash
# then
# PROJECTBRANCH=feature/rc1
# BUILD_TYPE=release
# ...copy command from bellow & paste..
# --------------------

# **TEMPORARY** for beineri PPA recompile #################
# PROJECTBRANCH=feature/rc1;BUILD_TYPE=release
# source /opt/qt*/bin/qt*-env.sh
# git fetch && git checkout $PROJECTBRANCH && git pull && ./development/build-with-qmake.sh ${BUILD_TYPE} noclean /usr/lib/nixnote2/tidy
# unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
# ./development/create-AppImage.sh
# mv *.AppImage appdir2 && chmod -R a+rwx appdir/*.AppImage

time docker run \
--rm \
-v $PROJECTDIR/appdir:/opt/nixnote2/appdir \
-v $PROJECTDIR/docker-build-${BUILD_TYPE}:/opt/nixnote2/qmake-build-${BUILD_TYPE} \
-v $PROJECTDIR/docker-build-${BUILD_TYPE}-t:/opt/nixnote2/qmake-build-${BUILD_TYPE}-t \
-it ${DOCKERTAG} \
/bin/bash -c "cd nixnote2 && git fetch && git checkout $PROJECTBRANCH && git pull && ./development/build-with-qmake.sh ${BUILD_TYPE} noclean /usr/lib/nixnote2/tidy && ./development/run-tests.sh ${BUILD_TYPE} noclean /usr/lib/nixnote2/tidy && ./development/create-AppImage.sh && mv *.AppImage appdir && chmod -R a+rwx appdir/*.AppImage"
/bin/bash -c "cd nixnote2 && git fetch && git checkout --track origin/$PROJECTBRANCH && git reset --hard origin/$PROJECTBRANCH && ./development/build-with-qmake.sh ${BUILD_TYPE} noclean /usr/lib/nixnote2/tidy browser && ./development/run-tests.sh ${BUILD_TYPE} noclean /usr/lib/nixnote2/tidy && ./development/create-AppImage-linuxdeploy.sh && mv *.AppImage appdir && chmod -R a+rwx appdir/*.AppImage"

ls appdir/*.AppImage
echo "If all got well then AppImage file in appdir is your binary"
Expand Down
17 changes: 13 additions & 4 deletions development/build-with-qmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -xe
BUILD_TYPE=${1}
CLEAN=${2}
TIDY_LIB_DIR=${3}
OAUTH_BACKEND=${4}
CDIR=`pwd`

function error_exit {
Expand Down Expand Up @@ -44,6 +45,15 @@ if [ ! -d "${TIDY_LIB_DIR}" ]; then
fi
echo "$0: libtidy is expected in: ${TIDY_LIB_DIR}"

if [ -z "${OAUTH_BACKEND}" ] || [ "${OAUTH_BACKEND}" == "browser" ]; then
# by default will use system browser for OAuth because it's the simplest and working option
OAUTH_CONFIG=""
elif [ "${OAUTH_BACKEND}" == "webengine" ]; then
OAUTH_CONFIG="CONFIG+=oauth_webengine"
else
OAUTH_CONFIG="CONFIG+=oauth_webkit"
fi

if [ ! -d "${BUILD_DIR}" ]; then
mkdir ${BUILD_DIR}
fi
Expand All @@ -56,7 +66,6 @@ if [ -d "${APPDIR}" ]; then
rm *.AppImage 2>/dev/null || echo "failed to remove"
fi


QMAKE_BINARY=qmake

if [ "${TIDY_LIB_DIR}" == "/usr/lib" ] ; then
Expand All @@ -71,10 +80,10 @@ elif [ -d ${TIDY_LIB_DIR}/pkgconfig ] ; then
export PKG_CONFIG_PATH=${TIDY_LIB_DIR}/pkgconfig
fi

echo ${QMAKE_BINARY} CONFIG+=${BUILD_TYPE} ${OAUTH_CONFIG} PREFIX=appdir/usr QMAKE_RPATHDIR+=${TIDY_LIB_DIR} QMAKE_CXX="ccache g++" || error_exit "$0: qmake"
${QMAKE_BINARY} CONFIG+=${BUILD_TYPE} ${OAUTH_CONFIG} PREFIX=appdir/usr QMAKE_RPATHDIR+=${TIDY_LIB_DIR} QMAKE_CXX="ccache g++" || error_exit "$0: qmake"

echo ${QMAKE_BINARY} CONFIG+=${BUILD_TYPE} PREFIX=appdir/usr QMAKE_RPATHDIR+=${TIDY_LIB_DIR} || error_exit "$0: qmake"
${QMAKE_BINARY} CONFIG+=${BUILD_TYPE} PREFIX=appdir/usr QMAKE_RPATHDIR+=${TIDY_LIB_DIR} || error_exit "$0: qmake"

make clean
make -j$(nproc) || error_exit "$0: make"
make -j$(nproc) install || error_exit "$0: make install"

Expand Down
29 changes: 29 additions & 0 deletions development/create-AppImage-linuxdeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

PROG=nixnote2
DESKTOP_FILE=appdir/usr/share/applications/${PROG}.desktop

BUILD_DIR=$(cat _build_dir_.txt)
echo Build dir: ${BUILD_DIR}

if [ ! -f "$DESKTOP_FILE" ]; then
echo "$DESKTOP_FILE not found!"
exit 1
fi

export VERSIONX=$(cat appdir/usr/share/nixnote2/version.txt)
echo Version: ${VERSIONX}

# First, create appdir with bundled binaries
CMD="linuxdeploy --desktop-file=$DESKTOP_FILE --appdir=appdir --plugin qt"
echo About to run: $CMD
$CMD

# Then remove nss libs from the AppDir as they are known to cause troubles, see
# https://github.com/probonopd/linuxdeployqt/issues/35
rm -f appdir/usr/lib/libnss3.so
rm -f appdir/usr/lib/libnssutil3.so

# Now create the actual appimage
echo "Creating AppImage"
appimagetool -n appdir
41 changes: 41 additions & 0 deletions development/docker/Dockerfile.ubuntu_focal
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu:focal

ARG wdir="/opt"
WORKDIR $wdir

ARG make_core=4
ENV PATH="${wdir}/linuxdeploy:${wdir}/linuxdeploy-plugin-qt:${wdir}/appimagetool:${PATH}"
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:nixnote/nixnote2-stable -y && apt-get update -qq
RUN apt-get update && apt-get install -y git-core qt5-default build-essential ccache p7zip-full libssl1.1 libcrypt1 libnss3 \
wget curl make pkg-config \
qtwebengine5-dev qtwebengine5-dev-tools \
libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev libcurl4-openssl-dev \
libpoppler-qt5-dev libqt5webkit5-dev qt5-qmake qttools5-dev-tools libhunspell-dev nixnote2-tidy

# install linuxdeploy
RUN wget -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" && \
chmod a+x ./linuxdeploy-x86_64.AppImage && \
./linuxdeploy-x86_64.AppImage --appimage-extract && \
mv squashfs-root linuxdeploy && \
mv linuxdeploy/AppRun linuxdeploy/linuxdeploy

# install linuxdeploy-plugin-qt
RUN wget -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" && \
chmod a+x ./linuxdeploy-plugin-qt-x86_64.AppImage && \
./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract && \
mv squashfs-root linuxdeploy-plugin-qt && \
mv linuxdeploy-plugin-qt/AppRun linuxdeploy-plugin-qt/linuxdeploy-plugin-qt

# install appimagetool
RUN wget -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" && \
chmod a+x appimagetool-x86_64.AppImage && \
./appimagetool-x86_64.AppImage --appimage-extract && \
mv squashfs-root appimagetool && \
mv appimagetool/AppRun appimagetool/appimagetool

RUN cd $wdir && git clone "https://github.com/robert7/nixnote2.git" && cd nixnote2 && git checkout master

CMD /bin/bash
Loading