gtk/mysql-workbench/PKGBUILD
2019-01-24 17:38:25 +01:00

128 lines
5.0 KiB
Bash

pkgname=mysql-workbench
pkgver=6.3.10
pkgrel=2
pkgdesc='A cross-platform, visual database design tool developed by MySQL'
arch=('x86_64')
url='https://www.mysql.com/products/workbench/'
license=('GPL2')
depends=('python2' 'libzip' 'libmariadbclient' 'gtkmm3' 'ctemplate'
'libgnome-keyring' 'libgl' 'python2-paramiko' 'python2-pexpect' 'gdal'
'pcre' 'tinyxml' 'libxml2' 'mysql-python' 'cairo'
'python2-cairo' 'hicolor-icon-theme' 'desktop-file-utils' 'libiodbc'
'mysql-connector-c++' 'vsqlite++' 'unixodbc' 'freetype2'
'libantlr3c')
optdepends=('python2-pyodbc: database migration')
makedepends=('cmake' 'boost' 'curl' 'mesa' 'swig' 'java-runtime' 'imagemagick')
install=mysql-workbench.install
source=("https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${pkgver}-src.tar.gz"
'https://www.antlr3.org/download/antlr-3.4-complete.jar'
'0001-mysql-workbench-no-check-for-updates.patch'
'0002-disable-unsupported-operating-system-warning.patch'
'0003-add-option-to-hide-nonstandard-server-warning.patch'
'0004-mariadb-no-escape-string-quote.patch'
'0005-mysql-workbench-mariadb.patch'
'0007-mysql-workbench-no-set-gtid-purged.patch'
'0009-mysql-workbench-gnome-keyring.patch'
'0013-mysql-workbench-no-json.patch'
'arch_linux_profile.xml')
sha256sums=('b5593e439c6f8d50262a8950456a9ba3709b02d1dece0360d5f6e47e1b0d7dc3'
'9d3e866b610460664522520f73b81777b5626fb0a282a5952b9800b751550bf7'
'b189e15c6b6f5a707357d9a9297f39ee3a33264fd28b44d5de6f537f851f82cf'
'0d65832bc5a73d4cfecef4b552bb78a30ce6020a5fabe5558dcf2ade8341b593'
'3c9097af599f08388c471d6fd02f40ea72e5759eaa89f731e662852a5e67feea'
'cfc21dfbf735dc6490c0934db580d769d5d6bf7f155c09dadc7c8813669e4c3d'
'b6cc28627a8e25dcdc6a7e151767f09e3f1e3a599313912f4490f6d03b03f012'
'b49d4ea352d2c2013b9c5834668c44521a0a2c5f9c7e3fe746ad94ce0d2bb865'
'9c2ae2fe7a4f59502bdcf591a07353c350b0ba29c3935c8242d97848cc0e50d3'
'968eadbf672680578c24f6950b1e7a702a178630589751c047a30a4935b4118c'
'28724c4b4cec29ce19aada08279df1b086381cd788fef7ae07c1860f7d17af7e')
noextract=(antlr-3.4-complete.jar)
prepare() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src/"
# Disable 'Help' -> 'Check for Updates'
# Updates are provided via Arch Linux packages
patch -Np1 < "${srcdir}"/0001-mysql-workbench-no-check-for-updates.patch
# mysqldump from mariadb (currently 1.0.16) does not support --set-gtid-purged
patch -Np1 < "${srcdir}"/0007-mysql-workbench-no-set-gtid-purged.patch
# fix gnome-keyring
patch -Np1 < "${srcdir}"/0009-mysql-workbench-gnome-keyring.patch
# we have no JSON, probably missing in mariadb
patch -Np1 < "${srcdir}"/0013-mysql-workbench-no-json.patch
# disable unsupported operating system warning
patch -Np1 < "${srcdir}"/0002-disable-unsupported-operating-system-warning.patch
# add option to hide nonstandard server warning
patch -Np1 < "${srcdir}"/0003-add-option-to-hide-nonstandard-server-warning.patch
# mysql-workbench doesn't like mariadb
patch -Np1 -i ../0004-mariadb-no-escape-string-quote.patch
patch -Np1 -i ../0005-mysql-workbench-mariadb.patch
# make cmake happy with mariadb
sed -i '/^find_package(MySQL /c find_package(MySQL REQUIRED)' \
CMakeLists.txt
# we need python 2.x
sed -i '/^FIND_PROGRAM(PYTHON_EXEC /c FIND_PROGRAM(PYTHON_EXEC "python2")' \
CMakeLists.txt
# GCC 7.x introduced some new warnings, remove '-Werror' for the build to complete
sed -i '/^set/s|-Werror -Wall|-Wall|' CMakeLists.txt
# GCC 7.x complains about unsupported flag
sed -i 's|-Wno-deprecated-register||' ext/scintilla/gtk/CMakeLists.txt
# fix the swig workaround
sed -i '/SWIG_VERSION/s/0x030008/0x030006/' \
library/forms/mforms/textbox.h \
library/forms/swig/mforms.i
# fix GDAL
sed -i '/#include/s|gdal/||' \
backend/wbpublic/grtui/geom_draw_box.h \
backend/wbpublic/grt/spatial_handler.h \
backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
# fix paramiko version
sed -i 's|paramiko 1.15.1|paramiko 2.4.0|' CMakeLists.txt
# put antlr into place
install -D ${srcdir}/antlr-3.4-complete.jar ${srcdir}/linux-res/bin/antlr-3.4-complete.jar
}
build() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src/"
# link to libsigc++, which requires ISO C++ 2011 standard
# so add the flag to enable c++11
cmake . \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_CXX_FLAGS="-std=c++11"
make
}
package() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src"
make DESTDIR="${pkgdir}" install
# icons
for SIZE in 16 24 32 48 64 96 128; do
convert -scale ${SIZE} \
images/icons/linux/128x128/apps/mysql-workbench.png \
${srcdir}/mysql-workbench.png
install -D -m0644 ${srcdir}/mysql-workbench.png "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/mysql-workbench.png"
done
install -D -m 0644 "${srcdir}"/arch_linux_profile.xml \
"${pkgdir}"/usr/share/mysql-workbench/mysql.profiles/Arch_Linux_\(MariaDB_5.5_Package\).xml
}