gittyup: Fix build with GCC 14 (#372123)

This commit is contained in:
Arne Keller
2025-01-09 23:26:31 +01:00
committed by GitHub
2 changed files with 51 additions and 12 deletions
@@ -0,0 +1,25 @@
From 687b5424128fd637555be4a0d18c72c4e870bd6f Mon Sep 17 00:00:00 2001
From: Alfie <30699769+AHSauge@users.noreply.github.com>
Date: Sat, 11 May 2024 13:11:08 +0200
Subject: [PATCH] Fix incorrect order of argument to calloc (#345)
---
src/zip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/zip.c b/src/zip.c
index b14f9e3..a7e5ef8 100644
--- a/test/dep/zip/src/zip.c
+++ b/test/dep/zip/src/zip.c
@@ -1874,7 +1874,7 @@ ssize_t zip_stream_copy(struct zip_t *zip, void **buf, size_t *bufsize) {
*bufsize = n;
}
- *buf = calloc(sizeof(unsigned char), n);
+ *buf = calloc(n, sizeof(unsigned char));
memcpy(*buf, zip->archive.m_pState->m_pMem, n);
return (ssize_t)n;
--
2.47.0
@@ -29,21 +29,32 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
cmakeFlags = [
"-DBUILD_SHARED_LIBS=OFF"
"-DUSE_SYSTEM_CMARK=ON"
"-DUSE_SYSTEM_GIT=ON"
"-DUSE_SYSTEM_HUNSPELL=ON"
# upstream uses its own fork of libgit2 as of 1.2.2, however this may change in the future
# "-DUSE_SYSTEM_LIBGIT2=ON"
"-DUSE_SYSTEM_LIBSSH2=ON"
"-DUSE_SYSTEM_LUA=ON"
"-DUSE_SYSTEM_OPENSSL=ON"
"-DENABLE_UPDATE_OVER_GUI=OFF"
patches = [
# Fix GCC 14 build error (remove for next update)
# https://github.com/Murmele/Gittyup/pull/759
./0001-Fix-incorrect-order-of-argument-to-calloc-345.patch
];
cmakeFlags =
let
inherit (lib) cmakeBool;
in
[
(cmakeBool "BUILD_SHARED_LIBS" false)
(cmakeBool "USE_SYSTEM_CMARK" true)
(cmakeBool "USE_SYSTEM_GIT" true)
(cmakeBool "USE_SYSTEM_HUNSPELL" true)
# upstream uses its own fork of libgit2 as of 1.2.2, however this may change in the future
# (cmakeBool "USE_SYSTEM_LIBGIT2" true)
(cmakeBool "USE_SYSTEM_LIBSSH2" true)
(cmakeBool "USE_SYSTEM_LUA" true)
(cmakeBool "USE_SYSTEM_OPENSSL" true)
(cmakeBool "ENABLE_UPDATE_OVER_GUI" false)
];
nativeBuildInputs = [
cmake
cmark
ninja
pkg-config
wrapQtAppsHook
@@ -77,7 +88,10 @@ stdenv.mkDerivation rec {
description = "Graphical Git client designed to help you understand and manage your source code history";
homepage = "https://murmele.github.io/Gittyup";
license = with licenses; [ mit ];
maintainers = [ ];
maintainers = with maintainers; [
fliegendewurst
phijor
];
platforms = platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
};