about summary refs log tree commit diff
path: root/pkgs/tools/misc/uucp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/uucp/default.nix')
-rw-r--r--pkgs/tools/misc/uucp/default.nix27
1 files changed, 20 insertions, 7 deletions
diff --git a/pkgs/tools/misc/uucp/default.nix b/pkgs/tools/misc/uucp/default.nix
index 28f7a6572c185..325ad135558c3 100644
--- a/pkgs/tools/misc/uucp/default.nix
+++ b/pkgs/tools/misc/uucp/default.nix
@@ -1,11 +1,11 @@
-{ lib, stdenv, fetchurl }:
+{ 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";
   };
 
@@ -13,15 +13,28 @@ 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)" ];
 
+  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
@@ -37,4 +50,4 @@ stdenv.mkDerivation rec {
     platforms = lib.platforms.all;
     maintainers = [ ];
   };
-}
+})