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,14 @@
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl boost Security CoreFoundation cctools;
};
in
buildMongoDB {
version = "4.4.13";
sha256 = "sha256-ebg3R6P+tjRvizDzsl7mZzhTfqIaRJPfHBu0IfRvtS8=";
patches = [
./forget-build-dependencies-4-4.patch
] ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view-4-4.patch ];
}

View file

@ -0,0 +1,25 @@
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl boost Security CoreFoundation cctools;
};
variants = if stdenv.isLinux then
{
version = "5.0.7";
sha256 = "sha256-1PeDBZJNqJXHH/cSh2e+WR0PfS/b7XuJEzkkbrRT/gc=";
}
else
{
version = "5.0.3"; # at least darwin has to stay on 5.0.3 until the SDK used by nixpkgs is bumped to 10.13
sha256 = "1p9pq0dfd6lynvnz5p1c8dqp4filzrz86j840xwxwx82dm1zl6p0";
};
in
buildMongoDB {
version = variants.version;
sha256 = variants.sha256;
patches = [
./forget-build-dependencies-4-4.patch
./asio-no-experimental-string-view-4-4.patch
];
}

View file

@ -0,0 +1,22 @@
--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp
+++ b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
@@ -831,20 +831,8 @@
# endif // (__cplusplus >= 201402)
# endif // (_LIBCPP_VERSION < 7000)
# else // defined(ASIO_HAS_CLANG_LIBCXX)
-# if (__cplusplus >= 201402)
-# if __has_include(<experimental/string_view>)
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-# endif // __has_include(<experimental/string_view>)
-# endif // (__cplusplus >= 201402)
# endif // // defined(ASIO_HAS_CLANG_LIBCXX)
# endif // defined(__clang__)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201402)
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-# endif // (__cplusplus >= 201402)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)

View file

@ -0,0 +1,23 @@
--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp
--- b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
@@ -831,20 +831,8 @@
# endif // (__cplusplus >= 201402)
# endif // (_LIBCPP_VERSION < 7000)
# else // defined(ASIO_HAS_CLANG_LIBCXX)
-# if (__cplusplus >= 201402)
-# if __has_include(<experimental/string_view>)
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-# endif // __has_include(<experimental/string_view>)
-# endif // (__cplusplus >= 201402)
# endif // // defined(ASIO_HAS_CLANG_LIBCXX)
# endif // defined(__clang__)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201402)
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-# endif // (__cplusplus >= 201402)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)

View file

@ -0,0 +1,20 @@
diff --git a/src/third_party/asio-master/asio/include/asio/detail/config.hpp b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
index 7fe6a95a..ff4cc56b 100644
--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp
+++ b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
@@ -786,7 +786,6 @@
# if (__cplusplus >= 201402)
# if __has_include(<experimental/string_view>)
# define ASIO_HAS_STD_STRING_VIEW 1
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // __has_include(<experimental/string_view>)
# endif // (__cplusplus >= 201402)
# endif // defined(__clang__)
@@ -794,7 +793,6 @@
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
# if (__cplusplus >= 201402)
# define ASIO_HAS_STD_STRING_VIEW 1
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // (__cplusplus >= 201402)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)

View file

@ -0,0 +1,17 @@
--- a/site_scons/mongo_scons_utils.py
+++ b/site_scons/mongo_scons_utils.py
@@ -84,14 +84,11 @@
def default_buildinfo_environment_data():
return (
('distmod', '$MONGO_DISTMOD', True, True,),
('distarch', '$MONGO_DISTARCH', True, True,),
('cc', '$CC_VERSION', True, False,),
- ('ccflags', '$CCFLAGS', True, False,),
('cxx', '$CXX_VERSION', True, False,),
- ('cxxflags', '$CXXFLAGS', True, False,),
- ('linkflags', '$LINKFLAGS', True, False,),
('target_arch', '$TARGET_ARCH', True, True,),
('target_os', '$TARGET_OS', True, False,),
)
# If you want buildInfo and --version to be relatively empty, set

View file

