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
75
pkgs/development/ruby-modules/bundler-env/default.nix
Normal file
75
pkgs/development/ruby-modules/bundler-env/default.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{ ruby, lib, callPackage, defaultGemConfig, buildEnv, runCommand
|
||||
, bundler, rsync
|
||||
}@defs:
|
||||
|
||||
{ name ? null
|
||||
, pname ? null
|
||||
, gemdir ? null
|
||||
, gemfile ? null
|
||||
, lockfile ? null
|
||||
, gemset ? null
|
||||
, groups ? ["default"]
|
||||
, ruby ? defs.ruby
|
||||
, copyGemFiles ? false # Copy gem files instead of symlinking
|
||||
, gemConfig ? defaultGemConfig
|
||||
, postBuild ? null
|
||||
, document ? []
|
||||
, meta ? {}
|
||||
, ignoreCollisions ? false
|
||||
, passthru ? {}
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
let
|
||||
inherit (import ../bundled-common/functions.nix {inherit lib ruby gemConfig groups; }) genStubsScript;
|
||||
|
||||
basicEnv = (callPackage ../bundled-common { inherit bundler; }) (args // { inherit pname name; mainGemName = pname; });
|
||||
|
||||
inherit (basicEnv) envPaths;
|
||||
# Idea here is a mkDerivation that gen-bin-stubs new stubs "as specified" -
|
||||
# either specific executables or the bin/ for certain gem(s), but
|
||||
# incorporates the basicEnv as a requirement so that its $out is in our path.
|
||||
|
||||
# When stubbing the bins for a gem, we should use the gem expression
|
||||
# directly, which means that basicEnv should somehow make it available.
|
||||
|
||||
# Different use cases should use different variations on this file, rather
|
||||
# than the expression trying to deduce a use case.
|
||||
|
||||
# The basicEnv should be put into passthru so that e.g. nix-shell can use it.
|
||||
in
|
||||
if pname == null then
|
||||
basicEnv // { inherit name basicEnv; }
|
||||
else
|
||||
let
|
||||
bundlerEnvArgs = {
|
||||
inherit ignoreCollisions;
|
||||
|
||||
name = basicEnv.name;
|
||||
|
||||
paths = envPaths;
|
||||
pathsToLink = [ "/lib" ];
|
||||
|
||||
postBuild = genStubsScript {
|
||||
inherit lib ruby bundler groups;
|
||||
confFiles = basicEnv.confFiles;
|
||||
binPaths = [ basicEnv.gems.${pname} ];
|
||||
} + lib.optionalString (postBuild != null) postBuild;
|
||||
|
||||
meta = { platforms = ruby.meta.platforms; } // meta;
|
||||
passthru = basicEnv.passthru // {
|
||||
inherit basicEnv;
|
||||
inherit (basicEnv) env;
|
||||
} // passthru;
|
||||
};
|
||||
in
|
||||
if copyGemFiles then
|
||||
runCommand basicEnv.name bundlerEnvArgs ''
|
||||
mkdir -p $out
|
||||
for i in $paths; do
|
||||
${rsync}/bin/rsync -a $i/lib $out/
|
||||
done
|
||||
eval "$postBuild"
|
||||
''
|
||||
else
|
||||
buildEnv bundlerEnvArgs
|
||||
33
pkgs/development/ruby-modules/bundler-env/test.nix
Normal file
33
pkgs/development/ruby-modules/bundler-env/test.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ callPackage, test, stubs, should}:
|
||||
let
|
||||
bundlerEnv = callPackage ./default.nix stubs // {
|
||||
basicEnv = callPackage ../bundled-common stubs;
|
||||
};
|
||||
|
||||
justName = bundlerEnv {
|
||||
name = "test-0.1.2";
|
||||
gemset = ./test/gemset.nix;
|
||||
};
|
||||
|
||||
pnamed = bundlerEnv {
|
||||
pname = "test";
|
||||
gemdir = ./test;
|
||||
gemset = ./test/gemset.nix;
|
||||
gemfile = ./test/Gemfile;
|
||||
lockfile = ./test/Gemfile.lock;
|
||||
};
|
||||
in
|
||||
builtins.concatLists [
|
||||
(test.run "bundlerEnv { name }" justName {
|
||||
name = should.equal "test-0.1.2";
|
||||
})
|
||||
(test.run "bundlerEnv { pname }" pnamed
|
||||
[
|
||||
(should.haveKeys [ "name" "env" "postBuild" ])
|
||||
{
|
||||
name = should.equal "test-0.1.2";
|
||||
env = should.beASet;
|
||||
postBuild = should.havePrefix "/nix/store";
|
||||
}
|
||||
])
|
||||
]
|
||||
0
pkgs/development/ruby-modules/bundler-env/test/Gemfile
Normal file
0
pkgs/development/ruby-modules/bundler-env/test/Gemfile
Normal file
10
pkgs/development/ruby-modules/bundler-env/test/gemset.nix
Normal file
10
pkgs/development/ruby-modules/bundler-env/test/gemset.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
test = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1j5r0anj8m4qlf2psnldip4b8ha2bsscv11lpdgnfh4nnchzjnxw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.2";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue