From aa54ac3b512b093c63d6bb78baa5ccf13440a0fb Mon Sep 17 00:00:00 2001 From: Raymond Gauthier Date: Fri, 19 Jan 2018 00:24:37 -0500 Subject: [PATCH 01/54] geis: fix python programs --- pkgs/development/libraries/geis/default.nix | 27 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/development/libraries/geis/default.nix index 6e043f5994df..5796425e4385 100644 --- a/pkgs/development/libraries/geis/default.nix +++ b/pkgs/development/libraries/geis/default.nix @@ -1,14 +1,20 @@ { stdenv, fetchurl , pkgconfig -, python3 +, python3Packages +, wrapGAppsHook +, atk , dbus_libs , evemu , frame +, gdk_pixbuf +, gobjectIntrospection , grail +, gtk3 , libX11 , libXext , libXi , libXtst +, pango , xorgserver }: @@ -25,8 +31,23 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-Wno-format -Wno-misleading-indentation -Wno-error"; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ python3 dbus_libs evemu frame grail libX11 libXext libXi libXtst xorgserver ]; + pythonPath = with python3Packages; + [ pygobject3 ]; + + nativeBuildInputs = [ pkgconfig wrapGAppsHook python3Packages.wrapPython]; + buildInputs = [ atk dbus_libs evemu frame gdk_pixbuf gobjectIntrospection grail + gtk3 libX11 libXext libXi libXtst pango python3Packages.python xorgserver + ]; + + patchPhase = '' + substituteInPlace python/geis/geis_v2.py --replace \ + "ctypes.util.find_library(\"geis\")" "'$out/lib/libgeis.so'" + ''; + + preFixup = '' + buildPythonPath "$out $pythonPath" + gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH") + ''; meta = { description = "A library for input gesture recognition"; From cb00c506035e34ae3f84993ab90a0733362af81f Mon Sep 17 00:00:00 2001 From: Valentin Heidelberger Date: Sun, 11 Feb 2018 21:04:24 +0100 Subject: [PATCH 02/54] pythonPackages.pynacl: ignore timeout in tests don't modify test_aead.py yet add pynacl-no-timeout-and-deadline.patch --- .../python-modules/pynacl/default.nix | 7 +-- .../pynacl-no-timeout-and-deadline.patch | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch diff --git a/pkgs/development/python-modules/pynacl/default.nix b/pkgs/development/python-modules/pynacl/default.nix index c23a90c095b6..981427e46f33 100644 --- a/pkgs/development/python-modules/pynacl/default.nix +++ b/pkgs/development/python-modules/pynacl/default.nix @@ -11,11 +11,8 @@ buildPythonPackage rec { sha256 = "0z9i1z4hjzmp23igyhvg131gikbrr947506lwfb3fayf0agwfv8f"; }; - #remove deadline from tests, see https://github.com/pyca/pynacl/issues/370 - preCheck = '' - sed -i 's/deadline=1500, //' tests/test_pwhash.py - sed -i 's/deadline=1500, //' tests/test_aead.py - ''; + #set timeout to unlimited, remove deadline from tests, see https://github.com/pyca/pynacl/issues/370 + patches = [ ./pynacl-no-timeout-and-deadline.patch ]; checkInputs = [ pytest coverage hypothesis ]; propagatedBuildInputs = [ libsodium cffi six ]; diff --git a/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch b/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch new file mode 100644 index 000000000000..5f831df3c48d --- /dev/null +++ b/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch @@ -0,0 +1,49 @@ +diff --git a/tests/test_pwhash.py b/tests/test_pwhash.py +index 9634c85..7f20316 100644 +--- a/tests/test_pwhash.py ++++ b/tests/test_pwhash.py +@@ -20,7 +20,7 @@ import os + import sys + import unicodedata as ud + +-from hypothesis import given, settings ++from hypothesis import given, settings, unlimited + from hypothesis.strategies import integers, text + + import pytest +@@ -411,7 +411,7 @@ def test_str_verify_argon2_ref_fail(password_hash, password): + integers(min_value=1024 * 1024, + max_value=16 * 1024 * 1024) + ) +-@settings(deadline=1500, max_examples=20) ++@settings(timeout=unlimited, deadline=None, max_examples=20) + def test_argon2i_str_and_verify(password, ops, mem): + _psw = password.encode('utf-8') + pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem) +@@ -425,7 +425,7 @@ def test_argon2i_str_and_verify(password, ops, mem): + integers(min_value=1024 * 1024, + max_value=16 * 1024 * 1024) + ) +-@settings(deadline=1500, max_examples=20) ++@settings(timeout=unlimited, deadline=None, max_examples=20) + def test_argon2id_str_and_verify(password, ops, mem): + _psw = password.encode('utf-8') + pw_hash = nacl.pwhash.argon2id.str(_psw, opslimit=ops, memlimit=mem) +@@ -439,7 +439,7 @@ def test_argon2id_str_and_verify(password, ops, mem): + integers(min_value=1024 * 1024, + max_value=16 * 1024 * 1024) + ) +-@settings(deadline=1500, max_examples=20) ++@settings(timeout=unlimited, deadline=None, max_examples=20) + def test_argon2i_str_and_verify_fail(password, ops, mem): + _psw = password.encode('utf-8') + pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem) +@@ -448,7 +448,7 @@ def test_argon2i_str_and_verify_fail(password, ops, mem): + + + @given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20)) +-@settings(deadline=1500, max_examples=5) ++@settings(timeout=unlimited, deadline=None, max_examples=5) + def test_pwhash_str_and_verify(password): + _psw = password.encode('utf-8') + From e2783b299c906756b3954948b08aa8a08b90878f Mon Sep 17 00:00:00 2001 From: taku0 Date: Sun, 4 Feb 2018 14:38:20 +0900 Subject: [PATCH 03/54] swift: fix build --- pkgs/development/compilers/swift/default.nix | 36 ++++++- .../compilers/swift/patches/icu59.patch | 101 ++++++++++++++++++ .../swift/patches/remove_xlocale.patch | 54 ++++++++++ .../compilers/swift/patches/sigaltstack.patch | 11 ++ .../compilers/swift/patches/sigunused.patch | 24 +++++ 5 files changed, 223 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/compilers/swift/patches/icu59.patch create mode 100644 pkgs/development/compilers/swift/patches/remove_xlocale.patch create mode 100644 pkgs/development/compilers/swift/patches/sigaltstack.patch create mode 100644 pkgs/development/compilers/swift/patches/sigunused.patch diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 937977b0a97d..62edb9044e58 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -12,7 +12,6 @@ , swig , bash , libxml2 -, llvm , clang , python , ncurses @@ -28,8 +27,10 @@ , git , libgit2 , fetchFromGitHub +, fetchpatch , paxctl , findutils +, makeWrapper #, systemtap }: @@ -47,7 +48,7 @@ let name = "${repo}-${version}-src"; }; -sources = { + sources = { # FYI: SourceKit probably would work but currently requires building everything twice # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 clang = fetch { @@ -119,6 +120,8 @@ sources = { ]; builder = '' + NIX_CFLAGS_COMPILE=$( echo ${clang.default_cxx_stdlib_compile} ) + $SWIFT_SOURCE_ROOT/swift/utils/build-script \ --preset=buildbot_linux \ installable_package=$INSTALLABLE_PACKAGE \ @@ -126,6 +129,20 @@ sources = { install_destdir=$SWIFT_INSTALL_DIR \ extra_cmake_options="${stdenv.lib.concatStringsSep "," cmakeFlags}"''; + # from llvm/4/llvm.nix + sigaltstackPatch = fetchpatch { + name = "sigaltstack.patch"; # for glibc-2.26 + url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff; + sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi"; + }; + + # https://bugs.swift.org/browse/SR-6409 + sigunusedPatch = fetchpatch { + name = "sigunused.patch"; + url = "https://github.com/apple/swift-llbuild/commit/303a89bc6da606c115560921a452686aa0655f5e.diff"; + sha256 = "04sw7ym1grzggj1v3xrzr2ljxz8rf9rnn9n5fg1xjbwlrdagkc7m"; + }; + in stdenv.mkDerivation rec { name = "swift-${version_friendly}"; @@ -145,6 +162,7 @@ stdenv.mkDerivation rec { rsync which findutils + makeWrapper ] ++ stdenv.lib.optional stdenv.needsPax paxctl; # TODO: Revisit what's propagated and how @@ -209,6 +227,10 @@ stdenv.mkDerivation rec { patch -p1 -d swift -i ${./patches/0002-build-presets-linux-allow-custom-install-prefix.patch} patch -p1 -d swift -i ${./patches/0003-build-presets-linux-disable-tests.patch} patch -p1 -d swift -i ${./patches/0004-build-presets-linux-plumb-extra-cmake-options.patch} + # https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27 + patch -p1 -i ${./patches/remove_xlocale.patch} + # https://bugs.swift.org/browse/SR-4633 + patch -p1 -d swift -i ${./patches/icu59.patch} substituteInPlace clang/lib/Driver/ToolChains.cpp \ --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ @@ -232,6 +254,11 @@ stdenv.mkDerivation rec { --replace usr "$PREFIX" substituteInPlace swiftpm/Utilities/bootstrap \ --replace "usr" "$PREFIX" + '' + stdenv.lib.optionalString (stdenv ? glibc) '' + patch -p1 -d compiler-rt -i ${sigaltstackPatch} + patch -p1 -d compiler-rt -i ${./patches/sigaltstack.patch} + patch -p1 -d llbuild -i ${sigunusedPatch} + patch -p1 -i ${./patches/sigunused.patch} ''; doCheck = false; @@ -251,6 +278,10 @@ stdenv.mkDerivation rec { # TODO: Use wrappers to get these on the PATH for swift tools, instead ln -s ${clang}/bin/* $out/bin/ ln -s ${targetPackages.stdenv.cc.bintools}/bin/ar $out/bin/ar + + wrapProgram $out/bin/swift \ + --suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \ + --suffix CPLUS_INCLUDE_PATH : $out/lib/swift/clang/include ''; # Hack to avoid TMPDIR in RPATHs. @@ -263,7 +294,6 @@ stdenv.mkDerivation rec { license = licenses.asl20; # Swift doesn't support 32bit Linux, unknown on other platforms. platforms = [ "x86_64-linux" ]; - broken = true; }; } diff --git a/pkgs/development/compilers/swift/patches/icu59.patch b/pkgs/development/compilers/swift/patches/icu59.patch new file mode 100644 index 000000000000..83d7e62636a4 --- /dev/null +++ b/pkgs/development/compilers/swift/patches/icu59.patch @@ -0,0 +1,101 @@ +--- a/stdlib/public/stubs/UnicodeNormalization.cpp ++++ b/stdlib/public/stubs/UnicodeNormalization.cpp +@@ -86,11 +86,8 @@ ASCIICollation() { + for (unsigned char c = 0; c < 128; ++c) { + UErrorCode ErrorCode = U_ZERO_ERROR; + intptr_t NumCollationElts = 0; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + UChar Buffer[1]; +-#else +- uint16_t Buffer[1]; +-#endif ++ + Buffer[0] = c; + + UCollationElements *CollationIterator = +@@ -127,18 +124,9 @@ swift::_swift_stdlib_unicode_compare_utf16_utf16(const uint16_t *LeftString, + int32_t LeftLength, + const uint16_t *RightString, + int32_t RightLength) { +-#if defined(__CYGWIN__) || defined(_MSC_VER) +- // ICU UChar type is platform dependent. In Cygwin, it is defined +- // as wchar_t which size is 2. It seems that the underlying binary +- // representation is same with swift utf16 representation. + return ucol_strcoll(GetRootCollator(), + reinterpret_cast(LeftString), LeftLength, + reinterpret_cast(RightString), RightLength); +-#else +- return ucol_strcoll(GetRootCollator(), +- LeftString, LeftLength, +- RightString, RightLength); +-#endif + } + + /// Compares the strings via the Unicode Collation Algorithm on the root locale. +@@ -156,12 +144,8 @@ swift::_swift_stdlib_unicode_compare_utf8_utf16(const unsigned char *LeftString, + UErrorCode ErrorCode = U_ZERO_ERROR; + + uiter_setUTF8(&LeftIterator, reinterpret_cast(LeftString), LeftLength); +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uiter_setString(&RightIterator, reinterpret_cast(RightString), + RightLength); +-#else +- uiter_setString(&RightIterator, RightString, RightLength); +-#endif + + uint32_t Diff = ucol_strcollIter(GetRootCollator(), + &LeftIterator, &RightIterator, &ErrorCode); +@@ -199,14 +183,10 @@ swift::_swift_stdlib_unicode_compare_utf8_utf8(const unsigned char *LeftString, + void *swift::_swift_stdlib_unicodeCollationIterator_create( + const __swift_uint16_t *Str, __swift_uint32_t Length) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + UCollationElements *CollationIterator = ucol_openElements( + GetRootCollator(), reinterpret_cast(Str), Length, + &ErrorCode); +-#else +- UCollationElements *CollationIterator = ucol_openElements( +- GetRootCollator(), Str, Length, &ErrorCode); +-#endif ++ + if (U_FAILURE(ErrorCode)) { + swift::crash("_swift_stdlib_unicodeCollationIterator_create: ucol_openElements() failed."); + } +@@ -244,17 +224,12 @@ swift::_swift_stdlib_unicode_strToUpper(uint16_t *Destination, + const uint16_t *Source, + int32_t SourceLength) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uint32_t OutputLength = u_strToUpper(reinterpret_cast(Destination), + DestinationCapacity, + reinterpret_cast(Source), + SourceLength, + "", &ErrorCode); +-#else +- uint32_t OutputLength = u_strToUpper(Destination, DestinationCapacity, +- Source, SourceLength, +- "", &ErrorCode); +-#endif ++ + if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { + swift::crash("u_strToUpper: Unexpected error uppercasing unicode string."); + } +@@ -271,17 +246,12 @@ swift::_swift_stdlib_unicode_strToLower(uint16_t *Destination, + const uint16_t *Source, + int32_t SourceLength) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uint32_t OutputLength = u_strToLower(reinterpret_cast(Destination), + DestinationCapacity, + reinterpret_cast(Source), + SourceLength, + "", &ErrorCode); +-#else +- uint32_t OutputLength = u_strToLower(Destination, DestinationCapacity, +- Source, SourceLength, +- "", &ErrorCode); +-#endif ++ + if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { + swift::crash("u_strToLower: Unexpected error lowercasing unicode string."); + } diff --git a/pkgs/development/compilers/swift/patches/remove_xlocale.patch b/pkgs/development/compilers/swift/patches/remove_xlocale.patch new file mode 100644 index 000000000000..8ef7e3916962 --- /dev/null +++ b/pkgs/development/compilers/swift/patches/remove_xlocale.patch @@ -0,0 +1,54 @@ +--- a/swift/stdlib/public/SDK/os/os_trace_blob.c ++++ b/swift/stdlib/public/SDK/os/os_trace_blob.c +@@ -14,7 +14,6 @@ + #include + #include + #include +-#include + #include "os_trace_blob.h" + + OS_NOINLINE + +--- a/swift/stdlib/public/stubs/Stubs.cpp ++++ b/swift/stdlib/public/stubs/Stubs.cpp +@@ -61,7 +61,6 @@ + #define strtof_l swift_strtof_l + #define strtold_l swift_strtold_l + #else +-#include + #endif + #include + #include "llvm/ADT/StringExtras.h" + +--- a/swift-corelibs-foundation/CoreFoundation/String.subproj/CFStringDefaultEncoding.h ++++ b/swift-corelibs-foundation/CoreFoundation/String.subproj/CFStringDefaultEncoding.h +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + + CF_EXTERN_C_BEGIN + + +--- a/swift-corelibs-foundation/CoreFoundation/String.subproj/CFStringEncodings.c ++++ b/swift-corelibs-foundation/CoreFoundation/String.subproj/CFStringEncodings.c +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + #include + #endif + + +--- a/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFInternal.h ++++ b/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFInternal.h +@@ -95,7 +95,6 @@ + #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD + #if TARGET_OS_CYGWIN + #else +-#include + #endif + #include + #include diff --git a/pkgs/development/compilers/swift/patches/sigaltstack.patch b/pkgs/development/compilers/swift/patches/sigaltstack.patch new file mode 100644 index 000000000000..c529fa3777b3 --- /dev/null +++ b/pkgs/development/compilers/swift/patches/sigaltstack.patch @@ -0,0 +1,11 @@ +--- a/lib/esan/esan_sideline_linux.cpp ++++ b/lib/esan/esan_sideline_linux.cpp +@@ -70,7 +70,7 @@ int SidelineThread::runSideline(void *Arg) { + + // Set up a signal handler on an alternate stack for safety. + InternalScopedBuffer StackMap(SigAltStackSize); +- struct sigaltstack SigAltStack; ++ stack_t SigAltStack; + SigAltStack.ss_sp = StackMap.data(); + SigAltStack.ss_size = SigAltStackSize; + SigAltStack.ss_flags = 0; diff --git a/pkgs/development/compilers/swift/patches/sigunused.patch b/pkgs/development/compilers/swift/patches/sigunused.patch new file mode 100644 index 000000000000..42e6e297e0a8 --- /dev/null +++ b/pkgs/development/compilers/swift/patches/sigunused.patch @@ -0,0 +1,24 @@ +--- a/swift-corelibs-libdispatch/libpwq/src/posix/manager.c ++++ b/swift-corelibs-libdispatch/libpwq/src/posix/manager.c +@@ -273,9 +273,6 @@ static void sigmask_init(void) + sigdelset(&sigmask, SIGFPE); + sigdelset(&sigmask, SIGBUS); + sigdelset(&sigmask, SIGSEGV); +-#if SIGSYS != SIGUNUSED +- sigdelset(&sigmask, SIGSYS); +-#endif + sigdelset(&sigmask, SIGPIPE); + sigdelset(&sigmask, SIGPROF); + + +--- a/swiftpm/Sources/Utility/Process.swift ++++ b/swiftpm/Sources/Utility/Process.swift +@@ -140,7 +140,7 @@ public final class Process: ObjectIdentifierProtocol { + // modify, so we have to take care about the set we use. + var mostSignals = sigset_t() + sigemptyset(&mostSignals); +- for i in 1 ..< SIGUNUSED { ++ for i in 1 ..< SIGSYS { + if i == SIGKILL || i == SIGSTOP { + continue + } From c275c3dc303938fa205df09cb3f9c1152bd5f03e Mon Sep 17 00:00:00 2001 From: taku0 Date: Mon, 12 Feb 2018 15:31:47 +0900 Subject: [PATCH 04/54] swift: 3.1.1 -> 4.0.3 --- pkgs/development/compilers/swift/default.nix | 46 +++++++++++-------- ...ts-linux-allow-custom-install-prefix.patch | 4 +- .../compilers/swift/patches/icu59.patch | 12 +++++ .../compilers/swift/patches/sigunused.patch | 21 ++------- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 62edb9044e58..360f96e12427 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -31,11 +31,13 @@ , paxctl , findutils , makeWrapper +, gnumake +, file #, systemtap }: let - v_major = "3.1.1"; + v_major = "4.0.3"; version = "${v_major}-RELEASE"; version_friendly = "${v_major}"; @@ -53,48 +55,48 @@ let # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 clang = fetch { repo = "swift-clang"; - sha256 = "1gmdgr8jph87nya8cgdl7iwrggbji2sag996m27hkbszw4nxy8sd"; + sha256 = "0zm624iwiprk3c3nzqf4p1fd9zqic4yi3jv51cw3249ax4x6vy10"; }; llvm = fetch { repo = "swift-llvm"; - sha256 = "0nwd7cp6mbj7f6a2rx8123n7ygs8406hsx7hp7ybagww6v75bwzi"; + sha256 = "11vw6461c0cdvwm1wna1a5709fjj14hzp6br6jg94p4f6jp3yv4d"; }; compilerrt = fetch { repo = "swift-compiler-rt"; - sha256 = "1gjcr6g3ffs3nhf4a84iwg4flbd7rqcf9rvvclwyq96msa3mj950"; + sha256 = "1hj4qaj4c9n2wzg2cvarbyl0n708zd1dlw4zkzq07fjxxqs36nfa"; }; cmark = fetch { repo = "swift-cmark"; - sha256 = "0qf2f3zd8lndkfbxbz6vkznzz8rvq5gigijh7pgmfx9fi4zcssqx"; + sha256 = "1nmxp0fj749sgar682c5nsj7zxxigqwg973baxj2r656a7ybh325"; }; lldb = fetch { repo = "swift-lldb"; - sha256 = "17n4whpf3wxw9zaayiq21gk9q3547qxi4rvxld2hybh0k7a1bj5c"; + sha256 = "0yk5qg85008vcn63vn2jpn5ls9pdhda222p2w1cfkrj27k5k8vqr"; }; llbuild = fetch { repo = "swift-llbuild"; - sha256 = "1l3hnb2s01jby91k1ipbc3bhszq14vyx5pzdhf2chld1yhpg420d"; + sha256 = "0jffw6z1s6ck1i05brw59x6vsg7zrxbz5n2wz72fj29rh3nppc7a"; }; pm = fetch { repo = "swift-package-manager"; - sha256 = "1ayy5vk3mjk354pg9bf68wvnaj3jymx23w0qnlw1jxz256ff8fwi"; + sha256 = "0xj070b8fii7ijfsnyq4fxgv6569vdrg0yippi85h2p1l7s9aagh"; }; xctest = fetch { repo = "swift-corelibs-xctest"; - sha256 = "0cj5y7wanllfldag08ci567x12aw793c79afckpbsiaxmwy4xhnm"; + sha256 = "0l355wq8zfwrpv044xf4smjwbm0bmib360748n8cwls3vkr9l2yv"; }; foundation = fetch { repo = "swift-corelibs-foundation"; - sha256 = "1d1ldk7ckqn4mhmdhsx2zrmsd6jfxzgdywn2pki7limk979hcwjc"; + sha256 = "0s7yc5gsbd96a4bs8c6q24dyfjm4xhcr2nzhl2ics8dmi60j15s4"; }; libdispatch = fetch { repo = "swift-corelibs-libdispatch"; - sha256 = "0ckjg41fjak06i532azhryckjq64fkxzsal4svf5v4s8n9mkq2sg"; + sha256 = "0x8zzq3shhvmhq4sbhaaa0ddiv3nw347pz6ayym6jyzq7j9n15ia"; fetchSubmodules = true; }; swift = fetch { repo = "swift"; - sha256 = "0879jlv37lmxc1apzi53xn033y72548i86r7fzwr0g52124q5gry"; + sha256 = "0a1gq0k5701i418f0qi7kywv16q7vh4a4wp0f6fpyv4sjkq27msx"; }; }; @@ -120,7 +122,8 @@ let ]; builder = '' - NIX_CFLAGS_COMPILE=$( echo ${clang.default_cxx_stdlib_compile} ) + # gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found + NIX_CFLAGS_COMPILE="$( echo ${clang.default_cxx_stdlib_compile} ) $NIX_CFLAGS_COMPILE" $SWIFT_SOURCE_ROOT/swift/utils/build-script \ --preset=buildbot_linux \ @@ -163,6 +166,7 @@ stdenv.mkDerivation rec { which findutils makeWrapper + gnumake ] ++ stdenv.lib.optional stdenv.needsPax paxctl; # TODO: Revisit what's propagated and how @@ -216,6 +220,14 @@ stdenv.mkDerivation rec { # Just patch all the things for now, we can focus this later patchShebangs $SWIFT_SOURCE_ROOT + # TODO eliminate use of env. + find -type f -print0 | xargs -0 sed -i \ + -e 's|/usr/bin/env|${coreutils}/bin/env|g' \ + -e 's|/usr/bin/make|${gnumake}/bin/make|g' \ + -e 's|/bin/mkdir|${coreutils}/bin/mkdir|g' \ + -e 's|/bin/cp|${coreutils}/bin/cp|g' \ + -e 's|/usr/bin/file|${file}/bin/file|g' + substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \ --replace '/usr/include' "${stdenv.cc.libc.dev}/include" substituteInPlace swift/utils/build-script-impl \ @@ -232,6 +244,9 @@ stdenv.mkDerivation rec { # https://bugs.swift.org/browse/SR-4633 patch -p1 -d swift -i ${./patches/icu59.patch} + # https://bugs.swift.org/browse/SR-5779 + sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake + substituteInPlace clang/lib/Driver/ToolChains.cpp \ --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ ' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);' @@ -239,16 +254,11 @@ stdenv.mkDerivation rec { # Workaround hardcoded dep on "libcurses" (vs "libncurses"): sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt - substituteInPlace llbuild/tests/BuildSystem/Build/basic.llbuild \ - --replace /usr/bin/env $(type -p env) # This test fails on one of my machines, not sure why. # Disabling for now. rm llbuild/tests/Examples/buildsystem-capi.llbuild - substituteInPlace swift-corelibs-foundation/lib/script.py \ - --replace /bin/cp $(type -p cp) - PREFIX=''${out/#\/} substituteInPlace swift-corelibs-xctest/build_script.py \ --replace usr "$PREFIX" diff --git a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch index 0e18e8812a84..66723f1cdf39 100644 --- a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch +++ b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch @@ -11,13 +11,13 @@ diff --git a/utils/build-presets.ini b/utils/build-presets.ini index e6b0af3581..1095cbaab7 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini -@@ -692,7 +692,7 @@ install-lldb +@@ -708,7 +708,7 @@ install-lldb install-llbuild install-swiftpm install-xctest -install-prefix=/usr +install-prefix=%(install_prefix)s - swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license + swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc build-swift-static-stdlib build-swift-static-sdk-overlay -- diff --git a/pkgs/development/compilers/swift/patches/icu59.patch b/pkgs/development/compilers/swift/patches/icu59.patch index 83d7e62636a4..26337814cafa 100644 --- a/pkgs/development/compilers/swift/patches/icu59.patch +++ b/pkgs/development/compilers/swift/patches/icu59.patch @@ -99,3 +99,15 @@ if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { swift::crash("u_strToLower: Unexpected error lowercasing unicode string."); } +@@ -300,9 +300,9 @@ + + swift::__swift_stdlib_UBreakIterator *swift::__swift_stdlib_ubrk_open( + swift::__swift_stdlib_UBreakIteratorType type, const char *locale, +- const UChar *text, int32_t textLength, __swift_stdlib_UErrorCode *status) { ++ const __swift_stdlib_UChar * text, __swift_int32_t textLength, __swift_stdlib_UErrorCode *status) { + return ptr_cast( +- ubrk_open(static_cast(type), locale, text, textLength, ++ ubrk_open(static_cast(type), locale, reinterpret_cast(text), textLength, + ptr_cast(status))); + } + diff --git a/pkgs/development/compilers/swift/patches/sigunused.patch b/pkgs/development/compilers/swift/patches/sigunused.patch index 42e6e297e0a8..2701d1a3ae25 100644 --- a/pkgs/development/compilers/swift/patches/sigunused.patch +++ b/pkgs/development/compilers/swift/patches/sigunused.patch @@ -1,22 +1,9 @@ ---- a/swift-corelibs-libdispatch/libpwq/src/posix/manager.c -+++ b/swift-corelibs-libdispatch/libpwq/src/posix/manager.c -@@ -273,9 +273,6 @@ static void sigmask_init(void) - sigdelset(&sigmask, SIGFPE); - sigdelset(&sigmask, SIGBUS); - sigdelset(&sigmask, SIGSEGV); --#if SIGSYS != SIGUNUSED -- sigdelset(&sigmask, SIGSYS); --#endif - sigdelset(&sigmask, SIGPIPE); - sigdelset(&sigmask, SIGPROF); - - ---- a/swiftpm/Sources/Utility/Process.swift -+++ b/swiftpm/Sources/Utility/Process.swift -@@ -140,7 +140,7 @@ public final class Process: ObjectIdentifierProtocol { +--- a/swiftpm/Sources/Basic/Process.swift ++++ b/swiftpm/Sources/Basic/Process.swift +@@ -258,7 +258,7 @@ public func launch() throws { // modify, so we have to take care about the set we use. var mostSignals = sigset_t() - sigemptyset(&mostSignals); + sigemptyset(&mostSignals) - for i in 1 ..< SIGUNUSED { + for i in 1 ..< SIGSYS { if i == SIGKILL || i == SIGSTOP { From 8ab1db0ff5e47e7c516f1bd8b5c6e86a92c88e2c Mon Sep 17 00:00:00 2001 From: davidak Date: Wed, 14 Feb 2018 01:06:29 +0100 Subject: [PATCH 05/54] micawber: init at 0.3.5 --- .../python-modules/micawber/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/python-modules/micawber/default.nix diff --git a/pkgs/development/python-modules/micawber/default.nix b/pkgs/development/python-modules/micawber/default.nix new file mode 100644 index 000000000000..5e3afe05ea79 --- /dev/null +++ b/pkgs/development/python-modules/micawber/default.nix @@ -0,0 +1,26 @@ +{ stdenv, buildPythonPackage, fetchPypi, beautifulsoup4 }: + +buildPythonPackage rec { + pname = "micawber"; + version = "0.3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "0pnq6j8f144virhri0drgf0058x6qcxfd5yrb0ynbwr8djh326yn"; + }; + + propagatedBuildInputs = [ beautifulsoup4 ]; + + meta = with stdenv.lib; { + homepage = http://micawber.readthedocs.io/en/latest/; + description = "A small library for extracting rich content from urls"; + license = licenses.mit; + longDescription = '' + micawber supplies a few methods for retrieving rich metadata + about a variety of links, such as links to youtube videos. + micawber also provides functions for parsing blocks of text and html + and replacing links to videos with rich embedded content. + ''; + maintainers = with maintainers; [ davidak ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 44a270b4db1e..6c6a1e463670 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10111,6 +10111,8 @@ in { }; }; + micawber = callPackage ../development/python-modules/micawber { }; + minimock = buildPythonPackage rec { version = "1.2.8"; name = "minimock-${version}"; From 772b72a8d7fbb77e99478d2e2cfe9c60216aed7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 17 Feb 2018 19:24:20 +0100 Subject: [PATCH 06/54] nixos/home-assistant: test MQTT configuration --- nixos/tests/home-assistant.nix | 36 +++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index 5d7e0ec65e73..2e45dc78471f 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -2,17 +2,27 @@ import ./make-test.nix ({ pkgs, ... }: let configDir = "/var/lib/foobar"; + apiPassword = "secret"; in { name = "home-assistant"; + meta = with pkgs.stdenv.lib; { + maintainers = with maintainers; [ dotlambda ]; + }; nodes = { hass = { config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + mosquitto + ]; services.home-assistant = { inherit configDir; enable = true; + package = pkgs.home-assistant.override { + extraPackages = ps: with ps; [ hbmqtt ]; + }; config = { homeassistant = { name = "Home"; @@ -22,7 +32,16 @@ in { elevation = 0; }; frontend = { }; - http = { }; + http.api_password = apiPassword; + mqtt = { }; # Use hbmqtt as broker + binary_sensor = [ + { + platform = "mqtt"; + state_topic = "home-assistant/test"; + payload_on = "let_there_be_light"; + payload_off = "off"; + } + ]; }; }; }; @@ -31,7 +50,7 @@ in { testScript = '' startAll; $hass->waitForUnit("home-assistant.service"); - + # Since config is specified using a Nix attribute set, # configuration.yaml is a link to the Nix store $hass->succeed("test -L ${configDir}/configuration.yaml"); @@ -39,8 +58,19 @@ in { # Check that Home Assistant's web interface and API can be reached $hass->waitForOpenPort(8123); $hass->succeed("curl --fail http://localhost:8123/states"); - $hass->succeed("curl --fail http://localhost:8123/api/ | grep 'API running'"); + $hass->succeed("curl --fail -H 'x-ha-access: ${apiPassword}' http://localhost:8123/api/ | grep -qF 'API running'"); + # Toggle a binary sensor using MQTT + $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"off\"'"); + $hass->waitUntilSucceeds("mosquitto_pub -V mqttv311 -t home-assistant/test -u homeassistant -P '${apiPassword}' -m let_there_be_light"); + $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"on\"'"); + + # Check that no errors were logged $hass->fail("cat ${configDir}/home-assistant.log | grep -qF ERROR"); + + # Print log to ease debugging + my $log = $hass->succeed("cat ${configDir}/home-assistant.log"); + print "\n### home-assistant.log ###\n"; + print "$log\n"; ''; }) From 554e91e79f283906e4652ea69682af89bf4277ec Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 18 Feb 2018 00:42:38 +0100 Subject: [PATCH 07/54] Revert "python: docker: 2.7.0 -> 3.0.0" `pythonPackages.docker` isn't compatible with `docker-compose` 1.18 and causes severe breackage when running `docker-compose up --build`. See https://github.com/docker/compose/issues/5685 for further reference. This reverts commit 2a8a058a217f286e562a8c8cc5d112f9d614dfeb. --- pkgs/development/python-modules/docker/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/docker/default.nix b/pkgs/development/python-modules/docker/default.nix index e0ab354173e3..4ce013ac7976 100644 --- a/pkgs/development/python-modules/docker/default.nix +++ b/pkgs/development/python-modules/docker/default.nix @@ -3,13 +3,13 @@ , ipaddress, backports_ssl_match_hostname, docker_pycreds }: buildPythonPackage rec { - version = "3.0.0"; + version = "2.7.0"; pname = "docker"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://pypi/d/docker/${name}.tar.gz"; - sha256 = "4a1083656c6ac7615c19094d9b5e052f36e38d0b07e63d7e506c9b5b32c3abe2"; + sha256 = "144248308e8ea31c4863c6d74e1b55daf97cc190b61d0fe7b7313ab920d6a76c"; }; propagatedBuildInputs = [ From ecf4825f325298e3b78665e7e6295c039dfe969f Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 17 Feb 2018 19:32:13 -0500 Subject: [PATCH 08/54] qemu: 2.11.0 -> 2.11.1 --- pkgs/applications/virtualization/qemu/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 68ab979ecfbe..48a9296fa97d 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -18,8 +18,8 @@ with stdenv.lib; let - version = "2.11.0"; - sha256 = "1jvzw6rdhimn583dz6an8xiw07n3ycvxmj3jpv1s312scv3k9w64"; + version = "2.11.1"; + sha256 = "1jrcff0szyjxc3vywyiclwdzk0xgq4cxvjbvmcfyjcpdrq9j5pyr"; audio = optionalString (hasSuffix "linux" stdenv.system) "alsa," + optionalString pulseSupport "pa," + optionalString sdlSupport "sdl,"; From 890c0b9654e78292b0596fab42446d5c2735a568 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 17 Feb 2018 20:29:11 -0500 Subject: [PATCH 09/54] qemu-riscv: Init at 2.11.50pre57991_713f2c1164. Fixes #35087 --- pkgs/applications/virtualization/qemu/riscv.nix | 16 ++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/applications/virtualization/qemu/riscv.nix diff --git a/pkgs/applications/virtualization/qemu/riscv.nix b/pkgs/applications/virtualization/qemu/riscv.nix new file mode 100644 index 000000000000..7f25388308d1 --- /dev/null +++ b/pkgs/applications/virtualization/qemu/riscv.nix @@ -0,0 +1,16 @@ +{ qemu, fetchFromGitHub, lib }: let + src = fetchFromGitHub { + owner = "riscv"; + repo = "riscv-qemu"; + rev = "713f2c116481d568702759bcb1b7fed835a2d575"; + sha256 = "0y4zrgidpc19pxwqqxcmj0ld50fdkf8b8c87xfcn88zrk8798qz4"; + fetchSubmodules = true; + }; + version = "2.11.50"; + date = "20180203"; + revCount = "57991"; + shortRev = "713f2c1164"; +in lib.overrideDerivation qemu (orig: { + name = "${(builtins.parseDrvName qemu.name).name}-${version}pre${revCount}_${shortRev}"; + inherit src; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8f336e502885..68c821cc53ee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16901,6 +16901,8 @@ with pkgs; inherit (darwin.stubs) rez setfile; }; + qemu-riscv = callPackage ../applications/virtualization/qemu/riscv.nix {}; + qgis = callPackage ../applications/gis/qgis {}; qgroundcontrol = libsForQt5.callPackage ../applications/science/robotics/qgroundcontrol { }; From 1ea44d75b219a56681152ecb166bbaec85a00d5c Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 17 Feb 2018 23:25:21 -0300 Subject: [PATCH 10/54] palemoon: 27.6.2 -> 27.7.2 Also, adding myself to maintainers. --- .../networking/browsers/palemoon/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/palemoon/default.nix b/pkgs/applications/networking/browsers/palemoon/default.nix index 006aa88f363c..cd4f95097889 100644 --- a/pkgs/applications/networking/browsers/palemoon/default.nix +++ b/pkgs/applications/networking/browsers/palemoon/default.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { name = "palemoon-${version}"; - version = "27.6.2"; + version = "27.7.2"; src = fetchFromGitHub { name = "palemoon-src"; owner = "MoonchildProductions"; repo = "Pale-Moon"; rev = version + "_Release"; - sha256 = "0ickxrwl36iyqj3v9qq6hnfl2y652f2ppwi949pfh4f6shm9x0ri"; + sha256 = "19ki6gp6bhcvhjnclalviiyp93mqsgc22xjl0gm9x5y4sxdb5wlq"; }; desktopItem = makeDesktopItem { @@ -101,10 +101,20 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A web browser"; + longDescription = '' + Pale Moon is an Open Source, Goanna-based web browser focusing on + efficiency and customization. + + Pale Moon offers you a browsing experience in a browser completely built + from its own, independently developed source that has been forked off from + Firefox/Mozilla code a number of years ago, with carefully selected + features and optimizations to improve the browser's stability and user + experience, while offering full customization and a growing collection of + extensions and themes to make the browser truly your own. + ''; homepage = https://www.palemoon.org/; license = licenses.mpl20; - maintainers = with maintainers; [ rnhmjoj ]; + maintainers = with maintainers; [ rnhmjoj AndersonTorres ]; platforms = platforms.linux; }; - } From 5be93a588335082d0610c739067035dfc1ddd260 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 17 Feb 2018 23:08:05 -0500 Subject: [PATCH 11/54] glibc: Add 2.27 --- pkgs/development/libraries/glibc/2.27.nix | 101 +++++++++ .../libraries/glibc/common-2.27.nix | 208 ++++++++++++++++++ .../dont-use-system-ld-so-cache-2.27.patch | 46 ++++ .../glibc/nix-locale-archive-2.27.patch | 118 ++++++++++ pkgs/top-level/all-packages.nix | 3 + 5 files changed, 476 insertions(+) create mode 100644 pkgs/development/libraries/glibc/2.27.nix create mode 100644 pkgs/development/libraries/glibc/common-2.27.nix create mode 100644 pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch create mode 100644 pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch diff --git a/pkgs/development/libraries/glibc/2.27.nix b/pkgs/development/libraries/glibc/2.27.nix new file mode 100644 index 000000000000..bb057ae899e7 --- /dev/null +++ b/pkgs/development/libraries/glibc/2.27.nix @@ -0,0 +1,101 @@ +{ stdenv, callPackage +, withLinuxHeaders ? true +, installLocales ? true +, profilingLibraries ? false +, withGd ? false +}: + +assert stdenv.cc.isGNU; + +callPackage ./common-2.27.nix { inherit stdenv; } { + name = "glibc" + stdenv.lib.optionalString withGd "-gd"; + + inherit withLinuxHeaders profilingLibraries installLocales withGd; + + NIX_NO_SELF_RPATH = true; + + postConfigure = '' + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS + + # Apparently --bindir is not respected. + makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin") + ''; + + # The stackprotector and fortify hardening flags are autodetected by glibc + # and enabled by default if supported. Setting it for every gcc invocation + # does not work. + hardeningDisable = [ "stackprotector" "fortify" ]; + + # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for + # any program we run, because the gcc will have been placed at a new + # store path than that determined when built (as a source for the + # bootstrap-tools tarball) + # Building from a proper gcc staying in the path where it was installed, + # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without + # any special hack. + preInstall = '' + if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then + mkdir -p $out/lib + cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 + # the .so It used to be a symlink, but now it is a script + cp -a ${stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so + fi + ''; + + postInstall = '' + if test -n "$installLocales"; then + make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales + fi + + test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache + + if test -n "$linuxHeaders"; then + # Include the Linux kernel headers in Glibc, except the `scsi' + # subdirectory, which Glibc provides itself. + (cd $dev/include && \ + ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .) + fi + + # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink + # "lib64" to "lib". + if test -n "$is64bit"; then + ln -s lib $out/lib64 + fi + + # Get rid of more unnecessary stuff. + rm -rf $out/var $bin/bin/sln + + # For some reason these aren't stripped otherwise and retain reference + # to bootstrap-tools; on cross-arm this stripping would break objects. + if [ -z "$crossConfig" ]; then + for i in "$out"/lib/*.a; do + [ "$i" = "$out/lib/libm.a" ] || strip -S "$i" + done + fi + + # Put libraries for static linking in a separate output. Note + # that libc_nonshared.a and libpthread_nonshared.a are required + # for dynamically-linked applications. + mkdir -p $static/lib + mv $out/lib/*.a $static/lib + mv $static/lib/lib*_nonshared.a $out/lib + # Some of *.a files are linker scripts where moving broke the paths. + sed "/^GROUP/s|$out/lib/lib|$static/lib/lib|g" \ + -i "$static"/lib/*.a + + # Work around a Nix bug: hard links across outputs cause a build failure. + cp $bin/bin/getconf $bin/bin/getconf_ + mv $bin/bin/getconf_ $bin/bin/getconf + ''; + + separateDebugInfo = true; + + meta.description = "The GNU C Library"; + } diff --git a/pkgs/development/libraries/glibc/common-2.27.nix b/pkgs/development/libraries/glibc/common-2.27.nix new file mode 100644 index 000000000000..d493feb35fa8 --- /dev/null +++ b/pkgs/development/libraries/glibc/common-2.27.nix @@ -0,0 +1,208 @@ +/* Build configuration used to build glibc, Info files, and locale + information. */ + +{ stdenv, lib +, buildPlatform, hostPlatform +, buildPackages +, fetchurl +, linuxHeaders ? null +, gd ? null, libpng ? null +, bison +}: + +{ name +, withLinuxHeaders ? false +, profilingLibraries ? false +, installLocales ? false +, withGd ? false +, meta +, ... +} @ args: + +let + version = "2.27"; + patchSuffix = ""; + sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji"; + cross = if buildPlatform != hostPlatform then hostPlatform else null; +in + +assert withLinuxHeaders -> linuxHeaders != null; +assert withGd -> gd != null && libpng != null; + +stdenv.mkDerivation ({ + inherit installLocales; + linuxHeaders = if withLinuxHeaders then linuxHeaders else null; + + # The host/target system. + crossConfig = if cross != null then cross.config else null; + + inherit (stdenv) is64bit; + + enableParallelBuilding = true; + + patches = + [ + /* Have rpcgen(1) look for cpp(1) in $PATH. */ + ./rpcgen-path.patch + + /* Allow NixOS and Nix to handle the locale-archive. */ + ./nix-locale-archive-2.27.patch + + /* Don't use /etc/ld.so.cache, for non-NixOS systems. */ + ./dont-use-system-ld-so-cache-2.27.patch + + /* Don't use /etc/ld.so.preload, but /etc/ld-nix.so.preload. */ + ./dont-use-system-ld-so-preload.patch + + /* The command "getconf CS_PATH" returns the default search path + "/bin:/usr/bin", which is inappropriate on NixOS machines. This + patch extends the search path by "/run/current-system/sw/bin". */ + ./fix_path_attribute_in_getconf.patch + + /* Allow running with RHEL 6 -like kernels. The patch adds an exception + for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible + (otherwise the loader would refuse libc). + Note that glibc will fully work only on their heavily patched kernels + and we lose early mismatch detection on 2.6.32. + + On major glibc updates we should check that the patched kernel supports + all the required features. ATM it's verified up to glibc-2.26-131. + # HOWTO: check glibc sources for changes in kernel requirements + git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h + # get kernel sources (update the URL) + mkdir tmp && cd tmp + curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv + tar xf linux-*.bz2 + # check syscall presence, for example + less linux-*?/arch/x86/kernel/syscall_table_32.S + */ + ./allow-kernel-2.6.32.patch + ] + ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch; + + postPatch = + '' + # Needed for glibc to build with the gnumake 3.82 + # http://comments.gmane.org/gmane.linux.lfs.support/31227 + sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile + + # nscd needs libgcc, and we don't want it dynamically linked + # because we don't want it to depend on bootstrap-tools libs. + echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile + ''; + + configureFlags = + [ "-C" + "--enable-add-ons" + "--enable-obsolete-nsl" + "--enable-obsolete-rpc" + "--sysconfdir=/etc" + "--enable-stackguard-randomization" + (if withLinuxHeaders + then "--with-headers=${linuxHeaders}/include" + else "--without-headers") + (if profilingLibraries + then "--enable-profile" + else "--disable-profile") + ] ++ lib.optionals withLinuxHeaders [ + "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26 + ] ++ lib.optionals (cross != null) [ + (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp") + ] ++ lib.optionals (cross != null) [ + "--with-__thread" + ] ++ lib.optionals (cross == null && stdenv.isArm) [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + + # To avoid linking with -lgcc_s (dynamic link) + # so the glibc does not depend on its compiler store path + "libc_cv_as_needed=no" + ] ++ lib.optional withGd "--with-gd"; + + installFlags = [ "sysconfdir=$(out)/etc" ]; + + outputs = [ "out" "bin" "dev" "static" ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ bison ]; + buildInputs = lib.optionals withGd [ gd libpng ]; + + # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to + # prevent a retained dependency on the bootstrap tools in the stdenv-linux + # bootstrap. + BASH_SHELL = "/bin/sh"; +} + +// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) // + +{ + name = name + "-${version}${patchSuffix}"; + + src = fetchurl { + url = "mirror://gnu/glibc/glibc-${version}.tar.xz"; + inherit sha256; + }; + + # Remove absolute paths from `configure' & co.; build out-of-tree. + preConfigure = '' + export PWD_P=$(type -tP pwd) + for i in configure io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + mkdir ../build + cd ../build + + configureScript="`pwd`/../$sourceRoot/configure" + + ${lib.optionalString (stdenv.cc.libc != null) + ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib"'' + } + + + '' + lib.optionalString (cross != null) '' + sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig" + + cat > config.cache << "EOF" + libc_cv_forced_unwind=yes + libc_cv_c_cleanup=yes + libc_cv_gnu89_inline=yes + EOF + ''; + + preBuild = lib.optionalString withGd "unset NIX_DONT_SET_RPATH"; + + meta = { + homepage = http://www.gnu.org/software/libc/; + description = "The GNU C Library"; + + longDescription = + '' Any Unix-like operating system needs a C library: the library which + defines the "system calls" and other basic facilities such as + open, malloc, printf, exit... + + The GNU C library is used as the C library in the GNU system and + most systems with the Linux kernel. + ''; + + license = lib.licenses.lgpl2Plus; + + maintainers = [ lib.maintainers.eelco ]; + platforms = lib.platforms.linux; + } // meta; +} + +// lib.optionalAttrs (cross != null) { + preInstall = null; # clobber the native hook + + dontStrip = true; + + separateDebugInfo = false; # this is currently broken for crossDrv + + # To avoid a dependency on the build system 'bash'. + preFixup = '' + rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace} + ''; +}) diff --git a/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch b/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch new file mode 100644 index 000000000000..f84b1049adf8 --- /dev/null +++ b/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch @@ -0,0 +1,46 @@ +diff -Naur glibc-2.27-orig/elf/ldconfig.c glibc-2.27/elf/ldconfig.c +--- glibc-2.27-orig/elf/ldconfig.c 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/elf/ldconfig.c 2018-02-17 22:43:17.232175182 -0500 +@@ -51,7 +51,7 @@ + #endif + + #ifndef LD_SO_CONF +-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" ++# define LD_SO_CONF PREFIX "/etc/ld.so.conf" + #endif + + /* Get libc version number. */ +diff -Naur glibc-2.27-orig/elf/Makefile glibc-2.27/elf/Makefile +--- glibc-2.27-orig/elf/Makefile 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/elf/Makefile 2018-02-17 22:44:50.334006750 -0500 +@@ -559,13 +559,13 @@ + + $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) + +-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' +-CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ ++PREFIX-FLAGS := -D'PREFIX="$(prefix)"' ++CFLAGS-ldconfig.c += $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \ + -D'SLIBDIR="$(slibdir)"' + libof-ldconfig = ldconfig +-CFLAGS-dl-cache.c += $(SYSCONF-FLAGS) +-CFLAGS-cache.c += $(SYSCONF-FLAGS) +-CFLAGS-rtld.c += $(SYSCONF-FLAGS) ++CFLAGS-dl-cache.c += $(PREFIX-FLAGS) ++CFLAGS-cache.c += $(PREFIX-FLAGS) ++CFLAGS-rtld.c += $(PREFIX-FLAGS) + + cpp-srcs-left := $(all-rtld-routines:=.os) + lib := rtld +diff -Naur glibc-2.27-orig/sysdeps/generic/dl-cache.h glibc-2.27/sysdeps/generic/dl-cache.h +--- glibc-2.27-orig/sysdeps/generic/dl-cache.h 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/sysdeps/generic/dl-cache.h 2018-02-17 22:45:20.471598816 -0500 +@@ -28,7 +28,7 @@ + #endif + + #ifndef LD_SO_CACHE +-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" ++# define LD_SO_CACHE PREFIX "/etc/ld.so.cache" + #endif + + #ifndef add_system_dir diff --git a/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch b/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch new file mode 100644 index 000000000000..1b3590db4fdd --- /dev/null +++ b/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch @@ -0,0 +1,118 @@ +diff -Naur glibc-2.27-orig/locale/loadarchive.c glibc-2.27/locale/loadarchive.c +--- glibc-2.27-orig/locale/loadarchive.c 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/locale/loadarchive.c 2018-02-17 22:32:25.680169462 -0500 +@@ -123,6 +123,23 @@ + return MAX (namehash_end, MAX (string_end, locrectab_end)); + } + ++static int ++open_locale_archive (void) ++{ ++ int fd = -1; ++ char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27"); ++ char *path = getenv ("LOCAL_ARCHIVE"); ++ if (versioned_path) ++ fd = __open_nocancel (versioned_path, O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ if (path && fd < 0) ++ fd = __open_nocancel (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ if (fd < 0) ++ fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ if (fd < 0) ++ fd = __open_nocancel ("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ return fd; ++} ++ + + /* Find the locale *NAMEP in the locale archive, and return the + internalized data structure for its CATEGORY data. If this locale has +@@ -202,7 +219,7 @@ + archmapped = &headmap; + + /* The archive has never been opened. */ +- fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ fd = open_locale_archive (); + if (fd < 0) + /* Cannot open the archive, for whatever reason. */ + return NULL; +@@ -397,8 +414,7 @@ + if (fd == -1) + { + struct stat64 st; +- fd = __open_nocancel (archfname, +- O_RDONLY|O_LARGEFILE|O_CLOEXEC); ++ fd = open_locale_archive (); + if (fd == -1) + /* Cannot open the archive, for whatever reason. */ + return NULL; +diff -Naur glibc-2.27-orig/locale/programs/locale.c glibc-2.27/locale/programs/locale.c +--- glibc-2.27-orig/locale/programs/locale.c 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/locale/programs/locale.c 2018-02-17 22:36:39.726293213 -0500 +@@ -633,6 +633,24 @@ + + + static int ++open_locale_archive (void) ++{ ++ int fd = -1; ++ char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27"); ++ char *path = getenv ("LOCAL_ARCHIVE"); ++ if (versioned_path) ++ fd = open64 (versioned_path, O_RDONLY); ++ if (path && fd < 0) ++ fd = open64 (path, O_RDONLY); ++ if (fd < 0) ++ fd = open64 (ARCHIVE_NAME, O_RDONLY); ++ if (fd < 0) ++ fd = open64 ("/usr/lib/locale/locale-archive", O_RDONLY); ++ return fd; ++} ++ ++ ++static int + write_archive_locales (void **all_datap, char *linebuf) + { + struct stat64 st; +@@ -644,7 +662,7 @@ + int fd, ret = 0; + uint32_t cnt; + +- fd = open64 (ARCHIVE_NAME, O_RDONLY); ++ fd = open_locale_archive (); + if (fd < 0) + return 0; + +diff -Naur glibc-2.27-orig/locale/programs/locarchive.c glibc-2.27/locale/programs/locarchive.c +--- glibc-2.27-orig/locale/programs/locarchive.c 2018-02-01 11:17:18.000000000 -0500 ++++ glibc-2.27/locale/programs/locarchive.c 2018-02-17 22:40:51.245293975 -0500 +@@ -117,6 +117,22 @@ + } + + ++static int ++open_locale_archive (const char * archivefname, int flags) ++{ ++ int fd = -1; ++ char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27"); ++ char *path = getenv ("LOCAL_ARCHIVE"); ++ if (versioned_path) ++ fd = open64 (versioned_path, flags); ++ if (path && fd < 0) ++ fd = open64 (path, flags); ++ if (fd < 0) ++ fd = open64 (archivefname, flags); ++ return fd; ++} ++ ++ + static void + create_archive (const char *archivefname, struct locarhandle *ah) + { +@@ -578,7 +594,7 @@ + while (1) + { + /* Open the archive. We must have exclusive write access. */ +- fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); ++ fd = open_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR); + if (fd == -1) + { + /* Maybe the file does not yet exist? If we are opening diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 68c821cc53ee..1b4fbf8c1e6f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8748,6 +8748,9 @@ with pkgs; glibc = callPackage ../development/libraries/glibc { installLocales = config.glibc.locales or false; }; + glibc_2_27 = callPackage ../development/libraries/glibc/2.27.nix { + installLocales = config.glibc.locales or false; + }; glibc_memusage = callPackage ../development/libraries/glibc { installLocales = false; From e288febee0809db7c594ceb42e655dd5d43a6369 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:09:25 -0500 Subject: [PATCH 12/54] Add riscv{32,64} crossSystems. --- lib/systems/examples.nix | 8 ++++++++ lib/systems/platforms.nix | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index f5562e28a09d..bd68ee9460e7 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -68,6 +68,14 @@ rec { musl64 = { config = "x86_64-unknown-linux-musl"; }; musl32 = { config = "i686-unknown-linux-musl"; }; + riscv = bits: { + config = "riscv${bits}-unknown-linux-gnu"; + platform = platforms.riscv-multiplatform bits; + }; + riscv64 = riscv "64"; + riscv32 = riscv "32"; + + # # Darwin # diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 58a7afa7679d..3106c05dd5d2 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -541,6 +541,12 @@ rec { }; }; + riscv-multiplatform = bits: { + name = "riscv-multiplatform"; + kernelArch = "riscv"; + bfdEmulation = "elf${bits}lriscv"; + }; + selectBySystem = system: { "i686-linux" = pc32; "x86_64-linux" = pc64; From 3bec7812887923fc3c0c7ab804196c1e086f2acd Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:11:28 -0500 Subject: [PATCH 13/54] Use gcc 7 for RISC-V support. --- pkgs/top-level/all-packages.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b4fbf8c1e6f..0c262e43a693 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5784,8 +5784,12 @@ with pkgs; gambit = callPackage ../development/compilers/gambit { }; gerbil = callPackage ../development/compilers/gerbil { }; - gccFun = callPackage ../development/compilers/gcc/6; - gcc = gcc6; + # !!! When updating to gcc7 everywhere we can get rid of the + # isRiscV overrides here and in gccCrossStageStatic + gccFun6 = callPackage ../development/compilers/gcc/6; + gccFun7 = callPackage ../development/compilers/gcc/7; + gccFun = if targetPlatform.isRiscV then gccFun7 else gccFun6; + gcc = if targetPlatform.isRiscV then gcc7 else gcc6; gcc-unwrapped = gcc.cc; gccStdenv = if stdenv.cc.isGNU then stdenv else stdenv.override { @@ -5865,6 +5869,7 @@ with pkgs; bintools = binutils-unwrapped; libc = libcCross1; }; + isl = if targetPlatform.isRiscV then isl_0_17 else isl_0_14; in wrapCCWith { name = "gcc-cross-wrapper"; cc = gccFun { @@ -5872,7 +5877,7 @@ with pkgs; inherit noSysDirs; # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); - isl = if !stdenv.isDarwin then isl_0_14 else null; + isl = if !stdenv.isDarwin then isl else null; # just for stage static crossStageStatic = true; From 1d493f6171e9a84a3ff7c77745230a7c3910217e Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:12:40 -0500 Subject: [PATCH 14/54] Use Linux 4.15 kernel headers for RISC-V support. --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0c262e43a693..cf8d8d6d5e99 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12942,7 +12942,7 @@ with pkgs; inherit (callPackages ../os-specific/linux/kernel-headers { }) linuxHeaders_4_4 linuxHeaders_4_15; - linuxHeaders = if hostPlatform.isMusl then linuxHeaders_4_15 else linuxHeaders_4_4; + linuxHeaders = if hostPlatform.isMusl || hostPlatform.isRiscV then linuxHeaders_4_15 else linuxHeaders_4_4; kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { }; From 4f8a9ff1ac4e9b671a732f8a6e4044551f51cc93 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:13:17 -0500 Subject: [PATCH 15/54] Use glibc-2.27 for RISC-V support. --- pkgs/top-level/all-packages.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cf8d8d6d5e99..57bc0ec071d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8763,7 +8763,11 @@ with pkgs; }; # Being redundant to avoid cycles on boot. TODO: find a better way - glibcCross = callPackage ../development/libraries/glibc { + glibcCross = let + expr = if hostPlatform.isRiscV + then ../development/libraries/glibc/2.27.nix + else ../development/libraries/glibc; + in callPackage expr { installLocales = config.glibc.locales or false; stdenv = crossLibcStdenv; }; From 158cf6449c58b559a02dccc40096d4171c8a6589 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:13:43 -0500 Subject: [PATCH 16/54] pcre: Disable JIT on RISC-V. --- pkgs/development/libraries/pcre/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index b34c9ff31f2c..2ea5e923bad0 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -24,8 +24,7 @@ in stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" "doc" "man" ]; - configureFlags = [ - "--enable-jit" + configureFlags = optional (!hostPlatform.isRiscV) "--enable-jit" ++ [ "--enable-unicode-properties" "--disable-cpp" ] From 96ac69288b07e1bfb58bd559c920eff86b8c6aab Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 18 Feb 2018 12:48:41 +0300 Subject: [PATCH 17/54] octoprint: 1.3.5 -> 1.3.6 --- pkgs/applications/misc/octoprint/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/octoprint/default.nix b/pkgs/applications/misc/octoprint/default.nix index 972fbfb7b072..6587305a770f 100644 --- a/pkgs/applications/misc/octoprint/default.nix +++ b/pkgs/applications/misc/octoprint/default.nix @@ -54,14 +54,13 @@ let in pythonPackages.buildPythonApplication rec { name = "OctoPrint-${version}"; - version = "1.3.5"; - # 1.3.5, 2017-10-16, 77753ca02602d3a798d6b0a22535e6fd69ff448a + version = "1.3.6"; src = fetchFromGitHub { owner = "foosel"; repo = "OctoPrint"; rev = version; - sha256 = "13krv9i6gm4jn4cb327q4qma4xwwashjnc0dia8vlnbjbbvkrni4"; + sha256 = "0pgpkjw5zjnks5bky51gjaksq8mhrzkl52kpgf799hl35pd08xr3"; }; # We need old Tornado @@ -70,7 +69,7 @@ in pythonPackages.buildPythonApplication rec { semantic-version flask_principal werkzeug flaskbabel tornado psutil pyserial flask_login netaddr markdown sockjs-tornado pylru pyyaml sarge feedparser netifaces click websocket_client - scandir chainmap future dateutil futures wrapt + scandir chainmap future dateutil futures wrapt monotonic emoji ]; buildInputs = with pythonPackages; [ nose mock ddt ]; From 3957b6b37918cf06366ef7b0aeb810405eea6a34 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 18 Feb 2018 12:27:15 +0300 Subject: [PATCH 18/54] moinmoin: refactor and fix build --- .../python-modules/moinmoin/default.nix | 32 +++++++++++++++++++ .../python-modules/moinmoin/fix_tests.patch | 16 ++++++++++ pkgs/top-level/python-packages.nix | 20 ++---------- 3 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 pkgs/development/python-modules/moinmoin/default.nix create mode 100644 pkgs/development/python-modules/moinmoin/fix_tests.patch diff --git a/pkgs/development/python-modules/moinmoin/default.nix b/pkgs/development/python-modules/moinmoin/default.nix new file mode 100644 index 000000000000..cedd45f2f225 --- /dev/null +++ b/pkgs/development/python-modules/moinmoin/default.nix @@ -0,0 +1,32 @@ +{ lib, buildPythonPackage, fetchurl, fetchpatch +, pytest, werkzeug, pygments +}: + +buildPythonPackage rec { + name = "moinmoin-${ver}"; + ver = "1.9.9"; + + src = fetchurl { + url = "http://static.moinmo.in/files/moin-${ver}.tar.gz"; + sha256 = "197ga41qghykmir80ik17f9hjpmixslv3zjgj7bj9qvs1dvdg5s3"; + }; + + patches = [ + # Recommended to install on their download page. + (fetchpatch { + url = "https://bitbucket.org/thomaswaldmann/moin-1.9/commits/561b7a9c2bd91b61d26cd8a5f39aa36bf5c6159e/raw"; + sha256 = "1nscnl9nspnrwyf3n95ig0ihzndryinq9kkghliph6h55cncfc65"; + }) + ./fix_tests.patch + ]; + + checkInputs = [ pytest werkzeug pygments ]; + + meta = with lib; { + description = "Advanced, easy to use and extensible WikiEngine"; + + homepage = "http://moinmo.in/"; + + license = licenses.gpl2Plus; + }; +} diff --git a/pkgs/development/python-modules/moinmoin/fix_tests.patch b/pkgs/development/python-modules/moinmoin/fix_tests.patch new file mode 100644 index 000000000000..e9856eeffca6 --- /dev/null +++ b/pkgs/development/python-modules/moinmoin/fix_tests.patch @@ -0,0 +1,16 @@ +diff -ru3 moin-1.9.9-old/MoinMoin/conftest.py moin-1.9.9-new/MoinMoin/conftest.py +--- moin-1.9.9-old/MoinMoin/conftest.py 2016-10-31 23:44:02.000000000 +0300 ++++ moin-1.9.9-new/MoinMoin/conftest.py 2018-02-18 12:13:19.551929093 +0300 +@@ -22,10 +22,11 @@ + + import atexit + import sys ++import os + + import py + +-rootdir = py.magic.autopath().dirpath() ++rootdir = os.path.abspath(os.path.dirname(__file__)) + moindir = rootdir.join("..") + sys.path.insert(0, str(moindir)) + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5608cd85ef26..9776bf6fa7d6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10372,24 +10372,8 @@ in { }; }; - moinmoin = buildPythonPackage (rec { - name = "moinmoin-${ver}"; - disabled = isPy3k; - ver = "1.9.8"; - - src = pkgs.fetchurl { - url = "http://static.moinmo.in/files/moin-${ver}.tar.gz"; - sha256 = "19hi16iy75lpx9ch799djc4hr4gai5rmvi542n29x6zhikysfjx7"; - }; - - meta = { - description = "Advanced, easy to use and extensible WikiEngine"; - - homepage = http://moinmo.in/; - - license = licenses.gpl2Plus; - }; - }); + # Needed here because moinmoin is loaded as a Python library. + moinmoin = callPackage ../development/python-modules/moinmoin { }; moretools = callPackage ../development/python-modules/moretools { }; From 7c2b2ddd683686f713807d6d0b2f62c71174afac Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 2 Feb 2018 06:39:50 +0000 Subject: [PATCH 19/54] ocamlPackages.lwt_ssl: init at 1.1.2 --- .../ocaml-modules/lwt_ssl/default.nix | 24 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/ocaml-modules/lwt_ssl/default.nix diff --git a/pkgs/development/ocaml-modules/lwt_ssl/default.nix b/pkgs/development/ocaml-modules/lwt_ssl/default.nix new file mode 100644 index 000000000000..e53c835a2911 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt_ssl/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchzip, ocaml, findlib, jbuilder, ssl, lwt }: + +stdenv.mkDerivation rec { + version = "1.1.2"; + name = "ocaml${ocaml.version}-lwt_ssl-${version}"; + + src = fetchzip { + url = "https://github.com/aantron/lwt_ssl/archive/${version}.tar.gz"; + sha256 = "1q0an3djqjxv83v3iswi7m81braqx93kcrcwrxwmf6jzhdm4pn15"; + }; + + buildInputs = [ ocaml findlib jbuilder ]; + propagatedBuildInputs = [ ssl lwt ]; + + inherit (jbuilder) installPhase; + + meta = { + homepage = "https://github.com/aantron/lwt_ssl"; + description = "OpenSSL binding with concurrent I/O"; + license = stdenv.lib.licenses.lgpl21; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c44124c3ffff..1fffa3fa800b 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -375,6 +375,10 @@ let lwt = lwt3; }; + lwt_ssl = callPackage ../development/ocaml-modules/lwt_ssl { + lwt = lwt3; + }; + macaque = callPackage ../development/ocaml-modules/macaque { }; magic-mime = callPackage ../development/ocaml-modules/magic-mime { }; From 7e09ff23ed0d0b420c981a69713dedeb384e2759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 18 Feb 2018 12:07:13 +0100 Subject: [PATCH 20/54] pythonPackages.yarl: 1.1.0 -> 1.1.1 --- pkgs/development/python-modules/yarl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/yarl/default.nix b/pkgs/development/python-modules/yarl/default.nix index e40aa9d05f9c..1953b1610ceb 100644 --- a/pkgs/development/python-modules/yarl/default.nix +++ b/pkgs/development/python-modules/yarl/default.nix @@ -9,11 +9,11 @@ buildPythonPackage rec { pname = "yarl"; - version = "1.1.0"; + version = "1.1.1"; src = fetchPypi { inherit pname version; - sha256 = "162630v7f98l27h11msk9416lqwm2mpgxh4s636594nlbfs9by3a"; + sha256 = "a69dd7e262cdb265ac7d5e929d55f2f3d07baaadd158c8f19caebf8dde08dfe8"; }; checkInputs = [ pytest pytestrunner ]; From fa3235781c0339d389b6e401da9a531cc82cf311 Mon Sep 17 00:00:00 2001 From: Tomas Hlavaty Date: Sun, 18 Feb 2018 12:12:37 +0100 Subject: [PATCH 21/54] sbcl: 1.4.3 -> 1.4.4 --- pkgs/development/compilers/sbcl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index 54610467e7ae..39b84ae6a365 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -9,11 +9,11 @@ stdenv.mkDerivation rec { name = "sbcl-${version}"; - version = "1.4.3"; + version = "1.4.4"; src = fetchurl { url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2"; - sha256 = "1z8d11k6vc6jhmpwzy0nawj84qdd2jvibrvqmb1nmq3h8w64hlam"; + sha256 = "1k6v5b8qv7vyxvh8asx6phf2hbapx5pp5p5j47hgnq123fwnh4fa"; }; patchPhase = '' From 061a16a41577b773e68d58c3fea01b641054ed24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 18 Feb 2018 11:59:24 +0100 Subject: [PATCH 22/54] home-assistant: 0.63.2 -> 0.63.3 --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/default.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 3f511cd2545c..43b2418db771 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "0.63.2"; + version = "0.63.3"; components = { "nuimo_controller" = ps: with ps; [ ]; "bbb_gpio" = ps: with ps; [ ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index e61d44369012..edc3539b0bdf 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -44,7 +44,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "0.63.2"; + hassVersion = "0.63.3"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -57,7 +57,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "home-assistant"; rev = version; - sha256 = "057xp3l3amzxbzzdqmgbmd0qk6fz29lpdbw3zcbjigjxbdi14h2l"; + sha256 = "1lrdrn0x8i81vbqxziv5fgcc8ldz7x5r62kfz3nyg4g43rk3dqq8"; }; propagatedBuildInputs = [ From 4d6a8d956fca014ba461ba6114e630709d818af8 Mon Sep 17 00:00:00 2001 From: Vladyslav M Date: Sun, 18 Feb 2018 13:32:59 +0200 Subject: [PATCH 23/54] hack-font: 2.020 -> 3.002 --- pkgs/data/fonts/hack/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/data/fonts/hack/default.nix b/pkgs/data/fonts/hack/default.nix index 0edd27dab0e3..eb7943265397 100644 --- a/pkgs/data/fonts/hack/default.nix +++ b/pkgs/data/fonts/hack/default.nix @@ -1,20 +1,18 @@ { stdenv, fetchzip }: let - version = "2.020"; + version = "3.002"; in fetchzip rec { name = "hack-font-${version}"; - url = let - version_ = with stdenv.lib; concatStringsSep "_" (splitString "." version); - in "https://github.com/chrissimpkins/Hack/releases/download/v${version}/Hack-v${version_}-ttf.zip"; + url = "https://github.com/chrissimpkins/Hack/releases/download/v${version}/Hack-v${version}-ttf.zip"; postFetch = '' mkdir -p $out/share/fonts unzip -j $downloadedFile \*.ttf -d $out/share/fonts/hack ''; - sha256 = "0cpsglb9vnhmpsn496aqisfvmq3yxvjnj7c361dspy0fn6z8x60c"; + sha256 = "11f3hl4nvxq6pvsmwr1c1r5wrxhrp7ixr5bshrz2dmqn7l8bxa63"; meta = with stdenv.lib; { description = "A typeface designed for source code"; @@ -25,7 +23,7 @@ in fetchzip rec { The face has been re-designed with a larger glyph set, modifications of the original glyph shapes, and meticulous attention to metrics. ''; - homepage = http://sourcefoundry.org/hack/; + homepage = https://sourcefoundry.org/hack/; /* "The font binaries are released under a license that permits unlimited @@ -36,6 +34,7 @@ in fetchzip rec { the license is available in LICENSE.md" (From the GitHub page) */ license = licenses.free; + maintainers = with maintainers; [ dywedir ]; platforms = platforms.all; }; } From 23cdc3224a358668142faff90613efbc98f21896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 17 Feb 2018 13:20:12 +0100 Subject: [PATCH 24/54] qt59.full: add missing modules Specifically: qtquickcontrols2, qtwebchannel, qtwebengine, qtwebkit. This fixes a regression since qt56.full. --- pkgs/development/libraries/qt-5/5.9/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix index e0dab3421627..4007e89568d3 100644 --- a/pkgs/development/libraries/qt-5/5.9/default.nix +++ b/pkgs/development/libraries/qt-5/5.9/default.nix @@ -103,9 +103,10 @@ let env = callPackage ../qt-env.nix {}; full = env "qt-${qtbase.version}" ([ qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects - qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript - qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets - qtx11extras qtxmlpatterns qtvirtualkeyboard + qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 + qtscript qtsensors qtserialport qtsvg qttools qttranslations + qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets + qtx11extras qtxmlpatterns ] ++ optional (!stdenv.isDarwin) qtwayland ++ optional (stdenv.isDarwin) qtmacextras); From 7ab180999b22b2294a00d7ad2432cfd199c3d8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 17 Feb 2018 13:23:17 +0100 Subject: [PATCH 25/54] qt510.full: add missing modules Specifically: qtquickcontrols2, qtvirtualkeyboard, qtwebchannel, qtwebengine, qtwebkit. This fixes a regression since qt56.full. --- pkgs/development/libraries/qt-5/5.10/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.10/default.nix b/pkgs/development/libraries/qt-5/5.10/default.nix index cf66e60d5696..6cbc5aca4091 100644 --- a/pkgs/development/libraries/qt-5/5.10/default.nix +++ b/pkgs/development/libraries/qt-5/5.10/default.nix @@ -103,8 +103,9 @@ let env = callPackage ../qt-env.nix {}; full = env "qt-${qtbase.version}" ([ qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects - qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript - qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets + qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 + qtscript qtsensors qtserialport qtsvg qttools qttranslations + qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets qtx11extras qtxmlpatterns ] ++ optional (!stdenv.isDarwin) qtwayland ++ optional (stdenv.isDarwin) qtmacextras); From d84f18e288bf5d507ecd0cc6b8f8639968b3bc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 11 Feb 2018 14:39:19 +0100 Subject: [PATCH 26/54] nixos/postfix: document that *Alias options support comma separated values For the longest time I thought there could be only one rootAlias. --- nixos/modules/services/mail/postfix.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 22af7e876af2..5ab331ac067f 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -414,7 +414,10 @@ in postmasterAlias = mkOption { type = types.str; default = "root"; - description = "Who should receive postmaster e-mail."; + description = " + Who should receive postmaster e-mail. Multiple values can be added by + separating values with comma. + "; }; rootAlias = mkOption { @@ -422,6 +425,7 @@ in default = ""; description = " Who should receive root e-mail. Blank for no redirection. + Multiple values can be added by separating values with comma. "; }; From 0552147a3456662908646c9896c5149788a0982c Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Sun, 18 Feb 2018 13:21:11 +0100 Subject: [PATCH 27/54] catdocx: init at 20170102 --- pkgs/tools/text/catdocx/default.nix | 30 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/tools/text/catdocx/default.nix diff --git a/pkgs/tools/text/catdocx/default.nix b/pkgs/tools/text/catdocx/default.nix new file mode 100644 index 000000000000..adf9d17815b0 --- /dev/null +++ b/pkgs/tools/text/catdocx/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchFromGitHub, makeWrapper, unzip, catdoc }: + +stdenv.mkDerivation { + name = "catdocx-20170102"; + + src = fetchFromGitHub { + owner = "jncraton"; + repo = "catdocx"; + rev = "04fa0416ec1f116d4996685e219f0856d99767cb"; + sha256 = "1sxiqhkvdqn300ygfgxdry2dj2cqzjhkzw13c6349gg5vxfypcjh"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/libexec $out/bin + cp catdocx.sh $out/libexec + chmod +x $out/libexec/catdocx.sh + wrapProgram $out/libexec/catdocx.sh --prefix PATH : "${lib.makeBinPath [ unzip catdoc ]}" + ln -s $out/libexec/catdocx.sh $out/bin/catdocx + ''; + + meta = with stdenv.lib; { + description = "Extracts plain text from docx files"; + homepage = https://github.com/jncraton/catdocx; + license = with licenses; [ bsd3 ]; + maintainers = [ maintainers.michalrus ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 55b51326859d..5a98b0d764aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -929,6 +929,8 @@ with pkgs; catdoc = callPackage ../tools/text/catdoc { }; + catdocx = callPackage ../tools/text/catdocx { }; + catclock = callPackage ../applications/misc/catclock { }; cde = callPackage ../tools/package-management/cde { }; From 986ab982b5b59137418ca2ae07fc8ac4fbb62134 Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Sun, 18 Feb 2018 14:10:53 +0100 Subject: [PATCH 28/54] arping: init at 2.19 --- pkgs/tools/networking/arping/default.nix | 25 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/tools/networking/arping/default.nix diff --git a/pkgs/tools/networking/arping/default.nix b/pkgs/tools/networking/arping/default.nix new file mode 100644 index 000000000000..4358d22142d9 --- /dev/null +++ b/pkgs/tools/networking/arping/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, libnet, libpcap }: + +stdenv.mkDerivation rec { + version = "2.19"; + name = "arping-${version}"; + + buildInputs = [ libnet libpcap ]; + + src = fetchFromGitHub { + owner = "ThomasHabets"; + repo = "arping"; + rev = "arping-${version}"; + sha256 = "10gpil6ic17x8v628vhz9s98rnw1k8ci2xs56i52pr103irirczw"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = with stdenv.lib; { + description = "Broadcasts a who-has ARP packet on the network and prints answers"; + homepage = https://github.com/ThomasHabets/arping; + license = with licenses; [ gpl2 ]; + maintainers = [ maintainers.michalrus ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 55b51326859d..3e5ead6b0402 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1366,6 +1366,8 @@ with pkgs; appdata-tools = callPackage ../tools/misc/appdata-tools { }; + arping = callPackage ../tools/networking/arping { }; + asciidoc = callPackage ../tools/typesetting/asciidoc { inherit (python2Packages) matplotlib numpy aafigure recursivePthLoader; w3m = w3m-batch; From 44901407f0b10742cc7e267fe2e0277bff12a80a Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Thu, 4 Jan 2018 07:03:46 +0300 Subject: [PATCH 29/54] qtEnv: fix paths in qt.conf The shell variables from setup hook are not visible here, so instead substitute them from Nix side. --- pkgs/development/libraries/qt-5/qt-env.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/qt-5/qt-env.nix b/pkgs/development/libraries/qt-5/qt-env.nix index 728761689b42..49585f601d14 100644 --- a/pkgs/development/libraries/qt-5/qt-env.nix +++ b/pkgs/development/libraries/qt-5/qt-env.nix @@ -13,9 +13,9 @@ buildEnv { cat >"$out/bin/qt.conf" < Date: Thu, 4 Jan 2018 07:04:03 +0300 Subject: [PATCH 30/54] qtcreator: fix path to qtquickcontrols This enables build of QML designer plugin. --- pkgs/development/qtcreator/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/qtcreator/default.nix b/pkgs/development/qtcreator/default.nix index 0b3cf3b53f89..de94b7a8eff3 100644 --- a/pkgs/development/qtcreator/default.nix +++ b/pkgs/development/qtcreator/default.nix @@ -31,6 +31,11 @@ stdenv.mkDerivation rec { installFlags = [ "INSTALL_ROOT=$(out)" ] ++ optional withDocumentation "install_docs"; + preConfigure = '' + substituteInPlace src/plugins/plugins.pro \ + --replace '$$[QT_INSTALL_QML]/QtQuick/Controls' '${qtquickcontrols}/${qtbase.qtQmlPrefix}/QtQuick/Controls' + ''; + preBuild = optional withDocumentation '' ln -s ${getLib qtbase}/$qtDocPrefix $NIX_QT5_TMP/share ''; From 09cf3506fa4cd84f3e0f01799f70eaf21bd87c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 18 Feb 2018 13:28:26 +0100 Subject: [PATCH 31/54] qt5X.full: add "-full" to package name This aligns the package name more with the attrname. This is a re-application of the idea behind 7405af72e6c2 ("qt: make package names of "full" variants appear as such"), which seems to have been lost on the way. --- pkgs/development/libraries/qt-5/5.10/default.nix | 2 +- pkgs/development/libraries/qt-5/5.6/default.nix | 2 +- pkgs/development/libraries/qt-5/5.9/default.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.10/default.nix b/pkgs/development/libraries/qt-5/5.10/default.nix index 6cbc5aca4091..eeff34568332 100644 --- a/pkgs/development/libraries/qt-5/5.10/default.nix +++ b/pkgs/development/libraries/qt-5/5.10/default.nix @@ -101,7 +101,7 @@ let qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; env = callPackage ../qt-env.nix {}; - full = env "qt-${qtbase.version}" ([ + full = env "qt-full-${qtbase.version}" ([ qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 qtscript qtsensors qtserialport qtsvg qttools qttranslations diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix index 1200884a30ce..8793b2bb9f01 100644 --- a/pkgs/development/libraries/qt-5/5.6/default.nix +++ b/pkgs/development/libraries/qt-5/5.6/default.nix @@ -113,7 +113,7 @@ let qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; env = callPackage ../qt-env.nix {}; - full = env "qt-${qtbase.version}" [ + full = env "qt-full-${qtbase.version}" [ qtconnectivity qtdeclarative qtdoc qtgraphicaleffects qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 qtscript qtsensors qtserialport qtsvg qttools qttranslations qtwayland diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix index 4007e89568d3..5afcdaa430e5 100644 --- a/pkgs/development/libraries/qt-5/5.9/default.nix +++ b/pkgs/development/libraries/qt-5/5.9/default.nix @@ -101,7 +101,7 @@ let qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {}; env = callPackage ../qt-env.nix {}; - full = env "qt-${qtbase.version}" ([ + full = env "qt-full-${qtbase.version}" ([ qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 qtscript qtsensors qtserialport qtsvg qttools qttranslations From b1047f34f7ec1b3169c52e8610be1cea5a85861d Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 15 Feb 2018 20:22:46 +0000 Subject: [PATCH 32/54] xenPackages.xen_4_8-vanilla: fix build of qemu-xen They merged that XSA and moved the tag. --- pkgs/applications/virtualization/xen/4.8.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/applications/virtualization/xen/4.8.nix b/pkgs/applications/virtualization/xen/4.8.nix index 44a52a1026af..b1fcf36a46c1 100644 --- a/pkgs/applications/virtualization/xen/4.8.nix +++ b/pkgs/applications/virtualization/xen/4.8.nix @@ -49,15 +49,9 @@ callPackage (import ./generic.nix (rec { src = fetchgit { url = https://xenbits.xen.org/git-http/qemu-xen.git; rev = "refs/tags/qemu-xen-${version}"; - sha256 = "1v19pp86kcgwvsbkrdrn4rlaj02i4054avw8k70w1m0rnwgcsdbs"; + sha256 = "1l4sygd8p0mc13bskr4r1m31qh1kr58h195qn1s52869s58jyhvm"; }; buildInputs = qemuDeps; - patches = [ - (xsaPatch { - name = "216-qemuu"; - sha256 = "06w2iw1r5gip2bpbg19cziws965h9in0f6np74cr31f76yy30yxn"; - }) - ]; meta.description = "Xen's fork of upstream Qemu"; }; } // optionalAttrs withInternalTraditionalQemu { From 23e68d119d65643528693516e8f7dad118901447 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 15 Feb 2018 20:22:46 +0000 Subject: [PATCH 33/54] xenPackages.xen_4_8-vanilla: stop overriding cc Nothing requires gcc49 in this version. --- pkgs/applications/virtualization/xen/packages.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/applications/virtualization/xen/packages.nix b/pkgs/applications/virtualization/xen/packages.nix index 8f5262acb024..4b5f15c8ff42 100644 --- a/pkgs/applications/virtualization/xen/packages.nix +++ b/pkgs/applications/virtualization/xen/packages.nix @@ -58,10 +58,6 @@ rec { }; xen_4_8-vanilla = callPackage ./4.8.nix { - # At the very least included seabios and etherboot need gcc49, - # so we have to build all of it with gcc49. - stdenv = overrideCC stdenv gcc49; - meta = { description = "vanilla"; longDescription = '' From a61fdebc2532d1547640346118c72ecad0191fc7 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:52:55 -0500 Subject: [PATCH 34/54] libatomic_ops: Add patch for RISC-V support. --- .../libraries/libatomic_ops/default.nix | 5 ++- .../libraries/libatomic_ops/riscv.patch | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/libatomic_ops/riscv.patch diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix index 3aae754be405..714e9361440c 100644 --- a/pkgs/development/libraries/libatomic_ops/default.nix +++ b/pkgs/development/libraries/libatomic_ops/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, autoconf, automake, libtool }: +{ stdenv, fetchurl, autoconf, automake, libtool, hostPlatform }: stdenv.mkDerivation rec { name = "libatomic_ops-${version}"; @@ -12,6 +12,9 @@ stdenv.mkDerivation rec { sha256 ="1rif2hjscq5mh639nsnjhb90c01gnmy1sbmj6x6hsn1xmpnj95r1"; }; + # https://github.com/ivmai/libatomic_ops/pull/32 + patches = if hostPlatform.isRiscV then [ ./riscv.patch ] else null; + nativeBuildInputs = stdenv.lib.optionals stdenv.isCygwin [ autoconf automake libtool ]; preConfigure = stdenv.lib.optionalString stdenv.isCygwin '' diff --git a/pkgs/development/libraries/libatomic_ops/riscv.patch b/pkgs/development/libraries/libatomic_ops/riscv.patch new file mode 100644 index 000000000000..27f2408c34c6 --- /dev/null +++ b/pkgs/development/libraries/libatomic_ops/riscv.patch @@ -0,0 +1,40 @@ +diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h +--- libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h 1969-12-31 19:00:00.000000000 -0500 ++++ libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h 2018-02-18 00:48:53.581721375 -0500 +@@ -0,0 +1 @@ ++#include "generic.h" +diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops.h libatomic_ops-7.6.2/src/atomic_ops.h +--- libatomic_ops-7.6.2-orig/src/atomic_ops.h 2017-12-24 03:31:12.000000000 -0500 ++++ libatomic_ops-7.6.2/src/atomic_ops.h 2018-02-18 00:48:53.580721359 -0500 +@@ -352,6 +352,9 @@ + # if defined(__tile__) + # include "atomic_ops/sysdeps/gcc/tile.h" + # endif ++# if defined(__riscv) ++# include "atomic_ops/sysdeps/gcc/riscv.h" ++# endif + #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */ + + #if (defined(__IBMC__) || defined(__IBMCPP__)) && !defined(__GNUC__) \ +diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.am libatomic_ops-7.6.2/src/Makefile.am +--- libatomic_ops-7.6.2-orig/src/Makefile.am 2017-12-24 03:31:12.000000000 -0500 ++++ libatomic_ops-7.6.2/src/Makefile.am 2018-02-18 00:48:53.579721342 -0500 +@@ -92,6 +92,7 @@ + atomic_ops/sysdeps/gcc/mips.h \ + atomic_ops/sysdeps/gcc/nios2.h \ + atomic_ops/sysdeps/gcc/powerpc.h \ ++ atomic_ops/sysdeps/gcc/riscv.h \ + atomic_ops/sysdeps/gcc/s390.h \ + atomic_ops/sysdeps/gcc/sh.h \ + atomic_ops/sysdeps/gcc/sparc.h \ +diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.in libatomic_ops-7.6.2/src/Makefile.in +--- libatomic_ops-7.6.2-orig/src/Makefile.in 2017-12-24 03:32:23.000000000 -0500 ++++ libatomic_ops-7.6.2/src/Makefile.in 2018-02-18 00:49:14.005062121 -0500 +@@ -446,6 +446,7 @@ + atomic_ops/sysdeps/gcc/mips.h \ + atomic_ops/sysdeps/gcc/nios2.h \ + atomic_ops/sysdeps/gcc/powerpc.h \ ++ atomic_ops/sysdeps/gcc/riscv.h \ + atomic_ops/sysdeps/gcc/s390.h \ + atomic_ops/sysdeps/gcc/sh.h \ + atomic_ops/sysdeps/gcc/sparc.h \ From f3f79bd6c6027277b123921edd4064a396358cd3 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 01:40:29 -0500 Subject: [PATCH 35/54] boehmgc: Add patch for RISC-V support. --- .../libraries/boehm-gc/default.nix | 4 +- .../libraries/boehm-gc/riscv.patch | 53 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/boehm-gc/riscv.patch diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index c1bcb46bae6e..d4e91deb7449 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -27,7 +27,9 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { url = "https://raw.githubusercontent.com/gentoo/musl/85b6a600996bdd71162b357e9ba93d8559342432/dev-libs/boehm-gc/files/boehm-gc-7.6.0-sys_select.patch"; sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3"; - }) ]; + }) ] ++ + # https://github.com/ivmai/bdwgc/pull/208 + lib.optional hostPlatform.isRiscV ./riscv.patch; configureFlags = [ "--enable-cplusplus" ] diff --git a/pkgs/development/libraries/boehm-gc/riscv.patch b/pkgs/development/libraries/boehm-gc/riscv.patch new file mode 100644 index 000000000000..249137d0a0dc --- /dev/null +++ b/pkgs/development/libraries/boehm-gc/riscv.patch @@ -0,0 +1,53 @@ +diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h +index a8e55dd2..439cc88d 100644 +--- a/include/private/gcconfig.h ++++ b/include/private/gcconfig.h +@@ -650,6 +650,15 @@ + # endif + # define mach_type_known + # endif ++# if defined(__riscv) && defined(LINUX) ++# if __riscv_xlen == 32 ++# define RISCV32 ++# define mach_type_known ++# elif __riscv_xlen == 64 ++# define RISCV64 ++# define mach_type_known ++# endif ++# endif + + # if defined(SN_TARGET_PSP2) + # define mach_type_known +@@ -2970,6 +2979,32 @@ + # endif + # endif + ++# ifdef RISCV32 ++# define CPP_WORDSZ 32 ++# define MACH_TYPE "RISC-V 32" ++# define ALIGNMENT 4 ++# ifdef LINUX ++# define OS_TYPE "LINUX" ++ extern int __data_start[]; ++# define DATASTART ((ptr_t)__data_start) ++# define LINUX_STACKBOTTOM ++# define DYNAMIC_LOADING ++# endif ++# endif ++ ++# ifdef RISCV64 ++# define CPP_WORDSZ 64 ++# define MACH_TYPE "RISC-V 64" ++# define ALIGNMENT 8 ++# ifdef LINUX ++# define OS_TYPE "LINUX" ++ extern int __data_start[]; ++# define DATASTART ((ptr_t)__data_start) ++# define LINUX_STACKBOTTOM ++# define DYNAMIC_LOADING ++# endif ++# endif ++ + #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES) + /* Use glibc's stack-end marker. */ + # define USE_LIBC_PRIVATES From a933aa9a8df44fa141eb24a802e38d7be3473918 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 01:48:07 -0500 Subject: [PATCH 36/54] busybox-sandbox-shell: Fix build on RISC-V --- pkgs/os-specific/linux/busybox/sandbox-shell.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/busybox/sandbox-shell.nix b/pkgs/os-specific/linux/busybox/sandbox-shell.nix index 1755bd4f3f74..b94fae7f787b 100644 --- a/pkgs/os-specific/linux/busybox/sandbox-shell.nix +++ b/pkgs/os-specific/linux/busybox/sandbox-shell.nix @@ -1,8 +1,9 @@ -{ busybox }: +{ busybox, hostPlatform }: # Minimal shell for use as basic /bin/sh in sandbox builds busybox.override { - useMusl = true; + # musl roadmap has RISC-V support projected for 1.1.20 + useMusl = !hostPlatform.isRiscV; enableStatic = true; enableMinimal = true; extraConfig = '' From 5a0eec1de1d25a3a63c65010e2351aee60bac958 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 02:47:08 -0500 Subject: [PATCH 37/54] nixUnstable: 2.0pre5950_3a5a241b -> 2.0pre5951_690ac7c9. --- pkgs/tools/package-management/nix/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 21b333f32316..cb1f5192822d 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -124,12 +124,12 @@ in rec { nixUnstable = (lib.lowPrio (common rec { name = "nix-2.0${suffix}"; - suffix = "pre5950_3a5a241b"; + suffix = "pre5951_690ac7c9"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "3a5a241b3209f14f8801b902ba20b5cb0666c9df"; - sha256 = "0cwjyhgyfzi2dz561nj897zhkbyx6lzi49avcyia2pr4498jcl6k"; + rev = "690ac7c90b5bf3c599e210c53365c7d229c8b0ff"; + sha256 = "1yn2p38kp1i67makbawr1rhdiwihgnvk2zwrz0gvf6q65mj2k89c"; }; fromGit = true; })) // { perl-bindings = perl-bindings { nix = nixUnstable; }; }; From 765194d7abb34f82fad697a769c570dd71f87530 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 02:48:03 -0500 Subject: [PATCH 38/54] nixUnstable: Disable seccomp support on RISC-V. --- pkgs/tools/package-management/nix/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index cb1f5192822d..f6e6988270ad 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -30,7 +30,7 @@ let buildInputs = [ curl openssl sqlite xz bzip2 ] ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium ++ lib.optionals fromGit [ brotli ] # Since 1.12 - ++ lib.optional stdenv.isLinux libseccomp + ++ lib.optional (stdenv.isLinux && !hostPlatform.isRiscV) libseccomp ++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20) (aws-sdk-cpp.override { apis = ["s3"]; @@ -55,7 +55,9 @@ let ] ++ lib.optional ( hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system - ) ''--with-system=${hostPlatform.nix.system}''; + ) ''--with-system=${hostPlatform.nix.system}'' + # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 + ++ lib.optional hostPlatform.isRiscV "--disable-seccomp-sandboxing"; makeFlags = "profiledir=$(out)/etc/profile.d"; From a551e6debce4cfc0bac3a051f5256a523cd32459 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 04:56:40 -0500 Subject: [PATCH 39/54] gnumake: Fix build against glibc 2.27. --- .../libraries/glibc/common-2.27.nix | 2 ++ .../build-managers/gnumake/4.2/default.nix | 4 +++- .../gnumake/4.2/glibc-2.27.patch | 24 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27.patch diff --git a/pkgs/development/libraries/glibc/common-2.27.nix b/pkgs/development/libraries/glibc/common-2.27.nix index d493feb35fa8..6c443ebbb932 100644 --- a/pkgs/development/libraries/glibc/common-2.27.nix +++ b/pkgs/development/libraries/glibc/common-2.27.nix @@ -192,6 +192,8 @@ stdenv.mkDerivation ({ maintainers = [ lib.maintainers.eelco ]; platforms = lib.platforms.linux; } // meta; + + passthru = { inherit version; }; } // lib.optionalAttrs (cross != null) { diff --git a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix index e175205143fc..1094cacb7af3 100644 --- a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix @@ -4,6 +4,8 @@ assert guileSupport -> ( pkgconfig != null && guile != null ); let version = "4.2.1"; + + needGlibcPatch = (stdenv.cc.libc.version or "") == "2.27"; in stdenv.mkDerivation { name = "gnumake-${version}"; @@ -20,7 +22,7 @@ stdenv.mkDerivation { # included Makefiles, don't look in /usr/include and friends. ./impure-dirs.patch ./pselect.patch - ]; + ] ++ stdenv.lib.optional needGlibcPatch ./glibc-2.27.patch; nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkgconfig ]; buildInputs = stdenv.lib.optionals guileSupport [ guile ]; diff --git a/pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27.patch b/pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27.patch new file mode 100644 index 000000000000..c2639c6cc927 --- /dev/null +++ b/pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27.patch @@ -0,0 +1,24 @@ +From 48c8a116a914a325a0497721f5d8b58d5bba34d4 Mon Sep 17 00:00:00 2001 +From: Paul Smith +Date: Sun, 19 Nov 2017 15:09:16 -0500 +Subject: * configure.ac: Support GLIBC glob interface version 2 + +--- + configure.ac | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff -Naur a/configure b/configure +--- configure 2016-06-10 19:03:21.000000000 -0400 ++++ configure 2018-02-18 04:40:32.971371555 -0500 +@@ -11481,10 +11481,9 @@ + #include + #include + +-#define GLOB_INTERFACE_VERSION 1 + #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 + # include +-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION ++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 + gnu glob + # endif + #endif From d4e1ef7b7b62c974d7d068b76a22651884aa6b4b Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 03:42:40 -0500 Subject: [PATCH 40/54] qemu-riscv: 2.11.50pre57991_713f2c1164 -> 2.11.50pre58771_af435b709d --- pkgs/applications/virtualization/qemu/riscv.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/riscv.nix b/pkgs/applications/virtualization/qemu/riscv.nix index 7f25388308d1..a900d943dabf 100644 --- a/pkgs/applications/virtualization/qemu/riscv.nix +++ b/pkgs/applications/virtualization/qemu/riscv.nix @@ -2,15 +2,19 @@ src = fetchFromGitHub { owner = "riscv"; repo = "riscv-qemu"; - rev = "713f2c116481d568702759bcb1b7fed835a2d575"; - sha256 = "0y4zrgidpc19pxwqqxcmj0ld50fdkf8b8c87xfcn88zrk8798qz4"; + rev = "af435b709d4a5de3ec2e59ff4dcd05b0b295a730"; + sha256 = "1kqcsn8yfdg3zyd991i4v5dxznd1l4a4hjry9304lvsm3sz2wllw"; fetchSubmodules = true; }; version = "2.11.50"; - date = "20180203"; - revCount = "57991"; - shortRev = "713f2c1164"; + revCount = "58771"; + shortRev = "af435b709d"; + targets = [ "riscv32-linux-user" "riscv32-softmmu" + "riscv64-linux-user" "riscv64-softmmu" + ]; in lib.overrideDerivation qemu (orig: { name = "${(builtins.parseDrvName qemu.name).name}-${version}pre${revCount}_${shortRev}"; inherit src; + configureFlags = orig.configureFlags ++ [ "--target-list=${lib.concatStringsSep "," targets}" ]; + postInstall = null; }) From 734f40a0a5ee8c8e2d3b7756d5a0dacb2122bb64 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Sun, 18 Feb 2018 09:53:59 -0500 Subject: [PATCH 41/54] linux-copperhead: 4.15.3.a -> 4.15.4.a --- pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix b/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix index 304c085f4aa7..0e39bc421c95 100644 --- a/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix +++ b/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix @@ -3,9 +3,9 @@ with stdenv.lib; let - version = "4.15.3"; + version = "4.15.4"; revision = "a"; - sha256 = "1fxdllg60hwlbmjijcj7w6c3xz0rf9268f12qy45diahmydyccgc"; + sha256 = "0j7nla8vjrxr82nfx8dl34qk8b56piwqbndqch9rv7plgl30hkj7"; # modVersion needs to be x.y.z, will automatically add .0 if needed modVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))); From 07e7a67f7b4b07d88be89e8b98bf2d8f21bd87fb Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Sun, 18 Feb 2018 09:54:31 -0500 Subject: [PATCH 42/54] linux: 4.4.115 -> 4.4.116 --- pkgs/os-specific/linux/kernel/linux-4.4.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix index 4316ba4cf4be..94425f4d1e47 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix @@ -1,11 +1,11 @@ { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { - version = "4.4.115"; + version = "4.4.116"; extraMeta.branch = "4.4"; src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "1pxm4r09402h4k8zgl0w1wm4vfvcaa3y7l36h50jr5wgi6l8rx2q"; + sha256 = "18sz68gbms5rvjiy51b1dg1jlr7pwazw9fg6q5ffczk22icflvsn"; }; } // (args.argsOverride or {})) From e3dd76f76ce112210e4c774cdeb653bd3cd43fed Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Sun, 18 Feb 2018 09:54:56 -0500 Subject: [PATCH 43/54] linux: 4.9.81 -> 4.9.82 --- pkgs/os-specific/linux/kernel/linux-4.9.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix index 2bb8ac1d948d..80db885170e4 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.9.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix @@ -1,11 +1,11 @@ { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { - version = "4.9.81"; + version = "4.9.82"; extraMeta.branch = "4.9"; src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "1bjwca7m3ksab6d23a05ciphzaj6nv6qmc5n6dxrgim0yhjpmvk4"; + sha256 = "105im51ax2cwfqkljfi1sqh6sap6sc76zh5l9n7fpbys04khnwab"; }; } // (args.argsOverride or {})) From 9d55ab2c4b6c24272da80f5cc135aba2b9b71fd6 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Sun, 18 Feb 2018 09:55:21 -0500 Subject: [PATCH 44/54] linux: 4.14.19 -> 4.14.20 --- pkgs/os-specific/linux/kernel/linux-4.14.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix index 96aa426b12ea..b5fd5168cf82 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.14.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix @@ -3,13 +3,13 @@ with stdenv.lib; buildLinux (args // rec { - version = "4.14.19"; + version = "4.14.20"; # branchVersion needs to be x.y extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version))); src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "0gj7mq0dnb914mm4rari9z2cxbybskv1587606aq6f9nv1qp3kn5"; + sha256 = "14njnspxmyzpapjzm8macrv411ss63xb39nb00xix75glqmg9dsa"; }; } // (args.argsOverride or {})) From 246359e8557e6c50f036fd4f9b0a101f60bd51a9 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Sun, 18 Feb 2018 09:55:54 -0500 Subject: [PATCH 45/54] linux: 4.15.3 -> 4.15.4 --- pkgs/os-specific/linux/kernel/linux-4.15.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-4.15.nix b/pkgs/os-specific/linux/kernel/linux-4.15.nix index 83fbfa81bf35..4bdcfba5db73 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.15.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.15.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "4.15.3"; + version = "4.15.4"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))); @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "055p02in09rj95z9hc1kjh4r12ydwdcl3ds2cp4dckhlnyhnxf4g"; + sha256 = "0fla9k90y6vaqvyjk81f59smcifcwickx4yr662m4whzkhd7wgd2"; }; } // (args.argsOverride or {})) From 47f25fae446e51d5229fe0386231d7446963b6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 18 Feb 2018 17:16:49 +0100 Subject: [PATCH 46/54] redshift, liferea: remove the extra cache file They're not really useful and cause collisions in envs. --- pkgs/applications/misc/redshift/default.nix | 5 ++++- pkgs/applications/networking/newsreaders/liferea/default.nix | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix index 9871c559523c..c0e481ae8788 100644 --- a/pkgs/applications/misc/redshift/default.nix +++ b/pkgs/applications/misc/redshift/default.nix @@ -41,7 +41,10 @@ stdenv.mkDerivation rec { pythonPath = [ pygobject3 pyxdg ]; preConfigure = "./bootstrap"; - postFixup = "wrapPythonPrograms"; + postFixup = '' + wrapPythonPrograms + rm "$out/share/icons/hicolor/icon-theme.cache" + ''; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/newsreaders/liferea/default.nix b/pkgs/applications/networking/newsreaders/liferea/default.nix index 743da7958067..ed6fe17cc7e8 100644 --- a/pkgs/applications/networking/newsreaders/liferea/default.nix +++ b/pkgs/applications/networking/newsreaders/liferea/default.nix @@ -28,6 +28,7 @@ in stdenv.mkDerivation rec { pythonPath = with python3Packages; [ pygobject3 pycairo ]; preFixup = '' + rm "$out/share/icons/hicolor/icon-theme.cache" buildPythonPath "$out $pythonPath" gappsWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH") ''; From c8aebb699a1e3a279e7ffbb1cde54d73f973635e Mon Sep 17 00:00:00 2001 From: Cray Elliott Date: Sun, 18 Feb 2018 09:03:33 -0800 Subject: [PATCH 47/54] ffmpeg, ffmpeg-full: 3.4.1 -> 3.4.2 --- pkgs/development/libraries/ffmpeg-full/default.nix | 4 ++-- pkgs/development/libraries/ffmpeg/3.4.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index 780008c95001..689b13a394dc 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -231,11 +231,11 @@ assert nvenc -> nvidia-video-sdk != null && nonfreeLicensing; stdenv.mkDerivation rec { name = "ffmpeg-full-${version}"; - version = "3.4.1"; + version = "3.4.2"; src = fetchurl { url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"; - sha256 = "1h4iz7q10wj04awr2wvmp60n7b09pfwrgwbbw9sgl7klcf52fxss"; + sha256 = "0h6prjn1ijkzzhkyj8mazp0wpx7m0n9ycadjxagf9czqirbyk4ib"; }; prePatch = '' diff --git a/pkgs/development/libraries/ffmpeg/3.4.nix b/pkgs/development/libraries/ffmpeg/3.4.nix index f4cda16424c3..98cbfdf43f6c 100644 --- a/pkgs/development/libraries/ffmpeg/3.4.nix +++ b/pkgs/development/libraries/ffmpeg/3.4.nix @@ -6,7 +6,7 @@ callPackage ./generic.nix (args // rec { version = "${branch}"; - branch = "3.4.1"; - sha256 = "0b2aaxx8l7g3pvs4zd3mzig44cc73savrxzfm6w0lnaa2lh3wi7k"; + branch = "3.4.2"; + sha256 = "0nkq4451masmzlx3p4vprqwc0sl2iwqxbzjrngmvj29q4azp00zb"; darwinFrameworks = [ Cocoa CoreMedia ]; }) From c64639b54caa6595f9ef62ed2548593b5fe5db66 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 12:42:17 -0500 Subject: [PATCH 48/54] nixos/binfmt: Initial binfmt_msc support. --- nixos/modules/module-list.nix | 1 + nixos/modules/system/boot/binfmt.nix | 139 +++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 nixos/modules/system/boot/binfmt.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 35f5e87d7e5e..01bd2960517b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -694,6 +694,7 @@ ./services/x11/xserver.nix ./system/activation/activation-script.nix ./system/activation/top-level.nix + ./system/boot/binfmt.nix ./system/boot/coredump.nix ./system/boot/emergency-mode.nix ./system/boot/grow-partition.nix diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix new file mode 100644 index 000000000000..15e84dc021e2 --- /dev/null +++ b/nixos/modules/system/boot/binfmt.nix @@ -0,0 +1,139 @@ +{ config, lib, ... }: +let + inherit (lib) mkOption types optionalString; + + cfg = config.boot.binfmtMiscRegistrations; + + makeBinfmtLine = name: { recognitionType, offset, magicOrExtension + , mask, preserveArgvZero, openBinary + , matchCredentials, fixBinary, ... + }: let + type = if recognitionType == "magic" then "M" else "E"; + offset' = toString offset; + mask' = toString mask; + interpreter = "/run/binfmt/${name}"; + flags = if !(matchCredentials -> openBinary) + then throw "boot.binfmtMiscRegistrations.${name}: you can't specify openBinary = false when matchCredentials = true." + else optionalString preserveArgvZero "P" + + optionalString (openBinary && !matchCredentials) "O" + + optionalString matchCredentials "C" + + optionalString fixBinary "F"; + in ":${name}:${type}:${offset'}:${magicOrExtension}:${mask'}:${interpreter}:${flags}"; + + binfmtFile = builtins.toFile "binfmt_nixos.conf" + (lib.concatStringsSep "\n" (lib.mapAttrsToList makeBinfmtLine cfg)); + + activationSnippet = name: { interpreter, ... }: + "ln -sf ${interpreter} /run/binfmt/${name}"; + activationScript = '' + mkdir -p -m 0755 /run/binfmt + ${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet cfg)} + ''; +in { + options = { + boot.binfmtMiscRegistrations = mkOption { + default = {}; + + description = '' + Extra binary formats to register with the kernel. + See https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html for more details. + ''; + + type = types.attrsOf (types.submodule ({ config, ... }: { + options = { + recognitionType = mkOption { + default = "magic"; + description = "Whether to recognize executables by magic number or extension."; + type = types.enum [ "magic" "extension" ]; + }; + + offset = mkOption { + default = null; + description = "The byte offset of the magic number used for recognition."; + type = types.nullOr types.int; + }; + + magicOrExtension = mkOption { + description = "The magic number or extension to match on."; + type = types.str; + }; + + mask = mkOption { + default = null; + description = + "A mask to be ANDed with the byte sequence of the file before matching"; + type = types.nullOr types.str; + }; + + interpreter = mkOption { + description = '' + The interpreter to invoke to run the program. + + Note that the actual registration will point to + /run/binfmt/''${name}, so the kernel interpreter length + limit doesn't apply. + ''; + type = types.path; + }; + + preserveArgvZero = mkOption { + default = false; + description = '' + Whether to pass the original argv[0] to the interpreter. + + See the description of the 'P' flag in the kernel docs + for more details; + ''; + type = types.bool; + }; + + openBinary = mkOption { + default = config.matchCredentials; + description = '' + Whether to pass the binary to the interpreter as an open + file descriptor, instead of a path. + ''; + type = types.bool; + }; + + matchCredentials = mkOption { + default = false; + description = '' + Whether to launch with the credentials and security + token of the binary, not the interpreter (e.g. setuid + bit). + + See the description of the 'C' flag in the kernel docs + for more details. + + Implies/requires openBinary = true. + ''; + type = types.bool; + }; + + fixBinary = mkOption { + default = false; + description = '' + Whether to open the interpreter file as soon as the + registration is loaded, rather than waiting for a + relevant file to be invoked. + + See the description of the 'F' flag in the kernel docs + for more details. + ''; + type = types.bool; + }; + }; + })); + }; + }; + + config = lib.mkIf (cfg != {}) { + environment.etc."binfmt.d/nixos.conf".source = binfmtFile; + system.activationScripts.binfmt = activationScript; + systemd.additionalUpstreamSystemUnits = + [ "proc-sys-fs-binfmt_misc.automount" + "proc-sys-fs-binfmt_misc.mount" + ]; + }; +} From 49dbb875369e35b370a18601e8e1d09a9782e1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 18 Feb 2018 19:19:04 +0100 Subject: [PATCH 49/54] pythonPackages.pymacaroons-pynacl: move expression Tests are now explicitly disabled to fix the build for Python 3. --- .../pymacaroons-pynacl/default.nix | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 13 +--------- 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 pkgs/development/python-modules/pymacaroons-pynacl/default.nix diff --git a/pkgs/development/python-modules/pymacaroons-pynacl/default.nix b/pkgs/development/python-modules/pymacaroons-pynacl/default.nix new file mode 100644 index 000000000000..8bc644252c0f --- /dev/null +++ b/pkgs/development/python-modules/pymacaroons-pynacl/default.nix @@ -0,0 +1,24 @@ +{ lib, buildPythonPackage, fetchFromGitHub, pynacl, six }: + +buildPythonPackage rec { + pname = "pymacaroons-pynacl"; + version = "0.9.3"; + + src = fetchFromGitHub { + owner = "matrix-org"; + repo = "pymacaroons"; + rev = "v${version}"; + sha256 = "0bykjk01zdndp6gjr30x46blsn0cvxa7j0zh5g8raxwaawchjhii"; + }; + + propagatedBuildInputs = [ pynacl six ]; + + # Tests require an old version of hypothesis + doCheck = false; + + meta = with lib; { + description = "Macaroon library for Python"; + homepage = https://github.com/matrix-org/pymacaroons; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fa0e0d02517d..0eebd578c3a3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19946,18 +19946,7 @@ EOF propagatedBuildInputs = with self; []; }; - pymacaroons-pynacl = buildPythonPackage rec { - name = "pymacaroons-pynacl-${version}"; - version = "0.9.3"; - - src = pkgs.fetchgit { - url = "https://github.com/matrix-org/pymacaroons.git"; - rev = "refs/tags/v${version}"; - sha256 = "0bykjk01zdndp6gjr30x46blsn0cvxa7j0zh5g8raxwaawchjhii"; - }; - - propagatedBuildInputs = with self; [ pynacl six ]; - }; + pymacaroons-pynacl = callPackage ../development/python-modules/pymacaroons-pynacl { }; pynacl = callPackage ../development/python-modules/pynacl { }; From 5ab428799ec920022b82d5d4f2c10ebfe0f418c4 Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Sun, 18 Feb 2018 13:21:25 -0500 Subject: [PATCH 50/54] conda: init at miniconda3 4.3.31 (#34872) * conda: init at miniconda3 4.3.31 --- .../package-management/conda/default.nix | 71 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/package-management/conda/default.nix diff --git a/pkgs/tools/package-management/conda/default.nix b/pkgs/tools/package-management/conda/default.nix new file mode 100644 index 000000000000..4589cfcec880 --- /dev/null +++ b/pkgs/tools/package-management/conda/default.nix @@ -0,0 +1,71 @@ +{ lib +, stdenv +, fetchurl +, runCommand +, makeWrapper +, buildFHSUserEnv +, libselinux +, xorg +# Conda installs its packages and environments under this directory +, installationPath ? "~/.conda" +# Conda manages most pkgs itself, but expects a few to be on the system. +, condaDeps ? [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ] +# Any extra nixpkgs you'd like available in the FHS env for Conda to use +, extraPkgs ? [ ] +}: + +# How to use this package? +# +# First-time setup: this nixpkg downloads the conda installer and provides a FHS +# env in which it can run. On first use, the user will need to install conda to +# the installPath using the installer: +# $ nix-env -iA conda +# $ conda-shell +# $ conda-install +# +# Under normal usage, simply call `conda-shell` to activate the FHS env, +# and then use conda commands as normal: +# $ conda-shell +# $ conda install spyder +let + version = "4.3.31"; + src = fetchurl { + url = "https://repo.continuum.io/miniconda/Miniconda3-${version}-Linux-x86_64.sh"; + sha256 = "1rklq81s9v7xz1q0ha99w2sl6kyc5vhk6b21cza0jr3b8cgz0lam"; + }; + + conda = runCommand "conda-install" { buildInputs = [ makeWrapper ]; } + '' + mkdir -p $out/bin + cp ${src} $out/bin/miniconda-installer.sh + chmod +x $out/bin/miniconda-installer.sh + + makeWrapper \ + $out/bin/miniconda-installer.sh \ + $out/bin/conda-install \ + --add-flags "-p ${installationPath}" \ + --add-flags "-b" + ''; +in + buildFHSUserEnv { + name = "conda-shell"; + targetPkgs = pkgs: (builtins.concatLists [ [ conda ] condaDeps extraPkgs]); + profile = '' + # Add conda to PATH + export PATH=${installationPath}/bin:$PATH + # Paths for gcc if compiling some C sources with pip + export NIX_CFLAGS_COMPILE="-I${installationPath}/include" + export NIX_CFLAGS_LINK="-L${installationPath}lib" + # Some other required environment variables + export FONTCONFIG_FILE=/etc/fonts/fonts.conf + export QTCOMPOSE=${xorg.libX11}/share/X11/locale + ''; + + meta = { + description = "Conda is a package manager for Python"; + homepage = https://conda.io/; + platforms = lib.platforms.linux; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ jluttine bhipple ]; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3d9fcb7ca3fc..925cd63a714a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1681,6 +1681,8 @@ with pkgs; checkbashisms = callPackage ../development/tools/misc/checkbashisms { }; + ckb = libsForQt5.callPackage ../tools/misc/ckb { }; + clamav = callPackage ../tools/security/clamav { }; clex = callPackage ../tools/misc/clex { }; @@ -1703,10 +1705,10 @@ with pkgs; cloud-utils = callPackage ../tools/misc/cloud-utils { }; - ckb = libsForQt5.callPackage ../tools/misc/ckb { }; - compass = callPackage ../development/tools/compass { }; + conda = callPackage ../tools/package-management/conda { }; + convmv = callPackage ../tools/misc/convmv { }; convoy = callPackage ../tools/filesystems/convoy { }; From 655446c7f574e08e92d191f0a80dd952bd33a687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 18 Feb 2018 19:56:34 +0100 Subject: [PATCH 51/54] libav*: maintenance updates Also remove myself from meta.maintainers, as I can't really give them too much maintenance. --- pkgs/development/libraries/libav/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index 6a80a856df3c..a069894f6c8c 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -28,9 +28,9 @@ let inherit (stdenv.lib) optional optionals hasPrefix; in let result = { # e.g. https://libav.org/releases/libav-11.11.tar.xz.sha1 - libav_0_8 = libavFun "0.8.20" "0c7a2417c3a01eb74072691bb93ce802ae1be08f"; - libav_11 = libavFun "11.11" "d7444fa4f135bdd7347cc962ab4b5228796b0f23"; - libav_12 = libavFun "12.2" "3784b15f88076ca0ab8fb6b0377e975b83a5c9f5"; + libav_0_8 = libavFun "0.8.21" "d858f65128dad0bac1a8c3a51e5cbb27a7c79b3f"; + libav_11 = libavFun "11.12" "61d5dcab5fde349834af193a572b12a5fd6a4d42"; + libav_12 = libavFun "12.3" "386c18c8b857f23dfcf456ce40370716130211d9"; }; libavFun = version : sha1 : stdenv.mkDerivation rec { @@ -125,7 +125,6 @@ let license = with licenses; if enableUnfree then unfree #ToDo: redistributable or not? else if enableGPL then gpl2Plus else lgpl21Plus; platforms = with platforms; linux ++ darwin; - maintainers = [ maintainers.vcunat ]; }; }; # libavFun From 4839b568de509478e7c49cd06a1efb5c40687e5c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 14:08:22 -0500 Subject: [PATCH 52/54] qemu: Add patch for statfs f_flags in Linux user mode. --- pkgs/applications/virtualization/qemu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 48a9296fa97d..694026d3bac2 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - patches = [ ./no-etc-install.patch ] + patches = [ ./no-etc-install.patch ./statfs-flags.patch ] ++ optional nixosTestRunner ./force-uid0-on-9p.patch ++ optional pulseSupport ./fix-hda-recording.patch; From e3f947a19a8f64fd190972561d75557f92d8a953 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 14:33:43 -0500 Subject: [PATCH 53/54] Add missing files --- .../virtualization/qemu/statfs-flags.patch | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 pkgs/applications/virtualization/qemu/statfs-flags.patch diff --git a/pkgs/applications/virtualization/qemu/statfs-flags.patch b/pkgs/applications/virtualization/qemu/statfs-flags.patch new file mode 100644 index 000000000000..c0f0162aacc9 --- /dev/null +++ b/pkgs/applications/virtualization/qemu/statfs-flags.patch @@ -0,0 +1,200 @@ +commit d3282d2512774dc5027c98930a3852b2b6e8407a +Author: Shea Levy +Date: Sun Feb 18 13:50:11 2018 -0500 + + linux-user: Support f_flags in statfs when available. + + Signed-off-by: Shea Levy + +diff --git a/configure b/configure +index 913e14839d..52fe2bf941 100755 +--- a/configure ++++ b/configure +@@ -5303,6 +5303,22 @@ if compile_prog "" "" ; then + have_utmpx=yes + fi + ++########################################## ++# Check for newer fields of struct statfs on Linux ++ ++if test "$linux_user" = "yes"; then ++ cat > $TMPC < ++ ++int main(void) { ++ struct statfs fs; ++ fs.f_flags = 0; ++} ++EOF ++ if compile_object ; then ++ have_statfs_flags=yes ++ fi ++fi + ########################################## + # checks for sanitizers + +@@ -6518,6 +6534,10 @@ if test "$have_utmpx" = "yes" ; then + echo "HAVE_UTMPX=y" >> $config_host_mak + fi + ++if test "$have_statfs_flags" = "yes" ; then ++ echo "HAVE_STATFS_FLAGS=y" >> $config_host_mak ++fi ++ + if test "$ivshmem" = "yes" ; then + echo "CONFIG_IVSHMEM=y" >> $config_host_mak + fi +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 82b35a6bdf..77481eca2c 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -9534,6 +9534,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); + __put_user(stfs.f_namelen, &target_stfs->f_namelen); + __put_user(stfs.f_frsize, &target_stfs->f_frsize); ++#ifdef HAVE_STATFS_FLAGS ++ __put_user(stfs.f_flags, &target_stfs->f_flags); ++#endif + memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); + unlock_user_struct(target_stfs, arg2, 1); + } +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h +index a35c52a60a..9f90451caf 100644 +--- a/linux-user/syscall_defs.h ++++ b/linux-user/syscall_defs.h +@@ -362,7 +362,14 @@ struct kernel_statfs { + int f_ffree; + kernel_fsid_t f_fsid; + int f_namelen; ++#ifdef HAVE_STATFS_FLAGS ++ int f_frsize; ++ int f_flags; ++ int f_spare[4]; ++#else + int f_spare[6]; ++#endif ++ + }; + + struct target_dirent { +@@ -2223,7 +2230,13 @@ struct target_statfs { + /* Linux specials */ + target_fsid_t f_fsid; + int32_t f_namelen; ++#ifdef HAVE_STATFS_FLAGS ++ int32_t f_frsize; ++ int32_t f_flags; ++ int32_t f_spare[4]; ++#else + int32_t f_spare[6]; ++#endif + }; + #else + struct target_statfs { +@@ -2239,7 +2252,13 @@ struct target_statfs { + /* Linux specials */ + target_fsid_t f_fsid; + abi_long f_namelen; ++#ifdef HAVE_STATFS_FLAGS ++ abi_long f_frsize; ++ abi_long f_flags; ++ abi_long f_spare[4]; ++#else + abi_long f_spare[6]; ++#endif + }; + #endif + +@@ -2255,7 +2274,13 @@ struct target_statfs64 { + uint64_t f_bavail; + target_fsid_t f_fsid; + uint32_t f_namelen; ++#ifdef HAVE_STATFS_FLAGS ++ uint32_t f_frsize; ++ uint32_t f_flags; ++ uint32_t f_spare[4]; ++#else + uint32_t f_spare[6]; ++#endif + }; + #elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \ + defined(TARGET_SPARC64) || defined(TARGET_AARCH64)) && \ +@@ -2271,7 +2296,12 @@ struct target_statfs { + target_fsid_t f_fsid; + abi_long f_namelen; + abi_long f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ abi_long f_flags; ++ abi_long f_spare[4]; ++#else + abi_long f_spare[5]; ++#endif + }; + + struct target_statfs64 { +@@ -2285,7 +2315,12 @@ struct target_statfs64 { + target_fsid_t f_fsid; + abi_long f_namelen; + abi_long f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ abi_long f_flags; ++ abi_long f_spare[4]; ++#else + abi_long f_spare[5]; ++#endif + }; + #elif defined(TARGET_S390X) + struct target_statfs { +@@ -2299,7 +2334,13 @@ struct target_statfs { + kernel_fsid_t f_fsid; + int32_t f_namelen; + int32_t f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ int32_t f_flags; ++ int32_t f_spare[4]; ++#else + int32_t f_spare[5]; ++#endif ++ + }; + + struct target_statfs64 { +@@ -2313,7 +2354,12 @@ struct target_statfs64 { + kernel_fsid_t f_fsid; + int32_t f_namelen; + int32_t f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ int32_t f_flags; ++ int32_t f_spare[4]; ++#else + int32_t f_spare[5]; ++#endif + }; + #else + struct target_statfs { +@@ -2327,7 +2373,12 @@ struct target_statfs { + target_fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ uint32_t f_flags; ++ uint32_t f_spare[4]; ++#else + uint32_t f_spare[5]; ++#endif + }; + + struct target_statfs64 { +@@ -2341,7 +2392,12 @@ struct target_statfs64 { + target_fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; ++#ifdef HAVE_STATFS_FLAGS ++ uint32_t f_flags; ++ uint32_t f_spare[4]; ++#else + uint32_t f_spare[5]; ++#endif + }; + #endif + From 0a0ecc4c2c0c6b55a250f7c31e06fb090e307259 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 15:12:33 -0500 Subject: [PATCH 54/54] Enable building riscv64 cross bootstrap tools Fixes #35089 --- pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 1 + pkgs/stdenv/linux/make-bootstrap-tools.nix | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index d08be79e6c55..6c217be4ea3c 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix @@ -17,4 +17,5 @@ in with (import ../../../lib).systems.examples; { i686-musl = make musl32; armv6l-musl = make muslpi; aarch64-musl = make aarch64-multiplatform-musl; + riscv64 = make riscv64; } diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 86801e3f0447..71347ef83927 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -5,6 +5,7 @@ let pkgs = import ../../.. { inherit localSystem crossSystem; }; libc = pkgs.stdenv.cc.libc; + isl = with pkgs; if targetPlatform.isRiscV then isl_0_17 else isl_0_14; in with pkgs; rec { @@ -19,7 +20,7 @@ in with pkgs; rec { tarMinimal = gnutar.override { acl = null; }; busyboxMinimal = busybox.override { - useMusl = true; + useMusl = !targetPlatform.isRiscV; enableStatic = true; enableMinimal = true; extraConfig = '' @@ -143,7 +144,7 @@ in with pkgs; rec { # These needed for cross but not native tools because the stdenv # GCC has certain things built in statically. See # pkgs/stdenv/linux/default.nix for the details. - cp -d ${isl_0_14.out}/lib/libisl*.so* $out/lib + cp -d ${isl.out}/lib/libisl*.so* $out/lib '' + '' cp -d ${bzip2.out}/lib/libbz2.so* $out/lib