Skip to content

Commit

Permalink
Merge pull request #6 from sqlitebrowser/master
Browse files Browse the repository at this point in the history
Changes from upstream
  • Loading branch information
deepsidhu1313 committed Dec 8, 2018
2 parents ce36277 + 6944874 commit 4d96c46
Show file tree
Hide file tree
Showing 138 changed files with 15,988 additions and 5,160 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -31,7 +31,7 @@ below with an "x", then click the "Submit new issue" button at the bottom

#### I'm using DB4S version:

- [ ] 3.11.0-alpha*
- [ ] 3.11.0-alpha1 or 3.11.0-beta*
- [ ] 3.10.1
- [ ] Other: ___

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.md
Expand Up @@ -37,7 +37,7 @@ The info below often helps, please fill it out if you're able to. :)

#### What is your DB4S version?

- [ ] 3.11.0-alpha*
- [ ] 3.11.0-alpha1 or 3.11.0-beta*
- [ ] 3.10.1
- [ ] Other: ___

Expand Down
60 changes: 11 additions & 49 deletions CMakeLists.txt
Expand Up @@ -34,33 +34,30 @@ endif ()
if(WIN32 AND MSVC)
if(CMAKE_CL_64)
# Paths for 64-bit windows builds
set(OPENSSL_PATH "C:/dev/OpenSSL-Win64")
set(QT5_PATH "C:/dev/Qt/5.10.1/msvc2013_64")
set(VSREDIST "vcredist_x64.exe")
set(OPENSSL_PATH "C:/dev/OpenSSL-Win64" CACHE PATH "OpenSSL Path")
set(QT5_PATH "C:/dev/Qt/5.11.2/msvc2017_64" CACHE PATH "Qt5 Path")

# Choose between SQLCipher or SQLite, depending whether
# -Dsqlcipher=1 is passed on the command line
if(sqlcipher)
set(SQLITE3_PATH "C:/git_repos/SQLCipher-Win64")
set(SQLITE3_PATH "C:/git_repos/SQLCipher-Win64" CACHE PATH "SQLCipher Path")
else()
set(SQLITE3_PATH "C:/dev/SQLite-Win64")
set(SQLITE3_PATH "C:/dev/SQLite-Win64" CACHE PATH "SQLite Path")
endif()
else()
# Paths for 32-bit windows builds
set(OPENSSL_PATH "C:/dev/OpenSSL-Win32")
set(QT5_PATH "C:/dev/Qt/5.7/msvc2013")
set(VSREDIST "vcredist_x86.exe")
set(OPENSSL_PATH "C:/dev/OpenSSL-Win32" CACHE PATH "OpenSSL Path")
set(QT5_PATH "C:/dev/Qt/5.7/msvc2013" CACHE PATH "Qt5 Path")

# Choose between SQLCipher or SQLite, depending whether
# -Dsqlcipher=1 is passed on the command line
if(sqlcipher)
set(SQLITE3_PATH "C:/git_repos/SQLCipher-Win32")
set(SQLITE3_PATH "C:/git_repos/SQLCipher-Win32" CACHE PATH "SQLCipher Path")
else()
set(SQLITE3_PATH "C:/dev/SQLite-Win32")
set(SQLITE3_PATH "C:/dev/SQLite-Win32" CACHE PATH "SQLite Path")
endif()
endif()
set(CMAKE_PREFIX_PATH "${QT5_PATH};${SQLITE3_PATH}")
set(VSREDIST_DIR "C:/dev/dependencies")
endif()

if(NOT FORCE_INTERNAL_ANTLR)
Expand Down Expand Up @@ -147,6 +144,7 @@ set(SQLB_MOC_HDR
src/DotenvFormat.h
src/Palette.h
src/CondFormat.h
src/RunSql.h
)

