Skip to content

Commit

Permalink
Merge branch 'staging' (early part)
Browse files Browse the repository at this point in the history
The comparison looks nice on Hydra.
  • Loading branch information
vcunat committed May 30, 2017
2 parents 30ce98b + 595141d commit 538aa0f
Show file tree
Hide file tree
Showing 24 changed files with 202 additions and 85 deletions.
28 changes: 25 additions & 3 deletions pkgs/development/compilers/llvm/4/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python }:
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python
, fixDarwinDylibNames
}:

let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
Expand All @@ -13,23 +15,37 @@ let
mv clang-tools-extra-* $sourceRoot/tools/extra
'';

buildInputs = [ cmake libedit libxml2 llvm python ];
nativeBuildInputs = [ cmake python python.pkgs.sphinx ];
buildInputs = [ libedit libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;

cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
"-DCLANG_INCLUDE_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++
# Maybe with compiler-rt this won't be needed?
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");

patches = [ ./purity.patch ];

postBuild = ''
cmake --build . --target docs-clang-man
'';

postPatch = ''
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
# Patch for standalone doc building
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
'';

outputs = [ "out" "python" ];
outputs = [ "out" "man" "python" ];

# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
Expand All @@ -46,6 +62,12 @@ let
mv $out/share/clang/*.py $python/share/clang
rm $out/bin/c-index-test
# Manually install clang manpage
cp docs/man/*.1 $out/share/man/man1/
# Move it and other man pages to 'man' output
moveToOutput "share/man" "$man"
'';

enableParallelBuilding = true;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/4/libc++abi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ stdenv.mkDerivation {

src = fetch "libcxxabi" "1n416kv27anabg9jsw6331r28ic30xk46p381lx2vbb2jrhwpafw";

buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
nativeBuildInputs = [ cmake ];
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;

postUnpack = ''
unpackFile ${libcxx.src}
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/4/lld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ stdenv.mkDerivation {

src = fetch "lld" "00km1qawk146pyjqa6aphcdzgkzrmg6cgk0ikg4661ffp5bn9q1k";

buildInputs = [ cmake llvm ];
nativeBuildInputs = [ cmake ];
buildInputs = [ llvm ];

outputs = [ "out" "dev" ];

Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/4/lldb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ stdenv.mkDerivation {
cmake/modules/LLDBStandalone.cmake
'';

buildInputs = [ cmake python which swig ncurses zlib libedit libxml2 llvm ]
nativeBuildInputs = [ cmake python which swig ];
buildInputs = [ ncurses zlib libedit libxml2 llvm ]
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc ];

CXXFLAGS = "-fno-rtti";
Expand Down
14 changes: 11 additions & 3 deletions pkgs/development/compilers/llvm/4/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ in stdenv.mkDerivation rec {
mv compiler-rt-* $sourceRoot/projects/compiler-rt
'';

outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";
outputs = [ "out" "man" ] ++ stdenv.lib.optional enableSharedLibraries "lib";

buildInputs = [ perl groff cmake libxml2 python libffi ]
nativeBuildInputs = [ perl groff cmake python python.pkgs.sphinx ];
buildInputs = [ libxml2 libffi ]
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ];

propagatedBuildInputs = [ ncurses zlib ];
Expand Down Expand Up @@ -80,6 +81,11 @@ in stdenv.mkDerivation rec {
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code
"-DLLVM_BUILD_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ stdenv.lib.optional enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"
] ++ stdenv.lib.optional (!isDarwin)
Expand All @@ -103,7 +109,9 @@ in stdenv.mkDerivation rec {
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
'';

postInstall = ""
postInstall = ''
moveToOutput "share/man" "$man"
''
+ stdenv.lib.optionalString (enableSharedLibraries) ''
moveToOutput "lib/libLLVM-*" "$lib"
moveToOutput "lib/libLLVM.${shlib}" "$lib"
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/4/openmp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ stdenv.mkDerivation {

src = fetch "openmp" "09kf41zgv551fnv628kqhlwgqkd2bkiwii9gqi6q12djgdddhmfv";

buildInputs = [ cmake llvm perl ];
nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];

enableParallelBuilding = true;

Expand Down
10 changes: 5 additions & 5 deletions pkgs/development/libraries/libdrm/default.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{ stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, valgrind }:
{ stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, valgrind-light }:

stdenv.mkDerivation rec {
name = "libdrm-2.4.79";
name = "libdrm-2.4.81";

src = fetchurl {
url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
sha256 = "c6aaf319293bce38023e9a637471b0f45c93c807d2a279060d741fc7a2e5b197";
sha256 = "8cc05c195ac8708199979a94c4e4d1a928c14ec338ecbcb38ead09f54dae11ae";
};

outputs = [ "out" "dev" ];

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libpthreadstubs libpciaccess ];
buildInputs = [ libpthreadstubs libpciaccess valgrind-light ];
# libdrm as of 2.4.70 does not actually do anything with udev.

patches = stdenv.lib.optional stdenv.isDarwin ./libdrm-apple.patch;

preConfigure = stdenv.lib.optionalString stdenv.isDarwin
"echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";

configureFlags = [ "--disable-valgrind" ]
configureFlags = [ ]
++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]
++ stdenv.lib.optional stdenv.isDarwin "-C";

Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/libtasn1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ stdenv.mkDerivation rec {
sha256 = "00jsix5hny0g768zv4hk78dib7w0qmk5fbizf4jj37r51nd4s6k8";
};

patches = [
(fetchurl {
name = "CVE-2017-6891.patch";
url = "https://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=patch;h=5520704d075802df25ce4ffccc010ba1641bd484";
sha256 = "000r6wb87zkx8yhzkf1c3h7p5akwhjw51cv8f1yjnplrqqrr7h2k";
})
];

outputs = [ "out" "dev" "devdoc" ];
outputBin = "dev";

Expand Down
13 changes: 6 additions & 7 deletions pkgs/development/libraries/mesa/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, pkgconfig, intltool, autoreconfHook, substituteAll
, file, expat, libdrm, xorg, wayland, openssl
, llvmPackages, libffi, libomxil-bellagio, libva
, libelf, libvdpau, python2
, libelf, libvdpau
, grsecEnabled ? false
, enableRadv ? false
# Texture floats are patented, see docs/patents.txt, so we don't enable them for full Mesa.
Expand Down Expand Up @@ -36,7 +36,7 @@ let
then ["nouveau" "freedreno" "vc4" "etnaviv" "imx"]
else if stdenv.isAarch64
then ["nouveau" "vc4" ]
else ["i915" "ilo" "r300" "r600" "radeonsi" "nouveau"];
else ["i915" "r300" "r600" "radeonsi" "nouveau"];
defaultDriDrivers =
if (stdenv.isArm || stdenv.isAarch64)
then ["nouveau"]
Expand Down Expand Up @@ -67,7 +67,7 @@ let
in

let
version = "17.0.6";
version = "17.1.1";
branch = head (splitString "." version);
driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
in
Expand All @@ -82,7 +82,7 @@ stdenv.mkDerivation {
"ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
"https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
];
sha256 = "17d60jjzg4ddm95gk2cqx0xz6b9anmmz6ax4majwr3gis2yg7v49";
sha256 = "aed503f94c0c1630a162a3e276f4ee12a86764cee4cb92338ea2dea99a04e7ef";
};

prePatch = "patchShebangs .";
Expand All @@ -103,7 +103,7 @@ stdenv.mkDerivation {
"--localstatedir=/var"
"--with-dri-driverdir=$(drivers)/lib/dri"
"--with-dri-searchpath=${driverLink}/lib/dri"
"--with-egl-platforms=x11,wayland,drm"
"--with-platforms=x11,wayland,drm"
]
++ (optional (galliumDrivers != [])
("--with-gallium-drivers=" +
Expand All @@ -126,7 +126,7 @@ stdenv.mkDerivation {
"--enable-glx"
"--enable-glx-tls"
"--enable-gallium-osmesa" # used by wine
"--enable-gallium-llvm"
"--enable-llvm"
"--enable-egl"
"--enable-xa" # used in vmware driver
"--enable-gbm"
Expand All @@ -152,7 +152,6 @@ stdenv.mkDerivation {
libX11 libXext libxcb libXt libXfixes libxshmfence
libffi wayland libvdpau libelf libXvMC
libomxil-bellagio libva libpthreadstubs openssl/*or another sha1 provider*/
(python2.withPackages (ps: [ ps.Mako ]))
];


