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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
35
pkgs/applications/editors/micro/default.nix
Normal file
35
pkgs/applications/editors/micro/default.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, callPackage }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "micro";
|
||||
version = "2.0.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zyedidia";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-hVFmViwGXuYVAKaCkzK/LHjCi8AtLu0tsPpT61glxys=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
subPackages = [ "cmd/micro" ];
|
||||
|
||||
vendorSha256 = "sha256-YcAKl4keizkbgQLAZGiCG3CGpNTNad8EvOJEXLX2s0s=";
|
||||
|
||||
ldflags = [ "-s" "-w" "-X github.com/zyedidia/micro/v2/internal/util.Version=${version}" "-X github.com/zyedidia/micro/v2/internal/util.CommitHash=${src.rev}" ];
|
||||
|
||||
postInstall = ''
|
||||
installManPage assets/packaging/micro.1
|
||||
install -Dt $out/share/applications assets/packaging/micro.desktop
|
||||
'';
|
||||
|
||||
passthru.tests.expect = callPackage ./test-with-expect.nix {};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://micro-editor.github.io";
|
||||
description = "Modern and intuitive terminal-based text editor";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ dtzWill ];
|
||||
};
|
||||
}
|
||||
30
pkgs/applications/editors/micro/test-with-expect.nix
Normal file
30
pkgs/applications/editors/micro/test-with-expect.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ micro, expect, runCommand, writeScript, runtimeShell }:
|
||||
|
||||
let expect-script = writeScript "expect-script" ''
|
||||
#!${expect}/bin/expect -f
|
||||
|
||||
spawn micro file.txt
|
||||
expect "file.txt"
|
||||
|
||||
send "Hello world!"
|
||||
expect "Hello world!"
|
||||
|
||||
# Send ctrl-q (exit)
|
||||
send "\021"
|
||||
|
||||
expect "Save changes to file.txt before closing?"
|
||||
send "y"
|
||||
|
||||
expect eof
|
||||
''; in
|
||||
runCommand "micro-test-expect"
|
||||
{
|
||||
nativeBuildInputs = [ micro expect ];
|
||||
passthru = { inherit expect-script; };
|
||||
} ''
|
||||
# Micro really wants a writable $HOME for its config directory.
|
||||
export HOME=$(pwd)
|
||||
expect -f ${expect-script}
|
||||
grep "Hello world!" file.txt
|
||||
touch $out
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue