uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

138
pkgs/shells/bash/5.1.nix Normal file
View file

@ -0,0 +1,138 @@
{ lib, stdenv
, buildPackages
, fetchurl
, binutils ? null
, bison
, util-linux
# patch for cygwin requires readline support
, interactive ? stdenv.isCygwin
, readline81 ? null
, withDocs ? false
, texinfo ? null
, forFHSEnv ? false
}:
with lib;
assert interactive -> readline81 != null;
assert withDocs -> texinfo != null;
assert stdenv.hostPlatform.isDarwin -> binutils != null;
let
upstreamPatches = import ./bash-5.1-patches.nix (nr: sha256: fetchurl {
url = "mirror://gnu/bash/bash-5.1-patches/bash51-${nr}";
inherit sha256;
});
in
stdenv.mkDerivation rec {
name = "bash-${optionalString interactive "interactive-"}${version}-p${toString (builtins.length upstreamPatches)}";
version = "5.1";
src = fetchurl {
url = "mirror://gnu/bash/bash-${version}.tar.gz";
sha256 = "1alv68wplnfdm6mh39hm57060xgssb9vqca4yr1cyva0c342n0fc";
};
hardeningDisable = [ "format" ];
outputs = [ "out" "dev" "man" "doc" "info" ];
NIX_CFLAGS_COMPILE = ''
-DSYS_BASHRC="/etc/bashrc"
-DSYS_BASH_LOGOUT="/etc/bash_logout"
'' + optionalString (!forFHSEnv) ''
-DDEFAULT_PATH_VALUE="/no-such-path"
-DSTANDARD_UTILS_PATH="/no-such-path"
'' + ''
-DNON_INTERACTIVE_LOGIN_SHELLS
-DSSH_SOURCE_BASHRC
'';
patchFlags = [ "-p0" ];
patches = upstreamPatches
++ [ ./pgrp-pipe-5.1.patch ];
configureFlags = [
(if interactive then "--with-installed-readline" else "--disable-readline")
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"bash_cv_job_control_missing=nomissing"
"bash_cv_sys_named_pipes=nomissing"
"bash_cv_getcwd_malloc=yes"
] ++ optionals stdenv.hostPlatform.isCygwin [
"--without-libintl-prefix"
"--without-libiconv-prefix"
"--with-installed-readline"
"bash_cv_dev_stdin=present"
"bash_cv_dev_fd=standard"
"bash_cv_termcap_lib=libncurses"
] ++ optionals (stdenv.hostPlatform.libc == "musl") [
"--without-bash-malloc"
"--disable-nls"
];
strictDeps = true;
# Note: Bison is needed because the patches above modify parse.y.
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison ]
++ optional withDocs texinfo
++ optional stdenv.hostPlatform.isDarwin binutils;
buildInputs = optional interactive readline81;
enableParallelBuilding = true;
makeFlags = optional stdenv.hostPlatform.isCygwin [
"LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a"
"SHOBJ_LIBS=-lbash"
];
checkInputs = [ util-linux ];
doCheck = false; # dependency cycle, needs to be interactive
postInstall = ''
ln -s bash "$out/bin/sh"
rm -f $out/lib/bash/Makefile.inc
'';
postFixup =
if interactive
then ''
substituteInPlace "$out/bin/bashbug" \
--replace '#!/bin/sh' "#!$out/bin/bash"
''
# most space is taken by locale data
else ''
rm -rf "$out/share" "$out/bin/bashbug"
'';
meta = with lib; {
homepage = "https://www.gnu.org/software/bash/";
description =
"GNU Bourne-Again Shell, the de facto standard shell on Linux" +
(if interactive then " (for interactive use)" else "");
longDescription = ''
Bash is the shell, or command language interpreter, that will
appear in the GNU operating system. Bash is an sh-compatible
shell that incorporates useful features from the Korn shell
(ksh) and C shell (csh). It is intended to conform to the IEEE
POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers
functional improvements over sh for both programming and
interactive use. In addition, most sh scripts can be run by
Bash without modification.
'';
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ dtzWill ];
mainProgram = "bash";
};
passthru = {
shellPath = "/bin/bash";
};
}

