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,58 @@
From 6be95cf45c4b5beae8b364468cef42d5c5880836 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Sun, 9 Jan 2022 01:57:18 +0100
Subject: [PATCH] build: Make includedir properly overrideable
This is required by some package managers like Nix.
---
CMakeLists.txt | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad50174..e0be58c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,10 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
+if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
+ set(CMAKE_INSTALL_INCLUDEDIR "include")
+endif()
+
if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
@@ -302,7 +306,7 @@ endif ()
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
aws_use_package(aws-c-http)
aws_use_package(aws-c-mqtt)
@@ -316,13 +320,13 @@ aws_use_package(aws-c-s3)
target_link_libraries(${PROJECT_NAME} ${DEP_AWS_LIBS})
-install(FILES ${AWS_CRT_HEADERS} DESTINATION "include/aws/crt" COMPONENT Development)
-install(FILES ${AWS_CRT_AUTH_HEADERS} DESTINATION "include/aws/crt/auth" COMPONENT Development)
-install(FILES ${AWS_CRT_CRYPTO_HEADERS} DESTINATION "include/aws/crt/crypto" COMPONENT Development)
-install(FILES ${AWS_CRT_IO_HEADERS} DESTINATION "include/aws/crt/io" COMPONENT Development)
-install(FILES ${AWS_CRT_IOT_HEADERS} DESTINATION "include/aws/iot" COMPONENT Development)
-install(FILES ${AWS_CRT_MQTT_HEADERS} DESTINATION "include/aws/crt/mqtt" COMPONENT Development)
-install(FILES ${AWS_CRT_HTTP_HEADERS} DESTINATION "include/aws/crt/http" COMPONENT Development)
+install(FILES ${AWS_CRT_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt" COMPONENT Development)
+install(FILES ${AWS_CRT_AUTH_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt/auth" COMPONENT Development)
+install(FILES ${AWS_CRT_CRYPTO_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt/crypto" COMPONENT Development)
+install(FILES ${AWS_CRT_IO_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt/io" COMPONENT Development)
+install(FILES ${AWS_CRT_IOT_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/iot" COMPONENT Development)
+install(FILES ${AWS_CRT_MQTT_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt/mqtt" COMPONENT Development)
+install(FILES ${AWS_CRT_HTTP_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/crt/http" COMPONENT Development)
install(
TARGETS ${PROJECT_NAME}
--
2.34.1

View file

@ -0,0 +1,86 @@
{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, aws-c-auth
, aws-c-cal
, aws-c-common
, aws-c-compression
, aws-c-event-stream
, aws-c-http
, aws-c-io
, aws-c-mqtt
, aws-c-s3
, aws-checksums
, cmake
, s2n-tls
}:
stdenv.mkDerivation rec {
pname = "aws-crt-cpp";
version = "0.17.28";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "awslabs";
repo = "aws-crt-cpp";
rev = "v${version}";
sha256 = "sha256-4/BgwX8Pa5D2lEn0Dh3JlUiYUtA9u0rWpBixqmv1X/A=";
};
patches = [
# Correct include path for split outputs.
# https://github.com/awslabs/aws-crt-cpp/pull/325
./0001-build-Make-includedir-properly-overrideable.patch
# Fix build with new input stream api
# https://github.com/awslabs/aws-crt-cpp/pull/341
# Remove with next release
(fetchpatch {
url = "https://github.com/awslabs/aws-crt-cpp/commit/8adb8490fd4f1d1fe65aad01b0a7dda0e52ac596.patch";
excludes = [ "crt/*" ];
sha256 = "190v8rlj6z0qllih6w3kqmdvqjifj66hc4bchsgr3gpfv18vpzid";
})
];
postPatch = ''
substituteInPlace CMakeLists.txt --replace '-Werror' ""
'';
nativeBuildInputs = [
cmake
];
propagatedBuildInputs = [
aws-c-auth
aws-c-cal
aws-c-common
aws-c-compression
aws-c-event-stream
aws-c-http
aws-c-io
aws-c-mqtt
aws-c-s3
aws-checksums
s2n-tls
];
cmakeFlags = [
"-DBUILD_DEPS=OFF"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DBUILD_SHARED_LIBS=ON"
];
postInstall = ''
# Prevent dependency cycle.
moveToOutput lib/aws-crt-cpp/cmake "$dev"
'';
meta = with lib; {
description = "C++ wrapper around the aws-c-* libraries";
homepage = "https://github.com/awslabs/aws-crt-cpp";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ r-burns ];
};
}