Merge master into staging-next

This commit is contained in:
github-actions[bot]
2021-05-11 12:24:28 +00:00
committed by GitHub
22 changed files with 903 additions and 98 deletions

View File

@@ -1,22 +1,22 @@
{ lib, stdenv, llvmPackages }:
let
clang = llvmPackages.clang-unwrapped;
unwrapped = llvmPackages.clang-unwrapped;
in stdenv.mkDerivation {
pname = "clang-tools";
version = lib.getVersion clang;
version = lib.getVersion unwrapped;
dontUnpack = true;
clang = llvmPackages.clang;
inherit unwrapped;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
export libc_includes="${lib.getDev stdenv.cc.libc}/include"
export libcpp_includes="${llvmPackages.libcxx}/include/c++/v1"
export clang=${clang}
substituteAll ${./wrapper} $out/bin/clangd
chmod +x $out/bin/clangd
for tool in \
@@ -32,7 +32,7 @@ in stdenv.mkDerivation {
runHook postInstall
'';
meta = clang.meta // {
meta = unwrapped.meta // {
description = "Standalone command line tools for C++ development";
maintainers = with lib.maintainers; [ aherrmann ];
};

19
pkgs/development/tools/clang-tools/wrapper Normal file → Executable file
View File

@@ -1,20 +1,27 @@
#!/bin/sh
buildcpath() {
local path
local path after
while (( $# )); do
case $1 in
-isystem)
shift
path=$path${path:+':'}$1
;;
-idirafter)
shift
after=$after${after:+':'}$1
;;
esac
shift
done
echo $path
echo $path${after:+':'}$after
}
export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE})
export CPATH=${CPATH}${CPATH:+':'}@libc_includes@
export CPLUS_INCLUDE_PATH=${CPATH}${CPATH:+':'}@libcpp_includes@
export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
$(<@clang@/nix-support/libc-cflags))
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
$(<@clang@/nix-support/libcxx-cxxflags) \
$(<@clang@/nix-support/libc-cflags))
exec -a "$0" @clang@/bin/$(basename $0) "$@"
exec -a "$0" @unwrapped@/bin/$(basename $0) "$@"

View File

@@ -1,4 +1,4 @@
{ lib, rustPlatform, fetchFromGitHub }:
{ lib, rustPlatform, fetchFromGitHub, stdenv, libiconv }:
rustPlatform.buildRustPackage rec {
pname = "cargo-expand";
@@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-1+A+n5VQS8zJULiR8IWLGo+RnFuVjg6ist8G3eCsXJM=";
buildInputs = lib.optional stdenv.isDarwin libiconv;
meta = with lib; {
description =
"A utility and Cargo subcommand designed to let people expand macros in their Rust source code";

View File

@@ -1,4 +1,4 @@
{ lib, rustPlatform, fetchFromGitHub }:
{ lib, rustPlatform, fetchFromGitHub, stdenv, libiconv }:
rustPlatform.buildRustPackage rec {
pname = "cargo-feature";
@@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "0nvl5smibl81b826xcsrjx8p89lcfpj7wqdsvywnj7jd3p5ag03n";
buildInputs = lib.optional stdenv.isDarwin libiconv;
meta = with lib; {
description = "Allows conveniently modify features of crate";
homepage = "https://github.com/Riey/cargo-feature";

View File

@@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, rustPlatform }:
{ lib, fetchFromGitHub, rustPlatform, stdenv, libiconv }:
rustPlatform.buildRustPackage rec {
pname = "cargo-fuzz";
@@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-eEfry6Q2YiIkNEHu6C8p17pUTF43eS1/iTP2oATZ/F8=";
buildInputs = lib.optional stdenv.isDarwin libiconv;
doCheck = false;
meta = with lib; {

View File

@@ -4,6 +4,9 @@
, nix-update-script
, pkg-config
, openssl
, stdenv
, libiconv
, Security
}:
rustPlatform.buildRustPackage rec {
@@ -28,7 +31,9 @@ rustPlatform.buildRustPackage rec {
# Integration tests fail
doCheck = false;
buildInputs = [ openssl ];
buildInputs = if stdenv.isDarwin
then [ libiconv Security ]
else [ openssl ];
nativeBuildInputs = [ pkg-config ];