View file

@ -0,0 +1,20 @@
# Automatically generated by `update-patch-set.sh'; do not edit.
patch: [
(patch "001" "1ymm8ppss6gyh9ifznjwiabrb4k91npd09c10y7mk66xp8yppc7b")
(patch "002" "1gjx9zqcm407am3n2sh44b8dxm48kgm15rzfiijqxr01m0hn3shm")
(patch "003" "1cdnpbfc64yhvkjj4d12s9ywp11g195vzfl1cab24sq55wkcrwi2")
(patch "004" "11iwhy6v562bv0kk7lwj7f5jj65ma9bblivy0v02h3ggcibbdbls")
(patch "005" "19bdyigdr81824nxvqr6a7k0cax60wq7376j6b91afbnwvlvbjyc")
(patch "006" "051x8wlwrqk0yr0zg378vh824iklfl5g9pkmcdf62qp8gn9pvqbm")
(patch "007" "0fir80pp1gmlpadmqcgkrv4y119pc7xllchjzg05fd7px73viz5c")
(patch "008" "1lfjgshk8i9vch92p5wgc9r90j3phw79aa7gbai89w183b2z6b7j")
(patch "009" "1vn36dzd9g4y1h3jiss6418crla0rbcd0d6wwsyv9d5l7aaxlp74")
(patch "010" "0amfmvbzsand7bdypylkjdpcp88fa3cplfshn7vyzv2ff2rdgj52")
(patch "011" "0yq24abb4fzfxqnwl20b330sxl9lr9ds0nc4yi30f81l94b1y6aq")
(patch "012" "165bff97ffih49vfs4mkr5w3z5gn1w6zfyrf773iajkw6v48kw8h")
(patch "013" "1bfmgv3lagbk3aq9a831d29xv7jz4sjq7jhn9hq89limyinvdb67")
(patch "014" "1l43dw4kpddn7l41i8wmj406z9abxky1wb3rk8krcys33g4f0kka")
(patch "015" "1w40vzadzx019v0zhs4q6yqycrk04x1k8xs6qb73vk7ny4p6jdqv")
(patch "016" "0krqqljz4bkp9wrdnwfx51bxkb8rkwf8ivc93as1znx5fr7i96c8")
]

View file

