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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,23 @@
{
"name": "vscode-lldb",
"version": "1.6.8",
"dependencies": {
"string-argv": "^0.3.1",
"yaml": "^1.10.0",
"yauzl": "^2.10.0",
"@types/vscode": "^1.31.0",
"@types/node": "^8.10.50",
"@types/mocha": "^7.0.1",
"@types/yauzl": "^2.9.0",
"typescript": "^4.2.4",
"mocha": "^8.4.0",
"source-map-support": "^0.5.12",
"memory-streams": "^0.1.3",
"vscode-debugprotocol": "^1.47.0",
"vscode-debugadapter-testsupport": "^1.47.0",
"vsce": "=1.88.0",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"ts-loader": "^8.0.0"
}
}

View file

@ -0,0 +1,36 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37745b5..cad11a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,13 +16,6 @@ endif()
set(VERSION "${VERSION}${VERSION_SUFFIX}")
message("Version ${VERSION}")
-set(LLDB_PACKAGE $ENV{LLDB_PACKAGE} CACHE PATH "Zip archive containing LLDB files")
-if (LLDB_PACKAGE)
- message("Using LLDB_PACKAGE=${LLDB_PACKAGE}")
-else()
- message(FATAL_ERROR "LLDB_PACKAGE not set." )
-endif()
-
set(TEST_TIMEOUT 5000 CACHE STRING "Test timeout [ms]")
# General OS-specific definitions
@@ -87,16 +80,6 @@ configure_file(package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
configure_file(webpack.config.js ${CMAKE_CURRENT_BINARY_DIR}/webpack.config.js @ONLY)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-# Run 'npm install'
-execute_process(
- COMMAND ${NPM} ci # like install, but actually respects package-lock file.
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE Result
-)
-if (NOT ${Result} EQUAL 0)
- message(FATAL_ERROR "npm intall failed: ${Result}")
-endif()
-
# Copy it back, so we can commit the lock file.
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -0,0 +1,104 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, callPackage
, nodePackages, cmake, nodejs, unzip, python3
}:
assert lib.versionAtLeast python3.version "3.5";
let
publisher = "vadimcn";
pname = "vscode-lldb";
version = "1.6.10";
vscodeExtUniqueId = "${publisher}.${pname}";
src = fetchFromGitHub {
owner = "vadimcn";
repo = "vscode-lldb";
rev = "v${version}";
sha256 = "sha256-4PM/818UFHRZekfbdhS/Rz0Pu6HOjJEldi4YuBWECnI=";
};
lldb = callPackage ./lldb.nix {};
adapter = rustPlatform.buildRustPackage {
pname = "${pname}-adapter";
inherit version src;
# It will pollute the build environment of `buildRustPackage`.
cargoPatches = [ ./reset-cargo-config.patch ];
cargoSha256 = "sha256-Ch1X2vN+p7oCqSs/GIu5IzG+pcSKmQ+VwP2T8ycRhos=";
nativeBuildInputs = [ makeWrapper ];
buildAndTestSubdir = "adapter";
buildFeatures = [ "weak-linkage" ];
cargoBuildFlags = [
"--lib"
"--bin=codelldb"
];
# Tests are linked to liblldb but it is not available here.
doCheck = false;
};
nodeDeps = nodePackages."vscode-lldb-build-deps-../../applications/editors/vscode/extensions/vscode-lldb/build-deps";
in stdenv.mkDerivation {
pname = "vscode-extension-${publisher}-${pname}";
inherit src version vscodeExtUniqueId;
installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}";
nativeBuildInputs = [ cmake nodejs unzip makeWrapper ];
patches = [ ./cmake-build-extension-only.patch ];
postConfigure = ''
cp -r ${nodeDeps}/lib/node_modules/vscode-lldb/{node_modules,package-lock.json} .
'';
cmakeFlags = [
# Do not append timestamp to version.
"-DVERSION_SUFFIX="
];
makeFlags = [ "vsix_bootstrap" ];
installPhase = ''
ext=$out/$installPrefix
runHook preInstall
unzip ./codelldb-bootstrap.vsix 'extension/*' -d ./vsix-extracted
mkdir -p $ext/{adapter,formatters}
mv -t $ext vsix-extracted/extension/*
cp -t $ext/adapter ${adapter}/{bin,lib}/* ../adapter/*.py
wrapProgram $ext/adapter/codelldb \
--set-default LLDB_DEBUGSERVER_PATH "${lldb.out}/bin/lldb-server"
cp -t $ext/formatters ../formatters/*.py
ln -s ${lldb.lib} $ext/lldb
# Mark that all components are installed.
touch $ext/platform.ok
runHook postInstall
'';
# `adapter` will find python binary and libraries at runtime.
postFixup = ''
wrapProgram $out/$installPrefix/adapter/codelldb \
--prefix PATH : "${python3}/bin" \
--prefix LD_LIBRARY_PATH : "${python3}/lib"
'';
passthru = {
inherit lldb adapter;
};
meta = with lib; {
description = "A native debugger extension for VSCode based on LLDB";
homepage = "https://github.com/vadimcn/vscode-lldb";
license = with licenses; [ mit ];
maintainers = with maintainers; [ nigelgbanks ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,23 @@
# Patched lldb for Rust language support.
{ lldb_12, fetchFromGitHub }:
let
llvmSrc = fetchFromGitHub {
owner = "vadimcn";
repo = "llvm-project";
rev = "f2e9ff34256cd8c6feaf14359f88ad3f538ed687";
sha256 = "sha256-5UsCBu3rtt+l2HZiCswoQJPPh8T6y471TBF4AypdF9I=";
};
in lldb_12.overrideAttrs (oldAttrs: {
src = "${llvmSrc}/lldb";
passthru = (oldAttrs.passthru or {}) // {
inherit llvmSrc;
};
doInstallCheck = true;
postInstallCheck = (oldAttrs.postInstallCheck or "") + ''
versionOutput="$($out/bin/lldb --version)"
echo "'lldb --version' returns: $versionOutput"
echo "$versionOutput" | grep -q 'rust-enabled'
'';
})

View file

@ -0,0 +1,19 @@
diff --git a/.cargo/config b/.cargo/config
index c3c75e4..e69de29 100644
--- a/.cargo/config
+++ b/.cargo/config
@@ -1,14 +0,0 @@
-[build]
-target-dir = "build/target"
-
-[target.armv7-unknown-linux-gnueabihf]
-rustflags = [
- "-C", "link-arg=-fuse-ld=lld",
- "-C", "link-arg=--target=armv7-unknown-linux-gnueabihf",
-]
-
-[target.aarch64-unknown-linux-gnu]
-rustflags = [
- "-C", "link-arg=-fuse-ld=lld",
- "-C", "link-arg=--target=aarch64-unknown-linux-gnu",
-]

View file

@ -0,0 +1,46 @@
#! /usr/bin/env nix-shell
#! nix-shell ../../update-shell.nix -i bash
set -eo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ $# -ne 1 ]]; then
echo "Usage: ./update.sh <version>"
exit 1
fi
echo "
FIXME: This script doesn't update patched lldb. Please manually check branches
of https://github.com/vadimcn/llvm-project and update lldb with correct version of LLVM.
"
# Ideally, nixpkgs points to default.nix file of Nixpkgs official tree
nixpkgs=../../../../../..
nixFile=./default.nix
owner=vadimcn
repo=vscode-lldb
version="$1"
sed -E 's/\bversion = ".*?"/version = "'$version'"/' --in-place "$nixFile"
srcHash=$(nix-prefetch fetchFromGitHub --owner vadimcn --repo vscode-lldb --rev "v$version")
sed -E 's#\bsha256 = ".*?"#sha256 = "'$srcHash'"#' --in-place "$nixFile"
cargoHash=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).vscode-extensions.vadimcn.vscode-lldb.adapter.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
sed -E 's#\bcargoSha256 = ".*?"#cargoSha256 = "'$cargoHash'"#' --in-place "$nixFile"
src="$(nix-build $nixpkgs -A vscode-extensions.vadimcn.vscode-lldb.src --no-out-link)"
oldDeps="$(jq '.dependencies' build-deps/package.json)"
newDeps="$(jq '.dependencies + .devDependencies' "$src/package.json")"
jq '{ name, version: $version, dependencies: (.dependencies + .devDependencies) }' \
--arg version "$version" \
"$src/package.json" \
> build-deps/package.json
if [[ "$oldDeps" == "$newDeps" ]]; then
echo "Dependencies not changed"
sed '/"vscode-lldb-build-deps-/,+3 s/version = ".*"/version = "'"$version"'"/' \
--in-place "$nixpkgs/pkgs/development/node-packages/node-packages.nix"
else
echo "Dependencies changed"
# Regenerate nodePackages.
cd "$nixpkgs/pkgs/development/node-packages"
exec ./generate.sh
fi