From 7c28930254ca30130b0598eac806f15b2d428883 Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Fri, 10 May 2024 01:27:14 -0700 Subject: [PATCH 1/2] uucp: unbreak on Darwin/in `pkgsLLVM` `configure` contains snippets like `main(){return(0);}` which modern clang versions complain about (with the default warnings and errors): ```console configure:1283:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main(){return(0);} ^ int ``` As a workaround, this commit has the package: - regenerate `configure` as part of the build - patches a test for `void` to not rely on `exit` being implicitly defined --- pkgs/tools/misc/uucp/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/uucp/default.nix b/pkgs/tools/misc/uucp/default.nix index 28f7a6572c18..4e1d74e4f73a 100644 --- a/pkgs/tools/misc/uucp/default.nix +++ b/pkgs/tools/misc/uucp/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, autoreconfHook }: stdenv.mkDerivation rec { pname = "uucp"; @@ -13,11 +13,19 @@ stdenv.mkDerivation rec { prePatch = '' # do not set sticky bit in nix store - substituteInPlace Makefile.in \ - --replace 4555 0555 - sed -i '/chown $(OWNER)/d' Makefile.in + substituteInPlace Makefile.am \ + --replace-fail 4555 0555 + sed -i '/chown $(OWNER)/d' Makefile.am + + # don't reply on implicitly defined `exit` function in `HAVE_VOID` test: + substituteInPlace configure.in \ + --replace-fail '(void) exit (0)' '(void) (0)' ''; + # Regenerate `configure`; the checked in version was generated in 2002 and + # contains snippets like `main(){return(0);}` that modern compilers dislike. + nativeBuildInputs = [ autoreconfHook ]; + makeFlags = [ "AR:=$(AR)" ]; meta = { From 1e1d654bd9cbc9a74d2e75e75116977820f70f86 Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Fri, 10 May 2024 01:30:51 -0700 Subject: [PATCH 2/2] uucp: add a version test --- pkgs/tools/misc/uucp/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/uucp/default.nix b/pkgs/tools/misc/uucp/default.nix index 4e1d74e4f73a..325ad135558c 100644 --- a/pkgs/tools/misc/uucp/default.nix +++ b/pkgs/tools/misc/uucp/default.nix @@ -1,11 +1,11 @@ -{ lib, stdenv, fetchurl, autoreconfHook }: +{ lib, stdenv, fetchurl, autoreconfHook, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "uucp"; version = "1.07"; src = fetchurl { - url = "mirror://gnu/uucp/uucp-${version}.tar.gz"; + url = "mirror://gnu/uucp/uucp-${finalAttrs.version}.tar.gz"; sha256 = "0b5nhl9vvif1w3wdipjsk8ckw49jj1w85xw1mmqi3zbcpazia306"; }; @@ -28,8 +28,13 @@ stdenv.mkDerivation rec { makeFlags = [ "AR:=$(AR)" ]; + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + meta = { description = "Unix-unix cp over serial line, also includes cu program"; + mainProgram = "uucp"; longDescription = '' Taylor UUCP is a free implementation of UUCP and is the standard @@ -45,4 +50,4 @@ stdenv.mkDerivation rec { platforms = lib.platforms.all; maintainers = [ ]; }; -} +})