From 55e5cc89e5fc59e20757a6f4f5caefe0048a1214 Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Wed, 8 Jan 2025 14:34:04 +0200 Subject: [PATCH 1/4] gittyup: Prefer using `cmakeBool` --- .../version-management/gittyup/default.nix | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/version-management/gittyup/default.nix b/pkgs/applications/version-management/gittyup/default.nix index aab9b79c0417..8794e5013b28 100644 --- a/pkgs/applications/version-management/gittyup/default.nix +++ b/pkgs/applications/version-management/gittyup/default.nix @@ -29,18 +29,22 @@ 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" - ]; + 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 From ddccad3800e7e9b28c153dc46cfc64cb3733faa6 Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Thu, 9 Jan 2025 00:36:53 +0200 Subject: [PATCH 2/4] gittyup: Fix generation of HTML docs from Markdown files `cmark` is needed to generate documentation at build time. --- pkgs/applications/version-management/gittyup/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/version-management/gittyup/default.nix b/pkgs/applications/version-management/gittyup/default.nix index 8794e5013b28..f7b8f79782b8 100644 --- a/pkgs/applications/version-management/gittyup/default.nix +++ b/pkgs/applications/version-management/gittyup/default.nix @@ -48,6 +48,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake + cmark ninja pkg-config wrapQtAppsHook From e0298518cf8ff5d8a5424032b08a75ee7b59846b Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Thu, 9 Jan 2025 01:28:09 +0200 Subject: [PATCH 3/4] gittyup: Fix build with GCC 14 GCC 14 turns transposed arguments to `calloc()` into an error. The affected file has been fixed upstream; patch it here to make things work until the next release of `gittyup`. --- ...rect-order-of-argument-to-calloc-345.patch | 25 +++++++++++++++++++ .../version-management/gittyup/default.nix | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/applications/version-management/gittyup/0001-Fix-incorrect-order-of-argument-to-calloc-345.patch diff --git a/pkgs/applications/version-management/gittyup/0001-Fix-incorrect-order-of-argument-to-calloc-345.patch b/pkgs/applications/version-management/gittyup/0001-Fix-incorrect-order-of-argument-to-calloc-345.patch new file mode 100644 index 000000000000..58431871e7e4 --- /dev/null +++ b/pkgs/applications/version-management/gittyup/0001-Fix-incorrect-order-of-argument-to-calloc-345.patch @@ -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 + diff --git a/pkgs/applications/version-management/gittyup/default.nix b/pkgs/applications/version-management/gittyup/default.nix index f7b8f79782b8..47bf9a8cd2a2 100644 --- a/pkgs/applications/version-management/gittyup/default.nix +++ b/pkgs/applications/version-management/gittyup/default.nix @@ -29,6 +29,12 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + 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; From 4d920907ce66abbc18a9f5545896ddbd0304ec4f Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Thu, 9 Jan 2025 11:59:07 +0200 Subject: [PATCH 4/4] gittyup: add fliegendewurst and phijor as maintainers --- pkgs/applications/version-management/gittyup/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/gittyup/default.nix b/pkgs/applications/version-management/gittyup/default.nix index 47bf9a8cd2a2..cfe26c2de044 100644 --- a/pkgs/applications/version-management/gittyup/default.nix +++ b/pkgs/applications/version-management/gittyup/default.nix @@ -88,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; };