set(SQLB_SRC
Expand Down Expand Up @@ -197,6 +195,7 @@ set(SQLB_SRC
src/DotenvFormat.cpp
src/Palette.cpp
src/CondFormat.cpp
src/RunSql.cpp
)

set(SQLB_FORMS
Expand Down Expand Up @@ -248,6 +247,7 @@ set(SQLB_TSS
"${CMAKE_SOURCE_DIR}/src/translations/sqlb_ko_KR.ts"
"${CMAKE_SOURCE_DIR}/src/translations/sqlb_tr.ts"
"${CMAKE_SOURCE_DIR}/src/translations/sqlb_uk_UA.ts"
"${CMAKE_SOURCE_DIR}/src/translations/sqlb_it.ts"
)

# Windows image format plugin files
Expand Down Expand Up @@ -478,7 +478,6 @@ if(WIN32 AND MSVC)
install(FILES
${QT5_PATH}/plugins/platforms/qwindows.dll
DESTINATION platforms)
install(PROGRAMS "${VSREDIST_DIR}/${VSREDIST}" DESTINATION redist)

# The XML dll
install(FILES
Expand Down Expand Up @@ -510,40 +509,3 @@ if(WIN32 AND MSVC)
distri/winlaunch.bat
DESTINATION "/")
endif()

#cpack
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "DB Browser for SQLite")
set(CPACK_PACKAGE_VENDOR "DB Browser for SQLite Team")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "3")
set(CPACK_PACKAGE_VERSION_MINOR "11")
set(CPACK_PACKAGE_VERSION_PATCH "99")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "DB Browser for SQLite")
if(WIN32 AND NOT UNIX)
# There is a bug in NSIS that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\src\\\\iconwin.ico")
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\src\\\\iconwin.ico")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "/")
set(CPACK_NSIS_INSTALLED_ICON_NAME "DB Browser for SQLite.exe")
set(CPACK_NSIS_DISPLAY_NAME "DB Browser for SQLite")
set(CPACK_NSIS_HELP_LINK "https:\\\\\\\\github.com\\\\sqlitebrowser\\\\sqlitebrowser")
set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\github.com\\\\sqlitebrowser\\\\sqlitebrowser")
set(CPACK_NSIS_CONTACT "justin@postgresql.org")
set(CPACK_NSIS_MODIFY_PATH OFF)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "winlaunch.bat")
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")

# VS redist
list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
ExecWait '\\\"$INSTDIR\\\\redist\\\\${VSREDIST}\\\" /install /passive /norestart /quiet'
Delete '\\\"$INSTDIR\\\\redist\\\\${VSREDIST}\\\"'
")
else(WIN32 AND NOT UNIX)
set(CPACK_STRIP_FILES "DB Browser for SQLite")
set(CPACK_SOURCE_STRIP_FILES "")
endif(WIN32 AND NOT UNIX)
set(CPACK_PACKAGE_EXECUTABLES "DB Browser for SQLite" "DB Browser for SQLite")
include(CPack)
1 change: 0 additions & 1 deletion distri/winlaunch.bat

This file was deleted.

3 changes: 3 additions & 0 deletions installer/macos/.db4s_secure
@@ -0,0 +1,3 @@
DEV_ID="Developer ID Application: Your name (AABBCCDDEE)"
KEYCHAIN_PASSWORD="yourpassword"
UPLOAD_SERVER="user@example.org"
228 changes: 228 additions & 0 deletions installer/macos/build_sqlitebrowser_nightly.sh
@@ -0,0 +1,228 @@
#!/bin/bash

# Builds and uploads DB Browser for SQLite nightlies,
# after updating the Homebrew dependencies

QTVER="5.11.2"
BRANCH="master"
BREW="/usr/local/bin/brew"
BUILD_TYPE="release"
DATE=`date "+%Y%m%d"`
LOG="$HOME/db4s_nightlies/nightly.log-$DATE"
LRELEASE="$HOME/Qt/${QTVER}/clang_64/bin/lrelease"
LUPDATE="$HOME/Qt/${QTVER}/clang_64/bin/lupdate"
MACDEPLOYQT="$HOME/Qt/${QTVER}/clang_64/bin/macdeployqt"
PATH="$PATH:/usr/local/bin:/usr/sbin"
QMAKE="$HOME/Qt/${QTVER}/clang_64/bin/qmake"

