diff options
Diffstat (limited to 'pkgs/development')
14 files changed, 381 insertions, 27 deletions
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 937977b0a97..360f96e1242 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,13 +27,17 @@ , git , libgit2 , fetchFromGitHub +, fetchpatch , 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}"; @@ -47,53 +50,53 @@ 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 { 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"; }; }; @@ -119,6 +122,9 @@ sources = { ]; builder = '' + # 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 \ installable_package=$INSTALLABLE_PACKAGE \ @@ -126,6 +132,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 +165,8 @@ stdenv.mkDerivation rec { rsync which findutils + makeWrapper + gnumake ] ++ stdenv.lib.optional stdenv.needsPax paxctl; # TODO: Revisit what's propagated and how @@ -198,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 \ @@ -209,6 +239,13 @@ 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} + + # 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);' \ @@ -217,21 +254,21 @@ 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" 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 +288,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 +304,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/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 0e18e8812a8..66723f1cdf3 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 new file mode 100644 index 00000000000..26337814caf --- /dev/null +++ b/pkgs/development/compilers/swift/patches/icu59.patch @@ -0,0 +1,113 @@ +--- 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<const UChar *>(LeftString), LeftLength, + reinterpret_cast<const UChar *>(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<const char *>(LeftString), LeftLength); +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uiter_setString(&RightIterator, reinterpret_cast<const UChar *>(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<const UChar *>(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<UChar *>(Destination), + DestinationCapacity, + reinterpret_cast<const UChar *>(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<UChar *>(Destination), + DestinationCapacity, + reinterpret_cast<const UChar *>(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."); + } +@@ -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<swift::__swift_stdlib_UBreakIterator>( +- ubrk_open(static_cast<UBreakIteratorType>(type), locale, text, textLength, ++ ubrk_open(static_cast<UBreakIteratorType>(type), locale, reinterpret_cast<const UChar *>(text), textLength, + ptr_cast<UErrorCode>(status))); + } + 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 00000000000..8ef7e391696 --- /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 <dispatch/dispatch.h> + #include <os/base.h> + #include <os/log.h> +-#include <xlocale.h> + #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 <xlocale.h> + #endif + #include <limits> + #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 <unistd.h> + #include <string.h> + #include <stdio.h> +-#include <xlocale.h> + + 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 <unistd.h> + #include <string.h> + #include <stdio.h> +-#include <xlocale.h> + #include <CoreFoundation/CFStringDefaultEncoding.h> + #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 <xlocale.h> + #endif + #include <unistd.h> + #include <sys/time.h> diff --git a/pkgs/development/compilers/swift/patches/sigaltstack.patch b/pkgs/development/compilers/swift/patches/sigaltstack.patch new file mode 100644 index 00000000000..c529fa3777b --- /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<char> 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 00000000000..2701d1a3ae2 --- /dev/null +++ b/pkgs/development/compilers/swift/patches/sigunused.patch @@ -0,0 +1,11 @@ +--- 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) +- for i in 1 ..< SIGUNUSED { ++ for i in 1 ..< SIGSYS { + if i == SIGKILL || i == SIGSTOP { + continue + } diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index c1bcb46bae6..d4e91deb744 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 00000000000..249137d0a0d --- /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 diff --git a/pkgs/development/libraries/glibc/common-2.27.nix b/pkgs/development/libraries/glibc/common-2.27.nix index d493feb35fa..6c443ebbb93 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/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix index 3aae754be40..714e9361440 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 00000000000..27f2408c34c --- /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 \ diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index b34c9ff31f2..2ea5e923bad 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" ] 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 e175205143f..1094cacb7af 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 00000000000..c2639c6cc92 --- /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 <psmith@gnu.org> +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 <glob.h> + #include <fnmatch.h> + +-#define GLOB_INTERFACE_VERSION 1 + #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 + # include <gnu-versions.h> +-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION ++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 + gnu glob + # endif + #endif |