From f68d5c76fde4d28a78d0aee8012d6e981e01bbc1 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 30 Dec 2024 22:58:58 +0100 Subject: [PATCH] mysql-workbench: 8.0.38 -> 8.0.40 --- .../dont-search-for-antlr-jar.patch | 4 +-- .../my/mysql-workbench/hardcode-paths.patch | 34 +++++++++---------- pkgs/by-name/my/mysql-workbench/package.nix | 21 ++++-------- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/pkgs/by-name/my/mysql-workbench/dont-search-for-antlr-jar.patch b/pkgs/by-name/my/mysql-workbench/dont-search-for-antlr-jar.patch index 80e4a7620173..8cf10866dd82 100644 --- a/pkgs/by-name/my/mysql-workbench/dont-search-for-antlr-jar.patch +++ b/pkgs/by-name/my/mysql-workbench/dont-search-for-antlr-jar.patch @@ -1,12 +1,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b7320bb..d7169da 100644 +index 3dd3e19..4290041 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,25 +143,6 @@ check_function_exists (strtoull HAVE_STRTOULL) check_function_exists (strtoimax HAVE_STRTOIMAX) check_function_exists (strtoumax HAVE_STRTOUMAX) --set(ANTLR_JAR_FILENAME "antlr-4.11.1-complete.jar") +-set(ANTLR_JAR_FILENAME "antlr-4.13.2-complete.jar") -get_filename_component(SOURCE_PARENT_DIR ${CMAKE_SOURCE_DIR} DIRECTORY) -set(LINUX_RES_BIN_DIR ${SOURCE_PARENT_DIR}/linux-res/bin) -message("WITH_ANTLR_JAR: ${WITH_ANTLR_JAR}") diff --git a/pkgs/by-name/my/mysql-workbench/hardcode-paths.patch b/pkgs/by-name/my/mysql-workbench/hardcode-paths.patch index 8f7b317fb6ca..9065355843cd 100644 --- a/pkgs/by-name/my/mysql-workbench/hardcode-paths.patch +++ b/pkgs/by-name/my/mysql-workbench/hardcode-paths.patch @@ -84,7 +84,7 @@ index 40ed515..00da327 100644 if to_spawn: command += ' &' - sudo_prefix += ' /usr/bin/nohup' -+ sudo_prefix += ' @nohup@' ++ sudo_prefix += ' @coreutils@/bin/nohup' # If as_user is the CURRENT then there's no need to sudo if as_user != Users.CURRENT: @@ -102,10 +102,10 @@ index 40ed515..00da327 100644 def get_file_owner(self, path, as_user = Users.CURRENT, user_password = None): if self.target_os == wbaOS.linux: - command = 'LC_ALL=C stat -c %U ' -+ command = 'LC_ALL=C @stat@ -c %U ' ++ command = 'LC_ALL=C @coreutils@/bin/stat -c %U ' else: - command = 'LC_ALL=C /usr/bin/stat -f "%Su" ' -+ command = 'LC_ALL=C @stat@ -f "%Su" ' ++ command = 'LC_ALL=C @coreutils@/bin/stat -f "%Su" ' output = io.StringIO() command = command + quote_path(path) @@ -114,10 +114,10 @@ index 40ed515..00da327 100644 raise PermissionDeniedError("Cannot set owner of directory %s" % path) else: - command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path)) -+ command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path)) ++ command = "@coreutils@/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path)) else: - command = "/bin/mkdir %s" % (quote_path(path)) -+ command = "@mkdir@ %s" % (quote_path(path)) ++ command = "@coreutils@/bin/mkdir %s" % (quote_path(path)) res = self.process_ops.exec_cmd(command, as_user = as_user, @@ -126,7 +126,7 @@ index 40ed515..00da327 100644 def remove_directory(self, path, as_user = Users.CURRENT, user_password = None): output = io.StringIO() - res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path), -+ res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path), ++ res = self.process_ops.exec_cmd('@coreutils@/bin/rmdir ' + quote_path(path), as_user = as_user, user_password = user_password, output_handler = output.write, @@ -135,7 +135,7 @@ index 40ed515..00da327 100644 def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None): output = io.StringIO() - res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path), -+ res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path), ++ res = self.process_ops.exec_cmd('@coreutils@/bin/rm -R ' + quote_path(path), as_user = as_user, user_password = user_password, output_handler = output.write, @@ -144,7 +144,7 @@ index 40ed515..00da327 100644 def delete_file(self, path, as_user = Users.CURRENT, user_password = None): output = io.StringIO() - res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path), -+ res = self.process_ops.exec_cmd("@rm@ " + quote_path(path), ++ res = self.process_ops.exec_cmd("@coreutils@/bin/rm " + quote_path(path), as_user = as_user, user_password = user_password, output_handler = output.write, @@ -153,7 +153,7 @@ index 40ed515..00da327 100644 output = io.StringIO() - res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest), -+ res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest), ++ res = self.process_ops.exec_cmd("LC_ALL=C @coreutils@/bin/cp " + quote_path(source) + " " + quote_path(dest), as_user = as_user, user_password = user_password, output_handler = output.write, @@ -162,10 +162,10 @@ index 40ed515..00da327 100644 # since both cases are possible, we need to handle both at the same time (1st line being total or not) # the good news is that if the line is there, then it will always start with total, regardless of the locale - command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path) -+ command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path) ++ command = 'LC_ALL=C @coreutils@/bin/ls -l -p %s' % quote_path(path) else: - command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path) -+ command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path) ++ command = 'LC_ALL=C @coreutils@/bin/ls -1 -p %s' % quote_path(path) output = io.StringIO() res = self.process_ops.exec_cmd(command, @@ -174,10 +174,10 @@ index 40ed515..00da327 100644 f = io.StringIO() if not self._need_sudo: - ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write) -+ ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write) ++ ret = self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write) else: - ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write) -+ ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write) ++ ret = self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write) if ret != 0: raise RuntimeError("Could not get data from file %s" % self.path) @@ -186,10 +186,10 @@ index 40ed515..00da327 100644 def read_task(self, offset, file): if not self._need_sudo: - self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write) -+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write) ++ self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write) else: - self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write) -+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write) ++ self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write) # this will signal the reader end that there's no more data file.close() @@ -198,10 +198,10 @@ index 40ed515..00da327 100644 f = io.StringIO() if not self._need_sudo: - self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write) -+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write) ++ self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write) else: - self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write) -+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write) ++ self.server_helper.execute_command("@coreutils@/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write) self.data = f self.data.seek(0) if self.skip_first_newline: diff --git a/pkgs/by-name/my/mysql-workbench/package.nix b/pkgs/by-name/my/mysql-workbench/package.nix index 9828074955f2..bffefc955f02 100644 --- a/pkgs/by-name/my/mysql-workbench/package.nix +++ b/pkgs/by-name/my/mysql-workbench/package.nix @@ -21,7 +21,7 @@ libiodbc, proj, - antlr4_12, + antlr4_13, gtkmm3, libxml2, libmysqlconnectorcpp, @@ -46,31 +46,22 @@ let }; }); - getCoreExe = lib.getExe' coreutils; - inherit (python3Packages) paramiko pycairo pyodbc; in stdenv.mkDerivation (finalAttrs: { pname = "mysql-workbench"; - version = "8.0.38"; + version = "8.0.40"; src = fetchurl { url = "https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${finalAttrs.version}-src.tar.gz"; - hash = "sha256-W2RsA2hIRUaNRK0Q5pN1YODbEiw6HE3cfeisPdUcYPY="; + hash = "sha256-/CrjHgZ3IFFvUB1IxeURme8Z6BoZx0b03MWk8QCe0Sg="; }; patches = [ (replaceVars ./hardcode-paths.patch { bash = lib.getExe bash; catchsegv = lib.getExe' glibc "catchsegv"; - cp = getCoreExe "cp"; - dd = getCoreExe "dd"; - ls = getCoreExe "ls"; - mkdir = getCoreExe "mkdir"; - nohup = getCoreExe "nohup"; - rm = getCoreExe "rm"; - rmdir = getCoreExe "rmdir"; - stat = getCoreExe "stat"; + coreutils = lib.getBin coreutils; sudo = lib.getExe sudo; }) @@ -101,7 +92,7 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - antlr4_12.runtime.cpp + antlr4_13.runtime.cpp gtkmm3 (libxml2.override { enableHttp = true; }) libmysqlconnectorcpp @@ -141,7 +132,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeFeature "MySQL_CONFIG_PATH" (lib.getExe' mysql "mysql_config")) (lib.cmakeFeature "IODBC_CONFIG_PATH" (lib.getExe' libiodbc "iodbc-config")) - (lib.cmakeFeature "ANTLR_JAR_PATH" "${antlr4_12.jarLocation}") + (lib.cmakeFeature "ANTLR_JAR_PATH" "${antlr4_13.jarLocation}") # mysql-workbench 8.0.21 depends on libmysqlconnectorcpp 1.1.8. # Newer versions of connector still provide the legacy library when enabled # but the headers are in a different location.