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
25
pkgs/build-support/dhall/directory-to-nix.nix
Normal file
25
pkgs/build-support/dhall/directory-to-nix.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ dhallPackages, dhallPackageToNix}:
|
||||
|
||||
# `dhallDirectoryToNix is a utility function to take a directory of Dhall files
|
||||
# and read them in as a Nix expression.
|
||||
#
|
||||
# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
|
||||
# as input instead of raw Dhall code.
|
||||
#
|
||||
# Note that this uses "import from derivation" (IFD), meaning that Nix will
|
||||
# perform a build during the evaluation phase if you use this
|
||||
# `dhallDirectoryToNix` utility. It is not possible to use
|
||||
# `dhallDirectoryToNix` in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
|
||||
|
||||
{ src
|
||||
, # The file to import, relative to the src root directory
|
||||
file ? "package.dhall"
|
||||
}@args:
|
||||
|
||||
let
|
||||
generatedPkg = dhallPackages.generateDhallDirectoryPackage args;
|
||||
|
||||
builtPkg = dhallPackages.callPackage generatedPkg { };
|
||||
|
||||
in
|
||||
dhallPackageToNix builtPkg
|
||||
36
pkgs/build-support/dhall/package-to-nix.nix
Normal file
36
pkgs/build-support/dhall/package-to-nix.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
# `dhallPackageToNix` is a utility function to take a Nixpkgs Dhall package
|
||||
# (created with a function like `dhallPackages.buildDhallDirectoryPackage`)
|
||||
# and read it in as a Nix expression.
|
||||
#
|
||||
# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
|
||||
# as input instead of raw Dhall code.
|
||||
#
|
||||
# Note that this uses "import from derivation" (IFD), meaning that Nix will
|
||||
# perform a build during the evaluation phase if you use this
|
||||
# `dhallPackageToNix` utility. It is not possible to use `dhallPackageToNix`
|
||||
# in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
|
||||
|
||||
{ stdenv, dhall-nix }:
|
||||
|
||||
dhallPackage:
|
||||
let
|
||||
drv = stdenv.mkDerivation {
|
||||
name = "dhall-compiled-package.nix";
|
||||
|
||||
buildCommand = ''
|
||||
# Dhall requires that the cache is writable, even if it is never written to.
|
||||
# We copy the cache from the input package to the current directory and
|
||||
# set the cache as writable.
|
||||
cp -r "${dhallPackage}/.cache" ./
|
||||
export XDG_CACHE_HOME=$PWD/.cache
|
||||
chmod -R +w ./.cache
|
||||
|
||||
dhall-to-nix <<< "${dhallPackage}/binary.dhall" > $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ dhall-nix ];
|
||||
};
|
||||
|
||||
in
|
||||
import drv
|
||||
38
pkgs/build-support/dhall/to-nix.nix
Normal file
38
pkgs/build-support/dhall/to-nix.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* `dhallToNix` is a utility function to convert expressions in the Dhall
|
||||
configuration language to their corresponding Nix expressions.
|
||||
|
||||
Example:
|
||||
dhallToNix "{ foo = 1, bar = True }"
|
||||
=> { foo = 1; bar = true; }
|
||||
dhallToNix "λ(x : Bool) → x == False"
|
||||
=> x : x == false
|
||||
dhallToNix "λ(x : Bool) → x == False" false
|
||||
=> true
|
||||
|
||||
See https://hackage.haskell.org/package/dhall-nix/docs/Dhall-Nix.html for
|
||||
a longer tutorial
|
||||
|
||||
Note that this uses "import from derivation", meaning that Nix will perform
|
||||
a build during the evaluation phase if you use this `dhallToNix` utility
|
||||
*/
|
||||
{ stdenv, dhall-nix, writeText }:
|
||||
|
||||
let
|
||||
dhallToNix = code :
|
||||
let
|
||||
file = writeText "dhall-expression" code;
|
||||
|
||||
drv = stdenv.mkDerivation {
|
||||
name = "dhall-compiled.nix";
|
||||
|
||||
buildCommand = ''
|
||||
dhall-to-nix <<< "${file}" > $out
|
||||
'';
|
||||
|
||||
buildInputs = [ dhall-nix ];
|
||||
};
|
||||
|
||||
in
|
||||
import drv;
|
||||
in
|
||||
dhallToNix
|
||||
Loading…
Add table
Add a link
Reference in a new issue