# Add the sensitive values we don't want to store in this script file
source ~/.db4s_secure

# Update the branch to build, if specified on the command line with "-b [branch name]"
if [ "$1" = "-b" ]; then
if [ ! -z "$2" ]; then
BRANCH="$2"
echo "New branch = ${BRANCH}" >>$LOG 2>&1
else
# Warn on missing branch name override
echo "Missing branch name after the '-b'"
exit 1
fi
fi

# Determine if a Release or Debug build is to be built
if [ "$3" = "-t" ]; then
if [ ! -z "$4" ]; then
BUILD_TYPE="$4"
echo "Build type = ${BUILD_TYPE}" >>$LOG 2>&1
else
# Warn on missing build type override
echo "Missing build type after the '-t'"
exit 2
fi
fi

# Verify the build type is valid
if [ "${BUILD_TYPE}" != "debug" -a "${BUILD_TYPE}" != "release" ]; then
echo "Unknown build type"
exit 3
fi

# Ensure Homebrew is owned by my user
echo Ensure Homebrew is owned by my user >>$LOG 2>&1
sudo chown -Rh jc:staff /usr/local >$LOG 2>&1

# Update Homebrew
echo Update Homebrew >>$LOG 2>&1
$BREW update >>$LOG 2>&1

### Build standard version

# Remove any existing Homebrew installed packages
echo Remove any existing Homebrew installed packages >>$LOG 2>&1
$BREW remove `$BREW list` --force >>$LOG 2>&1

# Install SQLite3
echo Install SQLite3 >>$LOG 2>&1
$BREW install sqlite --with-functions --with-json1 --without-readline --with-fts --with-fts5 >>$LOG 2>&1
$BREW link sqlite3 --force >>$LOG 2>&1

# Update the sqlitebrowser source
echo Update the sqlitebrowser source >>$LOG 2>&1
cd $HOME/git_repos/sqlitebrowser >>$LOG 2>&1
git reset --hard HEAD >>$LOG 2>&1
git clean -dffx >>$LOG 2>&1
git pull >>$LOG 2>&1
git checkout $BRANCH >>$LOG 2>&1

# Update the translation files
echo Updating the translations >>$LOG 2>&1
$LUPDATE src/src.pro >>$LOG 2>&1
$LRELEASE src/src.pro >>$LOG 2>&1

# Build and package standard sqlitebrowser nightly
echo Build and package standard sqlitebrowser nightly >>$LOG 2>&1
if [ "${BUILD_TYPE}" = "debug" ]; then
$QMAKE sqlitebrowser.pro -r -spec macx-clang CONFIG+=debug CONFIG+=x86_64 >>$LOG 2>&1
else
$QMAKE sqlitebrowser.pro -r -spec macx-clang CONFIG+=x86_64 >>$LOG 2>&1
fi
make -j3 >>$LOG 2>&1
make -j3 >>$LOG 2>&1 # Seems to need a 2nd time now, due to language files needing initialisation or something

# Include the depencencies in the .app bundle
$MACDEPLOYQT src/DB\ Browser\ for\ SQLite.app -verbose=2 >>$LOG 2>&1

# Copy the license files to the .dmg
echo Copying the license files to the .dmg >>$LOG 2>&1
cp LICENSE LICENSE-PLUGINS src/DB\ Browser\ for\ SQLite.app/Contents/Resources/ >>$LOG 2>&1

