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,61 @@
{ lib, stdenv, bzip2, zlib, autoconf, automake, cmake, help2man, texinfo, libtool, cppzmq, libarchive
, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, libkrb5, gcc, libcxx, which, catch2, nanodbc, fmt
, nlohmann_json, spdlog }:
# Common attributes of irods packages
{
nativeBuildInputs = [ autoconf automake cmake help2man texinfo which gcc ];
buildInputs = [ bzip2 zlib libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc libkrb5 boost
libcxx catch2 nanodbc fmt nlohmann_json spdlog ];
cmakeFlags = [
"-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}"
"-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}"
"-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}"
"-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}"
"-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}"
"-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}"
"-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}"
"-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
"-DIRODS_EXTERNALS_FULLPATH_CATCH2=${catch2}"
"-DIRODS_EXTERNALS_FULLPATH_NANODBC=${nanodbc}"
"-DIRODS_EXTERNALS_FULLPATH_FMT=${fmt}"
"-DIRODS_EXTERNALS_FULLPATH_JSON=${nlohmann_json}"
"-DIRODS_EXTERNALS_FULLPATH_SPDLOG=${spdlog}"
"-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
"-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1.0"
"-DCPACK_GENERATOR=TGZ"
"-DCMAKE_CXX_FLAGS=-I${lib.getDev libcxx}/include/c++/v1"
];
postPatch = ''
patchShebangs ./packaging ./scripts
substituteInPlace CMakeLists.txt \
--replace "DESTINATION usr/bin" "DESTINATION bin" \
--replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/" \
--replace "DESTINATION usr/lib/" "DESTINATION lib/" \
--replace "{IRODS_EXTERNALS_FULLPATH_JSON}/include" "{IRODS_EXTERNALS_FULLPATH_JSON}/include/nlohmann"
export cmakeFlags="$cmakeFlags
-DCMAKE_INSTALL_PREFIX=$out
"
'';
meta = with lib; {
description = "Integrated Rule-Oriented Data System (iRODS)";
longDescription = ''
The Integrated Rule-Oriented Data System (iRODS) is open source data management
software used by research organizations and government agencies worldwide.
iRODS is released as a production-level distribution aimed at deployment in mission
critical environments. It virtualizes data storage resources, so users can take
control of their data, regardless of where and on what device the data is stored.
As data volumes grow and data services become more complex, iRODS is increasingly
important in data management. The development infrastructure supports exhaustive
testing on supported platforms; plug-in support for microservices, storage resources,
drivers, and databases; and extensive documentation, training and support services.'';
homepage = "https://irods.org";
license = lib.licenses.bsd3;
maintainers = [ lib.maintainers.bzizou ];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,101 @@
{ lib, stdenv, fetchFromGitHub, bzip2, zlib, autoconf, automake, cmake, help2man, texinfo, libtool, cppzmq
, libarchive, avro-cpp_llvm, boost, jansson, zeromq, openssl, pam, libiodbc, libkrb5, gcc, libcxx, which, catch2
, nanodbc_llvm, fmt, nlohmann_json, spdlog }:
let
avro-cpp = avro-cpp_llvm;
nanodbc = nanodbc_llvm;
in
let
common = import ./common.nix {
inherit lib stdenv bzip2 zlib autoconf automake cmake
help2man texinfo libtool cppzmq libarchive jansson
zeromq openssl pam libiodbc libkrb5 gcc libcxx
boost avro-cpp which catch2 nanodbc fmt nlohmann_json
spdlog;
};
in
rec {
# irods: libs and server package
irods = stdenv.mkDerivation (common // rec {
version = "4.2.11";
pname = "irods";
src = fetchFromGitHub {
owner = "irods";
repo = "irods";
rev = version;
sha256 = "0prcsiddk8n3h515jjapgfz1d6hjqywhrkcf6giqd7xc7b0slz44";
fetchSubmodules = true;
};
# Patches:
# irods_root_path.patch : the root path is obtained by stripping 3 items of the path,
# but we don't use /usr with nix, so remove only 2 items.
patches = [ ./irods_root_path.patch ];
# fix build with recent llvm versions
NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";
postPatch = common.postPatch + ''
patchShebangs ./test
substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
substituteInPlace cmake/server.cmake --replace "DESTINATION usr/sbin" "DESTINATION sbin"
substituteInPlace cmake/server.cmake --replace "IRODS_DOC_DIR usr/share" "IRODS_DOC_DIR share"
substituteInPlace cmake/runtime_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/include" "DESTINATION include"
for file in unit_tests/cmake/test_config/*.cmake
do
substituteInPlace $file --replace "CATCH2}/include" "CATCH2}/include/catch2"
done
export cmakeFlags="$cmakeFlags
-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib
-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib
-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib
"
substituteInPlace cmake/server.cmake --replace SETUID ""
'';
meta = common.meta // {
longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
};
});
# icommands (CLI) package, depends on the irods package
irods-icommands = stdenv.mkDerivation (common // rec {
version = "4.2.11";
pname = "irods-icommands";
src = fetchFromGitHub {
owner = "irods";
repo = "irods_client_icommands";
rev = version;
sha256 = "0wgs585j2lp820py2pbizsk54xgz5id96fhxwwk9lqhbzxhfjhcg";
};
patches = [ ./zmqcpp-deprecated-send_recv.patch ];
buildInputs = common.buildInputs ++ [ irods ];
postPatch = common.postPatch + ''
patchShebangs ./bin
'';
cmakeFlags = common.cmakeFlags ++ [
"-DCMAKE_INSTALL_PREFIX=${stdenv.out}"
"-DIRODS_DIR=${irods}/lib/irods/cmake"
"-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
"-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
"-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
];
meta = common.meta // {
description = common.meta.description + " CLI clients";
longDescription = common.meta.longDescription + "This package provides the CLI clients, called 'icommands'.";
};
});
}

View file

@ -0,0 +1,49 @@
diff -r -u irods-4.2.0.orig/scripts/irods/paths.py irods-4.2.0/scripts/irods/paths.py
--- irods-4.2.0.orig/scripts/irods/paths.py 2016-11-15 06:23:55.000000000 +0000
+++ irods-4.2.0/scripts/irods/paths.py 2016-12-21 15:17:07.437864606 +0000
@@ -10,7 +10,7 @@
return os.path.join(root_directory(), 'var', 'lib', 'irods')
def config_directory():
- return os.path.join(root_directory(), 'etc', 'irods')
+ return os.path.join(os.path.abspath('/'), 'etc', 'irods')
def plugins_directory():
return os.path.join(root_directory(), 'usr', 'lib', 'irods', 'plugins')
@@ -37,7 +37,7 @@
def version_path():
return os.path.join(
- irods_directory(),
+ home_directory(),
'VERSION.json')
def hosts_config_path():
@@ -64,7 +64,7 @@
def log_directory():
return os.path.join(
- irods_directory(),
+ home_directory(),
'log')
def control_log_path():
@@ -110,8 +110,7 @@
def server_bin_directory():
return os.path.join(
root_directory(),
- 'usr',
- 'sbin')
+ 'bin')
def server_executable():
return os.path.join(
@@ -132,7 +131,7 @@
return os.path.join(config_directory(), 'service_account.config')
def genosauth_path():
- return os.path.join(irods_directory(), 'clients', 'bin', 'genOSAuth')
+ return os.path.join(home_directory(), 'clients', 'bin', 'genOSAuth')
def irods_user_and_group_entries():
try:

View file

@ -0,0 +1,21 @@
diff -r -u source/src/irods-grid.cpp source.new/src/irods-grid.cpp
--- source/src/irods-grid.cpp 1970-01-01 01:00:01.000000000 +0100
+++ source.new/src/irods-grid.cpp 2020-05-05 16:34:35.566464346 +0200
@@ -412,7 +412,7 @@
data_to_send.data(),
data_to_send.size() );
try {
- if (!zmq_skt.send(req)) {
+ if (!zmq_skt.send( req, zmq::send_flags::dontwait )) {
std::cerr << "ZeroMQ encountered an error sending a message.\n";
return errno;
}
@@ -426,7 +426,7 @@
zmq::message_t rep;
// wait for the server reponse
try {
- if (!zmq_skt.recv( &rep )) {
+ if (!zmq_skt.recv( rep, zmq::recv_flags::dontwait )) {
std::cerr << "ZeroMQ encountered an error receiving a message.\n";
return errno;
}