about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/archivers
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/archivers')
-rw-r--r--nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix44
-rw-r--r--nixpkgs/pkgs/tools/archivers/ctrtool/default.nix2
-rw-r--r--nixpkgs/pkgs/tools/archivers/unzip/default.nix4
-rw-r--r--nixpkgs/pkgs/tools/archivers/unzip/implicit-declarations-fix.patch21
4 files changed, 65 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix b/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix
index 2ade0f88a8d0..ee40a7a5ab4a 100644
--- a/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix
+++ b/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix
@@ -1,7 +1,20 @@
-{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv
-, libjpeg, zlib, openssl, libwebp, catch2 }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, makeWrapper
+, boost
+, libpng
+, libiconv
+, libjpeg
+, zlib
+, openssl
+, libwebp
+, catch2
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation {
   pname = "arc_unpacker";
   version = "unstable-2021-08-06";
 
@@ -12,14 +25,35 @@ stdenv.mkDerivation rec {
     hash = "sha256-STbdWH7Mr3gpOrZvujblYrIIKEWBHzy1/BaNuh4teI8=";
   };
 
-  nativeBuildInputs = [ cmake makeWrapper catch2 ];
-  buildInputs = [ boost libiconv libjpeg libpng libwebp openssl zlib ];
+  patches = [
+    (fetchpatch {
+      name = "failing_tests.patch";
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/failing_tests.patch?h=arc_unpacker-git&id=bda1ad9f69e6802e703b2e6913d71a36d76cfef9";
+      hash = "sha256-bClACsf/+SktyLAPtt7EcSqprkw8JVIi1ZLpcJcv9IE=";
+    })
+  ];
 
   postPatch = ''
     cp ${catch2}/include/catch2/catch.hpp tests/test_support/catch.h
     sed '1i#include <limits>' -i src/dec/eagls/pak_archive_decoder.cc # gcc12
   '';
 
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+    catch2
+  ];
+
+  buildInputs = [
+    boost
+    libiconv
+    libjpeg
+    libpng
+    libwebp
+    openssl
+    zlib
+  ];
+
   checkPhase = ''
     runHook preCheck
 
diff --git a/nixpkgs/pkgs/tools/archivers/ctrtool/default.nix b/nixpkgs/pkgs/tools/archivers/ctrtool/default.nix
index 4743f7ded3e8..2408f3cf6d6a 100644
--- a/nixpkgs/pkgs/tools/archivers/ctrtool/default.nix
+++ b/nixpkgs/pkgs/tools/archivers/ctrtool/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "07aayck82w5xcp3si35d7ghybmrbqw91fqqvmbpjrjcixc6m42z7";
   };
 
-  sourceRoot = "source/ctrtool";
+  sourceRoot = "${src.name}/ctrtool";
 
   makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++"];
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/tools/archivers/unzip/default.nix b/nixpkgs/pkgs/tools/archivers/unzip/default.nix
index f61bc9df66d5..b0a4484e87f3 100644
--- a/nixpkgs/pkgs/tools/archivers/unzip/default.nix
+++ b/nixpkgs/pkgs/tools/archivers/unzip/default.nix
@@ -60,6 +60,9 @@ stdenv.mkDerivation rec {
       ];
       sha256 = "sha256-on79jElQ+z2ULWAq14RpluAqr9d6itHiZwDkKubBzTc=";
     })
+    # Clang 16 makes implicit declarations an error by default for C99 and newer, causing the
+    # configure script to fail to detect errno and the directory libraries on Darwin.
+    ./implicit-declarations-fix.patch
   ] ++ lib.optional enableNLS
     (fetchurl {
       url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
@@ -67,6 +70,7 @@ stdenv.mkDerivation rec {
       sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1";
     });
 
+
   nativeBuildInputs = [ bzip2 ];
   buildInputs = [ bzip2 ] ++ lib.optional enableNLS libnatspec;
 
diff --git a/nixpkgs/pkgs/tools/archivers/unzip/implicit-declarations-fix.patch b/nixpkgs/pkgs/tools/archivers/unzip/implicit-declarations-fix.patch
new file mode 100644
index 000000000000..df19bf1722f9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/archivers/unzip/implicit-declarations-fix.patch
@@ -0,0 +1,21 @@
+--- a/unix/configure	2009-04-16 15:25:12.000000000 -0400
++++ b/unix/configure	2023-05-30 15:18:33.670321348 -0400
+@@ -408,7 +408,7 @@
+ echo Check for errno declaration
+ cat > conftest.c << _EOF_
+ #include <errno.h>
+-main()
++int main()
+ {
+   errno = 0;
+   return 0;
+@@ -419,6 +419,8 @@
+ 
+ echo Check for directory libraries
+ cat > conftest.c << _EOF_
++#include <sys/types.h>
++#include <dirent.h>
+ int main() { return closedir(opendir(".")); }
+ _EOF_
+ 
+