# Copy the translation files to the .dmg
mkdir -p src/DB\ Browser\ for\ SQLite.app/Contents/translations >>$LOG 2>&1
for i in ar zh_CN zh_TW cs en fr de it ko pl pt ru es uk; do
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qt_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtbase_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtmultimedia_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtquick1_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtscript_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtxmlpatterns_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
done

# Unlock the local security keychain, so signing can be done
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${HOME}/Library/Keychains/login.keychain"

# Sign the .app
codesign --sign "${DEV_ID}" --verbose --deep --keychain "/Library/Keychains/System.keychain" src/DB\ Browser\ for\ SQLite.app >>$LOG 2>&1

# Make a .dmg file from the .app
mv src/DB\ Browser\ for\ SQLite.app $HOME/appdmg/ >>$LOG 2>&1
cd $HOME/appdmg >>$LOG 2>&1
$BREW install npm >>$LOG 2>&1
npm -g update >>$LOG 2>&1
npm -g upgrade >>$LOG 2>&1
npm -g uninstall appdmg >>$LOG 2>&1
npm -g install appdmg >>$LOG 2>&1
appdmg --quiet nightly.json DB\ Browser\ for\ SQLite_${DATE}.dmg >>$LOG 2>&1
mv DB\ Browser\ for\ SQLite_${DATE}.dmg $HOME/db4s_nightlies/ >>$LOG 2>&1
$BREW unlink sqlite3 >>$LOG 2>&1
rm -rf $HOME/appdmg/DB\ Browser\ for\ SQLite.app >>$LOG 2>&1

# Upload standard sqlitebrowser nightly
echo Upload standard sqlitebrowser nightly >>$LOG 2>&1
rsync -a $HOME/db4s_nightlies/DB\ Browser\ for\ SQLite_${DATE}.dmg nightlies@nightlies.sqlitebrowser.org:/nightlies/osx/ >>$LOG 2>&1

### Build SQLCipher version
# Remove any existing Homebrew installed packages
echo Remove any existing Homebrew installed packages >>$LOG 2>&1
$BREW remove `$BREW list` --force >>$LOG 2>&1

# Install sqlcipher
echo Install sqlcipher >>$LOG 2>&1
$BREW install sqlcipher --with-fts >>$LOG 2>&1

# Clean the sqlitebrowser source
echo Clean the sqlitebrowser source >>$LOG 2>&1
cd $HOME/git_repos/sqlitebrowser >>$LOG 2>&1
git reset --hard HEAD >>$LOG 2>&1
git clean -dffx >>$LOG 2>&1
git checkout $BRANCH >>$LOG 2>&1

# Update the translation files
echo Updating the translations >>$LOG 2>&1
$LUPDATE src/src.pro >>$LOG 2>&1
$LRELEASE src/src.pro >>$LOG 2>&1

# Build and package sqlitebrowser with SQLCipher support
echo Build and package sqlitebrowser with SQLCipher support >>$LOG 2>&1
if [ "${BUILD_TYPE}" = "debug" ]; then
$QMAKE sqlitebrowser.pro -r -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=sqlcipher >>$LOG 2>&1
else
$QMAKE sqlitebrowser.pro -r -spec macx-clang CONFIG+=x86_64 CONFIG+=sqlcipher >>$LOG 2>&1
fi
make -j3 >>$LOG 2>&1
make -j3 >>$LOG 2>&1 # Seems to need a 2nd time now, due to language files needing initialisation or something

# Include the depencencies in the .app bundle
$MACDEPLOYQT src/DB\ Browser\ for\ SQLite.app -verbose=2 >>$LOG 2>&1

# Copy the license files to the .dmg
echo Copying the license files to the .dmg >>$LOG 2>&1
cp LICENSE LICENSE-PLUGINS src/DB\ Browser\ for\ SQLite.app/Contents/Resources/ >>$LOG 2>&1

