mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
svn path=/nixpkgs/trunk/; revision=10233
This commit is contained in:
parent
aa275908c0
commit
b4b61eccce
17
pkgs/applications/editors/bvi/default.nix
Normal file
17
pkgs/applications/editors/bvi/default.nix
Normal file
@ -0,0 +1,17 @@
|
||||
args:
|
||||
args.stdenv.mkDerivation {
|
||||
name = "bvi-1.3.2";
|
||||
|
||||
src = args.fetchurl {
|
||||
url = http://prdownloads.sourceforge.net/bvi/bvi-1.3.2.src.tar.gz;
|
||||
sha256 = "110wxqnyianqamxq4y53drqqxb9vp4k2fcvic45qggvlqkqhlfgz";
|
||||
};
|
||||
|
||||
buildInputs =(with args; [ncurses]);
|
||||
|
||||
meta = {
|
||||
description = "hex editor with vim style keybindings";
|
||||
homepage = http://bvi.sourceforge.net/download.html;
|
||||
license = "GPL2";
|
||||
};
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/* propoal Marc Weber (original idea and implementation: Michael Raskin)
|
||||
This should not be a complete rewrite of Michael Raskins code.
|
||||
I only fear having to override one step..
|
||||
(which could be done using textClosureMap = f: .. and telling f to substitute a text string)
|
||||
But I don't like this solution
|
||||
|
||||
I've rewritten the part creating the actual step hoping that it's easier to understand.
|
||||
|
||||
Baisc idea keeps the same: assemble a custom builder script by concatenating
|
||||
text snippets with dependencies.
|
||||
|
||||
Difference: Instead of concatenating the text snippets only aliases are concatenated [1]
|
||||
Then those alias names are looked up from an attribute set [2]
|
||||
(this way giving you full control overriding steps)
|
||||
|
||||
All script snippets written by Michael Raskin will be reused thankfully :)
|
||||
*/
|
||||
|
||||
/* Example:
|
||||
setup = {
|
||||
name = "setup";
|
||||
value = "echo setup"; # the text snippet (by calling it value it fits the attr name expected by listToAttrs
|
||||
}
|
||||
|
||||
unpack = {
|
||||
name = "unpack";
|
||||
value = "tar xf ... ";
|
||||
dependencies = [ "setup" ]; # createScript ensures that these are prependend to this text snipped
|
||||
}
|
||||
|
||||
script = createScript { steps = [setup unpack] }
|
||||
is equal to
|
||||
script = createScript { steps = [unpack] }
|
||||
|
||||
# overriding example:
|
||||
script_overridden_setup = createScript { steps = [unpack]; override = { setup = "overridden setup"; }; };
|
||||
*/
|
||||
lib :
|
||||
let inherit (builtins) listToAttrs;
|
||||
inherit (lib) intersperse concatLists uniqList concatStrings;
|
||||
in {
|
||||
createScript = { steps, override ? {} } : let
|
||||
addNameToDeps = r : ( if (r ? dependencies) then r.dependencies else [] ) ++ [r.name];
|
||||
names = uniqList { inputList = concatLists ( map addNameToDeps steps ) ; }; # [1]
|
||||
scriptsAsAttrs = listToAttrs steps; # [2]
|
||||
in concatStrings ( intersperse "\n" (map (x : __getAttr x (scriptsAsAttrs // override ) ) names) );
|
||||
}
|
@ -229,10 +229,6 @@ rec {
|
||||
inherit stdenv lib;
|
||||
};
|
||||
|
||||
builderDefs2 = lib.sumArgs ((import ./builder-defs2.nix) (builderDefs null));
|
||||
|
||||
stringsWithDeps2 = (import ../lib/strings-with-deps2.nix) lib;
|
||||
|
||||
# Call a specific version of a Nix expression, that is,
|
||||
# `selectVersion ./foo {version = "0.1.2"; args...}' evaluates to
|
||||
# `import ./foo/0.1.2.nix args'.
|
||||
@ -3876,6 +3872,10 @@ rec {
|
||||
inherit fetchurl stdenv pkgconfig bmp;
|
||||
};
|
||||
|
||||
bvi = import ../applications/editors/bvi {
|
||||
inherit fetchurl stdenv ncurses;
|
||||
};
|
||||
|
||||
cdparanoiaIII = import ../applications/audio/cdparanoia {
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user