@ -0,0 +1,36 @@
# MongoDB keeps track of its build parameters, which tricks nix into
# keeping dependencies to build inputs in the final output.
# We remove the build flags from buildInfo data.
--- a/site_scons/mongo/generators.py
+++ b/site_scons/mongo/generators.py
@@ -33,30 +33,12 @@ def default_buildinfo_environment_data():
True,
False,
),
- (
- 'ccflags',
- '$CCFLAGS',
- True,
- False,
- ),
(
'cxx',
'$CXX_VERSION',
True,
False,
),
- (
- 'cxxflags',
- '$CXXFLAGS',
- True,
- False,
- ),
- (
- 'linkflags',
- '$LINKFLAGS',
- True,
- False,
- ),
(
'target_arch',
'$TARGET_ARCH',

View file

@ -0,0 +1,33 @@
--- a/site_scons/mongo/generators.py
+++ b/site_scons/mongo/generators.py
@@ -34,30 +34,12 @@ def default_buildinfo_environment_data():
False,
),
(
- 'ccflags',
- '$CCFLAGS',
- True,
- False,
- ),
- (
'cxx',
'$CXX_VERSION',
True,
False,
),
(
- 'cxxflags',
- '$CXXFLAGS',
- True,
- False,
- ),
- (
- 'linkflags',
- '$LINKFLAGS',
- True,
- False,
- ),
- (
'target_arch',
'$TARGET_ARCH',
True,

View file

@ -0,0 +1,16 @@
# MongoDB keeps track of its build parameters, which tricks nix into
# keeping dependencies to build inputs in the final output.
# We remove the build flags from buildInfo data.
--- a/site_scons/mongo/generators.py
+++ b/site_scons/mongo/generators.py
@@ -18,10 +18,7 @@ def default_buildinfo_environment_data():
('distmod', '$MONGO_DISTMOD', True, True,),
('distarch', '$MONGO_DISTARCH', True, True,),
('cc', '$CC_VERSION', True, False,),
- ('ccflags', '$CCFLAGS', True, False,),
('cxx', '$CXX_VERSION', True, False,),
- ('cxxflags', '$CXXFLAGS', True, False,),
- ('linkflags', '$LINKFLAGS', True, False,),
('target_arch', '$TARGET_ARCH', True, True,),
('target_os', '$TARGET_OS', True, False,),
)

View file

@ -0,0 +1,140 @@
{ lib, stdenv, fetchurl, sconsPackages, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp
, sasl, openssl, libpcap, python3, curl, Security, CoreFoundation, cctools, xz }:
# Note:
# The command line tools are written in Go as part of a different package (mongodb-tools)
with lib;
{ version, sha256, patches ? []
, license ? lib.licenses.sspl
}:
let
variants = if versionAtLeast version "4.2"
then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 psutil setuptools ]);
scons = sconsPackages.scons_3_1_2.override { python = python3; }; # 4.2 < mongodb <= 5.0.x needs scons 3.x built with python3
mozjsVersion = "60";
mozjsReplace = "defined(HAVE___SINCOS)";
}
else rec { python = scons.python.withPackages (ps: with ps; [ pyyaml typing cheetah ]);
scons = sconsPackages.scons_3_1_2;
mozjsVersion = "45";
mozjsReplace = "defined(HAVE_SINCOS)";
};
system-libraries = [
"boost"
"pcre"
"snappy"
"yaml"
"zlib"
#"asio" -- XXX use package?
#"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
#"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
#"wiredtiger"
] ++ optionals stdenv.isLinux [ "tcmalloc" ];
inherit (lib) systems subtractLists;
in stdenv.mkDerivation rec {
inherit version;
pname = "mongodb";
src = fetchurl {
url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz";
inherit sha256;
};
nativeBuildInputs = [ variants.scons ]
++ lib.optionals (versionAtLeast version "4.4") [ xz ];
buildInputs = [
boost
curl
gperftools
libpcap
libyamlcpp
openssl
pcre-cpp
variants.python
sasl
snappy
zlib
] ++ lib.optionals stdenv.isDarwin [ Security CoreFoundation cctools ];
# MongoDB keeps track of its build parameters, which tricks nix into
# keeping dependencies to build inputs in the final output.
# We remove the build flags from buildInfo data.
inherit patches;
postPatch = ''
# fix environment variable reading
substituteInPlace SConstruct \
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0
substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2cap.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2latlng.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2latlngrect.cc --replace drem remainder
'' + lib.optionalString stdenv.isi686 ''
# don't fail by default on i686
substituteInPlace src/mongo/db/storage/storage_options.h \
--replace 'engine("wiredTiger")' 'engine("mmapv1")'
'';
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
"-Wno-unused-command-line-argument";
sconsFlags = [
"--release"
"--ssl"
#"--rocksdb" # Don't have this packaged yet
"--wiredtiger=on"
"--js-engine=mozjs"
"--use-sasl-client"
"--disable-warnings-as-errors"
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
] ++ lib.optionals (versionAtLeast version "4.4") [ "--link-model=static" ]
++ map (lib: "--use-system-${lib}") system-libraries;
preBuild = ''
sconsFlags+=" CC=$CC"
sconsFlags+=" CXX=$CXX"
'' + optionalString stdenv.isAarch64 ''
sconsFlags+=" CCFLAGS='-march=armv8-a+crc'"
'';
preInstall = ''
mkdir -p "$out/lib"
'';
postInstall = ''
rm -f "$out/bin/install_compass" || true
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
"$out/bin/mongo" --version
runHook postInstallCheck
'';
installTargets = if (versionAtLeast version "4.4") then "install-core" else "install";
prefixKey = if (versionAtLeast version "4.4") then "DESTDIR=" else "--prefix=";
enableParallelBuilding = true;
hardeningEnable = [ "pie" ];
meta = {
description = "A scalable, high-performance, open source NoSQL database";
homepage = "http://www.mongodb.org";
inherit license;
maintainers = with maintainers; [ bluescreen303 offline cstrahan ];
platforms = subtractLists systems.doubles.i686 systems.doubles.unix;
};
}

