mysql-workbench: fix build, small refactor

This commit is contained in:
TomaSajt 2024-01-16 00:58:48 +01:00
parent 2ba42c0d1a
commit 1f3bcdf276
No known key found for this signature in database
GPG Key ID: F011163C050122A1
2 changed files with 43 additions and 10 deletions

View File

@ -1,4 +1,5 @@
{ lib, stdenv
{ lib
, stdenv
, fetchurl
, substituteAll
, cmake
@ -44,13 +45,14 @@
let
inherit (python3.pkgs) paramiko pycairo pyodbc;
in stdenv.mkDerivation rec {
in
stdenv.mkDerivation (finalAttrs: {
pname = "mysql-workbench";
version = "8.0.34";
src = fetchurl {
url = "https://cdn.mysql.com//Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
sha256 = "sha256-ub/D6HRtXOvX+lai71t1UjMmMzBsz5ljCrJCuf9aq7U=";
url = "https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${finalAttrs.version}-src.tar.gz";
hash = "sha256-ub/D6HRtXOvX+lai71t1UjMmMzBsz5ljCrJCuf9aq7U=";
};
patches = [
@ -75,6 +77,9 @@ in stdenv.mkDerivation rec {
src = ./fix-swig-build.patch;
cairoDev = "${cairo.dev}";
})
# a newer libxml2 version has changed some interfaces
./fix-xml2.patch
];
# 1. have it look for 4.12.0 instead of 4.11.1
@ -138,6 +143,10 @@ in stdenv.mkDerivation rec {
patchShebangs tools/get_wb_version.sh
'';
# GCC 13: error: 'int64_t' in namespace 'std' does not name a type
# when updating the version make sure this is still needed
env.CXXFLAGS = "-include cstdint";
env.NIX_CFLAGS_COMPILE = toString ([
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations"
@ -183,7 +192,7 @@ in stdenv.mkDerivation rec {
done
'';
meta = with lib; {
meta = {
description = "Visual MySQL database modeling, administration and querying tool";
longDescription = ''
MySQL Workbench is a modeling tool that allows you to design
@ -191,11 +200,10 @@ in stdenv.mkDerivation rec {
and query development modules where you can manage MySQL server instances
and execute SQL queries.
'';
homepage = "http://wb.mysql.com/";
license = licenses.gpl2;
maintainers = [ ];
platforms = platforms.linux;
license = lib.licenses.gpl2Only;
mainProgram = "mysql-workbench";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = lib.platforms.linux;
};
}
})

View File

@ -0,0 +1,25 @@
diff --git a/library/grt/src/grt.h b/library/grt/src/grt.h
index 47bfd63..59e664b 100644
--- a/library/grt/src/grt.h
+++ b/library/grt/src/grt.h
@@ -35,6 +35,7 @@
#include <stdexcept>
#include <boost/function.hpp>
#include <libxml/xmlmemory.h>
+#include <libxml/tree.h>
#include "base/threading.h"
#include <string>
#include <gmodule.h>
diff --git a/library/grt/src/unserializer.cpp b/library/grt/src/unserializer.cpp
index 6dda76d..a6f6a3c 100644
--- a/library/grt/src/unserializer.cpp
+++ b/library/grt/src/unserializer.cpp
@@ -401,7 +401,7 @@ ValueRef internal::Unserializer::unserialize_xmldata(const char *data, size_t si
xmlDocPtr doc = xmlReadMemory(data, (int)size, NULL, NULL, XML_PARSE_NOENT);
if (!doc) {
- xmlErrorPtr error = xmlGetLastError();
+ const xmlError* error = xmlGetLastError();
if (error)
throw std::runtime_error(base::strfmt("Could not parse XML data. Line %d, %s", error->line, error->message));