From 3f4ad3d37d641f3b956e6d7770d9db54cd6435a9 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 21 Mar 2021 16:11:09 +0100 Subject: [PATCH] bash: don't rely on patch timestamps in build When, after patching, `configure.ac` is newer than `configure`, the Makefile will try to regenerate `configure` from `configure.ac`. While that might usually be desirable, in this case we want to keep bootstrapping simple and directly use the `configure` from the package so we can avoid a dependency on automake. Previously, we used the `-T` parameter to automake to make sure the timestamps were okay. However, this is brittle when we update: when the timestamp of the original file changes, and no longer matches the timestamp of the original file in the patch, `patch` will show a warning but otherwise continue without updating the timestamp. This PR changes things so we only patch `configure`, so that will always have a newer timestamp. Refs https://github.com/NixOS/nixpkgs/issues/115177 --- pkgs/shells/bash/4.4.nix | 2 +- pkgs/shells/bash/5.1.nix | 2 +- pkgs/shells/bash/pgrp-pipe-4.4.patch | 14 -------------- pkgs/shells/bash/pgrp-pipe-5.1.patch | 15 --------------- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/pkgs/shells/bash/4.4.nix b/pkgs/shells/bash/4.4.nix index bde942aff0c5..b3259466ddb1 100644 --- a/pkgs/shells/bash/4.4.nix +++ b/pkgs/shells/bash/4.4.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { -DSSH_SOURCE_BASHRC ''; - patchFlags = [ "-p0" "-T" ]; + patchFlags = [ "-p0" ]; patches = upstreamPatches ++ [ ./pgrp-pipe-4.4.patch ] diff --git a/pkgs/shells/bash/5.1.nix b/pkgs/shells/bash/5.1.nix index 5dd060db7efb..d234b18e6c90 100644 --- a/pkgs/shells/bash/5.1.nix +++ b/pkgs/shells/bash/5.1.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { -DSSH_SOURCE_BASHRC ''; - patchFlags = [ "-p0" "-T" ]; + patchFlags = [ "-p0" ]; patches = upstreamPatches ++ [ ./pgrp-pipe-5.1.patch ]; diff --git a/pkgs/shells/bash/pgrp-pipe-4.4.patch b/pkgs/shells/bash/pgrp-pipe-4.4.patch index ea3d7bdf92b4..6cbdcab4b7c0 100644 --- a/pkgs/shells/bash/pgrp-pipe-4.4.patch +++ b/pkgs/shells/bash/pgrp-pipe-4.4.patch @@ -13,17 +13,3 @@ diff -u ./configure ../bash-4.4-fixed/configure *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; powerux*) LOCAL_LIBS="-lgen" ;; -diff -u ./configure.ac ../bash-4.4-fixed/configure.ac ---- ./configure.ac 2016-09-07 22:56:28.000000000 +0200 -+++ ../bash-4.4-fixed/configure.ac 2016-09-07 22:56:28.000000000 +0200 -@@ -1092,9 +1092,7 @@ - solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; - lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; - linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading -- case "`uname -r`" in -- 2.[[456789]]*|[[34]]*) AC_DEFINE(PGRP_PIPE) ;; -- esac ;; -+ AC_DEFINE(PGRP_PIPE) ;; - *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; - *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; - powerux*) LOCAL_LIBS="-lgen" ;; diff --git a/pkgs/shells/bash/pgrp-pipe-5.1.patch b/pkgs/shells/bash/pgrp-pipe-5.1.patch index 2a9fa6f33c3b..478327cafc45 100644 --- a/pkgs/shells/bash/pgrp-pipe-5.1.patch +++ b/pkgs/shells/bash/pgrp-pipe-5.1.patch @@ -14,18 +14,3 @@ diff -u ./configure ../bash-5.0-fixed/configure netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; *qnx[67]*) LOCAL_LIBS="-lncurses" ;; *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; -diff -u ./configure.ac ../bash-5.0-fixed/configure.ac ---- ./configure.ac 2019-01-02 15:39:11.000000000 +0100 -+++ ../bash-5.0-fixed/configure.ac 2019-01-02 15:39:11.000000000 +0100 -@@ -1108,10 +1108,7 @@ - solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; - lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; - linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading -- case "`uname -r`" in -- 1.*|2.[[0123]]*) : ;; -- *) AC_DEFINE(PGRP_PIPE) ;; -- esac ;; -+ AC_DEFINE(PGRP_PIPE) ;; - netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; - *qnx[[67]]*) LOCAL_LIBS="-lncurses" ;; - *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;