Expand Down
19 changes: 11 additions & 8 deletions pkgs/development/libraries/mesa/symlink-drivers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/dri/Makefile.am mesa-12.0.
install-data-hook:
for i in $(TARGET_DRIVERS); do \
- ln -f $(DESTDIR)$(dridir)/gallium_dri.so \
+ ln -srf $(DESTDIR)$(dridir)/gallium_dri.so \
+ ln -srf $(DESTDIR)$(dridir)/gallium_dri.so \
$(DESTDIR)$(dridir)/$${i}_dri.so; \
done; \
- $(RM) $(DESTDIR)$(dridir)/gallium_dri.*
+ $(RM) $(DESTDIR)$(dridir)/gallium_dri.la
- $(RM) $(DESTDIR)$(dridir)/gallium_dri.*; \
+ $(RM) $(DESTDIR)$(dridir)/gallium_dri.la \
$(RM) -d $(DESTDIR)$(dridir) &>/dev/null || true

uninstall-hook:
for i in $(TARGET_DRIVERS); do \
Expand Down Expand Up @@ -60,8 +61,9 @@ diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/vdpau/Makefile.am mesa-12.
ln -sf $${l} \
$${dest_dir}/$${k}; \
done; \
- $(RM) $${dest_dir}/libvdpau_gallium.*
+ $(RM) $${dest_dir}/libvdpau_gallium.la
- $(RM) $${dest_dir}/libvdpau_gallium.*; \
+ $(RM) $${dest_dir}/libvdpau_gallium.la \
$(RM) -d $${dest_dir} &>/dev/null || true

uninstall-hook:
for i in $(TARGET_DRIVERS); do \
Expand All @@ -73,16 +75,17 @@ diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/xvmc/Makefile.am mesa-12.0
k=libXvMC$${i}.$(LIB_EXT); \
l=$${k}.$(XVMC_MAJOR).$(XVMC_MINOR).0; \
- ln -f $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
+ ln -srf $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
+ ln -srf $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
$${dest_dir}/$${l}; \
ln -sf $${l} \
$${dest_dir}/$${k}.$(XVMC_MAJOR).$(XVMC_MINOR); \
@@ -82,7 +82,7 @@
ln -sf $${l} \
$${dest_dir}/$${k}; \
done; \
- $(RM) $${dest_dir}/libXvMCgallium.*
+ $(RM) $${dest_dir}/libXvMCgallium.la
- $(RM) $${dest_dir}/libXvMCgallium.*; \
+ $(RM) $${dest_dir}/libXvMCgallium.la \
$(RM) -d $${dest_dir} &>/dev/null || true

uninstall-hook:
for i in $(TARGET_DRIVERS); do \
Expand Down
29 changes: 24 additions & 5 deletions pkgs/development/libraries/polkit/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, spidermonkey_17
, gobjectIntrospection, libxslt, docbook_xsl, docbook_xml_dtd_412
, useSystemd ? stdenv.isLinux, systemd }:
{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, glib, expat, pam
, intltool, spidermonkey_17 , gobjectIntrospection, libxslt, docbook_xsl
, docbook_xml_dtd_412, gtk_doc
, useSystemd ? stdenv.isLinux, systemd
}:

let

Expand All @@ -22,11 +24,28 @@ stdenv.mkDerivation rec {
sha256 = "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71";
};

patches = [
(fetchpatch {
url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-agent-leaks.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
sha256 = "1cxnhj0y30g7ldqq1y6zwsbdwcx7h97d3mpd3h5jy7dhg3h9ym91";
})
(fetchpatch {
url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-polkitpermission-leak.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
sha256 = "1h1rkd4avqyyr8q6836zzr3w10jf521gcqnvhrhzwdpgp1ay4si7";
})
(fetchpatch {
url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-itstool.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
sha256 = "0bxmjwp8ahy1y5g1l0kxmld0l3mlvb2l0i5n1qabia3d5iyjkyfh";
})
];

outputs = [ "bin" "dev" "out" ]; # small man pages in $bin

nativeBuildInputs =
[ gtk_doc pkgconfig autoreconfHook ]
++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
buildInputs =
[ pkgconfig glib expat pam intltool spidermonkey_17 gobjectIntrospection ]
++ [ libxslt docbook_xsl docbook_xml_dtd_412 ] # man pages
[ glib expat pam intltool spidermonkey_17 gobjectIntrospection ]
++ stdenv.lib.optional useSystemd systemd;

# Ugly hack to overwrite hardcoded directories
Expand Down
24 changes: 23 additions & 1 deletion pkgs/development/python-modules/ldap.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ buildPythonPackage, isPy3k, fetchPypi
{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
, openldap, cyrus_sasl, openssl }:

buildPythonPackage rec {
Expand All @@ -12,6 +12,28 @@ buildPythonPackage rec {
sha256 = "88bab69e519dd8bd83becbe36bd141c174b0fe309e84936cf1bae685b31be779";
};

# Needed by tests to setup a mockup ldap server.
BIN = "${openldap}/bin";
SBIN = "${openldap}/bin";
SLAPD = "${openldap}/libexec/slapd";
SCHEMA = "${openldap}/etc/schema";

patches = lib.singleton (writeText "avoid-syslog.diff" ''
diff a/Lib/slapdtest.py b/Lib/slapdtest.py
--- a/Lib/slapdtest.py
+++ b/Lib/slapdtest.py
@@ -60,7 +60,8 @@ def combined_logger(
pass
# for writing to syslog
new_logger = logging.getLogger(log_name)
- if sys_log_format:
+ # /dev/log does not exist in nix build environment.
+ if False:
my_syslog_formatter = logging.Formatter(
fmt=' '.join((log_name, sys_log_format)))
my_syslog_handler = logging.handlers.SysLogHandler(
'');

NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl";
propagatedBuildInputs = [openldap cyrus_sasl openssl];
}
6 changes: 0 additions & 6 deletions pkgs/development/tools/rtags/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

postInstall = lib.optionalString stdenv.isDarwin ''
for f in $out/bin/{rc,rdm,rp}; do
install_name_tool -change @rpath/libclang.dylib ${llvmPackages.clang.cc}/lib/libclang.dylib ''${f}
done
'';

meta = {
description = "C/C++ client-server indexer based on clang";
homepage = https://github.com/andersbakken/rtags;
Expand Down

0 comments on commit 538aa0f

Please sign in to comment.