From ef9a15a5a4952e36c111edfba3c6716c43a49090 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 19 Sep 2012 11:48:27 +0200 Subject: [PATCH 1/8] fix/update debootstrap (thereby updating fakeroot) fakeroot is used to create devices.tar.gz now (thanks to aszlig) --- pkgs/tools/misc/debootstrap/default.nix | 131 ++++++++++++++---------- pkgs/tools/system/fakeroot/default.nix | 18 +++- 2 files changed, 89 insertions(+), 60 deletions(-) diff --git a/pkgs/tools/misc/debootstrap/default.nix b/pkgs/tools/misc/debootstrap/default.nix index 33a1fc839ce..39666f46172 100644 --- a/pkgs/tools/misc/debootstrap/default.nix +++ b/pkgs/tools/misc/debootstrap/default.nix @@ -1,55 +1,68 @@ -{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget }: +{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget, coreutils, fakeroot }: let - devices = fetchurl { - url = mirror://gentoo/distfiles/devices.tar.gz; - sha256 = "0j4yhajmlgvbksr2ij0dm7jy3q52j3wzhx2fs5lh05i1icygk4qd"; +# USAGE like this: debootstrap sid /tmp/target-chroot-directory + +# There is also cdebootstrap now. Is that easier to maintain? + + makedev = stdenv.mkDerivation { + name = "makedev-for-debootstrap"; + src = fetchurl { + url = http://ftp.de.debian.org/debian/pool/main/m/makedev/makedev_2.3.1.orig.tar.gz; + sha256 = "1yhxlj2mhn1nqkx1f0sn0bl898nf28arxxa4lgp7hdrb5cpp36c5"; + }; + patches = [ + (fetchurl { + url = "http://ftp.de.debian.org/debian/pool/main/m/makedev/makedev_2.3.1-89.diff.gz"; + sha256 = "1zbifw2jkq6471fb67y893nq4lq009xbfbi57jbjwxnhqmrppcy9"; + }) + ]; + # TODO install man + installPhase = '' + ensureDir $out/sbin + ls -l + t=$out/sbin/MAKEDEV + cp MAKEDEV $t + chmod +x $t + ''; }; in stdenv.mkDerivation { - name = "debootstrap-1.0.10lenny"; + + name = "debootstrap-1.0.42"; src = fetchurl { - # I'd like to use the source. However it's lacking the lanny script ? - url = mirror://debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb; - sha256 = "a70af8e3369408ce9d6314fb5219de73f9523b347b75a3b07ee17ea92c445051"; + # git clone git://git.debian.org/d-i/debootstrap.git + # I'd like to use the source. However it's lacking the lanny script ? (still true?) + url = http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.42.tar.gz; + sha256 = "0a5azl22wz1q92b2c91zlpz6krd7wqyi63yk87vyczp363ml0nz0"; }; - + # unpackPhase = '' + # dpkg-deb --extract "$src" . + # ''; + buildInputs = [ dpkg gettext gawk perl ]; - unpackPhase = '' - dpkg-deb --extract "$src" . - ''; - buildPhase = ":"; - patches = [ - # replace /usr/* and /sbin/* executables by @executable@ so that they can be replaced by substitute - # Be careful not to replace code being run in the debian chroot ! - ./subst.patch - ]; - - # from deb + # If you have to update the patch for functions a vim regex like this + # can help you identify which lines are used to write scripts on TARGET and + # which should /bin/ paths should be replaced: + # \\|\/bin\/\|^\s*\\|EOF\|END installPhase = '' - cp -r . $out; cd $out - t=bin/debootstrap - mkdir -p bin man/man8 - cat >> $t << EOF - #!/bin/sh - export DEBOOTSTRAP_DIR=$out/usr/share/debootstrap - # mount and other tools must be found in chroot. So add default debain paths! - # TODO only add paths which are required by the scripts! - export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - $out/usr/sbin/debootstrap "\$@" - EOF - chmod +x $t - mv usr/share/man/man8/debootstrap.8.gz man/man8 - set -x - for file in usr/share/debootstrap/functions usr/sbin/debootstrap; do + sed -i \ + -e 's@/usr/bin/id@id@' \ + -e 's@/usr/bin/dpkg@${dpkg}/bin/dpkg@' \ + -e 's@/usr/bin/sha@${coreutils}/bin/sha@' \ + -e 's@/bin/sha@${coreutils}/bin/sha@' \ + debootstrap + + + for file in functions debootstrap; do substituteInPlace "$file" \ --subst-var-by gunzip "$(type -p gunzip)" \ --subst-var-by bunzip "$(type -p bunzip)" \ @@ -61,28 +74,36 @@ stdenv.mkDerivation { --subst-var-by uname "$(type -p uname)" \ --subst-var-by wget "${wget}/bin/wget" done + + + sed -i \ + -e 's@\@${wget}/bin/wget@' \ + functions + + d=$out/share/debootstrap + ensureDir $out/{share/debootstrap,bin} + + ${fakeroot}/bin/fakeroot -- make devices.tar.gz MAKEDEV=${makedev}/sbin/MAKEDEV + + cp -r . $d + + cat >> $out/bin/debootstrap << EOF + #!/bin/sh + export DEBOOTSTRAP_DIR="''${DEBOOTSTRAP_DIR:-$d}" + # mount and other tools must be found in chroot. So add default debain paths! + # TODO only add paths which are required by the scripts! + export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + exec $d/debootstrap "\$@" + EOF + chmod +x $out/bin/debootstrap + + ensureDir $out/man/man8 + mv debootstrap.8 $out/man/man8 ''; - /* build from source: - installPhase = '' - cp ${devices} devices.tar.gz - mkdir -p $out/{bin,man/man8}; - cp debootstrap.8 $out/man/man8 - sed -i \ - -e 's@-o root@@' \ - -e 's@-g root@@' \ - -e 's@chown@true@' \ - Makefile - make pkgdetails debootstrap-arch - make DESTDIR="''\${out}" install-arch - t=$out/bin/debootstrap - cat >> $t << EOF - #!/bin/sh - DEBOOTSTRAP_DIR=$out/usr/share/debootstrap $out/usr/sbin/debootstrap "\$@" - EOF - chmod +x $t - ''; - */ + passthru = { + inherit makedev; + }; meta = { description = "Tool to create a Debian system in a chroot"; diff --git a/pkgs/tools/system/fakeroot/default.nix b/pkgs/tools/system/fakeroot/default.nix index d80b35e1a11..1bf18ed867c 100644 --- a/pkgs/tools/system/fakeroot/default.nix +++ b/pkgs/tools/system/fakeroot/default.nix @@ -1,13 +1,21 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, utillinux}: -stdenv.mkDerivation { - name = "fakeroot-1.18.1"; +stdenv.mkDerivation rec { + name = "fakeroot-1.18.4"; src = fetchurl { - url = http://ftp.de.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.18.1.orig.tar.bz2; - sha256 = "0h5jsw715a9hv32cb1m1bajy26l7xxrbgrk6qk1b6m91lxh6rnw9"; + url = https://launchpad.net/ubuntu/+archive/primary/+files/fakeroot_1.18.4.orig.tar.bz2; + sha256 = "18mydrz49n7ic7147pikkpdb96x00s9wisdk6hrc75ll7vx9wd8a"; }; + buildInputs = [ utillinux /* provides getopt */ ]; + + postUnpack = '' + for prog in getopt; do + sed -i "s@getopt@$(type -p getopt)@g" ${name}/scripts/fakeroot.in + done + ''; + meta = { homepage = http://fakeroot.alioth.debian.org/; description = "Give a fake root environment through LD_PRELOAD"; From 172abb4b26e0453300fa873c5256f4b171258486 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Fri, 5 Oct 2012 03:24:09 +0200 Subject: [PATCH 2/8] Add a "smatch" package. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cyril Roelandt Signed-off-by: Ludovic Courtès --- .../tools/analysis/smatch/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/tools/analysis/smatch/default.nix diff --git a/pkgs/development/tools/analysis/smatch/default.nix b/pkgs/development/tools/analysis/smatch/default.nix new file mode 100644 index 00000000000..8b9deca409f --- /dev/null +++ b/pkgs/development/tools/analysis/smatch/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchgit, sqlite, pkgconfig +, buildllvmsparse ? true +, buildc2xml ? true +, llvm ? null, libxml2 ? null +}: + +assert buildllvmsparse -> llvm != null; +assert buildc2xml -> libxml2 != null; + +stdenv.mkDerivation { + name = "smatch"; + + src = fetchgit { + url = git://repo.or.cz/smatch.git; + rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9"; + sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa"; + }; + + buildInputs = [sqlite pkgconfig] + ++ stdenv.lib.optional buildllvmsparse llvm + ++ stdenv.lib.optional buildc2xml libxml2; + + installFlags = "DESTDIR=$(out)"; + + meta = { + description = "A semantic analysis tool for C"; + homepage = "http://smatch.sourceforge.net/"; + license = "free"; /* OSL, see http://www.opensource.org */ + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bd554b7f1d1..d1b93ce496f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3200,6 +3200,11 @@ let sloccount = callPackage ../development/tools/misc/sloccount { }; + smatch = callPackage ../development/tools/analysis/smatch { + buildllvmsparse = false; + buildc2xml = false; + }; + sparse = callPackage ../development/tools/analysis/sparse { }; spin = callPackage ../development/tools/analysis/spin { }; From e0be32f6760e26aab599a09ee2b4d71b4497f7e8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Oct 2012 13:45:27 -0400 Subject: [PATCH 3/8] =?UTF-8?q?Add=20a=20function=20=E2=80=98getVersion?= =?UTF-8?q?=E2=80=99=20to=20get=20the=20version=20of=20a=20derivation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/lib/strings.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index 4bd7a5bebde..19d1738182f 100644 --- a/pkgs/lib/strings.nix +++ b/pkgs/lib/strings.nix @@ -155,6 +155,12 @@ rec { # Return true iff string v1 denotes a version older than v2. versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1; + + # Get the version of the specified derivation, as specified in its + # ‘name’ attribute. + getVersion = drv: (builtins.parseDrvName drv.name).version; + + # Extract name with version from URL. Ask for separator which is # supposed to start extension nameFromURL = url: sep: let From e8c4748cdba536f6c85e47dea207205795b4c4de Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Oct 2012 16:06:19 -0400 Subject: [PATCH 4/8] cabextract: Update to 1.4 --- pkgs/tools/archivers/cabextract/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/archivers/cabextract/default.nix b/pkgs/tools/archivers/cabextract/default.nix index 9e11a1bf761..79be818bfb3 100644 --- a/pkgs/tools/archivers/cabextract/default.nix +++ b/pkgs/tools/archivers/cabextract/default.nix @@ -1,10 +1,11 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "cabextract-1.3"; + name = "cabextract-1.4"; + src = fetchurl { - url = meta.homepage + name + ".tar.gz"; - sha256 = "00f0qcrz9f2gwvm98qglbrjpwrzwrfdgh0hck6im93dl6lx3hr6l"; + url = "http://www.cabextract.org.uk/${name}.tar.gz"; + sha256 = "07p49053a727nwnw7vnx1bpj4xqa43cvx8mads2146fpqai8pfpp"; }; meta = { From d9c01ef51d5dd9ed9ce26de19ff94c0b2f70d243 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Oct 2012 16:06:35 -0400 Subject: [PATCH 5/8] p7zip: Update to 9.20.1 --- pkgs/tools/archivers/p7zip/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index bb9743e8e5d..767e85d6773 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "p7zip-9.13"; + name = "p7zip-9.20.1"; src = fetchurl { - url = mirror://sourceforge/p7zip/p7zip_9.13_src_all.tar.bz2; - sha256 = "08yr0cfbjx60r1ia7vhphzvc3gax62xhgsn3vdm7sdmxxai0z77w"; + url = mirror://sourceforge/p7zip/p7zip_9.20.1_src_all.tar.bz2; + sha256 = "10j7rc1nzdp7vvcpc3340yi3qw7abby4szv8zkwh10d0zizpwma9"; }; preConfigure = @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { buildFlags=all3 ''; + enableParallelBuilding = true; + meta = { homepage = http://p7zip.sourceforge.net/; description = "A port of the 7-zip archiver"; From 29aa7abe870519b3ef12568c296dd035195328ec Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Oct 2012 16:15:56 -0400 Subject: [PATCH 6/8] thunderbird: Update to 15.0.1 --- .../thunderbird/{11.x.nix => 15.x.nix} | 47 +++++-------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 14 insertions(+), 35 deletions(-) rename pkgs/applications/networking/mailreaders/thunderbird/{11.x.nix => 15.x.nix} (64%) diff --git a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/15.x.nix similarity index 64% rename from pkgs/applications/networking/mailreaders/thunderbird/11.x.nix rename to pkgs/applications/networking/mailreaders/thunderbird/15.x.nix index 0d36bf88739..0deee99eadf 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/15.x.nix @@ -2,6 +2,7 @@ , libIDL, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss , libnotify, cairo, pixman, fontconfig , libjpeg +, pythonPackages , # If you want the resulting program to call itself "Thunderbird" # instead of "Shredder", enable this option. However, those @@ -9,47 +10,26 @@ # Mozilla Foundation, see # http://www.mozilla.org/foundation/trademarks/. enableOfficialBranding ? false - }: -let version = "11.0.1"; - - # This patch may become necessary when we use a more recent version of libpng - # for now, it's actually not needed - # pngPatch = fetchurl { - # url = http://www.linuxfromscratch.org/patches/blfs/svn/thunderbird-9.0.1-libpng-1.5-1.patch; - # sha256 = "8454bdde3be8dc37c9f5e6f597914f0a585ff4b357d3fc86c6c9f80208b6068d"; - # }; -in +let version = "15.0.1"; in stdenv.mkDerivation { name = "thunderbird-${version}"; src = fetchurl { - url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/11.0.1/source/thunderbird-${version}.source.tar.bz2"; - sha1 = "037344b451b1c031472d92f96d401b15d8e3e7d3"; + url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2"; + sha1 = "688bed2b48abda000b489f3c84de0ba9f93818f0"; }; enableParallelBuilding = true; buildInputs = [ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr - libnotify cairo pixman fontconfig yasm mesa /* nss */ - libjpeg + libnotify cairo pixman fontconfig yasm mesa nss + libjpeg pythonPackages.sqlite3 ]; - # fix some paths in pngPatch - # prePatch = '' - # substitute ${pngPatch} png.patch --replace "mozilla-release/modules/" "comm-release/mozilla/modules/" - # ''; - - patches = [ - # "png.patch" # produced by postUnpack - - # Fix weird dependencies such as a so file which depends on "-lpthread". - # ./thunderbird-build-deps.patch - ]; - configureFlags = [ "--enable-application=mail" "--enable-optimize" @@ -58,11 +38,13 @@ stdenv.mkDerivation { "--enable-strip" "--with-pthreads" "--with-system-jpeg" - # "--with-system-png" # png 1.5.x not merged in nixpkgs yet + #"--with-system-png" "--with-system-zlib" "--with-system-bz2" "--with-system-nspr" - "--enable-system-cairo" + "--with-system-nss" + # Broken: https://bugzilla.mozilla.org/show_bug.cgi?id=722975 + #"--enable-system-cairo" "--disable-crashreporter" "--disable-necko-wifi" "--disable-webm" @@ -84,10 +66,7 @@ stdenv.mkDerivation { postInstall = '' - # Fix some references to /bin paths in the Xulrunner shell script. - substituteInPlace $out/lib/thunderbird-*/thunderbird \ - --replace /bin/pwd "$(type -tP pwd)" \ - --replace /bin/ls "$(type -tP ls)" + rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl # Create a desktop item. mkdir -p $out/share/applications @@ -109,7 +88,7 @@ stdenv.mkDerivation { # Official branding implies thunderbird name and logo cannot be reuse, # see http://www.mozilla.org/foundation/licensing.html if enableOfficialBranding then licenses.proprietary else licenses.mpl11; - maintainers = with maintainers; [ pierron ]; - platforms = with platforms; linux; + maintainers = maintainers.pierron; + platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d1b93ce496f..5e45b644203 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7763,7 +7763,7 @@ let thinkingRock = callPackage ../applications/misc/thinking-rock { }; - thunderbird = callPackage ../applications/networking/mailreaders/thunderbird/11.x.nix { + thunderbird = callPackage ../applications/networking/mailreaders/thunderbird/15.x.nix { inherit (gnome) libIDL; }; From a4cd5afd0318ca8f9c653472b6ada664994da3cb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Oct 2012 16:58:36 -0400 Subject: [PATCH 7/8] Fix "Failed to add path to set" error during nixos-rebuild --- pkgs/os-specific/linux/systemd/default.nix | 2 +- .../linux/systemd/ignore-duplicates.patch | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/systemd/ignore-duplicates.patch diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 9d67c5e2f72..36d341af5e6 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "0cgnnl6kqaz3als5y9g8jvsvbs4c8ccp0vl4s1g8rwk69w2cwxd2"; }; - patches = [ ./reexec.patch ]; + patches = [ ./reexec.patch ./ignore-duplicates.patch ]; buildInputs = [ pkgconfig intltool gperf libcap dbus kmod xz pam acl diff --git a/pkgs/os-specific/linux/systemd/ignore-duplicates.patch b/pkgs/os-specific/linux/systemd/ignore-duplicates.patch new file mode 100644 index 00000000000..764eead54ea --- /dev/null +++ b/pkgs/os-specific/linux/systemd/ignore-duplicates.patch @@ -0,0 +1,20 @@ +Ignore duplicate paths in "systemctl start". + +diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c +index a4290c4..d3ac3ad 100644 +--- a/src/systemctl/systemctl.c ++++ b/src/systemctl/systemctl.c +@@ -1596,8 +1596,11 @@ static int start_unit_one( + + r = set_put(s, p); + if (r < 0) { +- log_error("Failed to add path to set."); +- return r; ++ free(p); ++ if (r != -EEXIST) { ++ log_error("Failed to add path %s to set.", p); ++ return r; ++ } + } + + p = NULL; From 90f1e5b6725d9cd1e1dea068451d147a610d12be Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 6 Oct 2012 22:42:06 +0400 Subject: [PATCH 8/8] Add V4L support to SANE --- pkgs/misc/sane-backends/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/misc/sane-backends/default.nix b/pkgs/misc/sane-backends/default.nix index 31372aa8418..ac6fed5deb4 100644 --- a/pkgs/misc/sane-backends/default.nix +++ b/pkgs/misc/sane-backends/default.nix @@ -1,21 +1,27 @@ -{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null +{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null +, pkgconfig ? null , gt68xxFirmware ? null }: let firmware = gt68xxFirmware {inherit fetchurl;}; in assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"); -stdenv.mkDerivation { - name = "sane-backends-1.0.22"; +stdenv.mkDerivation rec { + version = "1.0.23"; + name = "sane-backends-${version}"; src = fetchurl { - url = http://alioth.debian.org/frs/download.php/3503/sane-backends-1.0.22.tar.gz; - sha256 = "0m0cz4ljw9asqvpryl6gx1ndwf7ll2qinlvql9whnzs901la314z"; + url = "https://launchpad.net/ubuntu/+archive/primary/+files/sane-backends_${version}.orig.tar.gz"; + sha256 = "4d4f5b2881615af7fc0ed75fdde7dc623a749e80e40f3f792fe4010163cbb029"; }; udevSupport = hotplugSupport; - buildInputs = if libusb != null then [libusb] else []; + buildInputs = [] + ++ stdenv.lib.optional (libusb != null) libusb + ++ stdenv.lib.optional (libv4l != null) libv4l + ++ stdenv.lib.optional (pkgconfig != null) pkgconfig + ; postInstall = '' if test "$udevSupport" = "1"; then