From 5911c1f45ac3c877c05192b951de5bfdf048b611 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 4 Apr 2013 13:42:26 +0200 Subject: [PATCH 001/426] perl: Update to 5.16.3, 5.14.4 CVE-2013-1667 Cherry-picked from stdenv-updates. --- pkgs/development/interpreters/perl/5.14/default.nix | 4 ++-- pkgs/development/interpreters/perl/5.16/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/perl/5.14/default.nix b/pkgs/development/interpreters/perl/5.14/default.nix index ac19900bcfc3..08690e9507fa 100644 --- a/pkgs/development/interpreters/perl/5.14/default.nix +++ b/pkgs/development/interpreters/perl/5.14/default.nix @@ -7,11 +7,11 @@ let in stdenv.mkDerivation rec { - name = "perl-5.14.2"; + name = "perl-5.14.4"; src = fetchurl { url = "mirror://cpan/src/${name}.tar.gz"; - sha256 = "1ls8cpbgnlaxfydyyqgr7pxj1hkxh9pzcdgr3dv42zdxffakb234"; + sha256 = "1js47zzna3v38fjnirf2vq6y0rjp8m86ysj5vagzgkig956d8gw0"; }; patches = diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index 288de63b4ae8..2113faee1640 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -7,11 +7,11 @@ let in stdenv.mkDerivation rec { - name = "perl-5.16.2"; + name = "perl-5.16.3"; src = fetchurl { url = "mirror://cpan/src/${name}.tar.gz"; - sha256 = "03nh8bqnjsdd5izjv3n2yfcxw4ck0llwww36jpbjbjgixwpqpy4f"; + sha256 = "1dpd9lhc4723wmsn4dsn4m320qlqgyw28bvcbhnfqp2nl3f0ikv9"; }; patches = From cc17e7037476e45fc5f86b0897b39b54553f2699 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 May 2013 13:50:51 +0200 Subject: [PATCH 002/426] glibc: Remove 2.13 It's not used and has security bugs. --- .../libraries/glibc/2.13/builder.sh | 54 ---- .../glibc/2.13/catalan-firstdays.patch | 13 - .../libraries/glibc/2.13/common.nix | 244 ------------------ .../libraries/glibc/2.13/default.nix | 99 ------- .../2.13/dont_use_system_ld_so_cache.patch | 43 --- .../glibc/2.13/glibc-elf-localscope.patch | 82 ------ .../development/libraries/glibc/2.13/info.nix | 26 -- .../libraries/glibc/2.13/locales-builder.sh | 17 -- .../libraries/glibc/2.13/locales.nix | 47 ---- .../glibc/2.13/nix-locale-archive.patch | 116 --------- .../glibc/2.13/nss-skip-unavail.patch | 21 -- .../libraries/glibc/2.13/rpcgen-path.patch | 72 ------ pkgs/top-level/all-packages.nix | 8 - 13 files changed, 842 deletions(-) delete mode 100644 pkgs/development/libraries/glibc/2.13/builder.sh delete mode 100644 pkgs/development/libraries/glibc/2.13/catalan-firstdays.patch delete mode 100644 pkgs/development/libraries/glibc/2.13/common.nix delete mode 100644 pkgs/development/libraries/glibc/2.13/default.nix delete mode 100644 pkgs/development/libraries/glibc/2.13/dont_use_system_ld_so_cache.patch delete mode 100644 pkgs/development/libraries/glibc/2.13/glibc-elf-localscope.patch delete mode 100644 pkgs/development/libraries/glibc/2.13/info.nix delete mode 100644 pkgs/development/libraries/glibc/2.13/locales-builder.sh delete mode 100644 pkgs/development/libraries/glibc/2.13/locales.nix delete mode 100644 pkgs/development/libraries/glibc/2.13/nix-locale-archive.patch delete mode 100644 pkgs/development/libraries/glibc/2.13/nss-skip-unavail.patch delete mode 100644 pkgs/development/libraries/glibc/2.13/rpcgen-path.patch diff --git a/pkgs/development/libraries/glibc/2.13/builder.sh b/pkgs/development/libraries/glibc/2.13/builder.sh deleted file mode 100644 index e68e13f9beca..000000000000 --- a/pkgs/development/libraries/glibc/2.13/builder.sh +++ /dev/null @@ -1,54 +0,0 @@ -# Glibc cannot have itself in its RPATH. -export NIX_NO_SELF_RPATH=1 - -source $stdenv/setup - -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 -} - - -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 - - # FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been - # renamed. - if test -z "$hurdHeaders"; then - # Include the Linux kernel headers in Glibc, except the `scsi' - # subdirectory, which Glibc provides itself. - (cd $out/include && \ - ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) - fi - - if test -f "$out/lib/libhurduser.so"; then - # libc.so, libhurduser.so, and libmachuser.so depend on each - # other, so add them to libc.so (a RUNPATH on libc.so.0.3 - # would be ignored by the cross-linker.) - echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..." - sed -i "$out/lib/libc.so" \ - -e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g" - 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 - - # This file, that should not remain in the glibc derivation, - # may have not been created during the preInstall - rm -f $out/lib/libgcc_s.so.1 -} - -genericBuild diff --git a/pkgs/development/libraries/glibc/2.13/catalan-firstdays.patch b/pkgs/development/libraries/glibc/2.13/catalan-firstdays.patch deleted file mode 100644 index 674e0aee8849..000000000000 --- a/pkgs/development/libraries/glibc/2.13/catalan-firstdays.patch +++ /dev/null @@ -1,13 +0,0 @@ -https://bugzilla.redhat.com/show_bug.cgi?id=454629 - ---- glibc-20090510T1842/localedata/locales/ca_ES.orig 2009-06-26 14:05:18.422043552 +0200 -+++ glibc-20090510T1842/localedata/locales/ca_ES 2009-06-26 14:05:38.292042700 +0200 -@@ -138,6 +138,8 @@ - date_fmt "/ - / - " -+first_weekday 2 -+first_workday 2 - END LC_TIME - - LC_PAPER diff --git a/pkgs/development/libraries/glibc/2.13/common.nix b/pkgs/development/libraries/glibc/2.13/common.nix deleted file mode 100644 index 8be076f335c0..000000000000 --- a/pkgs/development/libraries/glibc/2.13/common.nix +++ /dev/null @@ -1,244 +0,0 @@ -/* Build configuration used to build glibc, Info files, and locale - information. */ - -cross : - -{ name, fetchurl, stdenv, installLocales ? false -, gccCross ? null, kernelHeaders ? null -, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null -, mig ? null, fetchgit ? null -, profilingLibraries ? false, meta -, preConfigure ? "", ... }@args : - -let - # For GNU/Hurd, see below. - version = if hurdHeaders != null then "20120223" else "2.13"; - - needsPortsNative = stdenv.isMips || stdenv.isArm; - needsPortsCross = cross.arch == "mips" || cross.arch == "arm"; - needsPorts = - if (stdenv ? cross) && stdenv.cross != null && hurdHeaders == null then true - else if cross == null then needsPortsNative - else needsPortsCross; - - srcPorts = fetchurl { - url = "mirror://gnu/glibc/glibc-ports-2.13.tar.bz2"; - sha256 = "0npffql62m1xba15l1wkaqf2p0l2bvb33720gx28764jmq0la75i"; - }; - -in - -assert (cross != null) -> (gccCross != null); - -assert (mig != null) -> (machHeaders != null); -assert (machHeaders != null) -> (hurdHeaders != null); -assert (hurdHeaders != null) -> (libpthreadHeaders != null); -assert (hurdHeaders != null) -> (fetchgit != null); - -stdenv.mkDerivation ({ - inherit kernelHeaders installLocales; - - # The host/target system. - crossConfig = if cross != null then cross.config else null; - - inherit (stdenv) is64bit; - - enableParallelBuilding = true; - - patches = - stdenv.lib.optional (fetchgit == null) - /* Fix for NIXPKGS-79: when doing host name lookups, when - nsswitch.conf contains a line like - - hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 - - don't return an error when mdns4_minimal can't be found. This - is a bug in Glibc: when a service can't be found, NSS should - continue to the next service unless "UNAVAIL=return" is set. - ("NOTFOUND=return" refers to the service returning a NOTFOUND - error, not the service itself not being found.) The reason is - that the "status" variable (while initialised to UNAVAIL) is - outside of the loop that iterates over the services, the - "files" service sets status to NOTFOUND. So when the call to - find "mdns4_minimal" fails, "status" will still be NOTFOUND, - and it will return instead of continuing to "dns". Thus, the - line - - hosts: mdns4_minimal [NOTFOUND=return] dns mdns4 - - does work because "status" will contain UNAVAIL after the - failure to find mdns4_minimal. */ - ./nss-skip-unavail.patch - ++ [ - /* Have rpcgen(1) look for cpp(1) in $PATH. */ - ./rpcgen-path.patch - - /* Allow nixos and nix handle the locale-archive. */ - ./nix-locale-archive.patch - ] - - ++ (stdenv.lib.optional (hurdHeaders == null) - - /* Don't use /etc/ld.so.cache, for non-NixOS systems. Currently - disabled on GNU/Hurd, which uses a more recent libc snapshot. */ - ./dont_use_system_ld_so_cache.patch ) - - ++ [ - /* Without this patch many KDE binaries crash. */ - ./glibc-elf-localscope.patch - ] ++ stdenv.lib.optional installLocales ./catalan-firstdays.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" - "--sysconfdir=/etc" - "--localedir=/var/run/current-system/sw/lib/locale" - "libc_cv_ssp=no" - (if kernelHeaders != null - then "--with-headers=${kernelHeaders}/include" - else "--without-headers") - (if profilingLibraries - then "--enable-profile" - else "--disable-profile") - ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [ - "--enable-kernel=2.6.35" - ] ++ stdenv.lib.optionals (cross != null) [ - (if cross.withTLS then "--with-tls" else "--without-tls") - (if cross.float == "soft" then "--without-fp" else "--with-fp") - ] ++ stdenv.lib.optionals (cross != null - && cross.platform ? kernelMajor - && cross.platform.kernelMajor == "2.6") [ - "--enable-kernel=2.6.0" - "--with-__thread" - ] ++ stdenv.lib.optionals (cross == null && - (stdenv.system == "armv5tel-linux")) [ - "--host=arm-linux-gnueabi" - "--build=arm-linux-gnueabi" - "--without-fp" - - # To avoid linking with -lgcc_s (dynamic link) - # so the glibc does not depend on its compiler store path - "libc_cv_as_needed=no" - ] ++ stdenv.lib.optionals (cross == null && stdenv.platform.name == "raspberrypi") [ - "--host=arm-linux-gnueabi" - "--build=arm-linux-gnueabi" - "--with-fp" - - # To avoid linking with -lgcc_s (dynamic link) - # so the glibc does not depend on its compiler store path - "libc_cv_as_needed=no" - ]; - - installFlags = [ "sysconfdir=$(out)/etc" ]; - - buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ] - ++ stdenv.lib.optional (mig != null) mig; - - # 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"; - - # Workaround for this bug: - # http://sourceware.org/bugzilla/show_bug.cgi?id=411 - # I.e. when gcc is compiled with --with-arch=i686, then the - # preprocessor symbol `__i686' will be defined to `1'. This causes - # the symbol __i686.get_pc_thunk.dx to be mangled. - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686"; -} - -# Remove the `gccCross' attribute so that the *native* glibc store path -# doesn't depend on whether `gccCross' is null or not. -// (removeAttrs args [ "gccCross" ]) // - -{ - name = name + "-${version}" + - stdenv.lib.optionalString (cross != null) "-${cross.config}"; - - src = - if hurdHeaders != null - then fetchgit { - # Shamefully the "official" glibc won't build on GNU, so use the one - # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch. - # See . - url = "git://git.sv.gnu.org/hurd/glibc.git"; - sha256 = "cecec9dd5a2bafc875c56b058b6d7628a22b250b53747513dec304f31ffdb82d"; - rev = "d3cdecf18e6550b0984a42b43ed48c5fb26501e1"; - } - else fetchurl { - url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; - sha256 = "1cnv319ysc8nkwpqw6f6ymb6b8hbl0nyvyx48sddkrj50lmcjwq1"; - }; - - # `fetchurl' is a function and thus should not be passed to the - # `derivation' primitive. - fetchurl = null; - - # 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 - - ${if needsPorts then "tar xvf ${srcPorts}" else ""} - - mkdir ../build - cd ../build - - configureScript="`pwd`/../$sourceRoot/configure" - - ${preConfigure} - ''; - - meta = { - homepage = http://www.gnu.org/software/libc/; - description = "The GNU C Library" - + stdenv.lib.optionalString (hurdHeaders != null) ", for GNU/Hurd"; - - 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 = "LGPLv2+"; - - maintainers = [ stdenv.lib.maintainers.ludo ]; - #platforms = stdenv.lib.platforms.linux; - } // meta; -} - -// - -(if hurdHeaders != null - then { - # Work around the fact that the configure snippet that looks for - # does not honor `--with-headers=$sysheaders' and that - # glibc expects Mach, Hurd, and pthread headers to be in the same place. - CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include"; - - # `fetchgit' is a function and thus should not be passed to the - # `derivation' primitive. - fetchgit = null; - - # Install NSS stuff in the right place. - # XXX: This will be needed for all new glibcs and isn't Hurd-specific. - makeFlags = ''vardbdir="$out/var/db"''; - } - else { })) diff --git a/pkgs/development/libraries/glibc/2.13/default.nix b/pkgs/development/libraries/glibc/2.13/default.nix deleted file mode 100644 index f80ed9372e63..000000000000 --- a/pkgs/development/libraries/glibc/2.13/default.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ stdenv, fetchurl, kernelHeaders -, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null -, mig ? null, fetchgit ? null -, installLocales ? true -, profilingLibraries ? false -, gccCross ? null -, debugSymbols ? false -}: - -assert stdenv.gcc.gcc != null; - -let - build = import ./common.nix; - cross = if gccCross != null then gccCross.target else null; -in - build cross ({ - name = "glibc" - + stdenv.lib.optionalString (hurdHeaders != null) "-hurd" - + stdenv.lib.optionalString debugSymbols "-debug"; - - inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries - gccCross; - - builder = ./builder.sh; - - # 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.gcc.gcc}/lib/libgcc_s.so.1 ]; then - mkdir -p $out/lib - ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 - fi - ''; - - meta.description = "The GNU C Library"; - } - - // - - (if debugSymbols - then { - # Build with debugging symbols, but leave optimizations on and don't - # attempt to keep the build tree. - dontStrip = true; - dontCrossStrip = true; - NIX_STRIP_DEBUG = 0; - } - else {}) - - // - - (if hurdHeaders != null - then rec { - inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit; - - propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ]; - - passthru = { - # When building GCC itself `propagatedBuildInputs' above is not - # honored, so we pass it here so that the GCC builder can do the right - # thing. - inherit propagatedBuildInputs; - }; - } - else { }) - - // - - (if cross != null - then { - preConfigure = '' - 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 - # Only due to a problem in gcc configure scripts: - libc_cv_sparc64_tls=${if cross.withTLS then "yes" else "no"} - EOF - export BUILD_CC=gcc - export CC="$crossConfig-gcc" - export AR="$crossConfig-ar" - export RANLIB="$crossConfig-ranlib" - - dontStrip=1 - ''; - - # To avoid a dependency on the build system 'bash'. - preFixup = '' - rm $out/bin/{ldd,tzselect,catchsegv,xtrace} - ''; - } - else {})) diff --git a/pkgs/development/libraries/glibc/2.13/dont_use_system_ld_so_cache.patch b/pkgs/development/libraries/glibc/2.13/dont_use_system_ld_so_cache.patch deleted file mode 100644 index 444eb8251e49..000000000000 --- a/pkgs/development/libraries/glibc/2.13/dont_use_system_ld_so_cache.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c ---- glibc-2.13-orig/elf/ldconfig.c 2011-01-17 23:34:07.000000000 -0500 -+++ glibc-2.13/elf/ldconfig.c 2012-04-10 23:28:45.957492340 -0400 -@@ -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.13-orig/elf/Makefile glibc-2.13/elf/Makefile ---- glibc-2.13-orig/elf/Makefile 2011-01-17 23:34:07.000000000 -0500 -+++ glibc-2.13/elf/Makefile 2012-04-10 23:27:05.666477442 -0400 -@@ -459,11 +459,11 @@ - $(objpfx)sprof: $(libdl) - - $(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)"' -DIS_IN_ldconfig=1 --CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) --CFLAGS-cache.c = $(SYSCONF-FLAGS) -+CFLAGS-dl-cache.c = $(PREFIX-FLAGS) -+CFLAGS-cache.c = $(PREFIX-FLAGS) - - CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1) - -diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h ---- glibc-2.13-orig/sysdeps/generic/dl-cache.h 2011-01-17 23:34:07.000000000 -0500 -+++ glibc-2.13/sysdeps/generic/dl-cache.h 2012-04-10 23:28:20.077488815 -0400 -@@ -29,7 +29,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/2.13/glibc-elf-localscope.patch b/pkgs/development/libraries/glibc/2.13/glibc-elf-localscope.patch deleted file mode 100644 index 98f7f81087bb..000000000000 --- a/pkgs/development/libraries/glibc/2.13/glibc-elf-localscope.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff -ru a/elf/dl-close.c b/elf/dl-close.c ---- a/elf/dl-close.c 2011-02-04 00:35:03.000000000 +0100 -+++ b/elf/dl-close.c 2011-02-22 02:16:12.367883000 +0100 -@@ -180,24 +186,28 @@ - /* Signal the object is still needed. */ - l->l_idx = IDX_STILL_USED; - -+#define mark_used(dmap) \ -+ do { \ -+ if ((dmap)->l_idx != IDX_STILL_USED) \ -+ { \ -+ assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded); \ -+ \ -+ if (!used[(dmap)->l_idx]) \ -+ { \ -+ used[(dmap)->l_idx] = 1; \ -+ if ((dmap)->l_idx - 1 < done_index) \ -+ done_index = (dmap)->l_idx - 1; \ -+ } \ -+ } \ -+ } while (0) -+ - /* Mark all dependencies as used. */ - if (l->l_initfini != NULL) - { - struct link_map **lp = &l->l_initfini[1]; - while (*lp != NULL) - { -- if ((*lp)->l_idx != IDX_STILL_USED) -- { -- assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded); -- -- if (!used[(*lp)->l_idx]) -- { -- used[(*lp)->l_idx] = 1; -- if ((*lp)->l_idx - 1 < done_index) -- done_index = (*lp)->l_idx - 1; -- } -- } -- -+ mark_used(*lp); - ++lp; - } - } -@@ -206,19 +216,25 @@ - for (unsigned int j = 0; j < l->l_reldeps->act; ++j) - { - struct link_map *jmap = l->l_reldeps->list[j]; -- -- if (jmap->l_idx != IDX_STILL_USED) -- { -- assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded); -- -- if (!used[jmap->l_idx]) -- { -- used[jmap->l_idx] = 1; -- if (jmap->l_idx - 1 < done_index) -- done_index = jmap->l_idx - 1; -- } -- } -+ mark_used(jmap); - } -+ /* And the same for owners of our scopes; normally, our last -+ scope provider would render us unused, but this can be -+ prevented by the NODELETE flag. */ -+ if (__builtin_expect(l->l_type == lt_loaded -+ && (l->l_flags_1 & DF_1_NODELETE), 0)) -+ for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt) -+ /* This relies on l_scope[] entries being always set either -+ to its own l_symbolic_searchlist address, or some map's -+ l_searchlist address. */ -+ if (l->l_scope[cnt] != &l->l_symbolic_searchlist) -+ { -+ struct link_map *ls = (struct link_map *) -+ ((char *) l->l_scope[cnt] -+ - offsetof (struct link_map, l_searchlist)); -+ assert (ls->l_ns == nsid); -+ mark_used(ls); -+ } - } - - /* Sort the entries. */ diff --git a/pkgs/development/libraries/glibc/2.13/info.nix b/pkgs/development/libraries/glibc/2.13/info.nix deleted file mode 100644 index 75bd996d9bc5..000000000000 --- a/pkgs/development/libraries/glibc/2.13/info.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ stdenv, fetchurl, texinfo, perl }: - -let build = import ./common.nix; -in - /* null cross builder */ - build null { - name = "glibc-info"; - - inherit fetchurl stdenv; - - configureFlags = [ "--enable-add-ons" ]; - - buildInputs = [ texinfo perl ]; - - buildPhase = "make info"; - - # I don't know why the info is not generated in 'build' - # Somehow building the info still does not work, because the final - # libc.info hasn't a Top node. - installPhase = '' - mkdir -p "$out/share/info" - cp -v "../$sourceRoot/manual/"*.info* "$out/share/info" - ''; - - meta.description = "GNU Info manual of the GNU C Library"; - } diff --git a/pkgs/development/libraries/glibc/2.13/locales-builder.sh b/pkgs/development/libraries/glibc/2.13/locales-builder.sh deleted file mode 100644 index d732e208fa22..000000000000 --- a/pkgs/development/libraries/glibc/2.13/locales-builder.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Glibc cannot have itself in its RPATH. -export NIX_NO_SELF_RPATH=1 - -source $stdenv/setup - -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 -} - -genericBuild diff --git a/pkgs/development/libraries/glibc/2.13/locales.nix b/pkgs/development/libraries/glibc/2.13/locales.nix deleted file mode 100644 index b7eae50ca385..000000000000 --- a/pkgs/development/libraries/glibc/2.13/locales.nix +++ /dev/null @@ -1,47 +0,0 @@ -/* This function builds just the `lib/locale/locale-archive' file from - Glibc and nothing else. If `allLocales' is true, all supported - locales are included; otherwise, just the locales listed in - `locales'. See localedata/SUPPORTED in the Glibc source tree for - the list of all supported locales: - http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc -*/ - -{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }: - -let build = import ./common.nix; -in - build null { - name = "glibc-locales"; - - inherit fetchurl stdenv; - installLocales = true; - - builder = ./locales-builder.sh; - - # Awful hack: `localedef' doesn't allow the path to `locale-archive' - # to be overriden, but you *can* specify a prefix, i.e. it will use - # //lib/locale/locale-archive. So we use - # $TMPDIR as a prefix, meaning that the locale-archive is placed in - # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. - buildPhase = - '' - mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" - - # Hack to allow building of the locales (needed since glibc-2.12) - sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \ - /library-path/d ../glibc-2*/localedata/Makefile - ${if allLocales then "" else - "echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"} - - make localedata/install-locales \ - localedir=$out/lib/locale \ - ''; - - installPhase = - '' - mkdir -p "$out/lib/locale" - cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale" - ''; - - meta.description = "Locale information for the GNU C Library"; - } diff --git a/pkgs/development/libraries/glibc/2.13/nix-locale-archive.patch b/pkgs/development/libraries/glibc/2.13/nix-locale-archive.patch deleted file mode 100644 index aca904f7ff44..000000000000 --- a/pkgs/development/libraries/glibc/2.13/nix-locale-archive.patch +++ /dev/null @@ -1,116 +0,0 @@ -diff --git a/locale/loadarchive.c b/locale/loadarchive.c -index d545f17..0d8638a 100644 ---- a/locale/loadarchive.c -+++ b/locale/loadarchive.c -@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h) - } - - -+static int -+open_locale_archive () -+{ -+ int fd = -1; -+ char *path = getenv ("LOCALE_ARCHIVE_2_11"); -+ char *path2 = getenv ("LOCALE_ARCHIVE"); -+ const char *usualpath = "/usr/lib/locale/locale-archive"; -+ if (path) -+ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE); -+ if (path2 && fd < 0) -+ fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE); -+ if (fd < 0) -+ fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); -+ if (fd < 0) -+ fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE); -+ return fd; -+} -+ -+ - /* Find the locale *NAMEP in the locale archive, and return the - internalized data structure for its CATEGORY data. If this locale has - already been loaded from the archive, just returns the existing data -@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep) - archmapped = &headmap; - - /* The archive has never been opened. */ -- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); -+ fd = open_locale_archive (); - if (fd < 0) - /* Cannot open the archive, for whatever reason. */ - return NULL; -@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep) - if (fd == -1) - { - struct stat64 st; -- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); -+ fd = open_locale_archive (); - if (fd == -1) - /* Cannot open the archive, for whatever reason. */ - return NULL; -diff --git a/locale/programs/locale.c b/locale/programs/locale.c -index 77262b7..fddc00d 100644 ---- a/locale/programs/locale.c -+++ b/locale/programs/locale.c -@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b) - ((const struct nameent *) b)->name); - } - -+static int -+open_nix_locale_archive (const char * fname, int access) -+{ -+ int fd = -1; -+ char *path = getenv ("LOCALE_ARCHIVE_2_11"); -+ char *path2 = getenv ("LOCALE_ARCHIVE"); -+ if (path) -+ fd = open64 (path, access); -+ if (path2 && fd < 0) -+ fd = open64 (path2, access); -+ if (fd < 0) -+ fd = open64 (fname, access); -+ return fd; -+} - - static int - write_archive_locales (void **all_datap, char *linebuf) -@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf) - int fd, ret = 0; - uint32_t cnt; - -- fd = open64 (ARCHIVE_NAME, O_RDONLY); -+ fd = open_nix_locale_archive (ARCHIVE_NAME, O_RDONLY); - if (fd < 0) - return 0; - -diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c -index 85ba77d..3ad2af8 100644 ---- a/locale/programs/locarchive.c -+++ b/locale/programs/locarchive.c -@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) - *ah = new_ah; - } - -+static int -+open_nix_locale_archive (const char * fname, int access) -+{ -+ int fd = -1; -+ char *path = getenv ("LOCALE_ARCHIVE_2_11"); -+ char *path2 = getenv ("LOCALE_ARCHIVE"); -+ if (path) -+ fd = open64 (path, access); -+ if (path2 && fd < 0) -+ fd = open64 (path2, access); -+ if (fd < 0) -+ fd = open64 (fname, access); -+ return fd; -+} - - void - open_archive (struct locarhandle *ah, bool readonly) -@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly) - while (1) - { - /* Open the archive. We must have exclusive write access. */ -- fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); -+ fd = open_nix_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR); - if (fd == -1) - { - /* Maybe the file does not yet exist. */ diff --git a/pkgs/development/libraries/glibc/2.13/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.13/nss-skip-unavail.patch deleted file mode 100644 index e48dc2bc0a6e..000000000000 --- a/pkgs/development/libraries/glibc/2.13/nss-skip-unavail.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c ---- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c 2010-05-19 22:38:20.000000000 +0200 -+++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c 2010-08-05 18:39:54.259556327 +0200 -@@ -505,8 +505,6 @@ - int no_data = 0; - int no_inet6_data = 0; - service_user *nip = NULL; -- enum nss_status inet6_status = NSS_STATUS_UNAVAIL; -- enum nss_status status = NSS_STATUS_UNAVAIL; - int no_more; - int old_res_options; - -@@ -702,6 +700,8 @@ - - while (!no_more) - { -+ enum nss_status inet6_status = NSS_STATUS_UNAVAIL; -+ enum nss_status status = NSS_STATUS_UNAVAIL; - no_data = 0; - nss_gethostbyname4_r fct4 - = __nss_lookup_function (nip, "gethostbyname4_r"); diff --git a/pkgs/development/libraries/glibc/2.13/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.13/rpcgen-path.patch deleted file mode 100644 index fbb03dd5fade..000000000000 --- a/pkgs/development/libraries/glibc/2.13/rpcgen-path.patch +++ /dev/null @@ -1,72 +0,0 @@ -By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths -(`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This -patch makes it run any `cpp' command found in $PATH. - ---- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100 -+++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200 -@@ -79,7 +79,7 @@ static const char *cmdname; - - static const char *svcclosetime = "120"; - static int cppDefined; /* explicit path for C preprocessor */ --static const char *CPP = SUNOS_CPP; -+static const char *CPP = "cpp"; - static const char CPPFLAGS[] = "-C"; - static char *pathbuf; - static int cpp_pid; -@@ -108,7 +108,6 @@ static char *extendfile (const char *fil - static void open_output (const char *infile, const char *outfile); - static void add_warning (void); - static void clear_args (void); --static void find_cpp (void); - static void open_input (const char *infile, const char *define); - static int check_nettype (const char *name, const char *list_to_check[]); - static void c_output (const char *infile, const char *define, -@@ -327,31 +326,6 @@ clear_args (void) - argcount = FIXEDARGS; - } - --/* make sure that a CPP exists */ --static void --find_cpp (void) --{ -- struct stat buf; -- -- if (stat (CPP, &buf) < 0) -- { /* /lib/cpp or explicit cpp does not exist */ -- if (cppDefined) -- { -- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP); -- crash (); -- } -- else -- { /* try the other one */ -- CPP = SVR4_CPP; -- if (stat (CPP, &buf) < 0) -- { /* can't find any cpp */ -- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout); -- crash (); -- } -- } -- } --} -- - /* - * Open input file with given define for C-preprocessor - */ -@@ -370,7 +344,6 @@ open_input (const char *infile, const ch - switch (cpp_pid) - { - case 0: -- find_cpp (); - putarg (0, CPP); - putarg (1, CPPFLAGS); - addarg (define); -@@ -380,7 +353,7 @@ open_input (const char *infile, const ch - close (1); - dup2 (pd[1], 1); - close (pd[0]); -- execv (arglist[0], (char **) arglist); -+ execvp (arglist[0], (char **) arglist); - perror ("execv"); - exit (1); - case -1: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2cc7760b713c..adbbfe69e5c2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3797,14 +3797,6 @@ let glibcCross = glibc217Cross; - glibc213 = (callPackage ../development/libraries/glibc/2.13 { - kernelHeaders = linuxHeaders; - installLocales = config.glibc.locales or false; - machHeaders = null; - hurdHeaders = null; - gccCross = null; - }) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {}); - glibc217 = callPackage ../development/libraries/glibc/2.17 { kernelHeaders = linuxHeaders; installLocales = config.glibc.locales or false; From 0f53a2e9f3261998cd10e5c3588c2df0de3218a4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 May 2013 13:52:05 +0200 Subject: [PATCH 003/426] glibc: Require Linux 2.6.32 instead of 2.6.35 By popular demand. For instance, many widely used RHEL systems are still on 2.6.32. --- pkgs/development/libraries/glibc/2.17/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glibc/2.17/common.nix b/pkgs/development/libraries/glibc/2.17/common.nix index 413a0d7aae82..23ec1c46ad7b 100644 --- a/pkgs/development/libraries/glibc/2.17/common.nix +++ b/pkgs/development/libraries/glibc/2.17/common.nix @@ -81,7 +81,7 @@ stdenv.mkDerivation ({ then "--enable-profile" else "--disable-profile") ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [ - "--enable-kernel=2.6.35" + "--enable-kernel=2.6.32" ] ++ stdenv.lib.optionals (cross != null) [ (if cross.withTLS then "--with-tls" else "--without-tls") (if cross.float == "soft" then "--without-fp" else "--with-fp") From c2a16ec01208e44cd37baed6654e2d6cc9909b35 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 May 2013 13:57:59 +0200 Subject: [PATCH 004/426] glibc: Security fixes. CVE-2013-0242, CVE-2013-1914. --- .../libraries/glibc/2.17/common.nix | 6 ++ .../libraries/glibc/2.17/cve-2013-0242.patch | 87 +++++++++++++++++++ .../libraries/glibc/2.17/cve-2013-1914.patch | 52 +++++++++++ 3 files changed, 145 insertions(+) create mode 100644 pkgs/development/libraries/glibc/2.17/cve-2013-0242.patch create mode 100644 pkgs/development/libraries/glibc/2.17/cve-2013-1914.patch diff --git a/pkgs/development/libraries/glibc/2.17/common.nix b/pkgs/development/libraries/glibc/2.17/common.nix index 23ec1c46ad7b..e0588a6275d6 100644 --- a/pkgs/development/libraries/glibc/2.17/common.nix +++ b/pkgs/development/libraries/glibc/2.17/common.nix @@ -55,6 +55,12 @@ stdenv.mkDerivation ({ rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a2_native' failed." crashes. */ ./glibc-rh739743.patch + + /* Fix buffer overrun in regexp matcher. */ + ./cve-2013-0242.patch + + /* Fix stack overflow in getaddrinfo with many results. */ + ./cve-2013-1914.patch ]; postPatch = '' diff --git a/pkgs/development/libraries/glibc/2.17/cve-2013-0242.patch b/pkgs/development/libraries/glibc/2.17/cve-2013-0242.patch new file mode 100644 index 000000000000..1d6557071e1a --- /dev/null +++ b/pkgs/development/libraries/glibc/2.17/cve-2013-0242.patch @@ -0,0 +1,87 @@ +When extending regex buffers, make sure we allocate enough room for the +state log. Merely doubling the space may not be enough if the current +node has accepted a long run of characters. This part of the code only +triggers with multibyte characters. + +Andreas. + + [BZ #15078] + * posix/regexec.c (extend_buffers): Add parameter min_len. + (check_matching): Pass minimum needed length. + (clean_state_log_if_needed): Likewise. + (get_subexp): Likewise. + * posix/Makefile (tests): Add bug-regex34. + (bug-regex34-ENV): Define. + * posix/bug-regex34.c: New file. + +diff --git a/posix/regexec.c b/posix/regexec.c +index 7f2de85..5ca2bf6 100644 +--- a/posix/regexec.c ++++ b/posix/regexec.c +@@ -197,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa, + static int check_node_accept (const re_match_context_t *mctx, + const re_token_t *node, int idx) + internal_function; +-static reg_errcode_t extend_buffers (re_match_context_t *mctx) ++static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) + internal_function; + + /* Entry point for POSIX code. */ +@@ -1160,7 +1160,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match, + || (BE (next_char_idx >= mctx->input.valid_len, 0) + && mctx->input.valid_len < mctx->input.len)) + { +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, next_char_idx + 1); + if (BE (err != REG_NOERROR, 0)) + { + assert (err == REG_ESPACE); +@@ -1738,7 +1738,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx) + && mctx->input.valid_len < mctx->input.len)) + { + reg_errcode_t err; +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, next_state_log_idx + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + } +@@ -2792,7 +2792,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) + if (bkref_str_off >= mctx->input.len) + break; + +- err = extend_buffers (mctx); ++ err = extend_buffers (mctx, bkref_str_off + 1); + if (BE (err != REG_NOERROR, 0)) + return err; + +@@ -4102,7 +4102,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node, + + static reg_errcode_t + internal_function __attribute_warn_unused_result__ +-extend_buffers (re_match_context_t *mctx) ++extend_buffers (re_match_context_t *mctx, int min_len) + { + reg_errcode_t ret; + re_string_t *pstr = &mctx->input; +@@ -4111,8 +4111,10 @@ extend_buffers (re_match_context_t *mctx) + if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) + return REG_ESPACE; + +- /* Double the lengthes of the buffers. */ +- ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2)); ++ /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */ ++ ret = re_string_realloc_buffers (pstr, ++ MAX (min_len, ++ MIN (pstr->len, pstr->bufs_len * 2))); + if (BE (ret != REG_NOERROR, 0)) + return ret; + +-- +1.8.1.2 + + +-- +Andreas Schwab, SUSE Labs, schwab@suse.de +GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 +"And now for something completely different." + diff --git a/pkgs/development/libraries/glibc/2.17/cve-2013-1914.patch b/pkgs/development/libraries/glibc/2.17/cve-2013-1914.patch new file mode 100644 index 000000000000..c2963249f5e4 --- /dev/null +++ b/pkgs/development/libraries/glibc/2.17/cve-2013-1914.patch @@ -0,0 +1,52 @@ +From: Andreas Schwab +Date: Thu, 21 Mar 2013 14:50:27 +0000 (+0100) +Subject: Fix stack overflow in getaddrinfo with many results +X-Git-Url: http://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=1cef1b19089528db11f221e938f60b9b048945d7 + +Fix stack overflow in getaddrinfo with many results +--- + +diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c +index d95c2d1..2309281 100644 +--- a/sysdeps/posix/getaddrinfo.c ++++ b/sysdeps/posix/getaddrinfo.c +@@ -2489,11 +2489,27 @@ getaddrinfo (const char *name, const char *service, + __typeof (once) old_once = once; + __libc_once (once, gaiconf_init); + /* Sort results according to RFC 3484. */ +- struct sort_result results[nresults]; +- size_t order[nresults]; ++ struct sort_result *results; ++ size_t *order; + struct addrinfo *q; + struct addrinfo *last = NULL; + char *canonname = NULL; ++ bool malloc_results; ++ ++ malloc_results ++ = !__libc_use_alloca (nresults * (sizeof (*results) + sizeof (size_t))); ++ if (malloc_results) ++ { ++ results = malloc (nresults * (sizeof (*results) + sizeof (size_t))); ++ if (results == NULL) ++ { ++ __free_in6ai (in6ai); ++ return EAI_MEMORY; ++ } ++ } ++ else ++ results = alloca (nresults * (sizeof (*results) + sizeof (size_t))); ++ order = (size_t *) (results + nresults); + + /* Now we definitely need the interface information. */ + if (! check_pf_called) +@@ -2664,6 +2680,9 @@ getaddrinfo (const char *name, const char *service, + + /* Fill in the canonical name into the new first entry. */ + p->ai_canonname = canonname; ++ ++ if (malloc_results) ++ free (results); + } + + __free_in6ai (in6ai); From 93063dcf038586e012fa831d8df3611fe9ab639a Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 15 May 2013 02:25:56 +0200 Subject: [PATCH 005/426] eclipse: add latest stable eclipse (sdk), fix 3.7 urls, introducing more declarative style (use getAttr in favour of if) --- pkgs/applications/editors/eclipse/default.nix | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index a11cbf349c02..d0ac3890d7f0 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -8,7 +8,7 @@ assert stdenv ? glibc; let buildEclipse = - { name, src, description }: + { name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }: stdenv.mkDerivation rec { inherit name src; @@ -131,17 +131,16 @@ in { eclipse_sdk_37 = buildEclipse { name = "eclipse-sdk-3.7"; description = "Eclipse Classic"; - src = - if stdenv.system == "x86_64-linux" then - fetchurl { - url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz; - sha256 = "00ig3ww98r8imf32sx5npm6csn5nx288gvdk6w653nijni0di16j"; - } - else - fetchurl { - url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk.tar.gz; - sha256 = "08rgw85cam51l98mzb39fdc3ykb369v8pap93qhknbs6a3f5dnff"; + sources = { + "x86_64-linux" = fetchurl { + url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz; + sha256 = "0nf4nv7awhp1k8b1hjb7chpjyjrqnyszsjbc4dlk9phpjv3j4wg5"; }; + "i686-linux" = fetchurl { + url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk.tar.gz; + sha256 = "1isn7i45l9kyn2yx6vm88jl1gnxph8ynank0aaa218cg8kdygk7j"; + }; + }; }; eclipse_cpp_37 = buildEclipse { @@ -160,7 +159,7 @@ in { }; }; - eclipse_cpp_42 = buildEclipse { + eclipse_cpp_421 = buildEclipse { name = "eclipse-cpp-4.2"; description = "Eclipse IDE for C/C++ Developers"; src = @@ -176,8 +175,8 @@ in { }; }; - eclipse_sdk_42 = buildEclipse { - name = "eclipse-sdk-4.2"; + eclipse_sdk_421 = buildEclipse { + name = "eclipse-sdk-4.2.1"; description = "Eclipse Classic"; src = if stdenv.system == "x86_64-linux" then @@ -191,4 +190,19 @@ in { sha256 = "1av6qm9wkbyk123qqf38f0jq4jv2bj9wp6fmpnl55zg6qr463c1w"; }; }; + + eclipse_sdk_422 = buildEclipse { + name = "eclipse-sdk-4.2.2"; + description = "Eclipse Classic"; + sources = { + "x86_64-linux" = fetchurl { + url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz; + sha256 = "0ysa6ymk4h3k1vn59dc909iy197kmx132671kbzfwbim87jmgnqb"; + }; + "i686-linux" = fetchurl { + url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk.tar.gz; + sha256 = "038yibbrcia38wi72qrdl03g7l35mpvl5nxdfdnvpqxrkfffb826"; + }; + }; + }; } From 10b79927baa2b3ecb462e399e892b77a11c0c097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 16 May 2013 12:05:05 +0200 Subject: [PATCH 006/426] gtk2/3: bugfix updates --- pkgs/development/libraries/gtk+/2.x.nix | 4 ++-- pkgs/development/libraries/gtk+/3-default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index c8224fa18e6d..62f754c148ea 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -8,11 +8,11 @@ assert xineramaSupport -> xlibs.libXinerama != null; assert cupsSupport -> cups != null; stdenv.mkDerivation rec { - name = "gtk+-2.24.17"; + name = "gtk+-2.24.18"; src = fetchurl { url = "mirror://gnome/sources/gtk+/2.24/${name}.tar.xz"; - sha256 = "05gl82k82w3gjrzr4vmj3ski7mp1b0jbhc49wgl9hv8mc2sb4iz9"; + sha256 = "1193frzg0qrwa885w77kd055zfpbdjwby88xn2skpx9g4w0k35kc"; }; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/gtk+/3-default.nix b/pkgs/development/libraries/gtk+/3-default.nix index 1b296e2c3985..86bd4474c7a2 100644 --- a/pkgs/development/libraries/gtk+/3-default.nix +++ b/pkgs/development/libraries/gtk+/3-default.nix @@ -8,11 +8,11 @@ assert xineramaSupport -> xlibs.libXinerama != null; assert cupsSupport -> cups != null; stdenv.mkDerivation rec { - name = "gtk+-3.8.0"; + name = "gtk+-3.8.2"; src = fetchurl { url = "mirror://gnome/sources/gtk+/3.8/${name}.tar.xz"; - sha256 = "0bi5dip7l6d08c6v9c9aipwsi8hq38xjljqv86nmnpvbkpc4a4yv"; + sha256 = "15zjmyky4yw70ipi12dllira4av8wjpw5f7g9kbrbpx12nf0ra0w"; }; enableParallelBuilding = true; From 70882b980c3ed57b6815ad8f61260f8a5378ec59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 16 May 2013 17:16:02 +0200 Subject: [PATCH 007/426] WARNING: history from now is going to change (mesa+llvm) Current WIP, only tested nouveau (3D works very well). --- pkgs/development/compilers/llvm/default.nix | 27 ++- pkgs/development/libraries/libdrm/default.nix | 4 +- pkgs/development/libraries/mesa/default.nix | 118 ++++++++-- .../libraries/mesa/dricore-gallium.patch | 216 ++++++++++++++++++ .../libraries/mesa/static-gallium.patch | 71 ++++++ .../linux/xf86-video-nouveau/default.nix | 20 +- pkgs/top-level/all-packages.nix | 1 + 7 files changed, 419 insertions(+), 38 deletions(-) create mode 100644 pkgs/development/libraries/mesa/dricore-gallium.patch create mode 100644 pkgs/development/libraries/mesa/static-gallium.patch diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 4b5bbdc52584..1e514884bb5a 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, groff, cmake, python }: +{ stdenv, fetchurl, perl, groff, cmake, python, libffi, libcxx }: let version = "3.2"; in @@ -10,11 +10,32 @@ stdenv.mkDerivation { sha256 = "0hv30v5l4fkgyijs56sr1pbrlzgd674pg143x7az2h37sb290l0j"; }; - buildInputs = [ perl groff cmake python ]; + preConfigure = '' + patchShebangs . + export REQUIRES_RTTI=1 + ''; - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; + # ToDo: polly, libc++; --enable-cxx11? + + configureFlags = [ + "--enable-shared" # saves half the size, and even more for e.g. mesa + "--disable-assertions" "--enable-optimized" + "--disable-timestamps" # embedding timestamps seems a danger to purity + "--enable-libffi" + #"--enable-experimental-targets=r600" + #"--enable-libcpp" + ] ; + + patches = [ ./set_soname.patch ]; # http://llvm.org/bugs/show_bug.cgi?id=12334 + patchFlags = "-p0"; + + buildInputs = [ perl groff python ] + #++ [ libcxx ] + ; + propagatedBuildInputs = [ libffi ]; enableParallelBuilding = true; + #ToDo: doCheck? meta = { homepage = http://llvm.org/; diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix index 4e0038d4c34c..1816e212bbd0 100644 --- a/pkgs/development/libraries/libdrm/default.nix +++ b/pkgs/development/libraries/libdrm/default.nix @@ -16,9 +16,7 @@ stdenv.mkDerivation rec { preConfigure = stdenv.lib.optionalString stdenv.isDarwin "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache"; - configureFlags = [ "--enable-nouveau-experimental-api" - "--enable-radeon-experimental-api" - "--enable-udev" ] + configureFlags = [ "--enable-udev" ] ++ stdenv.lib.optional stdenv.isDarwin "-C"; crossAttrs.configureFlags = configureFlags ++ [ "--disable-intel" ]; diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index a07323b61b2e..9f1291809a6d 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -1,46 +1,126 @@ -{ stdenv, fetchurl, flex, bison, pkgconfig, intltool, libdrm, file, expat, makedepend -, libXxf86vm, libXfixes, libXdamage, glproto, dri2proto, libX11, libxcb, libXext -, libXt, udev, enableTextureFloats ? false, enableR600LlvmCompiler ? false -, python, libxml2Python, autoconf, automake, libtool, llvm, writeText -, libffi, wayland }: +{ stdenv, fetchurl, pkgconfig, intltool, flex, bison, autoconf, automake, libtool +, python, libxml2Python, file, expat, makedepend +, libdrm, xorg, wayland, udev, llvm, libffi +, libvdpau +, enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt +, enableR600LlvmCompiler ? false +}: if ! stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms then throw "unsupported platform for Mesa" else +/** Packaging design: + - The basic mesa ($out) contains headers and libraries (GLU is in mesa_glu now). + This or the mesa attribute (which also contains GLU) are small (< 3 MB, mostly headers) + and are designed to be the buildInput of other packages. + - DRI and EGL drivers are compiled into $drivers output, + which is bigger (~27 MB) and depends on LLVM (~80 MB). + These should be searched at runtime in /run/current-system/sw/lib/* + and so are kind-of impure (given by NixOS). + (I suppose on non-NixOS one would create the appropriate symlinks from there.) +*/ + let version = "9.1.2"; + extraFeatures = true; # probably doesn't work with false yet + driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32"; in stdenv.mkDerivation { name = "mesa-noglu-${version}"; src = fetchurl { url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2"; - sha256="1ns366armqmp2bxj1l7fff95v22b5z9mnkyykbdj81lhg9gi3586"; + sha256="1ns366armqmp2bxj1l7fff95v22b5z9mnkyykbdj81lhg9gi3586"; # 9.1.2 }; prePatch = "patchShebangs ."; + patches = [ + ./static-gallium.patch + ./dricore-gallium.patch + ]; + + # Change the search path for EGL drivers from $drivers/* to driverLink + postPatch = '' + sed '/D_EGL_DRIVER_SEARCH_DIR=/s,EGL_DRIVER_INSTALL_DIR,${driverLink}/lib/egl,' \ + -i src/egl/main/Makefile.am + ''; + + outputs = ["out" "drivers"]; + preConfigure = "./autogen.sh"; - configureFlags = - "" - + " --enable-gles1 --enable-gles2 --enable-gallium-egl" - + " --with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast" - + " --with-egl-platforms=x11,wayland,drm --enable-gbm --enable-shared-glapi" - + stdenv.lib.optionalString enableR600LlvmCompiler " --enable-r600-llvm-compiler" - # Texture floats are patented, see docs/patents.txt - + stdenv.lib.optionalString enableTextureFloats " --enable-texture-float"; + configureFlags = with stdenv.lib; [ + "--with-dri-driverdir=$(drivers)/lib/dri" + "--with-egl-driver-dir=$(drivers)/lib/egl" + "--with-dri-searchpath=${driverLink}/lib/dri" - buildInputs = [ - autoconf automake libtool intltool expat libxml2Python udev llvm - libdrm libXxf86vm libXfixes libXdamage glproto dri2proto libX11 libXext libxcb libXt - libffi wayland - ]; + "--enable-dri" + "--enable-glx-tls" + "--enable-shared-glapi" "--enable-shared-gallium" + "--enable-driglx-direct" # seems enabled anyway + "--enable-gallium-llvm" "--with-llvm-shared-libs" + + "--with-dri-drivers=i965,r200,radeon" + "--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast" # radeonsi complains about R600 missing in LLVM + "--with-egl-platforms=x11,wayland,drm" "--enable-gbm" "--enable-shared-glapi" + ] + ++ optional enableR600LlvmCompiler "--enable-r600-llvm-compiler" # complains about R600 missing in LLVM + ++ optional enableTextureFloats "--enable-texture-float" + ++ optionals extraFeatures [ + "--enable-gles1" "--enable-gles2" + "--enable-xa" + "--enable-osmesa" + "--enable-openvg" "--enable-gallium-egl" # not needed for EGL in Gallium, but OpenVG might be useful + #"--enable-xvmc" # tests segfault with 9.1.{1,2} + "--enable-vdpau" + #"--enable-opencl" # ToDo: opencl seems to need libclc for clover + ]; nativeBuildInputs = [ pkgconfig python makedepend file flex bison ]; + buildInputs = with xorg; [ + autoconf automake libtool intltool expat libxml2Python udev llvm + libdrm libXxf86vm libXfixes libXdamage glproto dri2proto libX11 libXext libxcb libXt + libffi wayland + ] ++ stdenv.lib.optionals extraFeatures [ /*libXvMC*/ libvdpau ]; + enableParallelBuilding = true; + doCheck = true; + + # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM + # ToDo: probably not all .la files are completely fixed, but it shouldn't matter + postInstall = '' + mv -t "$drivers/lib/" \ + $out/lib/libdricore* \ + $out/lib/libgallium.* \ + $out/lib/gallium-pipe \ + $out/lib/gbm \ + $out/lib/libxatracker* \ + `#$out/lib/libXvMC*` \ + $out/lib/vdpau \ + $out/lib/libOSMesa* + '' + /* now fix references in .la files */ '' + sed "/^libdir=/s,$out,$drivers," -i \ + $drivers/lib/gallium-pipe/*.la \ + $drivers/lib/libgallium.la \ + $drivers/lib/libdricore*.la \ + `#$drivers/lib/libXvMC*.la` \ + $drivers/lib/vdpau/*.la \ + $drivers/lib/libOSMesa*.la + sed "s,$out\(/lib/\(libdricore[0-9\.]*\|libgallium\).la\),$drivers\1,g" \ + -i $drivers/lib/*.la $drivers/lib/*/*.la + '' + /* work around bug #529, but maybe $drivers should also be patchelf-ed */ '' + find $drivers/ -type f -executable -print0 | xargs -0 strip -S || true + '' + /* add RPATH so the drivers can find the moved libgallium and libdricore9 */ '' + for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do + if [[ ! -L "$lib" ]]; then + patchelf --set-rpath "$(patchelf --print-rpath $lib):$drivers/lib" "$lib" + fi + done + ''; + #ToDo: @vcunat isn't sure if drirc will be found when in $out/etc/, but it doesn't seem important ATM passthru = { inherit libdrm; inherit version; }; diff --git a/pkgs/development/libraries/mesa/dricore-gallium.patch b/pkgs/development/libraries/mesa/dricore-gallium.patch new file mode 100644 index 000000000000..9a8b6768277b --- /dev/null +++ b/pkgs/development/libraries/mesa/dricore-gallium.patch @@ -0,0 +1,216 @@ +commit 5208f187c7dade2c33385a56c1a5f1c3cedc8377 (HEAD, nix-patches) +Author: Vladimír Čunát +Date: Mon May 13 11:34:59 2013 +0200 + + 118-dricore-gallium.patch + +diff --git a/configure.ac b/configure.ac +index be89843..08f6761 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -928,6 +928,8 @@ AC_SUBST([GLESv2_LIB_DEPS]) + AC_SUBST([GLESv2_PC_LIB_PRIV]) + + DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la" ++MESAGALLIUM_LIBS="${DRI_LIB_DEPS}" ++AC_SUBST([MESAGALLIUM_LIBS], ${MESAGALLIUM_LIBS}) + + AC_SUBST([HAVE_XF86VIDMODE]) + +diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am +index 3cdec83..53ff69b 100644 +--- a/src/gallium/auxiliary/Makefile.am ++++ b/src/gallium/auxiliary/Makefile.am +@@ -34,14 +34,14 @@ if LLVM_NEEDS_FNORTTI + + AM_CXXFLAGS += -fno-rtti + +-libgallium_la_LIBADD = $(LLVM_LIBS) +- + endif + + libgallium_la_SOURCES += \ + $(GALLIVM_SOURCES) \ + $(GALLIVM_CPP_SOURCES) + ++libgallium_la_LIBADD = ../../mesa/libdricore/libmesagallium.la $(LLVM_LIBS) $(GALLIUM_DRI_LIB_DEPS) ++ + endif + + indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py +diff --git a/src/gallium/targets/dri-i915/Makefile.am b/src/gallium/targets/dri-i915/Makefile.am +index f4f9030..e9b9462 100644 +--- a/src/gallium/targets/dri-i915/Makefile.am ++++ b/src/gallium/targets/dri-i915/Makefile.am +@@ -49,7 +49,7 @@ i915_dri_la_SOURCES = \ + i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + i915_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ + $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \ +diff --git a/src/gallium/targets/dri-nouveau/Makefile.am b/src/gallium/targets/dri-nouveau/Makefile.am +index 69ccf32..fef4c63 100644 +--- a/src/gallium/targets/dri-nouveau/Makefile.am ++++ b/src/gallium/targets/dri-nouveau/Makefile.am +@@ -48,7 +48,7 @@ nouveau_dri_la_SOURCES = \ + nouveau_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + nouveau_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ + $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ +diff --git a/src/gallium/targets/dri-r300/Makefile.am b/src/gallium/targets/dri-r300/Makefile.am +index 8c0215d..6beb536 100644 +--- a/src/gallium/targets/dri-r300/Makefile.am ++++ b/src/gallium/targets/dri-r300/Makefile.am +@@ -49,7 +49,7 @@ r300_dri_la_SOURCES = \ + r300_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + r300_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \ +diff --git a/src/gallium/targets/dri-r600/Makefile.am b/src/gallium/targets/dri-r600/Makefile.am +index 2b3524b..d40fb89 100644 +--- a/src/gallium/targets/dri-r600/Makefile.am ++++ b/src/gallium/targets/dri-r600/Makefile.am +@@ -48,7 +48,7 @@ r600_dri_la_SOURCES = \ + r600_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + r600_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/drivers/r600/libr600.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ +diff --git a/src/gallium/targets/dri-radeonsi/Makefile.am b/src/gallium/targets/dri-radeonsi/Makefile.am +index f7d87a6..87ab2aa 100644 +--- a/src/gallium/targets/dri-radeonsi/Makefile.am ++++ b/src/gallium/targets/dri-radeonsi/Makefile.am +@@ -49,7 +49,7 @@ radeonsi_dri_la_SOURCES = \ + radeonsi_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + radeonsi_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ +diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am +index 1104379..72d2401 100644 +--- a/src/gallium/targets/dri-swrast/Makefile.am ++++ b/src/gallium/targets/dri-swrast/Makefile.am +@@ -49,7 +49,7 @@ swrast_dri_la_SOURCES = \ + swrast_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + swrast_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/state_trackers/dri/sw/libdrisw.la \ + $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \ +diff --git a/src/gallium/targets/dri-vmwgfx/Makefile.am b/src/gallium/targets/dri-vmwgfx/Makefile.am +index ca7df65..4384976 100644 +--- a/src/gallium/targets/dri-vmwgfx/Makefile.am ++++ b/src/gallium/targets/dri-vmwgfx/Makefile.am +@@ -48,7 +48,7 @@ vmwgfx_dri_la_SOURCES = \ + vmwgfx_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined + + vmwgfx_dri_la_LIBADD = \ +- $(top_builddir)/src/mesa/libmesagallium.la \ ++ @MESAGALLIUM_LIBS@ \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ + $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \ +diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am +index 5c40ae8..6922ab2 100644 +--- a/src/gallium/targets/egl-static/Makefile.am ++++ b/src/gallium/targets/egl-static/Makefile.am +@@ -104,7 +104,7 @@ AM_CPPFLAGS += \ + $(API_DEFINES) + + egl_gallium_la_LIBADD += \ +- $(top_builddir)/src/mesa/libmesagallium.la ++ @MESAGALLIUM_LIBS@ + # make st/mesa built-in when there is a single glapi provider + if HAVE_SHARED_GLAPI + egl_gallium_la_LIBADD += \ +diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am +index 41483dd..0045a673 100644 +--- a/src/mesa/Makefile.am ++++ b/src/mesa/Makefile.am +@@ -75,9 +75,6 @@ noinst_LTLIBRARIES += libmesa.la + else + check_LTLIBRARIES = libmesa.la + endif +-if HAVE_GALLIUM +-noinst_LTLIBRARIES += libmesagallium.la +-endif + + SRCDIR = $(top_srcdir)/src/mesa/ + BUILDDIR = $(top_builddir)/src/mesa/ +@@ -119,15 +116,6 @@ libmesa_la_LIBADD = \ + $() + libmesa_la_LDFLAGS = + +-libmesagallium_la_SOURCES = \ +- $(MESA_GALLIUM_FILES) \ +- $(MESA_ASM_FILES_FOR_ARCH) +- +-libmesagallium_la_LIBADD = \ +- $(top_builddir)/src/glsl/libglsl.la \ +- $(top_builddir)/src/mesa/program/libprogram.la \ +- $() +- + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = gl.pc + +diff --git a/src/mesa/libdricore/Makefile.am b/src/mesa/libdricore/Makefile.am +index 753548e..8761418 100644 +--- a/src/mesa/libdricore/Makefile.am ++++ b/src/mesa/libdricore/Makefile.am +@@ -42,6 +42,7 @@ libdricore@VERSION@_la_SOURCES = \ + libdricore@VERSION@_la_LDFLAGS = -version-number 1:0 + libdricore@VERSION@_la_LIBADD = \ + ../program/libdricore_program.la \ ++ $(top_builddir)/src/mapi/shared-glapi/libglapi.la + $() + + if HAVE_X86_ASM +@@ -65,8 +66,10 @@ AM_CPPFLAGS += \ + -I$(top_srcdir)/src/mesa/sparc + endif + ++lib_LTLIBRARIES = ++ + if HAVE_DRI +-lib_LTLIBRARIES = libdricore@VERSION@.la ++lib_LTLIBRARIES += libdricore@VERSION@.la + + # Provide compatibility with scripts for the old Mesa build system for + # a while by putting a link to the driver into /lib of the build tree. +@@ -76,6 +79,17 @@ all-local: libdricore@VERSION@.la + ln -sf libdricore@VERSION@.so.1 $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so + endif + ++libmesagallium_la_SOURCES = \ ++ $(STATETRACKER_FILES) ++libmesagallium_la_CFLAGS = @LLVM_CFLAGS@ ++libmesagallium_la_CXXFLAGS = @LLVM_CXXFLAGS@ ++libmesagallium_la_LIBADD = libdricore@VERSION@.la $(LLVM_LIBS) ++ ++if HAVE_GALLIUM ++noinst_LTLIBRARIES = libmesagallium.la ++endif ++ ++ + CLEANFILES = \ + $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so.1 \ + $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so diff --git a/pkgs/development/libraries/mesa/static-gallium.patch b/pkgs/development/libraries/mesa/static-gallium.patch new file mode 100644 index 000000000000..755682d9f1e8 --- /dev/null +++ b/pkgs/development/libraries/mesa/static-gallium.patch @@ -0,0 +1,71 @@ +commit 2c910b6f186616cac8134e2a2cbe239c8351ed99 +Author: Vladimír Čunát +Date: Mon May 13 11:34:34 2013 +0200 + + 117-static-gallium.patch + + Conflicts (moving of VISIBILITY_ confused the merge): + src/gallium/auxiliary/Makefile.am + +diff --git a/configure.ac b/configure.ac +index b9fcb0b..be89843 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -747,6 +747,19 @@ if test "x$enable_shared_glapi" = xyes; then + fi + AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes) + ++AC_ARG_ENABLE([shared-gallium], ++ [AS_HELP_STRING([--enable-shared-gallium], ++ [Enable shared gallium core @<:@default=yes@:>@])], ++ [enable_shared_gallium="$enableval"], ++ [enable_shared_gallium=yes]) ++ ++SHARED_GALLIUM="0" ++if test "x$enable_shared_gallium" = xyes; then ++ SHARED_GALLIUM="1" ++fi ++AC_SUBST([SHARED_GALLIUM]) ++AM_CONDITIONAL(HAVE_SHARED_GALLIUM, test $SHARED_GALLIUM = 1) ++ + dnl + dnl Driver specific build directories + dnl +diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am +index f14279b..3cdec83 100644 +--- a/src/gallium/auxiliary/Makefile.am ++++ b/src/gallium/auxiliary/Makefile.am +@@ -3,14 +3,19 @@ AUTOMAKE_OPTIONS = subdir-objects + include Makefile.sources + include $(top_srcdir)/src/gallium/Automake.inc + +-noinst_LTLIBRARIES = libgallium.la +- + AM_CFLAGS = \ + -I$(top_srcdir)/src/gallium/auxiliary/util \ +- $(GALLIUM_CFLAGS) \ +- $(VISIBILITY_CFLAGS) ++ $(GALLIUM_CFLAGS) + +-AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) ++AM_CXXFLAGS = ++ ++if HAVE_SHARED_GALLIUM ++lib_LTLIBRARIES = libgallium.la ++else ++noinst_LTLIBRARIES = libgallium.la ++AM_CFLAGS += $(VISIBILITY_CFLAGS) ++AM_CXXFLAGS += $(VISIBILITY_CXXFLAGS) ++endif + + libgallium_la_SOURCES = \ + $(C_SOURCES) \ +@@ -29,6 +34,8 @@ if LLVM_NEEDS_FNORTTI + + AM_CXXFLAGS += -fno-rtti + ++libgallium_la_LIBADD = $(LLVM_LIBS) ++ + endif + + libgallium_la_SOURCES += \ diff --git a/pkgs/os-specific/linux/xf86-video-nouveau/default.nix b/pkgs/os-specific/linux/xf86-video-nouveau/default.nix index 876daa7a1ecb..8ac5cdb69696 100644 --- a/pkgs/os-specific/linux/xf86-video-nouveau/default.nix +++ b/pkgs/os-specific/linux/xf86-video-nouveau/default.nix @@ -1,5 +1,5 @@ { stdenv -, fetchgit +, fetchurl , autoconf , automake , libtool @@ -8,28 +8,22 @@ , libdrm , pkgconfig }: -stdenv.mkDerivation { - name = "xf86-video-nouveau-2012-03-05"; +stdenv.mkDerivation rec { + name = "xf86-video-nouveau-1.0.7"; - src = fetchgit { - url = git://anongit.freedesktop.org/nouveau/xf86-video-nouveau; - rev = "f5d1cd2cb6808838ae1a188cef888eaa9582c76d"; - sha256 = "8c20e9ce7897fbd4c5097e4738e80ecca30e6326b758a13fc97f96ccc12fd7d9"; + src = fetchurl { + url = "mirror://xorg/individual/driver/${name}.tar.bz2"; + sha256 = "0cg1q9dz9ksfp593x707gr10s8p7z00zdws1r4lshg42w5ccd1yi"; }; + buildInputs = [ - autoconf - automake - libtool xorgserver xproto fontsproto xf86driproto renderproto videoproto pixman utilmacros libdrm pkgconfig ]; - NIX_CFLAGS_COMPILE = "-I${pixman}/include/pixman-1"; - - preConfigure = "autoreconf -vfi"; meta = { homepage = http://nouveau.freedesktop.org/wiki/; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d39d23a0b3a2..c2daf19c527c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4646,6 +4646,7 @@ let mesaSupported = lib.elem system lib.platforms.mesaPlatforms; mesa_noglu = callPackage ../development/libraries/mesa { }; + mesa_drivers = mesa_noglu.drivers; mesa_glu = callPackage ../development/libraries/mesa-glu { }; mesa = if stdenv.isDarwin then darwinX11AndOpenGL else buildEnv { From d45b50ce6ff7f5982d71c28fba8446b00f45eaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 16 May 2013 18:49:47 +0200 Subject: [PATCH 008/426] llvm: add forgotten patch, WIP --- pkgs/development/compilers/llvm/set_soname.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pkgs/development/compilers/llvm/set_soname.patch diff --git a/pkgs/development/compilers/llvm/set_soname.patch b/pkgs/development/compilers/llvm/set_soname.patch new file mode 100644 index 000000000000..69ba74dddad8 --- /dev/null +++ b/pkgs/development/compilers/llvm/set_soname.patch @@ -0,0 +1,12 @@ +https://bugs.gentoo.org/show_bug.cgi?id=409267 +http://llvm.org/bugs/show_bug.cgi?id=12334 +--- tools/llvm-shlib/Makefile.orig 2012-03-26 18:14:13.071797115 +0200 ++++ tools/llvm-shlib/Makefile 2012-03-26 17:31:12.491196254 +0200 +@@ -67,6 +67,7 @@ + # Include everything from the .a's into the shared library. + LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \ + -Wl,--no-whole-archive ++ LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT) + endif + + ifeq ($(HOST_OS),Linux) From 6e1fa815684627ece0dc12a367ba4b41f9601134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 16 May 2013 20:35:04 +0200 Subject: [PATCH 009/426] mesa WIP: patch bad rounding (was OK on my HW, but not on hydra) --- pkgs/development/libraries/mesa/default.nix | 1 + .../libraries/mesa/fix-rounding.patch | 357 ++++++++++++++++++ 2 files changed, 358 insertions(+) create mode 100644 pkgs/development/libraries/mesa/fix-rounding.patch diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 9f1291809a6d..32ce4177b997 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -39,6 +39,7 @@ stdenv.mkDerivation { patches = [ ./static-gallium.patch ./dricore-gallium.patch + ./fix-rounding.patch ]; # Change the search path for EGL drivers from $drivers/* to driverLink diff --git a/pkgs/development/libraries/mesa/fix-rounding.patch b/pkgs/development/libraries/mesa/fix-rounding.patch new file mode 100644 index 000000000000..f81760a6708a --- /dev/null +++ b/pkgs/development/libraries/mesa/fix-rounding.patch @@ -0,0 +1,357 @@ +From c25ae5d27b114e23d5734f846002df1a05759658 Mon Sep 17 00:00:00 2001 +From: Roland Scheidegger +Date: Thu, 31 Jan 2013 19:27:49 +0000 +Subject: gallivm: fix issues with trunc/round/floor/ceil with no arch rounding + +The emulation of these if there's no rounding instruction available +is a bit more complicated than what the code did. +In particular, doing fp-to-int/int-to-fp will not work if the exponent +is large enough (and with NaNs, Infs). Hence such values need to be filtered +out and the original value returned in this case (which fortunately should +always be exact). This comes at the expense of performance (if your cpu +doesn't support rounding instructions). +Furthermore, floor/ifloor/ceil/iceil were affected by precision issues for +values near negative (for floor) or positive (for ceil) zero, fix that as well +(fixing this issue might not actually be slower except for ceil/iceil if the +type is not signed which is probably rare - note iceil has no callers left +in any case). + +Also add some new rounding test values in lp_test_arit to actually test +for that stuff (which previously would have failed without sse41). + +This fixes https://bugs.freedesktop.org/show_bug.cgi?id=59701. +--- +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c +index b4e9f23..ec05026 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c +@@ -1590,12 +1590,37 @@ lp_build_trunc(struct lp_build_context *bld, + return lp_build_round_arch(bld, a, LP_BUILD_ROUND_TRUNCATE); + } + else { +- LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type); +- LLVMTypeRef int_vec_type = lp_build_int_vec_type(bld->gallivm, type); +- LLVMValueRef res; +- res = LLVMBuildFPToSI(builder, a, int_vec_type, ""); +- res = LLVMBuildSIToFP(builder, res, vec_type, ""); +- return res; ++ const struct lp_type type = bld->type; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); ++ LLVMValueRef trunc, res, anosign, mask; ++ LLVMTypeRef int_vec_type = bld->int_vec_type; ++ LLVMTypeRef vec_type = bld->vec_type; ++ ++ assert(type.width == 32); /* might want to handle doubles at some point */ ++ ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); ++ ++ /* round by truncation */ ++ trunc = LLVMBuildFPToSI(builder, a, int_vec_type, ""); ++ res = LLVMBuildSIToFP(builder, trunc, vec_type, "floor.trunc"); ++ ++ /* mask out sign bit */ ++ anosign = lp_build_abs(bld, a); ++ /* ++ * mask out all values if anosign > 2^24 ++ * This should work both for large ints (all rounding is no-op for them ++ * because such floats are always exact) as well as special cases like ++ * NaNs, Infs (taking advantage of the fact they use max exponent). ++ * (2^24 is arbitrary anything between 2^24 and 2^31 should work.) ++ */ ++ anosign = LLVMBuildBitCast(builder, anosign, int_vec_type, ""); ++ cmpval = LLVMBuildBitCast(builder, cmpval, int_vec_type, ""); ++ mask = lp_build_cmp(&intbld, PIPE_FUNC_GREATER, anosign, cmpval); ++ return lp_build_select(bld, mask, a, res); + } + } + +@@ -1620,11 +1645,36 @@ lp_build_round(struct lp_build_context *bld, + return lp_build_round_arch(bld, a, LP_BUILD_ROUND_NEAREST); + } + else { +- LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type); +- LLVMValueRef res; ++ const struct lp_type type = bld->type; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); ++ LLVMValueRef res, anosign, mask; ++ LLVMTypeRef int_vec_type = bld->int_vec_type; ++ LLVMTypeRef vec_type = bld->vec_type; ++ ++ assert(type.width == 32); /* might want to handle doubles at some point */ ++ ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); ++ + res = lp_build_iround(bld, a); + res = LLVMBuildSIToFP(builder, res, vec_type, ""); +- return res; ++ ++ /* mask out sign bit */ ++ anosign = lp_build_abs(bld, a); ++ /* ++ * mask out all values if anosign > 2^24 ++ * This should work both for large ints (all rounding is no-op for them ++ * because such floats are always exact) as well as special cases like ++ * NaNs, Infs (taking advantage of the fact they use max exponent). ++ * (2^24 is arbitrary anything between 2^24 and 2^31 should work.) ++ */ ++ anosign = LLVMBuildBitCast(builder, anosign, int_vec_type, ""); ++ cmpval = LLVMBuildBitCast(builder, cmpval, int_vec_type, ""); ++ mask = lp_build_cmp(&intbld, PIPE_FUNC_GREATER, anosign, cmpval); ++ return lp_build_select(bld, mask, a, res); + } + } + +@@ -1648,11 +1698,52 @@ lp_build_floor(struct lp_build_context *bld, + return lp_build_round_arch(bld, a, LP_BUILD_ROUND_FLOOR); + } + else { +- LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type); +- LLVMValueRef res; +- res = lp_build_ifloor(bld, a); +- res = LLVMBuildSIToFP(builder, res, vec_type, ""); +- return res; ++ const struct lp_type type = bld->type; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); ++ LLVMValueRef trunc, res, anosign, mask; ++ LLVMTypeRef int_vec_type = bld->int_vec_type; ++ LLVMTypeRef vec_type = bld->vec_type; ++ ++ assert(type.width == 32); /* might want to handle doubles at some point */ ++ ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); ++ ++ /* round by truncation */ ++ trunc = LLVMBuildFPToSI(builder, a, int_vec_type, ""); ++ res = LLVMBuildSIToFP(builder, trunc, vec_type, "floor.trunc"); ++ ++ if (type.sign) { ++ LLVMValueRef tmp; ++ ++ /* ++ * fix values if rounding is wrong (for non-special cases) ++ * - this is the case if trunc > a ++ */ ++ mask = lp_build_cmp(bld, PIPE_FUNC_GREATER, res, a); ++ /* tmp = trunc > a ? 1.0 : 0.0 */ ++ tmp = LLVMBuildBitCast(builder, bld->one, int_vec_type, ""); ++ tmp = lp_build_and(&intbld, mask, tmp); ++ tmp = LLVMBuildBitCast(builder, tmp, vec_type, ""); ++ res = lp_build_sub(bld, res, tmp); ++ } ++ ++ /* mask out sign bit */ ++ anosign = lp_build_abs(bld, a); ++ /* ++ * mask out all values if anosign > 2^24 ++ * This should work both for large ints (all rounding is no-op for them ++ * because such floats are always exact) as well as special cases like ++ * NaNs, Infs (taking advantage of the fact they use max exponent). ++ * (2^24 is arbitrary anything between 2^24 and 2^31 should work.) ++ */ ++ anosign = LLVMBuildBitCast(builder, anosign, int_vec_type, ""); ++ cmpval = LLVMBuildBitCast(builder, cmpval, int_vec_type, ""); ++ mask = lp_build_cmp(&intbld, PIPE_FUNC_GREATER, anosign, cmpval); ++ return lp_build_select(bld, mask, a, res); + } + } + +@@ -1676,11 +1767,48 @@ lp_build_ceil(struct lp_build_context *bld, + return lp_build_round_arch(bld, a, LP_BUILD_ROUND_CEIL); + } + else { +- LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type); +- LLVMValueRef res; +- res = lp_build_iceil(bld, a); +- res = LLVMBuildSIToFP(builder, res, vec_type, ""); +- return res; ++ const struct lp_type type = bld->type; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); ++ LLVMValueRef trunc, res, anosign, mask, tmp; ++ LLVMTypeRef int_vec_type = bld->int_vec_type; ++ LLVMTypeRef vec_type = bld->vec_type; ++ ++ assert(type.width == 32); /* might want to handle doubles at some point */ ++ ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); ++ ++ /* round by truncation */ ++ trunc = LLVMBuildFPToSI(builder, a, int_vec_type, ""); ++ trunc = LLVMBuildSIToFP(builder, trunc, vec_type, "ceil.trunc"); ++ ++ /* ++ * fix values if rounding is wrong (for non-special cases) ++ * - this is the case if trunc < a ++ */ ++ mask = lp_build_cmp(bld, PIPE_FUNC_LESS, trunc, a); ++ /* tmp = trunc < a ? 1.0 : 0.0 */ ++ tmp = LLVMBuildBitCast(builder, bld->one, int_vec_type, ""); ++ tmp = lp_build_and(&intbld, mask, tmp); ++ tmp = LLVMBuildBitCast(builder, tmp, vec_type, ""); ++ res = lp_build_add(bld, trunc, tmp); ++ ++ /* mask out sign bit */ ++ anosign = lp_build_abs(bld, a); ++ /* ++ * mask out all values if anosign > 2^24 ++ * This should work both for large ints (all rounding is no-op for them ++ * because such floats are always exact) as well as special cases like ++ * NaNs, Infs (taking advantage of the fact they use max exponent). ++ * (2^24 is arbitrary anything between 2^24 and 2^31 should work.) ++ */ ++ anosign = LLVMBuildBitCast(builder, anosign, int_vec_type, ""); ++ cmpval = LLVMBuildBitCast(builder, cmpval, int_vec_type, ""); ++ mask = lp_build_cmp(&intbld, PIPE_FUNC_GREATER, anosign, cmpval); ++ return lp_build_select(bld, mask, a, res); + } + } + +@@ -1826,32 +1954,30 @@ lp_build_ifloor(struct lp_build_context *bld, + res = lp_build_round_arch(bld, a, LP_BUILD_ROUND_FLOOR); + } + else { +- /* Take the sign bit and add it to 1 constant */ +- LLVMTypeRef vec_type = bld->vec_type; +- unsigned mantissa = lp_mantissa(type); +- LLVMValueRef mask = lp_build_const_int_vec(bld->gallivm, type, +- (unsigned long long)1 << (type.width - 1)); +- LLVMValueRef sign; +- LLVMValueRef offset; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef trunc, itrunc, mask; + +- /* sign = a < 0 ? ~0 : 0 */ +- sign = LLVMBuildBitCast(builder, a, int_vec_type, ""); +- sign = LLVMBuildAnd(builder, sign, mask, ""); +- sign = LLVMBuildAShr(builder, sign, +- lp_build_const_int_vec(bld->gallivm, type, +- type.width - 1), +- "ifloor.sign"); ++ assert(type.floating); ++ assert(lp_check_value(type, a)); + +- /* offset = -0.99999(9)f */ +- offset = lp_build_const_vec(bld->gallivm, type, +- -(double)(((unsigned long long)1 << mantissa) - 10)/((unsigned long long)1 << mantissa)); +- offset = LLVMConstBitCast(offset, int_vec_type); ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); + +- /* offset = a < 0 ? offset : 0.0f */ +- offset = LLVMBuildAnd(builder, offset, sign, ""); +- offset = LLVMBuildBitCast(builder, offset, vec_type, "ifloor.offset"); ++ /* round by truncation */ ++ itrunc = LLVMBuildFPToSI(builder, a, int_vec_type, ""); ++ trunc = LLVMBuildSIToFP(builder, itrunc, bld->vec_type, "ifloor.trunc"); + +- res = LLVMBuildFAdd(builder, res, offset, "ifloor.res"); ++ /* ++ * fix values if rounding is wrong (for non-special cases) ++ * - this is the case if trunc > a ++ * The results of doing this with NaNs, very large values etc. ++ * are undefined but this seems to be the case anyway. ++ */ ++ mask = lp_build_cmp(bld, PIPE_FUNC_GREATER, trunc, a); ++ /* cheapie minus one with mask since the mask is minus one / zero */ ++ return lp_build_add(&intbld, itrunc, mask); + } + } + +@@ -1883,35 +2009,30 @@ lp_build_iceil(struct lp_build_context *bld, + res = lp_build_round_arch(bld, a, LP_BUILD_ROUND_CEIL); + } + else { +- LLVMTypeRef vec_type = bld->vec_type; +- unsigned mantissa = lp_mantissa(type); +- LLVMValueRef offset; ++ struct lp_type inttype; ++ struct lp_build_context intbld; ++ LLVMValueRef trunc, itrunc, mask; + +- /* offset = 0.99999(9)f */ +- offset = lp_build_const_vec(bld->gallivm, type, +- (double)(((unsigned long long)1 << mantissa) - 10)/((unsigned long long)1 << mantissa)); ++ assert(type.floating); ++ assert(lp_check_value(type, a)); + +- if (type.sign) { +- LLVMValueRef mask = lp_build_const_int_vec(bld->gallivm, type, +- (unsigned long long)1 << (type.width - 1)); +- LLVMValueRef sign; ++ inttype = type; ++ inttype.floating = 0; ++ lp_build_context_init(&intbld, bld->gallivm, inttype); + +- /* sign = a < 0 ? 0 : ~0 */ +- sign = LLVMBuildBitCast(builder, a, int_vec_type, ""); +- sign = LLVMBuildAnd(builder, sign, mask, ""); +- sign = LLVMBuildAShr(builder, sign, +- lp_build_const_int_vec(bld->gallivm, type, +- type.width - 1), +- "iceil.sign"); +- sign = LLVMBuildNot(builder, sign, "iceil.not"); +- +- /* offset = a < 0 ? 0.0 : offset */ +- offset = LLVMConstBitCast(offset, int_vec_type); +- offset = LLVMBuildAnd(builder, offset, sign, ""); +- offset = LLVMBuildBitCast(builder, offset, vec_type, "iceil.offset"); +- } ++ /* round by truncation */ ++ itrunc = LLVMBuildFPToSI(builder, a, int_vec_type, ""); ++ trunc = LLVMBuildSIToFP(builder, itrunc, bld->vec_type, "iceil.trunc"); + +- res = LLVMBuildFAdd(builder, a, offset, "iceil.res"); ++ /* ++ * fix values if rounding is wrong (for non-special cases) ++ * - this is the case if trunc < a ++ * The results of doing this with NaNs, very large values etc. ++ * are undefined but this seems to be the case anyway. ++ */ ++ mask = lp_build_cmp(bld, PIPE_FUNC_LESS, trunc, a); ++ /* cheapie plus one with mask since the mask is minus one / zero */ ++ return lp_build_sub(&intbld, itrunc, mask); + } + + /* round to nearest (toward zero) */ +diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c +index 99928b8..f14e4b3 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c +@@ -207,6 +207,18 @@ const float round_values[] = { + -10.0, -1, 0.0, 12.0, + -1.49, -0.25, 1.25, 2.51, + -0.99, -0.01, 0.01, 0.99, ++ 1.401298464324817e-45f, // smallest denormal ++ -1.401298464324817e-45f, ++ 1.62981451e-08f, ++ -1.62981451e-08f, ++ 1.62981451e15f, // large number not representable as 32bit int ++ -1.62981451e15f, ++ FLT_EPSILON, ++ -FLT_EPSILON, ++ 1.0f - 0.5f*FLT_EPSILON, ++ -1.0f + FLT_EPSILON, ++ FLT_MAX, ++ -FLT_MAX + }; + + static float fractf(float x) +-- +cgit v0.9.0.2-2-gbebe From 92da417fa4364349daf27d46ca4a0419d36c0fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 17 May 2013 09:19:04 +0200 Subject: [PATCH 010/426] mesa WIP: adding salt to restart hydra Hydra seems to have a problem with multiple-output derivations. --- pkgs/development/libraries/mesa/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 32ce4177b997..f3038f2d229a 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -93,6 +93,7 @@ stdenv.mkDerivation { # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM # ToDo: probably not all .la files are completely fixed, but it shouldn't matter postInstall = '' + # salt to restart hydra mv -t "$drivers/lib/" \ $out/lib/libdricore* \ $out/lib/libgallium.* \ From 16b2e1b46f0bb72ba82668ec2e307d80e2937798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 17 May 2013 17:54:12 +0200 Subject: [PATCH 011/426] mesa WIP: preferLocalBuild, hopefully work around --- pkgs/development/libraries/mesa/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index f3038f2d229a..6c2415b5d100 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -49,6 +49,7 @@ stdenv.mkDerivation { ''; outputs = ["out" "drivers"]; + preferLocalBuild = true; # see https://github.com/NixOS/nix/issues/118 preConfigure = "./autogen.sh"; @@ -93,7 +94,6 @@ stdenv.mkDerivation { # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM # ToDo: probably not all .la files are completely fixed, but it shouldn't matter postInstall = '' - # salt to restart hydra mv -t "$drivers/lib/" \ $out/lib/libdricore* \ $out/lib/libgallium.* \ From c82d9b616944b51ccc6ae02265f50165712787cc Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 9 May 2013 12:23:27 +0400 Subject: [PATCH 012/426] Adding Otter theorem prover. The development is frozen, but because of that Otter is considered a very reliable prover from soundness point of view. --- .../science/logic/otter/default.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/applications/science/logic/otter/default.nix diff --git a/pkgs/applications/science/logic/otter/default.nix b/pkgs/applications/science/logic/otter/default.nix new file mode 100644 index 000000000000..55eb269f79e5 --- /dev/null +++ b/pkgs/applications/science/logic/otter/default.nix @@ -0,0 +1,47 @@ +{stdenv, fetchurl, tcsh, libXaw, libXt, libX11}: +let + s = # Generated upstream information + rec { + version = "3.3f"; + name = "otter"; + url = "http://www.cs.unm.edu/~mccune/otter/otter-${version}.tar.gz"; + sha256 = "16mc1npl7sk9cmqhrf3ghfmvx29inijw76f1b1lsykllaxjqqb1r"; + }; + buildInputs = [ + tcsh libXaw libXt libX11 + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + buildPhase = '' + find . -name Makefile | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g" + find . -name Makefile | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g" + find . -perm +111 -type f | xargs sed -i -e "s@/bin/csh@$(type -P csh)@g" + find . -perm +111 -type f | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g" + find . -perm +111 -type f | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g" + + sed -i -e "s/^XLIBS *=.*/XLIBS=-lXaw -lXt -lX11/" source/formed/Makefile + + make all + make -C examples all + make -C examples-mace2 all + make -C source/formed realclean + make -C source/formed formed + ''; + installPhase = '' + mkdir -p "$out"/{bin,share/otter} + cp bin/* source/formed/formed "$out/bin/" + cp -r examples examples-mace2 documents README* Legal Changelog Contents index.html "$out/share/otter/" + ''; + meta = { + inherit (s) version; + description = "A reliable first-order theorem prover"; + license = stdenv.lib.licenses.publicDomain ; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c2daf19c527c..192491f9b91f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8882,6 +8882,8 @@ let opensmt = callPackage ../applications/science/logic/opensmt { }; + otter = callPackage ../applications/science/logic/otter {}; + picosat = callPackage ../applications/science/logic/picosat {}; prover9 = callPackage ../applications/science/logic/prover9 { }; From a453e495116a8cd4971bb6d6265dc8ddf14ca3e3 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 9 May 2013 17:47:40 +0400 Subject: [PATCH 013/426] Adding E-KRHyper theorem prover --- .../science/logic/ekrhyper/default.nix | 32 +++++++++++++++++++ .../science/logic/ekrhyper/default.upstream | 3 ++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 pkgs/applications/science/logic/ekrhyper/default.nix create mode 100644 pkgs/applications/science/logic/ekrhyper/default.upstream diff --git a/pkgs/applications/science/logic/ekrhyper/default.nix b/pkgs/applications/science/logic/ekrhyper/default.nix new file mode 100644 index 000000000000..7ff1acb062be --- /dev/null +++ b/pkgs/applications/science/logic/ekrhyper/default.nix @@ -0,0 +1,32 @@ +{stdenv, fetchurl, ocaml, perl}: +let + s = # Generated upstream information + rec { + baseName="ekrhyper"; + version="1_4_08022013"; + name="${baseName}-${version}"; + hash="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb"; + url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_08022013.tar.gz"; + sha256="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb"; + }; + buildInputs = [ + ocaml perl + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + setSourceRoot = "export sourceRoot=$(echo */ekrh/src/)"; + preInstall = "export INSTALLDIR=$out"; + postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done ''; + meta = { + inherit (s) version; + description = "Automated first-order theorem prover"; + license = stdenv.lib.licenses.gpl2 ; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/applications/science/logic/ekrhyper/default.upstream b/pkgs/applications/science/logic/ekrhyper/default.upstream new file mode 100644 index 000000000000..310e93ea53fd --- /dev/null +++ b/pkgs/applications/science/logic/ekrhyper/default.upstream @@ -0,0 +1,3 @@ +url http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ +ensure_choice +version '.*[^0-9]_([-0-9_]+)[.].*' '\1' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 192491f9b91f..e6e7f80788a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8838,6 +8838,8 @@ let cvc3 = callPackage ../applications/science/logic/cvc3 {}; + ekrhyper = callPackage ../applications/science/logic/ekrhyper {}; + eprover = callPackage ../applications/science/logic/eprover { texLive = texLiveAggregationFun { paths = [ From ccc11345c945e4cd8c568e17428542d8b0d38f26 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 20 May 2013 11:17:20 +0400 Subject: [PATCH 014/426] Adding jq JSON processor --- .../upstream-updater/urls-from-page.sh | 2 +- pkgs/development/tools/jq/default.nix | 28 +++++++++++++++++++ pkgs/development/tools/jq/default.upstream | 1 + pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/jq/default.nix create mode 100644 pkgs/development/tools/jq/default.upstream diff --git a/pkgs/build-support/upstream-updater/urls-from-page.sh b/pkgs/build-support/upstream-updater/urls-from-page.sh index 3c494114e914..d456794a563d 100755 --- a/pkgs/build-support/upstream-updater/urls-from-page.sh +++ b/pkgs/build-support/upstream-updater/urls-from-page.sh @@ -9,6 +9,6 @@ relpath="${path#$server}" echo "URL: $url" >&2 -curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]=("([^"]*)"|([^" <>&]+)[ <>&])/\n+\2\3\n-/g' | \ +curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]=("([^"]*)"|'\''([^'\'']*)'\''|([^"'\'' <>&]+)[ <>&])/\n+\2\3\4\n-/g' | \ sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g" | \ sed -re 's`^[^:]*$`'"$protocol://$basepath/&\`" diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix new file mode 100644 index 000000000000..f0c32fc0e9ec --- /dev/null +++ b/pkgs/development/tools/jq/default.nix @@ -0,0 +1,28 @@ +{stdenv, fetchurl}: +let + s = # Generated upstream information + rec { + baseName="jq"; + version="1.3"; + name="${baseName}-${version}"; + hash="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2"; + url="http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz"; + sha256="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2"; + }; + buildInputs = [ + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + meta = { + inherit (s) version; + description = ''A lightweight and flexible command-line JSON processor''; + license = stdenv.lib.licenses.mit ; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/tools/jq/default.upstream b/pkgs/development/tools/jq/default.upstream new file mode 100644 index 000000000000..1ad914d717e0 --- /dev/null +++ b/pkgs/development/tools/jq/default.upstream @@ -0,0 +1 @@ +url http://stedolan.github.io/jq/download/ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e6e7f80788a2..8ed2c9dd08d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1046,6 +1046,8 @@ let jnettop = callPackage ../tools/networking/jnettop { }; + jq = callPackage ../development/tools/jq {}; + jscoverage = callPackage ../development/tools/misc/jscoverage { }; jwhois = callPackage ../tools/networking/jwhois { }; From 4d9e7b2923ada28522f80a29a2fa00acca4953ca Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 23 May 2013 17:32:04 +0400 Subject: [PATCH 015/426] Fix NS plugin wrapper build --- .../browsers/mozilla-plugins/nspluginwrapper/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix index 5587f3b732ce..7cb1abf31537 100644 --- a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix +++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { preConfigure = '' sed -e 's@/usr/bin/@@g' -i configure sed -e '/gthread[.]h/d' -i src/npw-player.c + export NIX_LDFLAGS="$NIX_LDFLAGS -lgthread-2.0" export configureFlags="$configureFlags --target-cpu=$(uname -m)" ''; From 1d38b4842a17b436895cdc5c52c45f0c642337fb Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 24 May 2013 00:43:31 +0400 Subject: [PATCH 016/426] Support pre-start commands from newer NixOS versions in xlaunch --- pkgs/tools/X11/xlaunch/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/X11/xlaunch/default.nix b/pkgs/tools/X11/xlaunch/default.nix index 3cab25837e6c..b97c9def8227 100644 --- a/pkgs/tools/X11/xlaunch/default.nix +++ b/pkgs/tools/X11/xlaunch/default.nix @@ -46,6 +46,9 @@ EOF RESET_OPTION=\"-noreset\" fi; XCMD=\"\$(egrep \"^Environment=\" /etc/systemd/system/display-manager.service | sed -e \"s/Environment=/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ \$RESET_OPTION )\" + PRE_XCMD=\"\$(egrep \"^ExecStartPre=\" /etc/systemd/system/display-manager.service | sed -e \"\s/ExecStartPre=//\")\" + echo \"\$PRE_XCMD\" + echo \"\$PRE_XCMD\" | bash echo \"\$XCMD\" echo \"\$XCMD\" | bash & while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done From e3ff0f116fa8998e27429d6c8d00ccd7e4b8b1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 22 May 2013 17:07:12 +0200 Subject: [PATCH 017/426] vmware driver: depend on mesa_drivers to find libxatracker --- pkgs/servers/x11/xorg/overrides.nix | 4 ++++ pkgs/top-level/all-packages.nix | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 1fadab2cc3d6..8d2de0525869 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -150,6 +150,10 @@ in ]; }; + xf86videovmware = attrs: attrs // { + buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker + }; + xdriinfo = attrs: attrs // { buildInputs = attrs.buildInputs ++ [args.mesa]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8ed2c9dd08d2..1f0fbfb27a8a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5693,11 +5693,12 @@ let xorg = recurseIntoAttrs (import ../servers/x11/xorg/default.nix { inherit fetchurl fetchsvn stdenv pkgconfig intltool freetype fontconfig - libxslt expat libdrm libpng zlib perl mesa + libxslt expat libdrm libpng zlib perl mesa_drivers xkeyboard_config dbus libuuid openssl gperf m4 autoconf libtool xmlto asciidoc udev flex bison python mtdev; automake = automake110x; pixman = pixman_cairo; + mesa = mesa_noglu; }); xorgReplacements = callPackage ../servers/x11/xorg/replacements.nix { }; From d9acff2128faf27bf2b75c70c293b97a8b4db0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 22 May 2013 17:09:00 +0200 Subject: [PATCH 018/426] mesa WIP: bugfix-only update, minor tweaks, prune features Also disabled the workaround for #118. --- pkgs/development/libraries/mesa/default.nix | 51 ++++++++++++--------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 6c2415b5d100..a72d5d36adae 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -3,7 +3,8 @@ , libdrm, xorg, wayland, udev, llvm, libffi , libvdpau , enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt -, enableR600LlvmCompiler ? false +, enableR600LlvmCompiler ? false # we would need currently unreleased LLVM or patches +, enableExtraFeatures ? false # add ~15 MB to mesa_drivers }: if ! stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms then @@ -12,18 +13,17 @@ else /** Packaging design: - The basic mesa ($out) contains headers and libraries (GLU is in mesa_glu now). - This or the mesa attribute (which also contains GLU) are small (< 3 MB, mostly headers) + This or the mesa attribute (which also contains GLU) are small (~ 2.5 MB, mostly headers) and are designed to be the buildInput of other packages. - DRI and EGL drivers are compiled into $drivers output, - which is bigger (~27 MB) and depends on LLVM (~80 MB). + which is bigger (~13 MB) and depends on LLVM (~80 MB). These should be searched at runtime in /run/current-system/sw/lib/* and so are kind-of impure (given by NixOS). (I suppose on non-NixOS one would create the appropriate symlinks from there.) */ let - version = "9.1.2"; - extraFeatures = true; # probably doesn't work with false yet + version = "9.1.3"; driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32"; in stdenv.mkDerivation { @@ -31,7 +31,7 @@ stdenv.mkDerivation { src = fetchurl { url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2"; - sha256="1ns366armqmp2bxj1l7fff95v22b5z9mnkyykbdj81lhg9gi3586"; # 9.1.2 + sha256="0rnpaambxv5cd6kbfyvv4b8x2rw1xj13a67xbkzmndfh08iaqpcd"; }; prePatch = "patchShebangs ."; @@ -49,7 +49,6 @@ stdenv.mkDerivation { ''; outputs = ["out" "drivers"]; - preferLocalBuild = true; # see https://github.com/NixOS/nix/issues/118 preConfigure = "./autogen.sh"; @@ -63,6 +62,7 @@ stdenv.mkDerivation { "--enable-shared-glapi" "--enable-shared-gallium" "--enable-driglx-direct" # seems enabled anyway "--enable-gallium-llvm" "--with-llvm-shared-libs" + "--enable-xa" # used in vmware driver "--with-dri-drivers=i965,r200,radeon" "--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast" # radeonsi complains about R600 missing in LLVM @@ -70,12 +70,11 @@ stdenv.mkDerivation { ] ++ optional enableR600LlvmCompiler "--enable-r600-llvm-compiler" # complains about R600 missing in LLVM ++ optional enableTextureFloats "--enable-texture-float" - ++ optionals extraFeatures [ + ++ optionals enableExtraFeatures [ "--enable-gles1" "--enable-gles2" - "--enable-xa" "--enable-osmesa" "--enable-openvg" "--enable-gallium-egl" # not needed for EGL in Gallium, but OpenVG might be useful - #"--enable-xvmc" # tests segfault with 9.1.{1,2} + #"--enable-xvmc" # tests segfault with 9.1.{1,2,3} "--enable-vdpau" #"--enable-opencl" # ToDo: opencl seems to need libclc for clover ]; @@ -86,35 +85,43 @@ stdenv.mkDerivation { autoconf automake libtool intltool expat libxml2Python udev llvm libdrm libXxf86vm libXfixes libXdamage glproto dri2proto libX11 libXext libxcb libXt libffi wayland - ] ++ stdenv.lib.optionals extraFeatures [ /*libXvMC*/ libvdpau ]; + ] ++ stdenv.lib.optionals enableExtraFeatures [ /*libXvMC*/ libvdpau ]; enableParallelBuilding = true; doCheck = true; # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM # ToDo: probably not all .la files are completely fixed, but it shouldn't matter - postInstall = '' + postInstall = with stdenv.lib; '' mv -t "$drivers/lib/" \ - $out/lib/libdricore* \ - $out/lib/libgallium.* \ - $out/lib/gallium-pipe \ - $out/lib/gbm \ - $out/lib/libxatracker* \ + '' + optionalString enableExtraFeatures '' `#$out/lib/libXvMC*` \ $out/lib/vdpau \ - $out/lib/libOSMesa* + $out/lib/libOSMesa* \ + $out/lib/gbm $out/lib/libgbm* \ + $out/lib/gallium-pipe \ + '' + '' + $out/lib/libdricore* \ + $out/lib/libgallium* \ + $out/lib/libxatracker* + '' + /* now fix references in .la files */ '' sed "/^libdir=/s,$out,$drivers," -i \ - $drivers/lib/gallium-pipe/*.la \ - $drivers/lib/libgallium.la \ - $drivers/lib/libdricore*.la \ + '' + optionalString enableExtraFeatures '' `#$drivers/lib/libXvMC*.la` \ $drivers/lib/vdpau/*.la \ - $drivers/lib/libOSMesa*.la + $drivers/lib/libOSMesa*.la \ + $drivers/lib/gallium-pipe/*.la \ + '' + '' + $drivers/lib/libgallium.la \ + $drivers/lib/libdricore*.la + sed "s,$out\(/lib/\(libdricore[0-9\.]*\|libgallium\).la\),$drivers\1,g" \ -i $drivers/lib/*.la $drivers/lib/*/*.la + '' + /* work around bug #529, but maybe $drivers should also be patchelf-ed */ '' find $drivers/ -type f -executable -print0 | xargs -0 strip -S || true + '' + /* add RPATH so the drivers can find the moved libgallium and libdricore9 */ '' for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do if [[ ! -L "$lib" ]]; then From 253ee6f6a3573c5ed59745944780e8ca1ecefa1f Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Thu, 23 May 2013 16:25:21 -0700 Subject: [PATCH 019/426] update to 2013Q1 Intel Graphics Stack Release This changeset updates to all of the versions in https://01.org/linuxgraphics/downloads/2013/2013q1-intel-graphics-stack-release (but does not regression from newer version). I tried generating 'servers/x11/xorg/default.nix' with the perl script, but unrelated packges changed, so I just manually updated the file. --- pkgs/development/libraries/libva/default.nix | 4 ++-- pkgs/development/libraries/vaapi-intel/default.nix | 4 ++-- pkgs/servers/x11/xorg/default.nix | 6 +++--- pkgs/servers/x11/xorg/tarballs-7.7.list | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix index 5caea5ba6109..5b35d2b24ad4 100644 --- a/pkgs/development/libraries/libva/default.nix +++ b/pkgs/development/libraries/libva/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { - name = "libva-1.1.0"; + name = "libva-1.1.1"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; - sha256 = "1a7g7i96ww8hmim2pq2a3xc89073lzacxn1xh9526bzhlqjdqsnv"; + sha256 = "0kfdcrzcr82g15l0vvmm6rqr0f0604d4dgrza78gn6bfx7rppby0"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix index 548aeb8a2de6..192534a16e9f 100644 --- a/pkgs/development/libraries/vaapi-intel/default.nix +++ b/pkgs/development/libraries/vaapi-intel/default.nix @@ -2,11 +2,11 @@ , intelgen4asm }: stdenv.mkDerivation rec { - name = "libva-intel-driver-1.0.19"; + name = "libva-intel-driver-1.0.20"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva-intel-driver/${name}.tar.bz2"; - sha256 = "14m7krah3ajkwj190q431lqqa84hdljcdmrcrqkbgaffyjlqvdid"; + sha256 = "1jfl8909j3a3in6m8b5bx3dn7pzr8a1sw3sk4vzm7h3j2dkgpzhj"; }; buildInputs = [ autoconf automake libtool mesa libva pkgconfig libdrm libX11 intelgen4asm ]; diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index eddd231faa77..631ab0a24d98 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1510,11 +1510,11 @@ let })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;}; xf86videointel = (stdenv.mkDerivation ((if overrides ? xf86videointel then overrides.xf86videointel else x: x) { - name = "xf86-video-intel-2.20.19"; + name = "xf86-video-intel-2.21.3"; builder = ./builder.sh; src = fetchurl { - url = mirror://xorg/individual/driver/xf86-video-intel-2.20.19.tar.bz2; - sha256 = "0k67vcf0aqhv9zmy1arxyjdl7fsrg90cjm0ryyhamghq67z0xcmr"; + url = mirror://xorg/individual/driver/xf86-video-intel-2.21.3.tar.bz2; + sha256 = "1fwxjc6vnr926yd92y1w70kvnky24xw0dsa9crvvlv928ah75rhw"; }; buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ]; })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;}; diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list index 79aeb7c1a3ae..8efbae0670bd 100644 --- a/pkgs/servers/x11/xorg/tarballs-7.7.list +++ b/pkgs/servers/x11/xorg/tarballs-7.7.list @@ -129,7 +129,7 @@ mirror://xorg/individual/driver/xf86-video-geode-2.11.14.tar.bz2 mirror://xorg/individual/driver/xf86-video-glide-1.2.1.tar.bz2 mirror://xorg/individual/driver/xf86-video-glint-1.2.8.tar.bz2 mirror://xorg/individual/driver/xf86-video-i128-1.3.6.tar.bz2 -mirror://xorg/individual/driver/xf86-video-intel-2.20.19.tar.bz2 +mirror://xorg/individual/driver/xf86-video-intel-2.21.3.tar.bz2 mirror://xorg/individual/driver/xf86-video-mach64-6.9.4.tar.bz2 mirror://xorg/individual/driver/xf86-video-mga-1.6.2.tar.bz2 mirror://xorg/individual/driver/xf86-video-neomagic-1.2.7.tar.bz2 From 800c46759238728ee71f74482d6edd4b096a2c65 Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Fri, 24 May 2013 09:50:49 -0700 Subject: [PATCH 020/426] xf86-video-intel-2.21.7 --- pkgs/servers/x11/xorg/default.nix | 4 ++-- pkgs/servers/x11/xorg/tarballs-7.7.list | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 631ab0a24d98..4d3e3eebabcc 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1510,11 +1510,11 @@ let })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;}; xf86videointel = (stdenv.mkDerivation ((if overrides ? xf86videointel then overrides.xf86videointel else x: x) { - name = "xf86-video-intel-2.21.3"; + name = "xf86-video-intel-2.21.7"; builder = ./builder.sh; src = fetchurl { url = mirror://xorg/individual/driver/xf86-video-intel-2.21.3.tar.bz2; - sha256 = "1fwxjc6vnr926yd92y1w70kvnky24xw0dsa9crvvlv928ah75rhw"; + sha256 = "1nb3hc1h6scja89rwf2fvadj5z8ckcnm94lryf895i3r02jbpsps"; }; buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ]; })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;}; diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list index 8efbae0670bd..8af5589e5822 100644 --- a/pkgs/servers/x11/xorg/tarballs-7.7.list +++ b/pkgs/servers/x11/xorg/tarballs-7.7.list @@ -129,7 +129,7 @@ mirror://xorg/individual/driver/xf86-video-geode-2.11.14.tar.bz2 mirror://xorg/individual/driver/xf86-video-glide-1.2.1.tar.bz2 mirror://xorg/individual/driver/xf86-video-glint-1.2.8.tar.bz2 mirror://xorg/individual/driver/xf86-video-i128-1.3.6.tar.bz2 -mirror://xorg/individual/driver/xf86-video-intel-2.21.3.tar.bz2 +mirror://xorg/individual/driver/xf86-video-intel-2.21.7.tar.bz2 mirror://xorg/individual/driver/xf86-video-mach64-6.9.4.tar.bz2 mirror://xorg/individual/driver/xf86-video-mga-1.6.2.tar.bz2 mirror://xorg/individual/driver/xf86-video-neomagic-1.2.7.tar.bz2 From fc8f474a9c428d619f7c5ece92f31b8622bd263d Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Fri, 24 May 2013 11:56:48 -0700 Subject: [PATCH 021/426] fix url and hash for intel x driver --- pkgs/servers/x11/xorg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 4d3e3eebabcc..e0bfae80431e 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1513,8 +1513,8 @@ let name = "xf86-video-intel-2.21.7"; builder = ./builder.sh; src = fetchurl { - url = mirror://xorg/individual/driver/xf86-video-intel-2.21.3.tar.bz2; - sha256 = "1nb3hc1h6scja89rwf2fvadj5z8ckcnm94lryf895i3r02jbpsps"; + url = mirror://xorg/individual/driver/xf86-video-intel-2.21.7.tar.bz2; + sha256 = "0mpdd7am813gv7nxxvbllcph1xg7czy0bd1kn3q6bc489h53wzbp"; }; buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ]; })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;}; From 0f8a1b29d276b3ad126ecd483ffa76a0bf6d9590 Mon Sep 17 00:00:00 2001 From: Domen Kozar Date: Sun, 26 May 2013 13:22:55 +0200 Subject: [PATCH 022/426] unzip: add bzip2 as native build input --- pkgs/tools/archivers/unzip/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/archivers/unzip/default.nix b/pkgs/tools/archivers/unzip/default.nix index 8309a2102ab4..f939c968c44d 100644 --- a/pkgs/tools/archivers/unzip/default.nix +++ b/pkgs/tools/archivers/unzip/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation ({ sha256 = "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"; }; + nativeBuildInputs = [ bzip2 ]; buildInputs = [ bzip2 ] ++ stdenv.lib.optional enableNLS libnatspec; makefile = "unix/Makefile"; From e7b61ea77de5960f0c3969f86776ddfaf308fccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 27 May 2013 12:24:04 +0200 Subject: [PATCH 023/426] xorg.xf86videointel: fix bad hash (from #556) --- pkgs/servers/x11/xorg/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index e0bfae80431e..83d413e5f130 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1514,7 +1514,7 @@ let builder = ./builder.sh; src = fetchurl { url = mirror://xorg/individual/driver/xf86-video-intel-2.21.7.tar.bz2; - sha256 = "0mpdd7am813gv7nxxvbllcph1xg7czy0bd1kn3q6bc489h53wzbp"; + sha256 = "1nb3hc1h6scja89rwf2fvadj5z8ckcnm94lryf895i3r02jbpsps"; }; buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ]; })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;}; From 466ce40f0f19eb2f752eac67dd50087a1ea9963d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 27 May 2013 20:43:02 +0200 Subject: [PATCH 024/426] xorg.xf86videointel: regression-fix update http://lists.freedesktop.org/archives/intel-gfx/2013-May/028277.html --- pkgs/servers/x11/xorg/default.nix | 6 +++--- pkgs/servers/x11/xorg/tarballs-7.7.list | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 83d413e5f130..164a6e56080a 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1510,11 +1510,11 @@ let })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;}; xf86videointel = (stdenv.mkDerivation ((if overrides ? xf86videointel then overrides.xf86videointel else x: x) { - name = "xf86-video-intel-2.21.7"; + name = "xf86-video-intel-2.21.8"; builder = ./builder.sh; src = fetchurl { - url = mirror://xorg/individual/driver/xf86-video-intel-2.21.7.tar.bz2; - sha256 = "1nb3hc1h6scja89rwf2fvadj5z8ckcnm94lryf895i3r02jbpsps"; + url = mirror://xorg/individual/driver/xf86-video-intel-2.21.8.tar.bz2; + sha256 = "13yg9bcz55plnpx7k5xkbgpaj6hnlszxys94lxqa6b012l2hr1ad"; }; buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ]; })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;}; diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list index 8af5589e5822..f2ad7a4bcc54 100644 --- a/pkgs/servers/x11/xorg/tarballs-7.7.list +++ b/pkgs/servers/x11/xorg/tarballs-7.7.list @@ -129,7 +129,7 @@ mirror://xorg/individual/driver/xf86-video-geode-2.11.14.tar.bz2 mirror://xorg/individual/driver/xf86-video-glide-1.2.1.tar.bz2 mirror://xorg/individual/driver/xf86-video-glint-1.2.8.tar.bz2 mirror://xorg/individual/driver/xf86-video-i128-1.3.6.tar.bz2 -mirror://xorg/individual/driver/xf86-video-intel-2.21.7.tar.bz2 +mirror://xorg/individual/driver/xf86-video-intel-2.21.8.tar.bz2 mirror://xorg/individual/driver/xf86-video-mach64-6.9.4.tar.bz2 mirror://xorg/individual/driver/xf86-video-mga-1.6.2.tar.bz2 mirror://xorg/individual/driver/xf86-video-neomagic-1.2.7.tar.bz2 From 71628d6e356636cef794c6f2fe680cb31f4cab64 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Mon, 27 May 2013 18:29:35 +0200 Subject: [PATCH 025/426] vim: supporting multiple sources: - vim-nox: client-server implementation without X - latest: latest mercurial sources (still very stable) - default: latest release vim-plugins: Introduce an area to put vim plugins which are worth adding to nix because they need more effort than just "unpacking". Document that --- .../applications/editors/vim/configurable.nix | 38 +++++- pkgs/misc/vim-plugins/default.nix | 129 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +- 3 files changed, 166 insertions(+), 7 deletions(-) create mode 100644 pkgs/misc/vim-plugins/default.nix diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 9d07121f4cb4..c10db35a51b9 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -1,14 +1,38 @@ # TODO tidy up eg The patchelf code is patching gvim even if you don't build it.. # but I have gvim with python support now :) - Marc -args: with args; +args@{source ? "latest", ...}: with args; + + let inherit (args.composableDerivation) composableDerivation edf; in -composableDerivation {} { +composableDerivation {} (fix: { name = "vim_configurable-7.3"; - src = args.fetchurl { - url = ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2; - sha256 = "079201qk8g9yisrrb0dn52ch96z3lzw6z473dydw9fzi0xp5spaw"; + enableParallelBuilding = true; # test this + + src = + builtins.getAttr source { + "default" = + # latest release + args.fetchurl { + url = ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2; + sha256 = "079201qk8g9yisrrb0dn52ch96z3lzw6z473dydw9fzi0xp5spaw"; + }; + "vim-nox" = + { + # vim nox branch: client-server without X by uing sockets + # REGION AUTO UPDATE: { name="vim-nox"; type="hg"; url="https://code.google.com/r/yukihironakadaira-vim-cmdsrv-nox/"; branch="cmdsrv-nox"; } + src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-nox-hg-2082fc3.tar.bz2"; sha256 = "293164ca1df752b7f975fd3b44766f5a1db752de6c7385753f083499651bd13a"; }); + name = "vim-nox-hg-2082fc3"; + # END + }.src; + "latest" = { + # vim latest usually is vim + bug fixes. So it should be very stable + # REGION AUTO UPDATE: { name="vim"; type="hg"; url="https://vim.googlecode.com/hg"; } + src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-hg-7f98896.tar.bz2"; sha256 = "efcb8cc5924b530631a8e5fc2a0622045c2892210d32d300add24aded51866f1"; }); + name = "vim-hg-7f98896"; + # END + }.src; }; configureFlags = ["--enable-gui=auto" "--with-features=${args.features}"]; @@ -54,6 +78,7 @@ composableDerivation {} { cscopeSupport = config.vim.cscope or false; # add .nix filetype detection and minimal syntax highlighting support ftNixSupport = config.vim.ftNix or true; + netbeansSupport = config.netbeans or true; # eg envim is using it }; #--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon @@ -85,4 +110,5 @@ composableDerivation {} { homepage = "www.vim.org"; }; -} +}) + diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix new file mode 100644 index 000000000000..b0c70d958217 --- /dev/null +++ b/pkgs/misc/vim-plugins/default.nix @@ -0,0 +1,129 @@ +{fetchurl, stdenv, python, cmake, vim}: + +/* +About Vim and plugins +===================== +Let me tell you how Vim plugins work, so that you can decide on how to orginize +your setup. + +typical plugin files: + + plugin/P1.vim + autoload/P1.vim + ftplugin/xyz.vim + doc/plugin-documentation.txt + README(.md) (nowadays thanks to github) + +Traditionally plugins were installed into ~/.vim/* so it was your task to keep track +of which files belong to what plugin. Now this problem is "fixed" by nix which +assembles your profile for you. + + +Vim offers the :h rtp setting which works for most plugins. Thus adding adding +this to your .vimrc should make most plugins work: + + set rtp+=~/.nix-profile/vim-plugins/YouCompleteMe + " or for p in ["YouCompleteMe"] | exec 'set rtp+=~/.nix-profile/vim-plugins/'.p | endfor + +Its what +pathogen, vundle, vim-addon-manager (VAM) use. + +VAM's benefits: +- works around after/* directories if they are used in non ~/.vim locations +- allows activating plugins at runtime, eg when you need them. (works around + some au command hooks, eg required for TheNerdTree plugin) +- VAM checkous out all sources (vim.sf.net, git, mercurial, ...) +- runs :helptags on update/installation only. Obviously it cannot do that on + store paths. + +VAM is made up of +- the code loading plugins +- an optional pool (github.com/MarcWeber/vim-addon-manager-known-repositories) + +That pool probably is the best source to automatically derive plugin +information from or to lookup about how to get data from www.vim.org. + +I'm not sure we should package them all. Most of them are not used much. +You need your .vimrc anyway, and then VAM gets the job done ? + +How to install VAM? eg provide such a bash function: + + vim-install-vam () { + mkdir -p ~/.vim/vim-addons && git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager.git ~/.vim/vim-addons/vim-addon-manager && cat >> ~/.vimrc <