View file

@ -0,0 +1,27 @@
# HG changeset patch
# User Dan Gohman <sunfish@mozilla.com>
# Parent d9b405d82cffb07343a5f2fd941e029298c7f6c4
# Bug 1390214 - IonMonkey: Don't test for a 3-byte opcode in a 2-byte opcode predicate.
# https://bug1390214.bmoattachments.org/attachment.cgi?id=8902972
diff --git a/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h b/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h
--- a/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h
+++ b/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h
@@ -310,17 +310,16 @@ enum ThreeByteOpcodeID {
// Test whether the given opcode should be printed with its operands reversed.
inline bool IsXMMReversedOperands(TwoByteOpcodeID opcode)
{
switch (opcode) {
case OP2_MOVSD_WsdVsd: // also OP2_MOVPS_WpsVps
case OP2_MOVAPS_WsdVsd:
case OP2_MOVDQ_WdqVdq:
- case OP3_PEXTRD_EdVdqIb:
return true;
default:
break;
}
return false;
}
enum ThreeByteEscape {

View file

@ -0,0 +1,16 @@
{ callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl;
inherit boost;
inherit Security;
inherit CoreFoundation;
inherit cctools;
};
in buildMongoDB {
version = "3.4.24";
sha256 = "0j6mvgv0jnsnvgkl8505bl88kbxkba66qijlpi1la0dd5pd1imfr";
patches = [ ./forget-build-dependencies-3-4.patch ];
license = lib.licenses.agpl3;
}

View file

@ -0,0 +1,16 @@
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl;
inherit boost;
inherit Security;
inherit CoreFoundation;
inherit cctools;
};
in buildMongoDB {
version = "3.6.23";
sha256 = "sha256-EJpIerW4zcGJvHfqJ65fG8yNsLRlUnRkvYfC+jkoFJ4=";
patches = [ ./forget-build-dependencies.patch ]
++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ];
}

View file

@ -0,0 +1,17 @@
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl;
inherit boost;
inherit Security;
inherit CoreFoundation;
inherit cctools;
};
in buildMongoDB {
version = "4.0.27";
sha256 = "sha256-ct33mnK4pszhYM4Is7j0GZQRyi8i8Qmy0wcklyq5LjM=";
patches =
[ ./forget-build-dependencies.patch ./mozjs-45_fix-3-byte-opcode.patch ]
++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ];
}

View file

@ -0,0 +1,17 @@
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl;
inherit boost;
inherit Security;
inherit CoreFoundation;
inherit cctools;
};
in buildMongoDB {
version = "4.2.19";
sha256 = "sha256-fngTHd+fSdHqiqQYOYS7o6P5eHybeZy3iNKkGzFmjTw=";
patches =
[ ./forget-build-dependencies-4-2.patch ]
++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view-4-2.patch ];
}