Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5428f06b9eaa
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4e944c591dcd
Choose a head ref
  • 1 commit
  • 6 files changed
  • 1 contributor

Commits on Apr 14, 2020

  1. Copy the full SHA
    4e944c5 View commit details
20 changes: 8 additions & 12 deletions pkgs/build-support/trivial-builders.nix
Original file line number Diff line number Diff line change
@@ -2,10 +2,12 @@

let

runCommand' = runLocal: stdenv: name: env: buildCommand:
runCommand' = runLocal: stdenv: name: env: buildScript:
stdenv.mkDerivation ({
inherit name buildCommand;
passAsFile = [ "buildCommand" ];
inherit name buildScript;
buildCommand = ''
source <(${jq}/bin/jq -r <.attrs.json '.buildScript')
'';
}
// (lib.optionalAttrs runLocal {
preferLocalBuild = true;
@@ -80,7 +82,6 @@ rec {
}:
runCommand name
{ inherit text executable;
passAsFile = [ "text" ];
# Pointless to do this on a remote machine.
preferLocalBuild = true;
allowSubstitutes = false;
@@ -89,11 +90,7 @@ rec {
n=$out${destination}
mkdir -p "$(dirname "$n")"
if [ -e "$textPath" ]; then
mv "$textPath" "$n"
else
echo -n "$text" > "$n"
fi
cp <(${jq}/bin/jq -r <.attrs.json '.text') $n
${checkPhase}
@@ -221,15 +218,14 @@ rec {
{
inherit name code;
executable = true;
passAsFile = ["code"];
# Pointless to do this on a remote machine.
preferLocalBuild = true;
allowSubstitutes = false;
}
''
n=$out/bin/$name
mkdir -p "$(dirname "$n")"
mv "$codePath" code.c
cp <(${jq}/bin/jq -r <.attrs.json '.code') code.c
$CC -x c code.c -o "$n"
'';

@@ -292,7 +288,7 @@ rec {
in runCommand name args
''
mkdir -p $out
while IFS= read -r -d $'\0' path; do
while IFS= read -r path; do
${lndir}/bin/lndir -silent $path $out
done < <(${jq}/bin/jq -r <.attrs.json '.paths[]')
${postBuild}
6 changes: 4 additions & 2 deletions pkgs/development/haskell-modules/hoogle.nix
Original file line number Diff line number Diff line change
@@ -60,9 +60,11 @@ buildPackages.stdenv.mkDerivation {

inherit docPackages;

passAsFile = ["buildCommand"];

buildCommand = ''
source <(${buildPackages.jq}/bin/jq -r <.attrs.json '.buildScript')
'';

buildScript = ''
${lib.optionalString (packages != [] -> docPackages == [])
("echo WARNING: localHoogle package list empty, even though"
+ " the following were specified: "
24 changes: 15 additions & 9 deletions pkgs/development/tools/jq/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, oniguruma }:
{ stdenv, fetchurl, oniguruma, minimal ? false }:

stdenv.mkDerivation rec {
pname = "jq";
@@ -9,21 +9,27 @@ stdenv.mkDerivation rec {
sha256="0wmapfskhzfwranf6515nzmm84r7kwljgfs7dg6bjgxakbicis2x";
};

outputs = [ "bin" "doc" "man" "dev" "lib" "out" ];
outputs = if minimal then [ "out" ] else [ "bin" "doc" "man" "dev" "lib" "out" ];

buildInputs = [ oniguruma ];
buildInputs = stdenv.lib.optional (!minimal) oniguruma;

configureFlags =
[
"--bindir=\${bin}/bin"
"--sbindir=\${bin}/bin"
"--datadir=\${doc}/share"
"--mandir=\${man}/share/man"
if minimal then [ "--with-oniguruma=no" "--enable-all-static" ]
else [
"--bindir=\${bin}/bin"
"--sbindir=\${bin}/bin"
"--datadir=\${doc}/share"
"--mandir=\${man}/share/man"
]
# jq is linked to libjq:
++ stdenv.lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}";

doInstallCheck = true;
preFixup = stdenv.lib.optionalString minimal ''
rm -r .libs $out/{include,share}
patchelf --shrink-rpath $out/bin/jq
'';

doInstallCheck = !minimal;
installCheckTarget = "check";

postInstallCheck = ''
4 changes: 1 addition & 3 deletions pkgs/misc/uboot/default.nix
Original file line number Diff line number Diff line change
@@ -53,14 +53,12 @@ let
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
] ++ extraMakeFlags;

passAsFile = [ "extraConfig" ];

configurePhase = ''
runHook preConfigure
make ${defconfig}
cat $extraConfigPath >> .config
cat <(${buildPackages.jq}/bin/jq -r <.attrs.json .extraConfig) >> .config
runHook postConfigure
'';
4 changes: 0 additions & 4 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
@@ -1258,10 +1258,6 @@ showPhaseHeader() {


genericBuild() {
if [ -f "${buildCommandPath:-}" ]; then
source "$buildCommandPath"
return
fi
if [ -n "${buildCommand:-}" ]; then
eval "$buildCommand"
return
11 changes: 7 additions & 4 deletions pkgs/top-level/stage.nix
Original file line number Diff line number Diff line change
@@ -70,10 +70,13 @@ let
};

trivialBuilders = self: super:
import ../build-support/trivial-builders.nix {
inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.pkgsBuildHost.xorg) lndir;
inherit (self) runtimeShell; inherit (self.pkgsBuildHost) jq;
};
let
jq = self.pkgsBuildHost.jq.override { minimal = true; };
in
import ../build-support/trivial-builders.nix {
inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.pkgsBuildHost.xorg) lndir;
inherit (self) runtimeShell; inherit jq;
};

stdenvBootstappingAndPlatforms = self: super: let
withFallback = thisPkgs: