1 # Maintainer: Christian Hesse <mail@eworm.de>
2 # Contributor: Alexandre Boily <alexandreboily@gmail.com>
3 # Contributor: Illarion Kovalchuk <illarion.kovalchuk@gmail.com>
4 # Contributor: totoloco <totoloco at gmail _dot_com>
5 # Contributor: Ionut Biru <ibiru@archlinux.org>
7 pkgname=mysql-workbench
10 _mysql_version=${pkgver}
11 _connector_version=${pkgver}
14 # bump the antlr4 version as required, this is to match the jar file name
15 _antlr4_version=4.12.0
16 pkgdesc='A cross-platform, visual database design tool developed by MySQL'
18 url='https://www.mysql.com/products/workbench/'
20 depends=('cairo' 'antlr4-runtime' 'curl' 'desktop-file-utils' 'freetype2' 'giflib'
21 'gtkmm3' 'hicolor-icon-theme' 'json-c' 'libgl' 'libsecret' 'libssh' 'libaio'
22 'libxml2' 'libzip' 'pcre' 'proj' 'python' 'rapidjson' 'unixodbc'
24 makedepends=('cmake' 'boost' 'mesa' 'swig' 'java-runtime' 'imagemagick' 'gcc12'
25 "antlr4=${_antlr4_version}" "antlr4-runtime=${_antlr4_version}")
26 validpgpkeys=('859BE8D7C586F538430B19C2467B942D3A79BD29') # MySQL Release Engineering <mysql-build@oss.oracle.com>
27 source=("https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${pkgver}-src.tar.gz"{,.asc}
28 "https://cdn.mysql.com/Downloads/MySQL-${_mysql_version%.*}/mysql-${_mysql_version}.tar.gz"{,.asc}
29 "https://cdn.mysql.com/Downloads/Connector-C++/mysql-connector-c++-${_connector_version}-src.tar.gz"{,.asc}
30 "https://download.osgeo.org/gdal/${_gdal_version}/gdal-${_gdal_version}.tar.xz"
31 "https://downloads.sourceforge.net/project/boost/boost/${_boost_version}/boost_${_boost_version//./_}.tar.bz2"
32 '0001-mysql-workbench-no-check-for-updates.patch'
33 '0002-disable-unsupported-operating-system-warning.patch'
34 '0003-include-list.patch'
35 'arch_linux_profile.xml')
36 sha256sums=('a6c9b05ee6f8accd45203d8234a43415da65ddc8118d427dd1a2ef2a209261bc'
38 '962002f5d906f42f40b277a39d2db93931248c1f07ff8f4312c288e63803dd12'
40 '160cf6881fbde9bd46cd11aaf12930b676bc6e27589ac5c7ba49c196b97e053b'
42 '3cccbed883b1fb99b913966aa3a650ad930e7c3afc714f5823f9754176ee49ea'
43 'fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854'
44 'cdf687f23bc6e8d52dbee9fa02b23d755e80f88476f0fc2e7c4c71cdfed3792f'
45 '2d0f6dcf38f22e49ef7ab9de0230484f1ffac41b7ac40feaf5ef4538ae2f7a18'
46 'e7e66ba68a21a0da87f0513f2b9550359c923a94aa7d16afe6ead063322e3d53'
47 'd816164098c90c432b4fe590708c14f95ab137abfe16ad1b7d498b2e83c0e265')
50 cd "${srcdir}/mysql-workbench-community-${pkgver}-src/"
52 # Disable 'Help' -> 'Check for Updates'
53 # Updates are provided via Arch Linux packages
54 patch -Np1 < "${srcdir}"/0001-mysql-workbench-no-check-for-updates.patch
56 # disable unsupported operating system warning
57 patch -Np1 < "${srcdir}"/0002-disable-unsupported-operating-system-warning.patch
60 patch -Np1 < "${srcdir}"/0003-include-list.patch
63 sed -i '/^\s*set/s| -Werror||' CMakeLists.txt
65 # GCC 7.x complains about unsupported flag
66 sed -i 's| -Wno-deprecated-register||' ext/scintilla/gtk/CMakeLists.txt
68 # be happy with more recent antlr
69 sed -i "/set(ANTLR_JAR_FILENAME/s/4.11.1/${_antlr4_version}/" CMakeLists.txt
74 mkdir "${srcdir}/mysql-${_mysql_version}-build"
75 cd "${srcdir}/mysql-${_mysql_version}-build"
76 echo "Configure mysql..."
77 cmake "${srcdir}/mysql-${_mysql_version}" \
79 -DBUILD_CONFIG=mysql_release \
80 -DCMAKE_INSTALL_PREFIX=/usr \
81 -DSYSCONFDIR=/etc/mysql \
82 -DMYSQL_DATADIR=/var/lib/mysql \
83 -DWITH_BOOST="${srcdir}/boost_${_boost_version//./_}"
86 echo "Install mysql..."
87 make DESTDIR="${srcdir}/install-bundle/" install
89 # Build mysql-connector-c++
90 mkdir "${srcdir}/mysql-connector-c++-${_connector_version}-src-build"
91 cd "${srcdir}/mysql-connector-c++-${_connector_version}-src-build"
92 echo "Configure mysql-connector-c++..."
93 cmake "${srcdir}/mysql-connector-c++-${_connector_version}-src" \
95 -DCMAKE_INSTALL_PREFIX=/usr \
96 -DCMAKE_BUILD_TYPE=Release \
97 -DINSTALL_LIB_DIR=lib \
98 -DMYSQL_DIR="${srcdir}/install-bundle/" \
99 -DMYSQL_CONFIG_EXECUTABLE="${srcdir}/install-bundle/usr/bin/mysql_config" \
101 echo "Build mysql-connector-c++..."
103 echo "Install mysql-connector-c++..."
104 make DESTDIR="${srcdir}/install-bundle/" install
108 echo "Configure gdal..."
109 cmake -B build-gdal -S "${srcdir}/gdal-${_gdal_version}" \
110 -DCMAKE_INSTALL_PREFIX='/usr' \
111 -DGDAL_USE_JASPER='OFF' \
112 -DGDAL_USE_MYSQL='OFF'
114 make LD_LIBRARY_PATH="${srcdir}/install-bundle/usr/lib/" -C build-gdal
115 echo "Install gdal..."
116 make LD_LIBRARY_PATH="${srcdir}/install-bundle/usr/lib/" DESTDIR="${srcdir}/install-bundle/" -C build-gdal install
117 ln -s '.' "${srcdir}/install-bundle/usr/include/gdal"
119 # fix build with gcc 12.x for now...
120 # TODO: remove when fixed upstream
121 export CXX=/usr/bin/g++-12
122 export CC=/usr/bin/gcc-12
124 # Build MySQL Workbench itself with bundled libs
125 mkdir "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
126 cd "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
127 echo "Configure mysql-workbench..."
128 cmake "${srcdir}/mysql-workbench-community-${pkgver}-src" \
130 -DCMAKE_INSTALL_PREFIX:PATH=/usr \
131 -DCMAKE_CXX_FLAGS="-std=c++17" \
132 -DCMAKE_BUILD_TYPE=Release \
133 -DMySQL_CONFIG_PATH="${srcdir}/install-bundle/usr/bin/mysql_config" \
134 -DMySQLCppConn_LIBRARY="${srcdir}/install-bundle/usr/lib/libmysqlcppconn.so" \
135 -DMySQLCppConn_INCLUDE_DIR="${srcdir}/install-bundle/usr/include/jdbc" \
136 -DGDAL_INCLUDE_DIR="${srcdir}/install-bundle/usr/include" \
137 -DGDAL_LIBRARY="${srcdir}/install-bundle/usr/lib/libgdal.so" \
138 -DUNIXODBC_CONFIG_PATH='/usr/bin/odbc_config' \
139 -DUSE_BUNDLED_MYSQLDUMP=1 \
140 -DWITH_ANTLR_JAR="/usr/share/java/antlr-${_antlr4_version}-complete.jar"
141 echo "Build mysql-workbench..."
146 # install bundled libraries
147 for LIBRARY in $(find "${srcdir}/install-bundle/usr/lib/" -type f -regex '.*/lib\(gdal\|mysql\(client\|cppconn\)\)\.so\..*'); do
148 BASENAME="$(basename "${LIBRARY}")"
149 SONAME="$(readelf -d "${LIBRARY}" | grep -Po '(?<=(Library soname: \[)).*(?=\])')"
150 install -D -m0755 "${LIBRARY}" "${pkgdir}"/usr/lib/mysql-workbench/"${BASENAME}"
151 ln -s "${BASENAME}" "${pkgdir}"/usr/lib/mysql-workbench/"${SONAME}"
154 # install bundled mysql and mysqldump
155 install -m0755 "${srcdir}/install-bundle/usr/bin/mysql"{,dump} "${pkgdir}"/usr/lib/mysql-workbench/
157 # install MySQL Workbench itself
158 cd "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
160 make DESTDIR="${pkgdir}" install
163 for SIZE in 16 24 32 48 64 96 128; do
164 # set modify/create for reproducible builds
165 convert -scale ${SIZE} +set date:create +set date:modify \
166 "${srcdir}/mysql-workbench-community-${pkgver}-src/images/icons/MySQLWorkbench-128.png" \
167 "${srcdir}/mysql-workbench.png"
168 install -D -m0644 "${srcdir}/mysql-workbench.png" "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/mysql-workbench.png"
171 install -D -m 0644 "${srcdir}"/arch_linux_profile.xml \
172 "${pkgdir}"/usr/share/mysql-workbench/mysql.profiles/Arch_Linux_\(MariaDB\).xml