# Copy the translation files to the .dmg
mkdir -p src/DB\ Browser\ for\ SQLite.app/Contents/translations >>$LOG 2>&1
for i in ar zh_CN zh_TW cs en fr de it ko pl pt ru es uk; do
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qt_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtbase_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtmultimedia_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtquick1_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtscript_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
cp -v $HOME/Qt/${QTVER}/clang_64/translations/qtxmlpatterns_${i}.qm src/DB\ Browser\ for\ SQLite.app/Contents/translations/ >>$LOG 2>&1
done

# Unlock the local security keychain, so signing can be done
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${HOME}/Library/Keychains/login.keychain"

# Sign the .app
codesign --sign "${DEV_ID}" --verbose --deep --keychain "/Library/Keychains/System.keychain" src/DB\ Browser\ for\ SQLite.app >>$LOG 2>&1

# Make a .dmg file from the .app
mv src/DB\ Browser\ for\ SQLite.app $HOME/appdmg/ >>$LOG 2>&1
cd $HOME/appdmg >>$LOG 2>&1
$BREW install npm >>$LOG 2>&1
npm -g update >>$LOG 2>&1
npm -g upgrade >>$LOG 2>&1
npm -g uninstall appdmg >>$LOG 2>&1
npm -g install appdmg >>$LOG 2>&1
appdmg --quiet nightly.json DB\ Browser\ for\ SQLite-sqlcipher_${DATE}.dmg >>$LOG 2>&1
mv DB\ Browser\ for\ SQLite-sqlcipher_${DATE}.dmg $HOME/db4s_nightlies/ >>$LOG 2>&1
rm -rf $HOME/appdmg/DB\ Browser\ for\ SQLite.app >>$LOG 2>&1

# If building a non-master branch, remove it now that we're finished
if [ "${BRANCH}" != "master" ]; then
echo "Removing non-master branch, now we're finihed" >>$LOG 2>&1
cd $HOME/git_repos/sqlitebrowser >>$LOG 2>&1
git reset --hard HEAD >>$LOG 2>&1
git clean -dffx >>$LOG 2>&1
git checkout master >>$LOG 2>&1
git branch -D "${BRANCH}" >>$LOG 2>&1
fi

# Upload sqlitebrowser nightly with SQLCipher support
echo Upload sqlitebrowser nightly with SQLCipher support >>$LOG 2>&1
rsync -a $HOME/db4s_nightlies/DB\ Browser\ for\ SQLite-sqlcipher_${DATE}.dmg nightlies@nightlies.sqlitebrowser.org:/nightlies/osx/ >>$LOG 2>&1

# Upload the nightlies build log
echo Upload the build log >>$LOG 2>&1
rsync -a $HOME/db4s_nightlies/nightly.log-${DATE} nightlies@nightlies.sqlitebrowser.org:/nightlies/osx/ >>$LOG 2>&1

# Add the new builds to the "latest" directory
ssh ${UPLOAD_SERVER} "cd /nightlies/latest; rm -f *dmg" >>$LOG 2>&1
ssh ${UPLOAD_SERVER} "cd /nightlies/latest; cp /nightlies/osx/DB\ Browser\ for\ SQLite_${DATE}.dmg /nightlies/latest/DB.Browser.for.SQLite.dmg" >>$LOG 2>&1
ssh ${UPLOAD_SERVER} "cd /nightlies/latest; cp /nightlies/osx/DB\ Browser\ for\ SQLite-sqlcipher_${DATE}.dmg /nightlies/latest/DB.Browser.for.SQLite-sqlcipher.dmg" >>$LOG 2>&1

# Remove the nightlies from the local filesystem as we no longer need them
#echo Remove the nightlies from the local filesystem as we no longer need them >>$LOG 2>&1
#rm -f $HOME/db4s_nightlies/sqlitebrowser_${DATE}.dmg $HOME/db4s_nightlies/sqlitebrowser-sqlcipher_${DATE}.dmg >>$LOG 2>&1

echo Done! >>$LOG 2>&1

0 comments on commit 4d96c46

Please sign in to comment.