Merge staging into staging-next

This commit is contained in:
Frederik Rietdijk
2020-05-01 09:28:45 +02:00
176 changed files with 644 additions and 526 deletions

View File

@@ -3,20 +3,9 @@
, stdenv
, writeTextDir
, substituteAll
, targetPackages
, pkgsHostHost
}:
let
# See https://mesonbuild.com/Reference-tables.html#cpu-families
cpuFamilies = {
aarch64 = "aarch64";
armv5tel = "arm";
armv6l = "arm";
armv7l = "arm";
i686 = "x86";
x86_64 = "x86_64";
};
in
python3Packages.buildPythonApplication rec {
pname = "meson";
version = "0.54.0";
@@ -45,6 +34,11 @@ python3Packages.buildPythonApplication rec {
# We remove the check so multiple outputs can work sanely.
./allow-dirs-outside-of-prefix.patch
# Meson is currently inspecting fewer variables than autoconf does, which
# makes it harder for us to use setup hooks, etc. Taken from
# https://github.com/mesonbuild/meson/pull/6827
./more-env-vars.patch
# Unlike libtool, vanilla Meson does not pass any information
# about the path library will be installed to to g-ir-scanner,
# breaking the GIR when path other than ${!outputLib}/lib is used.
@@ -65,35 +59,15 @@ python3Packages.buildPythonApplication rec {
setupHook = ./setup-hook.sh;
crossFile = writeTextDir "cross-file.conf" ''
[binaries]
c = '${targetPackages.stdenv.cc.targetPrefix}cc'
cpp = '${targetPackages.stdenv.cc.targetPrefix}c++'
ar = '${targetPackages.stdenv.cc.bintools.targetPrefix}ar'
strip = '${targetPackages.stdenv.cc.bintools.targetPrefix}strip'
pkgconfig = 'pkg-config'
ld = '${targetPackages.stdenv.cc.targetPrefix}ld'
objcopy = '${targetPackages.stdenv.cc.targetPrefix}objcopy'
[properties]
needs_exe_wrapper = true
[host_machine]
system = '${targetPackages.stdenv.targetPlatform.parsed.kernel.name}'
cpu_family = '${cpuFamilies.${targetPackages.stdenv.targetPlatform.parsed.cpu.name}}'
cpu = '${targetPackages.stdenv.targetPlatform.parsed.cpu.name}'
endian = ${if targetPackages.stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"}
'';
# Ensure there will always be a native C compiler when meson is used, as a
# workaround until https://github.com/mesonbuild/meson/pull/6512 lands.
depsHostHostPropagated = [ pkgsHostHost.stdenv.cc ];
# 0.45 update enabled tests but they are failing
doCheck = false;
# checkInputs = [ ninja pkgconfig ];
# checkPhase = "python ./run_project_tests.py";
inherit (stdenv) cc;
isCross = stdenv.targetPlatform != stdenv.hostPlatform;
meta = with lib; {
homepage = "https://mesonbuild.com";
description = "SCons-like build system that use python as a front-end language and Ninja as a building backend";

View File

@@ -0,0 +1,16 @@
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index ac13a710..e0d07c51 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -119,9 +119,9 @@ def get_env_var_pair(for_machine: MachineChoice,
# compiling we fall back on the unprefixed host version. This
# allows native builds to never need to worry about the 'BUILD_*'
# ones.
- ([var_name + '_FOR_BUILD'] if is_cross else [var_name]),
+ [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]),
# Always just the unprefixed host verions
- ([] if is_cross else [var_name]),
+ [var_name],
)[for_machine]
for var in candidates:
value = os.environ.get(var)

View File

@@ -5,11 +5,6 @@ mesonConfigurePhase() {
mesonFlags="--prefix=$prefix $mesonFlags"
fi
# Build release by default.
if [ -n "@isCross@" ]; then
crossMesonFlags="--cross-file=@crossFile@/cross-file.conf"
fi
# See multiple-outputs.sh and mesons coredata.py
mesonFlags="\
--libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \
@@ -25,7 +20,7 @@ mesonConfigurePhase() {
echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"
CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build $mesonFlags "${mesonFlagsArray[@]}"
meson build $mesonFlags "${mesonFlagsArray[@]}"
cd build
if ! [[ -v enableParallelBuilding ]]; then

View File

@@ -22,7 +22,7 @@ buildGoPackage rec {
sha256 = "187cvb3i5cwm7cwxmzpl2ca7900yb6v6b6cybyz5mnd5ccy5ff1q";
};
outputs = [ "bin" "man" "out" ];
outputs = [ "out" "man" ];
goPackagePath = "github.com/containers/buildah";
excludedPackages = [ "tests" ];
@@ -35,7 +35,7 @@ buildGoPackage rec {
buildPhase = ''
pushd go/src/${goPackagePath}
make GIT_COMMIT="unknown"
install -Dm755 buildah $bin/bin/buildah
install -Dm755 buildah $out/bin/buildah
installShellCompletion --bash contrib/completions/bash/buildah
'';

View File

@@ -34,7 +34,7 @@ buildGoPackage rec {
'';
installPhase = ''
install -Dm555 out/cf "$bin/bin/cf"
install -Dm555 out/cf "$out/bin/cf"
installShellCompletion --bash "$src/ci/installers/completion/cf"
'';

View File

@@ -20,8 +20,8 @@ buildGoPackage rec {
'';
postInstall = ''
mv $bin/bin/{internal,ct}
rm $bin/bin/tools
mv $out/bin/{internal,ct}
rm $out/bin/tools
'';
meta = {

View File

@@ -24,10 +24,10 @@ buildGoPackage rec {
postInstall = ''
# Fix binary name
mv $bin/bin/{agent,buildkite-agent}
mv $out/bin/{agent,buildkite-agent}
# These are runtime dependencies
wrapProgram $bin/bin/buildkite-agent \
wrapProgram $out/bin/buildkite-agent \
--prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
'';

View File

@@ -15,17 +15,17 @@ buildGoPackage {
postInstall = ''
${stdenv.lib.optionalString hasBootstrapScript ''
# Install bootstrap.sh
mkdir -p $bin/libexec/buildkite-agent
cp $NIX_BUILD_TOP/go/src/${goPackagePath}/templates/bootstrap.sh $bin/libexec/buildkite-agent
sed -e "s|#!/bin/bash|#!${bash}/bin/bash|g" -i $bin/libexec/buildkite-agent/bootstrap.sh
mkdir -p $out/libexec/buildkite-agent
cp $NIX_BUILD_TOP/go/src/${goPackagePath}/templates/bootstrap.sh $out/libexec/buildkite-agent
sed -e "s|#!/bin/bash|#!${bash}/bin/bash|g" -i $out/libexec/buildkite-agent/bootstrap.sh
''}
# Fix binary name
mv $bin/bin/{agent,buildkite-agent}
mv $out/bin/{agent,buildkite-agent}
# These are runtime dependencies
wrapProgram $bin/bin/buildkite-agent \
${stdenv.lib.optionalString hasBootstrapScript "--set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $bin/libexec/buildkite-agent/bootstrap.sh"} \
wrapProgram $out/bin/buildkite-agent \
${stdenv.lib.optionalString hasBootstrapScript "--set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $out/libexec/buildkite-agent/bootstrap.sh"} \
--prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
'';

View File

@@ -35,10 +35,10 @@ buildGoPackage rec {
patches = [ ./fix-shell-path.patch ];
postInstall = ''
touch $bin/bin/hello
install -d $bin/bin/helper-images
ln -sf ${docker_x86_64} $bin/bin/helper-images/prebuilt-x86_64.tar.xz
ln -sf ${docker_arm} $bin/bin/helper-images/prebuilt-arm.tar.xz
touch $out/bin/hello
install -d $out/bin/helper-images
ln -sf ${docker_x86_64} $out/bin/helper-images/prebuilt-x86_64.tar.xz
ln -sf ${docker_arm} $out/bin/helper-images/prebuilt-arm.tar.xz
'';
meta = with lib; {

View File

@@ -9,8 +9,8 @@ buildGoPackage rec {
subPackages = [ "client" ];
postInstall = ''
if [ -f "$bin/bin/client" ]; then
mv "$bin/bin/client" "$bin/bin/deis"
if [ -f "$out/bin/client" ]; then
mv "$out/bin/client" "$out/bin/deis"
fi
'';

View File

@@ -19,7 +19,7 @@ buildGoPackage rec {
];
postFixup = ''
wrapProgram $bin/bin/dep2nix \
wrapProgram $out/bin/dep2nix \
--prefix PATH : ${nix-prefetch-scripts}/bin
'';

View File

@@ -21,7 +21,7 @@ buildGoPackage rec {
postInstall = ''
export HOME=$(mktemp -d) # attempts to write to /homeless-shelter
for shell in bash fish zsh; do
$bin/bin/doctl completion $shell > doctl.$shell
$out/bin/doctl completion $shell > doctl.$shell
installShellCompletion doctl.$shell
done
'';

View File

@@ -18,7 +18,7 @@ buildGoPackage rec {
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $bin/bin/fac \
wrapProgram $out/bin/fac \
--prefix PATH : ${git}/bin
# Install man page, not installed by default

View File

@@ -17,14 +17,14 @@ buildGoPackage rec {
goDeps = ./deps.nix;
outputs = [ "bin" "out" "man" ];
outputs = [ "out" "man" ];
nativeBuildInputs = [ go-bindata gotools makeWrapper ];
preBuild = ''go generate ./...'';
postInstall = ''
wrapProgram $bin/bin/go2nix \
wrapProgram $out/bin/go2nix \
--prefix PATH : ${nix-prefetch-git}/bin \
--prefix PATH : ${git}/bin

View File

@@ -25,7 +25,7 @@ buildGoPackage rec {
goDeps = ./deps.nix;
postInstall = ''
mv $bin/bin/gocode $bin/bin/gocode-gomod
mv $out/bin/gocode $out/bin/gocode-gomod
'';
meta = with stdenv.lib; {

View File

@@ -20,7 +20,7 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash zsh; do
$bin/bin/kind completion $shell > kind.$shell
$out/bin/kind completion $shell > kind.$shell
installShellCompletion kind.$shell
done
'';

View File

@@ -27,7 +27,7 @@ buildGoPackage rec {
postInstall = with stdenv; let
binPath = lib.makeBinPath [ mercurial git ];
in ''
wrapProgram $bin/bin/houndd --prefix PATH : ${binPath}
wrapProgram $out/bin/houndd --prefix PATH : ${binPath}
'';
meta = {

View File

@@ -17,7 +17,7 @@ buildGoPackage rec {
goDeps = ./deps.nix;
postFixup = ''
wrapProgram $bin/bin/out-of-tree \
wrapProgram $out/bin/out-of-tree \
--prefix PATH : "${stdenv.lib.makeBinPath [ qemu docker which ]}"
'';

View File

@@ -0,0 +1,29 @@
{ haskellPackages, haskell, removeReferencesTo }:
let
static = haskell.lib.justStaticExecutables haskellPackages.pandoc;
in
(haskell.lib.overrideCabal static (drv: {
configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ];
})).overrideAttrs (drv: {
# These libraries are still referenced, because pandoc references
# their `Paths_*` module for figuring out their version.
# The `Paths_*` module is generated by Cabal, and contains the
# version, but also paths to e.g. the data directories, which
# lead to a transitive runtime dependency on the whole GHC distribution.
# This should ideally be fixed in haskellPackages (or even Cabal),
# but a minimal pandoc is important enough to patch it manually.
disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.HTTP ];
postInstall = ''
remove-references-to \
-t ${haskellPackages.pandoc-types} \
$out/bin/pandoc
remove-references-to \
-t ${haskellPackages.HTTP} \
$out/bin/pandoc
'';
})

View File

@@ -1,16 +1,24 @@
{ stdenv, fetchFromGitHub, autoreconfHook }:
{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
stdenv.mkDerivation rec {
pname = "re2c";
version = "1.2.1";
version = "1.3";
src = fetchFromGitHub {
owner = "skvadrik";
repo = "re2c";
rev = version;
sha256 = "1qj0ck9msb9h8g9qb1lr57jmlj8x68ini3y3ccdifjjahhhr0hd4";
sha256 = "0aqlf2h6i2m3dq11dkq89p4w4c9kp4x66s5rhp84gmpz5xqv1x5h";
};
patches = [
(fetchpatch {
name = "CVE-2020-11958.patch";
url = "https://github.com/skvadrik/re2c/commit/c4603ba5ce229db83a2a4fb93e6d4b4e3ec3776a.patch";
sha256 = "1d95ahxk92g7k87sda9gxgmr3blyfzwd2y7h9jxj8zkd74knd9zh";
})
];
nativeBuildInputs = [ autoreconfHook ];
doCheck = true;

View File

@@ -26,7 +26,7 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash zsh; do
$bin/bin/skaffold completion $shell > skaffold.$shell
$out/bin/skaffold completion $shell > skaffold.$shell
installShellCompletion skaffold.$shell
done
'';

View File

@@ -34,7 +34,7 @@ buildGoPackage {
inherit version;
inherit src goPackagePath;
outputs = [ "bin" "man" "out" ];
outputs = [ "out" "man" ];
excludedPackages = [ "integration" ];

View File

@@ -15,8 +15,8 @@ buildGoPackage rec {
buildFlagsArray = "-ldflags=-X github.com/Shopify/toxiproxy.Version=v${version}";
postInstall = ''
mv $bin/bin/cli $bin/bin/toxiproxy-cli
mv $bin/bin/cmd $bin/bin/toxiproxy-cmd
mv $out/bin/cli $out/bin/toxiproxy-cli
mv $out/bin/cmd $out/bin/toxiproxy-cmd
'';
meta = {

View File

@@ -28,7 +28,7 @@ buildGoPackage {
postInstall = with stdenv; let
binPath = lib.makeBinPath [ nix-prefetch-git go ];
in ''
wrapProgram $bin/bin/vgo2nix --prefix PATH : ${binPath}
wrapProgram $out/bin/vgo2nix --prefix PATH : ${binPath}
'';
meta = with stdenv.lib; {

View File

@@ -19,7 +19,7 @@ buildGoPackage rec {
};
postInstall = ''
mv $bin/bin/cli $bin/bin/wally
mv $out/bin/cli $out/bin/wally
'';
goDeps = ./deps.nix;

View File

@@ -110,11 +110,15 @@ runCommand "xcodebuild-${xcbuild.version}" {
mkdir -p $out/Applications/Xcode.app/Contents
ln -s $out $out/Applications/Xcode.app/Contents/Developer
# The native xcodebuild command supports an invocation like "xcodebuild -version -sdk" without specifying the specific SDK, so we simulate this by
# detecting this case and simulating the output; printing the header and appending the normal output via appending the sdk version to the positional
# arguments we pass through to the wrapped xcodebuild.
makeWrapper ${xcbuild}/bin/xcodebuild $out/bin/xcodebuild \
--add-flags "-xcconfig ${xcconfig}" \
--add-flags "DERIVED_DATA_DIR=." \
--set DEVELOPER_DIR "$out" \
--set SDKROOT ${sdkName} \
--run '[ "$#" -eq 2 ] && [ "$1" = "-version" ] && [ "$2" = "-sdk" ] && echo ${sdkName}.sdk - macOS ${sdkVer} \(macosx${sdkVer}\) && set -- "$@" "${sdkName}"' \
--run '[ "$1" = "-version" ] && [ "$#" -eq 1 ] && (echo Xcode ${xcodeVer}; echo Build version ${sdkBuildVersion}) && exit 0' \
--run '[ "$1" = "-license" ] && exit 0'