@ -0,0 +1,74 @@
{ lib, stdenv, fetchurl
, fetchpatch
, autoreconfHook
, perl
, ps
, python3Packages
, bashInteractive
}:
stdenv.mkDerivation rec {
pname = "bash-completion";
version = "2.11";
# Using fetchurl because fetchGithub or fetchzip will have trouble on
# e.g. APFS filesystems (macOS) because of non UTF-8 characters in some of the
# test fixtures that are part of the repository.
# See discussion in https://github.com/NixOS/nixpkgs/issues/107768
src = fetchurl {
url = "https://github.com/scop/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
sha256 = "1b0iz7da1sgifx1a5wdyx1kxbzys53v0kyk8nhxfipllmm5qka3k";
};
strictDeps = true;
nativeBuildInputs = [ autoreconfHook ];
# tests are super flaky unfortunately, and regularily break.
# let's disable them for now.
doCheck = false;
checkInputs = [
# perl is assumed by perldoc completion
perl
# ps assumed to exist by gdb, killall, pgrep, pidof,
# pkill, pwdx, renice, and reptyr completions
ps
python3Packages.pexpect
python3Packages.pytest
bashInteractive
];
# - ignore test_gcc on ARM because it assumes -march=native
# - ignore test_chsh because it assumes /etc/shells exists
# - ignore test_ether_wake, test_ifdown, test_ifstat, test_ifup,
# test_iperf, test_iperf3, test_nethogs and ip_addresses
# because they try to touch network
# - ignore test_ls because impure logic
# - ignore test_screen because it assumes vt terminals exist
checkPhase = ''
pytest . \
${lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \
--ignore=test/t/test_chsh.py \
--ignore=test/t/test_ether_wake.py \
--ignore=test/t/test_ifdown.py \
--ignore=test/t/test_ifstat.py \
--ignore=test/t/test_ifup.py \
--ignore=test/t/test_iperf.py \
--ignore=test/t/test_iperf3.py \
--ignore=test/t/test_nethogs.py \
--ignore=test/t/unit/test_unit_ip_addresses.py \
--ignore=test/t/test_ls.py \
--ignore=test/t/test_screen.py
'';
prePatch = lib.optionalString stdenv.isDarwin ''
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
'';
meta = with lib; {
homepage = "https://github.com/scop/bash-completion";
description = "Programmable completion for the bash shell";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = [ maintainers.xfix ];
};
}

View file

@ -0,0 +1,43 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
version = "0.6.8";
pname = "nix-bash-completions";
src = fetchFromGitHub {
owner = "hedning";
repo = "nix-bash-completions";
rev = "v${version}";
sha256 = "1n5zs6xcnv4bv1hdaypmz7fv4j7dsr4a0ifah99iyj4p5j85i1bc";
};
strictDeps = true;
# To enable lazy loading via. bash-completion we need a symlink to the script
# from every command name.
installPhase = ''
runHook preInstall
commands=$(
function complete() { shift 2; echo "$@"; }
shopt -s extglob
source _nix
)
install -Dm444 -t $out/share/bash-completion/completions _nix
cd $out/share/bash-completion/completions
for c in $commands; do
ln -s _nix $c
done
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/hedning/nix-bash-completions";
description = "Bash completions for Nix, NixOS, and NixOps";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ hedning ];
# Set a lower priority such that the newly provided completion from Nix 2.4 are preferred.
priority = 10;
};
}

View file

@ -0,0 +1,16 @@
diff -u ./configure ../bash-5.0-fixed/configure
--- ./configure 2019-01-02 15:43:31.000000000 +0100
+++ ../bash-5.0-fixed/configure 2020-01-08 14:18:21.017296179 +0100
@@ -16312,11 +16312,7 @@
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
- case "`uname -r`" in
- 1.*|2.[0123]*) : ;;
- *) $as_echo "#define PGRP_PIPE 1" >>confdefs.h
- ;;
- esac ;;
+ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
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" ;;

View file

@ -0,0 +1,81 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, fetchpatch
, coreutils
, gnused
, libnotify
, pulseaudio
, sound-theme-freedesktop
, xprop
}:
stdenvNoCC.mkDerivation rec {
pname = "undistract-me";
version = "unstable-2020-08-09";
src = fetchFromGitHub {
owner = "jml";
repo = pname;
rev = "2f8ac25c6ad8efcf160d2b480825b1cbb6772aab";
hash = "sha256-Qw7Cu9q0ZgK/RTvyDdHM5N3eBaKjtYqYH0J+hKMUZX8=";
};
patches = [
# Don't block the terminal when notification sound is played
#
# See https://github.com/jml/undistract-me/pull/69
(fetchpatch {
url = "https://github.com/jml/undistract-me/commit/2356ebbe8bf2bcb4b95af1ae2bcdc786ce7cc6e8.patch";
sha256 = "sha256-Ij3OXTOnIQsYhKVmqjChhN1q4ASZ7waOkfQTTp5XfPo=";
})
# Fix showing notifications when using Wayland apps with XWayland
# running, or connection to X server fails.
#
# NOTE: Without a real X server, notifications will not be
# suppressed when the window running the command is focused.
#
# See https://github.com/jml/undistract-me/pull/71
(fetchpatch {
url = "https://github.com/jml/undistract-me/commit/3f4ceaf5a4eba8e3cb02236c48247f87e3d1124f.patch";
sha256 = "sha256-9AK9Jp3TXJ75Y+jwZXlwQ6j54FW1rOBddoktrm0VX68=";
})
];
strictDeps = true;
# Patch in dependencies. Can't use makeWrapper because the bash
# functions will be sourced and invoked in a different environment
# for each command invocation.
postPatch = ''
for script in *.bash *.sh; do
substituteInPlace "$script" \
--replace /usr/share/undistract-me "$out/share/undistract-me" \
--replace basename ${coreutils}/bin/basename \
--replace 'cut ' '${coreutils}/bin/cut ' \
--replace date ${coreutils}/bin/date \
--replace dirname ${coreutils}/bin/dirname \
--replace sed ${gnused}/bin/sed \
--replace notify-send ${libnotify}/bin/notify-send \
--replace paplay ${pulseaudio}/bin/paplay \
--replace /usr/share/sounds/freedesktop ${sound-theme-freedesktop}/share/sounds/freedesktop \
--replace xprop ${xprop}/bin/xprop
done
'';
installPhase = ''
mkdir -p "$out/share/undistract-me" "$out/etc/profile.d" "$out/share/licenses/undistract-me"
cp long-running.bash "$out/share/undistract-me"
cp preexec.bash "$out/share/undistract-me"
cp undistract-me.sh "$out/etc/profile.d"
cp LICENSE "$out/share/licenses/undistract-me"
'';
meta = with lib; {
description = "Notifies you when long-running terminal commands complete";
homepage = "https://github.com/jml/undistract-me";
license = licenses.mit;
maintainers = with maintainers; [ kira-bruneau ];
};
}

View file

@ -0,0 +1,52 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure -i bash -p wget -p gnupg -p cacert -p nix
# Update patch set for GNU Bash or Readline.
if [ $# -ne 2 ]
then
echo "Usage: $(basename "$0") PROJECT VERSION"
echo ""
echo "Update the patch set for PROJECT (one of \`bash' or \`readline') for"
echo "the given version (e.g., \`4.0'). Produce \`PROJECT-patches.nix'."
exit 1
fi
PROJECT="$1"
VERSION="$2"
DIR=$(dirname "$0")
VERSION_CONDENSED="$(echo "$VERSION" | sed -es/\\.//g)"
PATCH_LIST="$DIR/$PROJECT-$VERSION-patches.nix"
set -e
rm -vf "$PATCH_LIST"
wget "https://tiswww.case.edu/php/chet/gpgkey.asc"
echo "4ef5051ce7200241e65d29c11eb57df8 gpgkey.asc" > gpgkey.asc.md5
md5sum -c gpgkey.asc.md5
gpg --import ./gpgkey.asc
rm gpgkey.asc{,.md5}
( echo "# Automatically generated by \`$(basename "$0")'; do not edit." ; \
echo "" ; \
echo "patch: [" ) \
>> "$PATCH_LIST"
for i in {001..100}
do
wget -P "$DIR" "ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i" || break
wget -P "$DIR" "ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i.sig"
gpg --verify "$DIR/$PROJECT$VERSION_CONDENSED-$i.sig"
hash=$(nix-hash --flat --type sha256 --base32 "$DIR/$PROJECT$VERSION_CONDENSED-$i")
echo "(patch \"$i\" \"$hash\")" \
>> "$PATCH_LIST"
rm -f "$DIR/$PROJECT$VERSION_CONDENSED-$i"{,.sig}
done
echo "]" >> "$PATCH_LIST"
# bash interprets numbers starting with 0 as octals
echo "Got $((10#$i - 1)) patches."
echo "Patch list has been written to \`$PATCH_LIST'."

View file

@ -0,0 +1,35 @@
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
}:
stdenv.mkDerivation rec {
pname = "yarn-bash-completion";
version = "0.17.0";
src = fetchFromGitHub {
owner = "dsifford";
repo = "yarn-completion";
rev = "v${version}";
sha256 = "0xflbrbwskjqv3knvc8jqygpvfxh5ak66q7w22d1ng8gwrfqzcng";
};
strictDeps = true;
nativeBuildInputs = [ installShellFiles ];
installPhase = ''
runHook preInstall
installShellCompletion --cmd yarn ./yarn-completion.bash
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/dsifford/yarn-completion/";
description = "Bash completion for Yarn";
license = licenses.mit;
maintainers = with maintainers; [ DamienCassou ];
};
}