diff --git a/maintainers/scripts/gnu/gnupdate b/maintainers/scripts/gnu/gnupdate index 289fc9d079a..d830b3ab26c 100755 --- a/maintainers/scripts/gnu/gnupdate +++ b/maintainers/scripts/gnu/gnupdate @@ -584,6 +584,7 @@ exec ${GUILE-guile} -L "$PWD" -l "$0" \ ("ghostscript" . "gnu-ghostscript") ;; ../ghostscript/gnu-ghoscript-X.Y.tar.gz ("gnum4" . "m4") ("gnugrep" . "grep") + ("gnumake" . "make") ("gnused" . "sed") ("gnutar" . "tar") ("gnunet" . "GNUnet") ;; ftp.gnu.org/gnu/gnunet/GNUnet-x.y.tar.gz diff --git a/maintainers/scripts/gnu/gnupdate.scm b/maintainers/scripts/gnu/gnupdate.scm new file mode 100644 index 00000000000..3cf6e7cfaba --- /dev/null +++ b/maintainers/scripts/gnu/gnupdate.scm @@ -0,0 +1,712 @@ +;;; GNUpdate -- Update GNU packages in Nixpkgs. -*- coding: utf-8; -*- +;;; Copyright (C) 2010 Ludovic Courtès +;;; +;;; This program is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see . + +(cond-expand (guile-2 #t) + (else (error "GNU Guile 2.0 is required"))) + +(use-modules (sxml ssax) + (ice-9 popen) + (ice-9 match) + (ice-9 rdelim) + (ice-9 regex) + (ice-9 vlist) + (srfi srfi-1) + (srfi srfi-9) + (srfi srfi-11) + (srfi srfi-37) + (system foreign) + (rnrs bytevectors)) + + +;;; +;;; SNix. +;;; + +(define-record-type + (make-location file line column) + location? + (file location-file) + (line location-line) + (column location-column)) + +(define (->loc line column path) + (and line column path + (make-location path (string->number line) (string->number column)))) + +;; XXX: Hack to add missing exports from `(sxml ssax)' as of 1.9.10. +(let ((ssax (resolve-module '(sxml ssax)))) + (for-each (lambda (sym) + (module-add! (current-module) sym + (module-variable ssax sym))) + '(ssax:warn ssax:skip-pi nl))) + +;; Nix object types visible in the XML output of `nix-instantiate' and +;; mapping to S-expressions (we map to sexps, not records, so that we +;; can do pattern matching): +;; +;; at (at varpat attrspat) +;; attr (attribute loc name value) +;; attrs (attribute-set attributes) +;; attrspat (attribute-set-pattern patterns) +;; bool #f|#t +;; derivation (derivation drv-path out-path attributes) +;; ellipsis '... +;; expr (snix loc body ...) +;; function (function loc at|attrspat|varpat) +;; int int +;; list list +;; null 'null +;; path string +;; string string +;; unevaluated 'unevaluated +;; varpat (varpat name) +;; +;; Initially ATTRIBUTES in `derivation' and `attribute-set' was a promise; +;; however, handling `repeated' nodes makes it impossible to do anything +;; lazily because the whole SXML tree has to be traversed to maintain the +;; list of known derivations. + +(define (xml-element->snix elem attributes body derivations) + ;; Return an SNix element corresponding to XML element ELEM. + + (define (loc) + (->loc (assq-ref attributes 'line) + (assq-ref attributes 'column) + (assq-ref attributes 'path))) + + (case elem + ((at) + (values `(at ,(car body) ,(cadr body)) derivations)) + ((attr) + (let ((name (assq-ref attributes 'name))) + (cond ((null? body) + (values `(attribute-pattern ,name) derivations)) + ((and (pair? body) (null? (cdr body))) + (values `(attribute ,(loc) ,name ,(car body)) + derivations)) + (else + (error "invalid attribute body" name (loc) body))))) + ((attrs) + (values `(attribute-set ,(reverse body)) derivations)) + ((attrspat) + (values `(attribute-set-pattern ,body) derivations)) + ((bool) + (values (string-ci=? "true" (assq-ref attributes 'value)) + derivations)) + ((derivation) + (let ((drv-path (assq-ref attributes 'drvPath)) + (out-path (assq-ref attributes 'outPath))) + (if (equal? body '(repeated)) + (let ((body (vhash-assoc drv-path derivations))) + (if (pair? body) + (values `(derivation ,drv-path ,out-path ,(cdr body)) + derivations) + (error "no previous occurrence of derivation" + drv-path))) + (values `(derivation ,drv-path ,out-path ,body) + (vhash-cons drv-path body derivations))))) + ((ellipsis) + (values '... derivations)) + ((expr) + (values `(snix ,(loc) ,@body) derivations)) + ((function) + (values `(function ,(loc) ,body) derivations)) + ((int) + (values (string->number (assq-ref attributes 'value)) + derivations)) + ((list) + (values body derivations)) + ((null) + (values 'null derivations)) + ((path) + (values (assq-ref attributes 'value) derivations)) + ((repeated) + (values 'repeated derivations)) + ((string) + (values (assq-ref attributes 'value) derivations)) + ((unevaluated) + (values 'unevaluated derivations)) + ((varpat) + (values `(varpat ,(assq-ref attributes 'name)) derivations)) + (else (error "unhandled Nix XML element" elem)))) + +(define xml->snix + ;; Return the SNix represention of TREE, an SXML tree as returned by + ;; parsing the XML output of `nix-instantiate' on Nixpkgs. + (let ((parse + (ssax:make-parser NEW-LEVEL-SEED + (lambda (elem-gi attributes namespaces expected-content + seed) + (cons '() (cdr seed))) + + FINISH-ELEMENT + (lambda (elem-gi attributes namespaces parent-seed + seed) + (let ((snix (car seed)) + (derivations (cdr seed))) + (let-values (((snix derivations) + (xml-element->snix elem-gi + attributes + snix + derivations))) + (cons (cons snix (car parent-seed)) + derivations)))) + + CHAR-DATA-HANDLER + (lambda (string1 string2 seed) + ;; Discard inter-node strings, which are blanks. + seed)))) + (lambda (port) + ;; Discard the second value returned by the parser (the derivation + ;; vhash). + (caar (parse port (cons '() vlist-null)))))) + +(define (call-with-package snix proc) + (match snix + (('attribute _ (and attribute-name (? string?)) + ('derivation _ _ body)) + ;; Ugly pattern matching. + (let ((meta + (any (lambda (attr) + (match attr + (('attribute _ "meta" ('attribute-set metas)) metas) + (_ #f))) + body)) + (package-name + (any (lambda (attr) + (match attr + (('attribute _ "name" (and name (? string?))) + name) + (_ #f))) + body)) + (location + (any (lambda (attr) + (match attr + (('attribute loc "name" (? string?)) + loc) + (_ #f))) + body)) + (src + (any (lambda (attr) + (match attr + (('attribute _ "src" src) + src) + (_ #f))) + body))) + (proc attribute-name package-name location meta src))))) + +(define (call-with-src snix proc) + ;; Assume SNIX contains the SNix expression for the value of an `src' + ;; attribute, as returned by `call-with-package', and call PROC with the + ;; relevant SRC information, or #f if SNIX doesn't match. + (match snix + (('derivation _ _ body) + (let ((name + (any (lambda (attr) + (match attr + (('attribute _ "name" (and name (? string?))) + name) + (_ #f))) + body)) + (output-hash + (any (lambda (attr) + (match attr + (('attribute _ "outputHash" (and hash (? string?))) + hash) + (_ #f))) + body)) + (urls + (any (lambda (attr) + (match attr + (('attribute _ "urls" (and urls (? pair?))) + urls) + (_ #f))) + body))) + (proc name output-hash urls))) + (_ (proc #f #f #f)))) + +(define (src->values snix) + (call-with-src snix values)) + +(define (open-nixpkgs nixpkgs) + (let ((script (string-append nixpkgs + "/maintainers/scripts/eval-release.nix"))) + (open-pipe* OPEN_READ "nix-instantiate" + "--strict" "--eval-only" "--xml" + script))) + +(define (nix-prefetch-url url) + ;; Download URL in the Nix store and return the base32-encoded SHA256 hash + ;; of the file at URL + (let* ((pipe (open-pipe* OPEN_READ "nix-prefetch-url" url)) + (hash (read-line pipe))) + (close-pipe pipe) + (if (eof-object? hash) + (values #f #f) + (let* ((pipe (open-pipe* OPEN_READ "nix-store" "--print-fixed-path" + "sha256" hash (basename url))) + (path (read-line pipe))) + (if (eof-object? path) + (values #f #f) + (values (string-trim-both hash) (string-trim-both path))))))) + +(define (update-nix-expression file + old-version old-hash + new-version new-hash) + ;; Modify FILE in-place. Ugly: we call out to sed(1). + (let ((cmd (format #f "sed -i \"~a\" -e 's/~A/~a/g ; s/~A/~A/g'" + file + (regexp-quote old-version) new-version + old-hash + (or new-hash "new hash not available, check the log")))) + (format #t "running `~A'...~%" cmd) + (system cmd))) + + +;;; +;;; FTP client. +;;; + +(define-record-type + (%make-ftp-connection socket addrinfo) + ftp-connection? + (socket ftp-connection-socket) + (addrinfo ftp-connection-addrinfo)) + +(define %ftp-ready-rx + (make-regexp "^([0-9]{3}) (.+)$")) + +(define (%ftp-listen port) + (let loop ((line (read-line port))) + (cond ((eof-object? line) (values line #f)) + ((regexp-exec %ftp-ready-rx line) + => + (lambda (match) + (values (string->number (match:substring match 1)) + (match:substring match 2)))) + (else + (loop (read-line port)))))) + +(define (%ftp-command command expected-code port) + (format port "~A~A~A" command (string #\return) (string #\newline)) + (let-values (((code message) (%ftp-listen port))) + (if (eqv? code expected-code) + message + (throw 'ftp-error port command code message)))) + +(define (%ftp-login user pass port) + (let ((command (string-append "USER " user (string #\newline)))) + (display command port) + (let-values (((code message) (%ftp-listen port))) + (case code + ((230) #t) + ((331) (%ftp-command (string-append "PASS " pass) 230 port)) + (else (throw 'ftp-error port command code message)))))) + +(define (ftp-open host) + (catch 'getaddrinfo-error + (lambda () + (let* ((ai (car (getaddrinfo host "ftp"))) + (s (socket (addrinfo:fam ai) (addrinfo:socktype ai) + (addrinfo:protocol ai)))) + (connect s (addrinfo:addr ai)) + (setvbuf s _IOLBF) + (let-values (((code message) (%ftp-listen s))) + (if (eqv? code 220) + (begin + ;(%ftp-command "OPTS UTF8 ON" 200 s) + (%ftp-login "anonymous" "ludo@example.com" s) + (%make-ftp-connection s ai)) + (begin + (format (current-error-port) "FTP to `~a' failed: ~A: ~A~%" + host code message) + (close s) + #f))))) + (lambda (key errcode) + (format (current-error-port) "failed to resolve `~a': ~a~%" + host (gai-strerror errcode)) + #f))) + +(define (ftp-close conn) + (close (ftp-connection-socket conn))) + +(define (ftp-chdir conn dir) + (%ftp-command (string-append "CWD " dir) 250 + (ftp-connection-socket conn))) + +(define (ftp-pasv conn) + (define %pasv-rx + (make-regexp "([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+)")) + + (let ((message (%ftp-command "PASV" 227 (ftp-connection-socket conn)))) + (cond ((regexp-exec %pasv-rx message) + => + (lambda (match) + (+ (* (string->number (match:substring match 5)) 256) + (string->number (match:substring match 6))))) + (else + (throw 'ftp-error conn "PASV" 227 message))))) + + +(define* (ftp-list conn #:optional directory) + (define (address-with-port sa port) + (let ((fam (sockaddr:fam sa)) + (addr (sockaddr:addr sa))) + (cond ((= fam AF_INET) + (make-socket-address fam addr port)) + ((= fam AF_INET6) + (make-socket-address fam addr port + (sockaddr:flowinfo sa) + (sockaddr:scopeid sa))) + (else #f)))) + + (if directory + (ftp-chdir conn directory)) + + (let* ((port (ftp-pasv conn)) + (ai (ftp-connection-addrinfo conn)) + (s (socket (addrinfo:fam ai) (addrinfo:socktype ai) + (addrinfo:protocol ai)))) + (connect s (address-with-port (addrinfo:addr ai) port)) + (setvbuf s _IOLBF) + + (dynamic-wind + (lambda () #t) + (lambda () + (%ftp-command "LIST" 150 (ftp-connection-socket conn)) + + (let loop ((line (read-line s)) + (result '())) + (cond ((eof-object? line) (reverse result)) + ((regexp-exec %ftp-ready-rx line) + => + (lambda (match) + (let ((code (string->number (match:substring match 1)))) + (if (= 126 code) + (reverse result) + (throw 'ftp-error conn "LIST" code))))) + (else + (loop (read-line s) + (let ((file (car (reverse (string-tokenize line))))) + (cons file result))))))) + (lambda () + (close s) + (let-values (((code message) (%ftp-listen (ftp-connection-socket conn)))) + (or (eqv? code 226) + (throw 'ftp-error conn "LIST" code message))))))) + + +;;; +;;; GNU. +;;; + +(define %ignored-package-attributes + ;; Attribute name of packages to be ignored. + '("bash" "bashReal" "bashInteractive" ;; the full versioned name is incorrect + "autoconf213" + "automake17x" + "automake19x" + "automake110x" + "automake" ;; = 1.10.x + "bison1875" + "bison23" + "bison" ;; = 2.3 + "emacs22" + "emacsSnapshot" + "gcc295" + "gcc33" + "gcc34" + "gcc40" + "gcc41" + "gcc42" + "gcc43" + "glibc25" + "glibc27" + "glibc29" + "guile_1_9" + )) + +(define (gnu? package) + ;; Return true if PACKAGE (a snix expression) is a GNU package (according + ;; to a simple heuristic.) Otherwise return #f. + (match package + (('attribute _ attribute-name ('derivation _ _ body)) + (any (lambda (attr) + (match attr + (('attribute _ "meta" ('attribute-set metas)) + (any (lambda (attr) + (match attr + (('attribute _ "description" value) + (string-prefix? "GNU" value)) + (('attribute _ "homepage" value) + (string-contains value "www.gnu.org")) + (_ #f))) + metas)) + (_ #f))) + body)) + (_ #f))) + +(define (gnu-packages packages) + (fold (lambda (package gnu) + (match package + (('attribute _ "emacs23Packages" emacs-packages) + ;; XXX: Should prepend `emacs23Packages.' to attribute names. + (append (gnu-packages emacs-packages) gnu)) + (('attribute _ attribute-name ('derivation _ _ body)) + (if (member attribute-name %ignored-package-attributes) + gnu + (if (gnu? package) + (cons package gnu) + gnu))) + (_ gnu))) + '() + packages)) + +(define (ftp-server/directory project) + (define quirks + '(("commoncpp2" "ftp.gnu.org" "/gnu/commoncpp" #f) + ("libgcrypt" "ftp.gnupg.org" "/gcrypt" #t) + ("libgpg-error" "ftp.gnupg.org" "/gcrypt" #t) + ("gnupg" "ftp.gnupg.org" "/gcrypt" #t) + ("gnu-ghostscript" "ftp.gnu.org" "/ghostscript" #f) + ("GNUnet" "ftp.gnu.org" "/gnu/gnunet" #f) + ("mit-scheme" "ftp.gnu.org" "/gnu/mit-scheme/stable.pkg") + ("icecat" "ftp.gnu.org" "/gnu/gnuzilla" #f) + ("TeXmacs" "ftp.texmacs.org" "/TeXmacs/targz" #f))) + + (let ((quirk (assoc project quirks))) + (match quirk + ((_ server directory subdir?) + (values server (if (not subdir?) + directory + (string-append directory "/" project)))) + (else + (values "ftp.gnu.org" (string-append "/gnu/" project)))))) + +(define (nixpkgs->gnu-name project) + (define quirks + '(("gcc-wrapper" . "gcc") + ("ghostscript" . "gnu-ghostscript") ;; ../ghostscript/gnu-ghoscript-X.Y.tar.gz + ("gnum4" . "m4") + ("gnugrep" . "grep") + ("gnused" . "sed") + ("gnutar" . "tar") + ("gnunet" . "GNUnet") ;; ftp.gnu.org/gnu/gnunet/GNUnet-x.y.tar.gz + ("mitscheme" . "mit-scheme") + ("texmacs" . "TeXmacs"))) + + (or (assoc-ref quirks project) project)) + +(define (releases project) + ;; TODO: Handle project release trees like that of IceCat and MyServer. + (define release-rx + (make-regexp (string-append "^" project "-[0-9].*\\.tar\\."))) + + (catch #t + (lambda () + (let-values (((server directory) (ftp-server/directory project))) + (let* ((conn (ftp-open server)) + (files (ftp-list conn directory))) + (ftp-close conn) + (map (lambda (tarball) + (let ((end (string-contains tarball ".tar"))) + (substring tarball 0 end))) + + ;; Filter out signatures, deltas, and files which are potentially + ;; not releases of PROJECT (e.g., in /gnu/guile, filter out + ;; guile-oops and guile-www). + (filter (lambda (file) + (and (not (string-suffix? ".sig" file)) + (regexp-exec release-rx file))) + files))))) + (lambda (key subr message . args) + (format (current-error-port) + "failed to get release list for `~A': ~A ~A~%" + project message args) + '()))) + +(define version-string>? + (let ((strverscmp + (let ((sym (or (dynamic-func "strverscmp" (dynamic-link)) + (error "could not find `strverscmp' (from GNU libc)")))) + (make-foreign-function int sym (list '* '*)))) + (string->null-terminated-utf8 + (lambda (s) + (let* ((utf8 (string->utf8 s)) + (len (bytevector-length utf8)) + (nts (make-bytevector (+ len 1)))) + (bytevector-copy! utf8 0 nts 0 len) + (bytevector-u8-set! nts len 0) + nts)))) + (lambda (a b) + (let ((a (bytevector->foreign (string->null-terminated-utf8 a))) + (b (bytevector->foreign (string->null-terminated-utf8 b)))) + (> (strverscmp a b) 0))))) + +(define (latest-release project) + ;; Return "FOO-X.Y" or #f. + (let ((releases (releases project))) + (and (not (null? releases)) + (fold (lambda (release latest) + (if (version-string>? release latest) + release + latest)) + "" + releases)))) + +(define (package/version name+version) + (let ((hyphen (string-rindex name+version #\-))) + (if (not hyphen) + (values name+version #f) + (let ((name (substring name+version 0 hyphen)) + (version (substring name+version (+ hyphen 1) + (string-length name+version)))) + (values name version))))) + +(define (file-extension file) + (let ((dot (string-rindex file #\.))) + (and dot (substring file (+ 1 dot) (string-length file))))) + +(define (packages-to-update gnu-packages) + (fold (lambda (pkg result) + (call-with-package pkg + (lambda (attribute name+version location meta src) + (let-values (((name old-version) + (package/version name+version))) + (let ((latest (latest-release (nixpkgs->gnu-name name)))) + (cond ((not latest) + (format #t "~A [unknown latest version]~%" + name+version) + result) + ((string=? name+version latest) + (format #t "~A [up to date]~%" name+version) + result) + (else + (let-values (((project new-version) + (package/version latest)) + ((old-name old-hash old-urls) + (src->values src))) + (format #t "~A -> ~A [~A]~%" name+version latest + (and (pair? old-urls) (car old-urls))) + (let* ((url (and (pair? old-urls) + (car old-urls))) + (new-hash (fetch-gnu project new-version + (if url + (file-extension url) + "gz")))) + (cons (list name attribute + old-version old-hash + new-version new-hash + location) + result)))))))))) + '() + gnu-packages)) + +(define (fetch-gnu project version archive-type) + (let-values (((server directory) + (ftp-server/directory project))) + (let* ((base (string-append project "-" version ".tar." archive-type)) + (url (string-append "ftp://" server "/" directory "/" base)) + (sig (string-append base ".sig")) + (sig-url (string-append url ".sig"))) + (let-values (((hash path) (nix-prefetch-url url))) + (pk 'prefetch-url url hash path) + (and hash path + (begin + (false-if-exception (delete-file sig)) + (system* "wget" sig-url) + (if (file-exists? sig) + (let ((ret (system* "gpg" "--verify" sig path))) + (false-if-exception (delete-file sig)) + (if (and ret (= 0 (status:exit-val ret))) + hash + (begin + (format (current-error-port) + "signature verification failed for `~a'~%" + base) + (format (current-error-port) + "(could be because the public key is not in your keyring)~%") + #f))) + (begin + (format (current-error-port) + "no signature for `~a'~%" base) + hash)))))))) + + +;;; +;;; Main program. +;;; + +(define %options + ;; Specifications of the command-line options. + (list (option '(#\h "help") #f #f + (lambda (opt name arg result) + (format #t "Usage: gnupdate [OPTIONS...]~%") + (format #t "GNUpdate -- update Nix expressions of GNU packages in Nixpkgs~%") + (format #t "~%") + (format #t " -x, --xml=FILE Read XML output of `nix-instantiate'~%") + (format #t " from FILE.~%") + (format #t " -d, --dry-run Don't actually update Nix expressions~%") + (format #t " -h, --help Give this help list.~%~%") + (format #t "Report bugs to ~%") + (exit 0))) + (option '(#\d "dry-run") #f #f + (lambda (opt name arg result) + (alist-cons 'dry-run #t result))) + + (option '(#\x "xml") #t #f + (lambda (opt name arg result) + (alist-cons 'xml-file arg result))))) + +(define-public (main . args) + ;; Assume Nixpkgs is under $NIXPKGS or ~/src/nixpkgs. + (let* ((opts (args-fold args %options + (lambda (opt name arg result) + (error "unrecognized option `~A'" name)) + (lambda (operand result) + (error "extraneous argument `~A'" operand)) + '())) + (home (getenv "HOME")) + (path (or (getenv "NIXPKGS") + (string-append home "/src/nixpkgs"))) + (snix (begin + (format (current-error-port) "parsing XML...~%") + (xml->snix + (or (and=> (assoc-ref opts 'xml-file) open-input-file) + (open-nixpkgs path))))) + (packages (match snix + (('snix _ ('attribute-set attributes)) + attributes) + (else #f))) + (gnu (gnu-packages packages)) + (updates (packages-to-update gnu))) + (format #t "~%~A packages to update...~%" (length updates)) + (for-each (lambda (update) + (match update + ((name attribute + old-version old-hash + new-version new-hash + location) + (if (assoc-ref opts 'dry-run) + (format #t "`~a' would be updated from ~a to ~a (~a -> ~a)~%" + name old-version new-version + old-hash new-hash) + (update-nix-expression (location-file location) + old-version old-hash + new-version new-hash))) + (_ #f))) + updates) + #t)) diff --git a/pkgs/applications/audio/aumix/default.nix b/pkgs/applications/audio/aumix/default.nix index 9a8a7560088..d69d9d47133 100644 --- a/pkgs/applications/audio/aumix/default.nix +++ b/pkgs/applications/audio/aumix/default.nix @@ -5,22 +5,26 @@ assert gtkGUI -> pkgconfig != null && gtk != null; -stdenv.mkDerivation { - name = "aumix-2.8"; +stdenv.mkDerivation rec { + name = "aumix-2.9.1"; src = fetchurl { - url = http://www.jpj.net/~trevor/aumix/aumix-2.8.tar.bz2; - sha256 = "636eef7f400c2f3df489c0d2fa21507e88692113561e75a40a26c52bc422d7fc"; + url = "http://www.jpj.net/~trevor/aumix/releases/${name}.tar.bz2"; + sha256 = "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"; }; buildInputs = [ gettext ncurses ] ++ (if gtkGUI then [pkgconfig gtk] else []); meta = { + description = "Aumix, an audio mixer for X and the console"; longDescription = '' Aumix adjusts an audio mixer from X, the console, a terminal, the command line or a script. ''; homepage = http://www.jpj.net/~trevor/aumix.html; - license = "GPL"; + license = "GPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.linux; }; } diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix new file mode 100644 index 00000000000..80de5567000 --- /dev/null +++ b/pkgs/applications/audio/mpg123/default.nix @@ -0,0 +1,23 @@ +{stdenv, fetchurl, alsaLib }: + +stdenv.mkDerivation { + name = "mpg123-1.12.3"; + + src = fetchurl { + url = mirror://sourceforge/mpg123/mpg123-1.12.3.tar.bz2; + sha256 = "1ij689s7jch3d4g0ja3jylaphallc8vgrsrm9b12254phnyy23xf"; + }; + + buildInputs = [ alsaLib ]; + + crossAttrs = { + configureFlags = if stdenv.cross ? mpg123 then + "--with-cpu=${stdenv.cross.mpg123.cpu}" else ""; + }; + + meta = { + description = "Command-line MP3 player"; + homepage = http://mpg123.sourceforge.net/; + license = "LGPL"; + }; +} diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix index 9f26c0a2886..905cde880ed 100644 --- a/pkgs/applications/editors/ed/default.nix +++ b/pkgs/applications/editors/ed/default.nix @@ -10,6 +10,10 @@ stdenv.mkDerivation rec { doCheck = true; + crossAttrs = { + compileFlags = [ "CC=${stdenv.cross.config}-gcc" ]; + }; + meta = { description = "GNU ed, an implementation of the standard Unix editor"; diff --git a/pkgs/applications/editors/emacs-modes/quack/default.nix b/pkgs/applications/editors/emacs-modes/quack/default.nix index c0ba183697e..317f121f364 100644 --- a/pkgs/applications/editors/emacs-modes/quack/default.nix +++ b/pkgs/applications/editors/emacs-modes/quack/default.nix @@ -1,12 +1,12 @@ { fetchurl, stdenv, emacs }: stdenv.mkDerivation { - name = "quack-0.37"; + name = "quack-0.39"; src = fetchurl { # XXX: Upstream URL is not versioned, which might eventually break this. url = "http://www.neilvandyke.org/quack/quack.el"; - sha256 = "1q5442cpvw2i0qhmhn7mh45jnmzg0cmd01k5zp4gvg1526c0hbcc"; + sha256 = "1w3p03f1f3l2nldxc7dig1kkgbbvy5j7zid0cfmkcrpp1qrcsqic"; }; buildInputs = [ emacs ]; diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 28ce0d271cf..7e03fd6b7b3 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -46,8 +46,14 @@ composableDerivation {} { ; cfg = { - pythonSupport = true; - ftNixSupport = true; # add .nix filetype detection and minimal syntax highlighting support + pythonSupport = getConfig [ "vim" "python" ] true; + darwinSupport = getConfig [ "vim" "darwin" ] false; + nlsSupport = getConfig [ "vim" "nls" ] false; + tclSupport = getConfig [ "vim" "tcl" ] false; + multibyteSupport = getConfig [ "vim" "multibyte" ] false; + cscopeSupport = getConfig [ "vim" "cscope" ] false; + # add .nix filetype detection and minimal syntax highlighting support + ftNixSupport = getConfig [ "vim" "ftNix" ] true; }; #--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 7dc9f05b179..dec93327167 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "079201qk8g9yisrrb0dn52ch96z3lzw6z473dydw9fzi0xp5spaw"; }; - buildInputs = [ ncurses gettext pkgconfig ]; + buildInputs = [ ncurses pkgconfig ]; + buildNativeInputs = [ gettext ]; configureFlags = [ "--enable-multibyte" @@ -16,6 +17,29 @@ stdenv.mkDerivation rec { ]; postInstall = "ln -s $out/bin/vim $out/bin/vi"; + + crossAttrs = { + configureFlags = [ + "vim_cv_toupper_broken=no" + "--with-tlib=ncurses" + "vim_cv_terminfo=yes" + "vim_cv_tty_group=tty" + "vim_cv_tty_mode=0660" + "vim_cv_getcwd_broken=no" + "vim_cv_stat_ignores_slash=yes" + "ac_cv_sizeof_int=4" + "vim_cv_memmove_handles_overlap=yes" + "vim_cv_memmove_handles_overlap=yes" + "STRIP=${stdenv.cross.config}-strip" + ]; + }; + + # To fix the trouble in vim73, that it cannot cross-build with this patch + # to bypass a configure script check that cannot be done cross-building. + # http://groups.google.com/group/vim_dev/browse_thread/thread/66c02efd1523554b?pli=1 + patchPhase = '' + sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure + ''; meta = { description = "The most popular clone of the VI editor"; diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix index c9d3cf7b7ef..c81815da750 100644 --- a/pkgs/applications/editors/zile/default.nix +++ b/pkgs/applications/editors/zile/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, ncurses, help2man }: stdenv.mkDerivation rec { - name = "zile-2.3.20"; + name = "zile-2.3.21"; src = fetchurl { url = "mirror://gnu/zile/${name}.tar.gz"; - sha256 = "0y07bkb7ypvsnz8ly7w274489icxw5z5hy6z50mx1nywkv2whd3q"; + sha256 = "1cmw98khpyk0yv3fn94506fm7589adfbs57czrdsm4q8xf2xrj4i"; }; buildInputs = [ ncurses ]; diff --git a/pkgs/applications/graphics/panotools/default.nix b/pkgs/applications/graphics/panotools/default.nix index 579c8744681..8216c415cb6 100644 --- a/pkgs/applications/graphics/panotools/default.nix +++ b/pkgs/applications/graphics/panotools/default.nix @@ -1,24 +1,22 @@ -{stdenv, fetchsvn, libjpeg, libpng, libtiff, automake, libtool, autoconf }: +{ fetchurl, stdenv, libjpeg, libpng, libtiff, perl }: -stdenv.mkDerivation { - name = "panotools-r955"; +stdenv.mkDerivation rec { + name = "libpano13-2.9.17"; - src = fetchsvn { - url = https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano; - rev = 955; - sha256 = "e896c21caa098d33f33f33f134a8c9a725686c2470fe3cd08b76cd7934a56034"; + src = fetchurl { + url = "mirror://sourceforge/panotools/libpano13/${name}/${name}.tar.gz"; + sha256 = "1zcrkw0xw11170mlhh9r8562gafwx3hd92wahl9xxaah5z4v0am2"; }; - configurePhase = '' - export AUTOGEN_CONFIGURE_ARGS="--prefix $out" - ./bootstrap - ''; + buildInputs = [ perl libjpeg libpng libtiff ]; - buildInputs = [ libjpeg libpng libtiff automake libtool autoconf ]; + doCheck = true; meta = { homepage = http://panotools.sourceforge.net/; description = "Free software suite for authoring and displaying virtual reality panoramas"; - license = "LGPL"; + license = "GPLv2+"; + + platforms = stdenv.lib.platforms.gnu; # arbitrary choice }; } diff --git a/pkgs/applications/graphics/qtpfsgui/default.nix b/pkgs/applications/graphics/qtpfsgui/default.nix index 633e41e661d..95d7acca36c 100644 --- a/pkgs/applications/graphics/qtpfsgui/default.nix +++ b/pkgs/applications/graphics/qtpfsgui/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, qt4, exiv2, openexr, fftw, libtiff, ilmbase }: +{stdenv, fetchurl, qt4, exiv2, openexr, fftwSinglePrec, libtiff, ilmbase }: stdenv.mkDerivation rec { name = "qtpfsgui-1.9.3"; @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { sha256 = "1mlg9dry4mfnnjlnwsw375hzsiagssdhccfmapx5nh6ykqrslsh1"; }; - buildInputs = [ qt4 exiv2 openexr fftw libtiff ]; + buildInputs = [ qt4 exiv2 openexr fftwSinglePrec libtiff ]; configurePhase = '' export CPATH="${ilmbase}/include/OpenEXR:$CPATH" qmake PREFIX=$out EXIV2PATH=${exiv2}/include/exiv2 \ OPENEXRDIR=${openexr}/include/OpenEXR \ - FFTW3DIR=${fftw}/include \ + FFTW3DIR=${fftwSinglePrec}/include \ LIBTIFFDIR=${libtiff}/include ''; diff --git a/pkgs/applications/misc/adobe-reader/builder.sh b/pkgs/applications/misc/adobe-reader/builder.sh index 0b5ed4a4029..cd4bebfe9ad 100644 --- a/pkgs/applications/misc/adobe-reader/builder.sh +++ b/pkgs/applications/misc/adobe-reader/builder.sh @@ -3,11 +3,13 @@ source $stdenv/setup echo "unpacking $src..." tar xvfa $src -ensureDir $out +ensureDir $out/Adobe/Reader9 echo "unpacking reader..." +set +e tar xvf AdobeReader/COMMON.TAR -C $out tar xvf AdobeReader/ILINXR.TAR -C $out +set -e # Disable this plugin for now (it needs LDAP, and I'm too lazy to add it). rm $out/Adobe/Reader*/Reader/intellinux/plug_ins/PPKLite.api diff --git a/pkgs/applications/misc/filelight/default.nix b/pkgs/applications/misc/filelight/default.nix index c91fb13c862..087c3ea045c 100644 --- a/pkgs/applications/misc/filelight/default.nix +++ b/pkgs/applications/misc/filelight/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation { url = http://www.kde-apps.org/CONTENT/content-files/99561-filelight-1.9rc3.tgz; sha256 = "0ljyx23j4cvrsi1dvmxila82q2cd26barmcvc8qmr74kz6pj78sq"; }; + patches = [ ./gcc45.diff ]; buildInputs = [ cmake qt4 perl kdelibs kdebase_workspace automoc4 phonon qimageblitz ]; meta = { diff --git a/pkgs/applications/misc/filelight/gcc45.diff b/pkgs/applications/misc/filelight/gcc45.diff new file mode 100644 index 00000000000..dcce2edaf16 --- /dev/null +++ b/pkgs/applications/misc/filelight/gcc45.diff @@ -0,0 +1,26 @@ +diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp +index 68ec189..feb0e53 100644 +--- a/src/app/mainWindow.cpp ++++ b/src/app/mainWindow.cpp +@@ -222,7 +222,7 @@ inline void MainWindow::slotComboScan() + + inline bool MainWindow::slotScanPath(const QString &path) + { +- return slotScanUrl(KUrl::KUrl(path)); ++ return slotScanUrl(KUrl(path)); + } + + bool MainWindow::slotScanUrl(const KUrl &url) +diff --git a/src/part/radialMap/widget.cpp b/src/part/radialMap/widget.cpp +index d48a673..762f74e 100644 +--- a/src/part/radialMap/widget.cpp ++++ b/src/part/radialMap/widget.cpp +@@ -64,7 +64,7 @@ RadialMap::Widget::path() const + KUrl + RadialMap::Widget::url(File const * const file) const + { +- return KUrl::KUrl(file ? file->fullPath() : m_tree->fullPath()); ++ return KUrl(file ? file->fullPath() : m_tree->fullPath()); + } + + void diff --git a/pkgs/applications/misc/simgrid/default.nix b/pkgs/applications/misc/simgrid/default.nix new file mode 100644 index 00000000000..45b93dab830 --- /dev/null +++ b/pkgs/applications/misc/simgrid/default.nix @@ -0,0 +1,59 @@ +{ fetchurl, stdenv, cmake, ruby }: + +stdenv.mkDerivation rec { + name = "simgrid-3.4.1"; + + src = fetchurl { + url = "https://gforge.inria.fr/frs/download.php/26944/${name}.tar.bz2"; + sha256 = "acd2bb2c1abf59e9b190279b1c38582b7c1edd4b6ef4c6a9b01100740f1a6b28"; + }; + + /* FIXME: Ruby currently disabled because of this: + + Linking C shared library ../src/.libs/libsimgrid.so + ld: cannot find -lruby-1.8.7-p72 + + */ + buildInputs = [ cmake /* ruby */ ]; + + preConfigure = + # Make it so that libsimgrid.so will be found when running programs from + # the build dir. + '' export LD_LIBRARY_PATH="$PWD/src/.libs" + export cmakeFlags="-Dprefix=$out" + ''; + + makeFlags = "VERBOSE=1"; + + patchPhase = + '' for i in "src/smpi/"* + do + sed -i "$i" -e's|/bin/bash|/bin/sh|g' + done + ''; + + installPhase = "make install-simgrid"; + + # Fixing the few tests that fail is left as an exercise to the reader. + doCheck = false; + + meta = { + description = "SimGrid, a simulator for distributed applications in heterogeneous environments"; + + longDescription = + '' SimGrid is a toolkit that provides core functionalities for the + simulation of distributed applications in heterogeneous distributed + environments. The specific goal of the project is to facilitate + research in the area of distributed and parallel application + scheduling on distributed computing platforms ranging from simple + network of workstations to Computational Grids. + ''; + + homepage = http://simgrid.gforge.inria.fr/; + + license = "LGPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.gnu; # arbitrary choice + }; +} diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix index 9fb59fcdb86..e06bfe538c0 100644 --- a/pkgs/applications/networking/browsers/elinks/default.nix +++ b/pkgs/applications/networking/browsers/elinks/default.nix @@ -18,6 +18,16 @@ stdenv.mkDerivation rec { --enable-nntp --with-openssl=${openssl} ''; + crossAttrs = { + propagatedBuildInputs = [ ncurses.hostDrv zlib.hostDrv openssl.hostDrv ]; + configureFlags = '' + --enable-finger --enable-html-highlight + --enable-gopher --enable-cgi --enable-bittorrent --enable-nntp + --with-openssl=${openssl.hostDrv} + --with-bzip2=${bzip2.hostDrv} + ''; + }; + meta = { description = "Full-featured text-mode web browser"; homepage = http://elinks.or.cz; diff --git a/pkgs/applications/networking/browsers/firefox/3.6.nix b/pkgs/applications/networking/browsers/firefox/3.6.nix index a972c980982..f119f301dbb 100644 --- a/pkgs/applications/networking/browsers/firefox/3.6.nix +++ b/pkgs/applications/networking/browsers/firefox/3.6.nix @@ -40,12 +40,18 @@ rec { "--disable-necko-wifi" # maybe we want to enable this at some point ]; - xulrunner = stdenv.mkDerivation { name = "xulrunner-${xulVersion}"; inherit src; + patches = [ + # Loongson2f related patches: + ./xulrunner-chromium-mips.patch + ./xulrunner-mips-n32.patch + ./xulrunner-1.9.2_beta4-mips-bus-error.patch + ]; + buildInputs = [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2 python dbus dbus_glib pango freetype fontconfig xlibs.libXi @@ -53,6 +59,10 @@ rec { alsaLib nspr /* nss */ libnotify xlibs.pixman ]; + preConfigure = if stdenv.isMips then '' + export ac_cv_thread_keyword=no + '' else ""; + configureFlags = [ "--enable-application=xulrunner" "--disable-javaxpcom" diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch new file mode 100644 index 00000000000..54799397f6f --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch @@ -0,0 +1,26 @@ +http://www.gentoo-cn.org/gitweb/?p=loongson.git;a=blob;f=net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch;h=2bf51d77054796ffaf4f4d903dd8560bf96b7844;hb=HEAD + +--- ./xpcom/glue/nsTArray.h.orig 2009-04-26 01:21:58.000000000 +0800 ++++ ./xpcom/glue/nsTArray.h 2009-04-26 01:21:33.000000000 +0800 +@@ -168,6 +168,7 @@ + + // The array's elements (prefixed with a Header). This pointer is never + // null. If the array is empty, then this will point to sEmptyHdr. ++ void *padding; + Header *mHdr; + }; + +diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp +index 6d452d0..3ce4193 100644 +--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp ++++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp +@@ -169,8 +169,8 @@ private: + PRBool SetupForDirectTextRun(gfxContext *aContext, float aScale); + void SetupFor(gfxContext *aContext, float aScale); + +- nsSVGGlyphFrame *mSource; + nsAutoTArray mPositions; ++ nsSVGGlyphFrame *mSource; + gfxMatrix mInitialMatrix; + // Textrun advance width from start to mCurrentChar, in appunits + gfxFloat mCurrentAdvance; diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch new file mode 100644 index 00000000000..d309f5fb6e8 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch @@ -0,0 +1,207 @@ +http://gentoo-overlays.zugaina.org/loongson/portage/net-libs/xulrunner/files/xulrunner-chromium-mips.patch + +diff --git a/ipc/chromium/src/base/atomicops.h b/ipc/chromium/src/base/atomicops.h +index 87df918..363bf63 100644 +--- a/ipc/chromium/src/base/atomicops.h ++++ b/ipc/chromium/src/base/atomicops.h +@@ -132,6 +132,8 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); + #include "base/atomicops_internals_x86_gcc.h" + #elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARM_FAMILY) + #include "base/atomicops_internals_arm_gcc.h" ++#elif defined(COMPILER_GCC) && defined(ARCH_CPU_MIPS_FAMILY) ++#include "base/atomicops_internals_mips_gcc.h" + #else + #error "Atomic operations are not supported on your platform" + #endif +diff --git a/ipc/chromium/src/base/atomicops_internals_mips_gcc.h b/ipc/chromium/src/base/atomicops_internals_mips_gcc.h +new file mode 100644 +index 0000000..d1b87ee +--- /dev/null ++++ b/ipc/chromium/src/base/atomicops_internals_mips_gcc.h +@@ -0,0 +1,160 @@ ++// Copyright (c) 2010 Zhang, Le ++// Use of this source code is governed by GPLv2. ++ ++// This file is an internal atomic implementation, use base/atomicops.h instead. ++ ++#ifndef BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ ++#define BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ ++ ++#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory") ++ ++namespace base { ++namespace subtle { ++ ++// 32-bit low-level operations on any platform. ++ ++inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ Atomic32 prev; ++ __asm__ __volatile__( ++ " .set push \n" ++ " .set noat \n" ++ " .set mips3 \n" ++ "1: ll %0, %2 \n" ++ " bne %0, %z3, 2f \n" ++ " .set mips0 \n" ++ " move $1, %z4 \n" ++ " .set mips3 \n" ++ " sc $1, %1 \n" ++ " beqz $1, 3f \n" ++ "2: \n" ++ " .subsection 2 \n" ++ "3: b 1b \n" ++ " .previous \n" ++ " .set pop \n" ++ : "=&r" (prev), "=R" (*ptr) ++ : "R" (*ptr), "Jr" (old_value), "Jr" (new_value) ++ : "memory"); ++ return prev; ++} ++ ++inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, ++ Atomic32 new_value) { ++ unsigned int ret_value; ++ unsigned long dummy; ++ ++ __asm__ __volatile__(" .set mips3 \n" ++ "1: ll %0, %3 # xchg_u32 \n" ++ " .set mips0 \n" ++ " move %2, %z4 \n" ++ " .set mips3 \n" ++ " sc %2, %1 \n" ++ " beqz %2, 2f \n" ++ " .subsection 2 \n" ++ "2: b 1b \n" ++ " .previous \n" ++ " .set mips0 \n" ++ : "=&r" (ret_value), "=m" (*ptr), "=&r" (dummy) ++ : "R" (*ptr), "Jr" (new_value) ++ : "memory"); ++ ++ return ret_value; // Now it's the previous value. ++} ++ ++inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, ++ Atomic32 increment) { ++ Atomic32 temp, result; ++ __asm__ __volatile__( ++ " .set mips3 \n" ++ "1: ll %1, %2 # atomic_add_return \n" ++ " addu %0, %1, %3 \n" ++ " sc %0, %2 \n" ++ " beqz %0, 2f \n" ++ " addu %0, %1, %3 \n" ++ " .subsection 2 \n" ++ "2: b 1b \n" ++ " .previous \n" ++ " .set mips0 \n" ++ : "=&r" (result), "=&r" (temp), "=m" (*ptr) ++ : "Ir" (increment), "m" (*ptr) ++ : "memory"); ++ return result; ++} ++ ++inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, ++ Atomic32 increment) { ++ Atomic32 temp, result; ++ __asm__ __volatile__( ++ " .set mips3 \n" ++ "1: ll %1, %2 # atomic_add_return \n" ++ " addu %0, %1, %3 \n" ++ " sc %0, %2 \n" ++ " beqz %0, 2f \n" ++ " addu %0, %1, %3 \n" ++ " .subsection 2 \n" ++ "2: b 1b \n" ++ " .previous \n" ++ " .set mips0 \n" ++ : "=&r" (result), "=&r" (temp), "=m" (*ptr) ++ : "Ir" (increment), "m" (*ptr) ++ : "memory"); ++ __asm__ __volatile__("sync" : : : "memory"); ++ return result; ++} ++ ++inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ Atomic32 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value); ++ __asm__ __volatile__("sync" : : : "memory"); ++ return x; ++} ++ ++inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ return NoBarrier_CompareAndSwap(ptr, old_value, new_value); ++} ++ ++inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { ++ *ptr = value; ++} ++ ++inline void MemoryBarrier() { ++ __asm__ __volatile__("sync" : : : "memory"); ++} ++ ++inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { ++ *ptr = value; ++ __asm__ __volatile__("sync" : : : "memory"); ++} ++ ++inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { ++ ATOMICOPS_COMPILER_BARRIER(); ++ *ptr = value; // An x86 store acts as a release barrier. ++ // See comments in Atomic64 version of Release_Store(), below. ++} ++ ++inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { ++ return *ptr; ++} ++ ++inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { ++ Atomic32 value = *ptr; // An x86 load acts as a acquire barrier. ++ // See comments in Atomic64 version of Release_Store(), below. ++ ATOMICOPS_COMPILER_BARRIER(); ++ return value; ++} ++ ++inline Atomic32 Release_Load(volatile const Atomic32* ptr) { ++ MemoryBarrier(); ++ return *ptr; ++} ++ ++} // namespace base::subtle ++} // namespace base ++ ++#undef ATOMICOPS_COMPILER_BARRIER ++ ++#endif // BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ +diff --git a/ipc/chromium/src/base/debug_util_posix.cc b/ipc/chromium/src/base/debug_util_posix.cc +index f7c58b4..50fb41d 100644 +--- a/ipc/chromium/src/base/debug_util_posix.cc ++++ b/ipc/chromium/src/base/debug_util_posix.cc +@@ -108,7 +108,7 @@ bool DebugUtil::BeingDebugged() { + + // static + void DebugUtil::BreakDebugger() { +-#if !defined(ARCH_CPU_ARM_FAMILY) ++#if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) + asm ("int3"); + #endif + } +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index 36f83e7..128bbc7 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -57,6 +57,8 @@ + #define ARCH_CPU_ARMEL 1 + #define ARCH_CPU_32_BITS 1 + #define WCHAR_T_IS_UNSIGNED 1 ++#elif defined(__MIPSEL__) ++#define ARCH_CPU_MIPS_FAMILY 1 + #else + #error Please add support for your architecture in build/build_config.h + #endif diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch new file mode 100644 index 00000000000..8be51035260 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch @@ -0,0 +1,764 @@ +http://gentoo-overlays.zugaina.org/loongson/portage/net-libs/xulrunner/files/xulrunner-mips-n32.patch + +From 1aa3577cf7e79b574bd2cff058ea00221194869b Mon Sep 17 00:00:00 2001 +From: Zhang Le +Date: Thu, 12 Mar 2009 02:24:34 +0800 +Subject: [PATCH 2/2] xulrunner mips n32 ABI patch + +Signed-off-by: Zhang Le +--- + xpcom/reflect/xptcall/src/md/unix/Makefile.in | 5 + + .../xptcall/src/md/unix/xptcinvoke_asm_mips64.s | 159 ++++++++++++++ + .../xptcall/src/md/unix/xptcinvoke_mips64.cpp | 173 ++++++++++++++++ + .../xptcall/src/md/unix/xptcstubs_asm_mips64.s | 149 +++++++++++++ + .../xptcall/src/md/unix/xptcstubs_mips64.cpp | 218 ++++++++++++++++++++ + 5 files changed, 704 insertions(+), 0 deletions(-) + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp + +diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in +index 524174e..63586cf 100644 +--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in ++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in +@@ -274,8 +274,13 @@ endif + + ifeq ($(OS_ARCH),Linux) + ifneq (,$(findstring mips, $(OS_TEST))) ++ifneq (,$(findstring mips64, $(OS_TEST))) ++CPPSRCS := xptcinvoke_mips64.cpp xptcstubs_mips64.cpp ++ASFILES := xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s ++else + CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp + ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s ++endif + ASFLAGS += -I$(DIST)/include -x assembler-with-cpp + endif + endif +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s +new file mode 100644 +index 0000000..f146ad8 +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s +@@ -0,0 +1,159 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1998 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * ZHANG Le ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++#include ++#include ++ ++.text ++.globl invoke_count_words ++.globl invoke_copy_to_stack ++ ++LOCALSZ=7 # a0, a1, a2, a3, s0, ra, gp ++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK ++ ++RAOFF=FRAMESZ-(1*SZREG) ++A0OFF=FRAMESZ-(2*SZREG) ++A1OFF=FRAMESZ-(3*SZREG) ++A2OFF=FRAMESZ-(4*SZREG) ++A3OFF=FRAMESZ-(5*SZREG) ++S0OFF=FRAMESZ-(6*SZREG) ++GPOFF=FRAMESZ-(7*SZREG) ++ ++# ++# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params) ++# a0 a1 a2 a3 ++ ++NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra) ++ PTR_SUBU sp, FRAMESZ ++ SETUP_GP64(GPOFF, _NS_InvokeByIndex_P) ++ ++ REG_S ra, RAOFF(sp) ++ REG_S a0, A0OFF(sp) ++ REG_S a1, A1OFF(sp) ++ REG_S a2, A2OFF(sp) ++ REG_S a3, A3OFF(sp) ++ REG_S s0, S0OFF(sp) ++ ++ # invoke_count_words(paramCount, params) ++ move a0, a2 ++ move a1, a3 ++ jal invoke_count_words ++ ++ # invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, ++ # nsXPTCVariant* s, PRUint32 *reg) ++ ++ REG_L a1, A2OFF(sp) # a1 - paramCount ++ REG_L a2, A3OFF(sp) # a2 - params ++ ++ # save sp before we copy the params to the stack ++ move t0, sp ++ ++ # assume full size of 16 bytes per param to be safe ++ sll v0, 4 # 16 bytes * num params ++ subu sp, sp, v0 # make room ++ move a0, sp # a0 - param stack address ++ ++ # create temporary stack space to write int and fp regs ++ subu sp, 64 # 64 = 8 regs of 8 bytes ++ move a3, sp ++ ++ # save the old sp and save the arg stack ++ subu sp, sp, 16 ++ REG_S t0, 0(sp) ++ REG_S a0, 8(sp) ++ ++ # copy the param into the stack areas ++ jal invoke_copy_to_stack ++ ++ REG_L t3, 8(sp) # get previous a0 ++ REG_L sp, 0(sp) # get orig sp back ++ ++ REG_L a0, A0OFF(sp) # a0 - that ++ REG_L a1, A1OFF(sp) # a1 - methodIndex ++ ++ # t1 = methodIndex * pow(2, PTRLOG) ++ # (use shift instead of mult) ++ sll t1, a1, PTRLOG ++ ++ # calculate the function we need to jump to, ++ # which must then be saved in t9 ++ lw t9, 0(a0) ++ addu t9, t9, t1 ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++ lw t9, (t9) ++#else /* not G++ V3 ABI */ ++ lw t9, 2*PTRSIZE(t9) ++#endif /* G++ V3 ABI */ ++ ++ # get register save area from invoke_copy_to_stack ++ subu t1, t3, 64 ++ ++ # a1..a7 and f13..f19 should now be set to what ++ # invoke_copy_to_stack told us. skip a0 and f12 ++ # because that's the "this" pointer ++ ++ REG_L a1, 0(t1) ++ REG_L a2, 8(t1) ++ REG_L a3, 16(t1) ++ REG_L a4, 24(t1) ++ REG_L a5, 32(t1) ++ REG_L a6, 40(t1) ++ REG_L a7, 48(t1) ++ ++ l.d $f13, 0(t1) ++ l.d $f14, 8(t1) ++ l.d $f15, 16(t1) ++ l.d $f16, 24(t1) ++ l.d $f17, 32(t1) ++ l.d $f18, 40(t1) ++ l.d $f19, 48(t1) ++ ++ # save away our stack pointer and create ++ # the stack pointer for the function ++ move s0, sp ++ move sp, t3 ++ ++ jalr t9 ++ ++ move sp, s0 ++ ++ RESTORE_GP64 ++ REG_L ra, RAOFF(sp) ++ REG_L s0, S0OFF(sp) ++ PTR_ADDU sp, FRAMESZ ++ j ra ++.end _NS_InvokeByIndex_P +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp +new file mode 100644 +index 0000000..d1d1a7d +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp +@@ -0,0 +1,173 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1998 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * ZHANG Le ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++/* Platform specific code to invoke XPCOM methods on native objects */ ++ ++#include "xptcprivate.h" ++ ++#if (_MIPS_SIM != _ABIN32) ++#error "This code is for MIPS N32 only" ++#endif ++ ++extern "C" uint32 ++invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) ++{ ++ return paramCount; ++} ++ ++extern "C" void ++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, ++ nsXPTCVariant* s, PRUint64 *regs) ++{ ++#define N_ARG_REGS 7 /* 8 regs minus 1 for "this" ptr */ ++ ++ for (PRUint32 i = 0; i < paramCount; i++, s++) ++ { ++ if (s->IsPtrData()) { ++ if (i < N_ARG_REGS) ++ regs[i] = (PRUint64)s->ptr; ++ else ++ *d++ = (PRUint64)s->ptr; ++ continue; ++ } ++ switch (s->type) { ++ // ++ // signed types first ++ // ++ case nsXPTType::T_I8: ++ if (i < N_ARG_REGS) ++ ((PRInt64*)regs)[i] = s->val.i8; ++ else ++ *d++ = s->val.i8; ++ break; ++ case nsXPTType::T_I16: ++ if (i < N_ARG_REGS) ++ ((PRInt64*)regs)[i] = s->val.i16; ++ else ++ *d++ = s->val.i16; ++ break; ++ case nsXPTType::T_I32: ++ if (i < N_ARG_REGS) ++ ((PRInt64*)regs)[i] = s->val.i32; ++ else ++ *d++ = s->val.i32; ++ break; ++ case nsXPTType::T_I64: ++ if (i < N_ARG_REGS) ++ ((PRInt64*)regs)[i] = s->val.i64; ++ else ++ *d++ = s->val.i64; ++ break; ++ // ++ // unsigned types next ++ // ++ case nsXPTType::T_U8: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.u8; ++ else ++ *d++ = s->val.u8; ++ break; ++ case nsXPTType::T_U16: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.u16; ++ else ++ *d++ = s->val.u16; ++ break; ++ case nsXPTType::T_U32: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.u32; ++ else ++ *d++ = s->val.u32; ++ break; ++ case nsXPTType::T_U64: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.u64; ++ else ++ *d++ = s->val.u64; ++ break; ++ case nsXPTType::T_FLOAT: ++ if (i < N_ARG_REGS) ++ *(float*)®s[i] = s->val.f; ++ else ++ *(float*)d++ = s->val.f; ++ break; ++ case nsXPTType::T_DOUBLE: ++ if (i < N_ARG_REGS) ++ *(double*)®s[i] = s->val.d; ++ else ++ *(double*)d++ = s->val.d; ++ break; ++ case nsXPTType::T_BOOL: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.b; ++ else ++ *d++ = s->val.b; ++ break; ++ case nsXPTType::T_CHAR: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.c; ++ else ++ *d++ = s->val.c; ++ break; ++ case nsXPTType::T_WCHAR: ++ if (i < N_ARG_REGS) ++ regs[i] = s->val.wc; ++ else ++ *d++ = s->val.wc; ++ break; ++ default: ++ // all the others are plain pointer types ++ if (i < N_ARG_REGS) ++ regs[i] = (PRUint64)s->val.p; ++ else ++ *d++ = (PRUint64)s->val.p; ++ break; ++ } ++ } ++} ++ ++extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, ++ PRUint32 paramCount, ++ nsXPTCVariant* params); ++ ++EXPORT_XPCOM_API(nsresult) ++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, ++ PRUint32 paramCount, nsXPTCVariant* params) ++{ ++ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params); ++} +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s +new file mode 100644 +index 0000000..dfee24b +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s +@@ -0,0 +1,149 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1998 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * ZHANG Le ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++#include ++#include ++ ++LOCALSZ=16 ++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK ++ ++A1OFF=FRAMESZ-(9*SZREG) ++A2OFF=FRAMESZ-(8*SZREG) ++A3OFF=FRAMESZ-(7*SZREG) ++A4OFF=FRAMESZ-(6*SZREG) ++A5OFF=FRAMESZ-(5*SZREG) ++A6OFF=FRAMESZ-(4*SZREG) ++A7OFF=FRAMESZ-(3*SZREG) ++GPOFF=FRAMESZ-(2*SZREG) ++RAOFF=FRAMESZ-(1*SZREG) ++ ++F13OFF=FRAMESZ-(16*SZREG) ++F14OFF=FRAMESZ-(15*SZREG) ++F15OFF=FRAMESZ-(14*SZREG) ++F16OFF=FRAMESZ-(13*SZREG) ++F17OFF=FRAMESZ-(12*SZREG) ++F18OFF=FRAMESZ-(11*SZREG) ++F19OFF=FRAMESZ-(10*SZREG) ++ ++#define SENTINEL_ENTRY(n) /* defined in cpp file, not here */ ++ ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++#define STUB_ENTRY(x) \ ++ .if x < 10; \ ++ MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev); \ ++ .elseif x < 100; \ ++ MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev); \ ++ .elseif x < 1000; \ ++ MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev); \ ++ .else; \ ++ .err; \ ++ .endif ++#else /* not G++ V3 ABI */ ++#define STUB_ENTRY(x) \ ++ MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase) ++#endif /* G++ V3 ABI */ ++ ++#define MAKE_STUB(x, name) \ ++ .globl name; \ ++ .type name,@function; \ ++ .aent name,0; \ ++name:; \ ++ PTR_SUBU sp,FRAMESZ; \ ++ SETUP_GP64(GPOFF, name); \ ++ li t0,x; \ ++ b sharedstub; \ ++ ++# ++# open a dummy frame for the function entries ++# ++ .text ++ .align 2 ++ .type dummy,@function ++ .ent dummy, 0 ++dummy: ++ .frame sp, FRAMESZ, ra ++ .mask 0x90000FF0, RAOFF-FRAMESZ ++ .fmask 0x000FF000, F19OFF-FRAMESZ ++ ++#include "xptcstubsdef.inc" ++ ++sharedstub: ++ ++ REG_S a1, A1OFF(sp) ++ REG_S a2, A2OFF(sp) ++ REG_S a3, A3OFF(sp) ++ REG_S a4, A4OFF(sp) ++ REG_S a5, A5OFF(sp) ++ REG_S a6, A6OFF(sp) ++ REG_S a7, A7OFF(sp) ++ REG_S ra, RAOFF(sp) ++ ++ s.d $f13, F13OFF(sp) ++ s.d $f14, F14OFF(sp) ++ s.d $f15, F15OFF(sp) ++ s.d $f16, F16OFF(sp) ++ s.d $f17, F17OFF(sp) ++ s.d $f18, F18OFF(sp) ++ s.d $f19, F19OFF(sp) ++ ++ # t0 is methodIndex ++ move a1, t0 ++ ++ # a2 is stack address where extra function params ++ # are stored that do not fit in registers ++ move a2, sp ++ addi a2, FRAMESZ ++ ++ # a3 is stack address of a1..a7 ++ move a3, sp ++ addi a3, A1OFF ++ ++ # a4 is stack address of f13..f19 ++ move a4, sp ++ addi a4, F13OFF ++ ++ # PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs) ++ # a0 a1 a2 a3 a4 ++ # ++ jal PrepareAndDispatch ++ ++ REG_L ra, RAOFF(sp) ++ RESTORE_GP64 ++ ++ PTR_ADDU sp, FRAMESZ ++ j ra ++ END(dummy) +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp +new file mode 100644 +index 0000000..c404065 +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp +@@ -0,0 +1,218 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1999 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * ZHANG Le ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++#include "xptcprivate.h" ++#include "xptiprivate.h" ++ ++#if (_MIPS_SIM != _ABIN32) ++#error "This code is for MIPS N32 only" ++#endif ++ ++/* ++ * This is for MIPS N32 ABI ++ * ++ * When we're called, the "gp" registers are stored in gprData and ++ * the "fp" registers are stored in fprData. There are 8 regs ++ * available which coorespond to the first 7 parameters of the ++ * function and the "this" pointer. If there are additional parms, ++ * they are stored on the stack at address "args". ++ * ++ */ ++extern "C" nsresult ++PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint64* args, ++ PRUint64 *gprData, double *fprData) ++{ ++#define PARAM_BUFFER_COUNT 16 ++#define PARAM_GPR_COUNT 7 ++#define PARAM_FPR_COUNT 7 ++ ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = NULL; ++ const nsXPTMethodInfo* info; ++ PRUint8 paramCount; ++ PRUint8 i; ++ nsresult result = NS_ERROR_FAILURE; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); ++ NS_ASSERTION(info,"no method info"); ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ ++ PRUint64* ap = args; ++ PRUint32 iCount = 0; ++ for(i = 0; i < paramCount; i++) ++ { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ const nsXPTType& type = param.GetType(); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ ++ if(param.IsOut() || !type.IsArithmetic()) ++ { ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.p = (void*)gprData[iCount++]; ++ else ++ dp->val.p = (void*)*ap++; ++ continue; ++ } ++ // else ++ switch(type) ++ { ++ case nsXPTType::T_I8: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.i8 = (PRInt8)gprData[iCount++]; ++ else ++ dp->val.i8 = (PRInt8)*ap++; ++ break; ++ ++ case nsXPTType::T_I16: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.i16 = (PRInt16)gprData[iCount++]; ++ else ++ dp->val.i16 = (PRInt16)*ap++; ++ break; ++ ++ case nsXPTType::T_I32: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.i32 = (PRInt32)gprData[iCount++]; ++ else ++ dp->val.i32 = (PRInt32)*ap++; ++ break; ++ ++ case nsXPTType::T_I64: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.i64 = (PRInt64)gprData[iCount++]; ++ else ++ dp->val.i64 = (PRInt64)*ap++; ++ break; ++ ++ case nsXPTType::T_U8: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.u8 = (PRUint8)gprData[iCount++]; ++ else ++ dp->val.u8 = (PRUint8)*ap++; ++ break; ++ ++ case nsXPTType::T_U16: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.u16 = (PRUint16)gprData[iCount++]; ++ else ++ dp->val.u16 = (PRUint16)*ap++; ++ break; ++ ++ case nsXPTType::T_U32: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.u32 = (PRUint32)gprData[iCount++]; ++ else ++ dp->val.u32 = (PRUint32)*ap++; ++ break; ++ ++ case nsXPTType::T_U64: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.u64 = (PRUint64)gprData[iCount++]; ++ else ++ dp->val.u64 = (PRUint64)*ap++; ++ break; ++ ++ case nsXPTType::T_FLOAT: ++ if (iCount < PARAM_FPR_COUNT) ++ dp->val.f = (double)fprData[iCount++]; ++ else ++ dp->val.f = *((double*)ap++); ++ break; ++ ++ case nsXPTType::T_DOUBLE: ++ if (iCount < PARAM_FPR_COUNT) ++ dp->val.d = (double)fprData[iCount++]; ++ else ++ dp->val.d = *((double*)ap++); ++ break; ++ ++ case nsXPTType::T_BOOL: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.b = (PRBool)gprData[iCount++]; ++ else ++ dp->val.b = (PRBool)*ap++; ++ break; ++ ++ case nsXPTType::T_CHAR: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.c = (char)gprData[iCount++]; ++ else ++ dp->val.c = (char)*ap++; ++ break; ++ ++ case nsXPTType::T_WCHAR: ++ if (iCount < PARAM_GPR_COUNT) ++ dp->val.wc = (wchar_t)gprData[iCount++]; ++ else ++ dp->val.wc = (wchar_t)*ap++; ++ break; ++ ++ default: ++ NS_ASSERTION(0, "bad type"); ++ break; ++ } ++ } ++ ++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); ++ ++ if(dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++} ++ ++#define STUB_ENTRY(n) /* defined in the assembly file */ ++ ++#define SENTINEL_ENTRY(n) \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" +-- +1.6.2 + diff --git a/pkgs/applications/networking/browsers/links2/stdenv.nix b/pkgs/applications/networking/browsers/links2/stdenv.nix new file mode 100644 index 00000000000..923d0aff0f5 --- /dev/null +++ b/pkgs/applications/networking/browsers/links2/stdenv.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchurl, libpng, libjpeg, bzip2, zlib, libtiff, gpm, openssl, pkgconfig, directfb +, enableX11 ? true, libX11, libXau, xproto, libXt }: + +let + version="2.2"; + name="links2-2.2"; + hash="188y37rw4s9brl55ncc12q1b45w0caxcnsq1gqyby9byw1sawnq9"; + url="http://links.twibright.com/download/links-${version}.tar.gz"; + advertisedUrl="http://links.twibright.com/download/links-2.2.tar.gz"; +in + +stdenv.mkDerivation { + inherit name; + + src = fetchurl { + inherit url; + sha256 = hash; + }; + + buildInputs = [ libpng libjpeg bzip2 zlib libtiff gpm openssl pkgconfig directfb ] + ++ stdenv.lib.optionals enableX11 [ libX11 libXau xproto libXt ]; + + configureFlags = [ + "--enable-graphics" + "--with-ssl" + "--with-fb" + ] ++ stdenv.lib.optional enableX11 "--with-x"; + + crossAttrs = { + preConfigure = '' + export CC=$crossConfig-gcc + ''; + }; + + meta = { + description = "A small browser with some graphics support"; + maintainers = [ + stdenv.lib.maintainers.viric + ]; + }; +} diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix index c9da94258c8..c0175fc6a70 100644 --- a/pkgs/applications/networking/browsers/lynx/default.nix +++ b/pkgs/applications/networking/browsers/lynx/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ncurses +{ stdenv, fetchurl, ncurses, gzip , sslSupport ? true, openssl ? null }: @@ -14,7 +14,13 @@ stdenv.mkDerivation { configureFlags = if sslSupport then "--with-ssl" else ""; - buildInputs = [ ncurses ] ++ stdenv.lib.optional sslSupport openssl; + buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl; + buildNativeInputs = [ ncurses ]; + + crossAttrs = { + configureFlags = "--enable-widec" + + (if sslSupport then " --with-ssl" else ""); + }; meta = { homepage = http://lynx.isc.org/; diff --git a/pkgs/applications/networking/browsers/rekonq/source.nix b/pkgs/applications/networking/browsers/rekonq/source.nix new file mode 100644 index 00000000000..5faeddaaf2a --- /dev/null +++ b/pkgs/applications/networking/browsers/rekonq/source.nix @@ -0,0 +1,28 @@ +{ fetchurl, fetchgit }: + +builtins.listToAttrs +[ + { + name = "0.4.90"; + value = rec { + name = "rekonq-0.4.90"; + src = fetchurl { + url = "http://kde-apps.org/CONTENT/content-files/94258-${name}.tar.bz2"; + name = "${name}.tar.bz2"; + sha256 = "1dmdx54asv0b4xzc8p5nadn92l8pks9cl1y9j8a46lsslwsjw3ws"; + }; + }; + } + + { + name = "scm"; + value = { + name = "rekonq-0.4.0-20100514"; + src = fetchgit { + url = git://gitorious.org/rekonq/mainline.git; + rev = "6b4f4d69a3c599bc958ccddc5f7ac1c8648a7042"; + sha256 = "1qcwf7rsrnsbnq62cl44r48bmavc2nysi2wqhy1jxmj2ndwvsxy1"; + }; + }; + } +] diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix index 95ed08d8834..6844e582026 100644 --- a/pkgs/applications/networking/browsers/w3m/default.nix +++ b/pkgs/applications/networking/browsers/w3m/default.nix @@ -16,6 +16,10 @@ stdenv.mkDerivation { md5 = "ba06992d3207666ed1bf2dcf7c72bf58"; }; + # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that + # alpha. At the time of writing this, boehm-gc-7.1 is the last stable. + patches = stdenv.lib.optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ]; + buildInputs = [ncurses boehmgc gettext zlib] ++ stdenv.lib.optional sslSupport openssl ++ stdenv.lib.optionals graphicsSupport [imlib2 x11]; diff --git a/pkgs/applications/networking/browsers/w3m/newgc.patch b/pkgs/applications/networking/browsers/w3m/newgc.patch new file mode 100644 index 00000000000..db25e305c8c --- /dev/null +++ b/pkgs/applications/networking/browsers/w3m/newgc.patch @@ -0,0 +1,15 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=555467 + +--- a/main.c.old 2007-05-31 06:49:50.000000000 +0530 ++++ b/main.c 2010-02-16 16:16:24.000000000 +0530 +@@ -842,7 +842,9 @@ + mySignal(SIGPIPE, SigPipe); + #endif + +- orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); ++ orig_GC_warn_proc = GC_get_warn_proc(); ++ GC_set_warn_proc(wrap_GC_warn_proc); ++ + err_msg = Strnew(); + if (load_argc == 0) { + /* no URL specified */ diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix index 6bc6dce38f8..ecc2e5f7794 100644 --- a/pkgs/applications/networking/p2p/mldonkey/default.nix +++ b/pkgs/applications/networking/p2p/mldonkey/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }: stdenv.mkDerivation (rec { - name = "mldonkey-3.0.2"; + name = "mldonkey-3.0.4"; src = fetchurl { url = "mirror://sourceforge/mldonkey/${name}.tar.bz2"; - sha256 = "0l1gcgsn603l2lv5jxjjr44r7kq2hpfcy98w3y2gf5n9d4fhja84"; + sha256 = "0wnyi2m7126dq6r5zbqplgknnypzcx0p3q2mxcdfhp94ln7vn3f6"; }; meta = { @@ -13,6 +13,8 @@ stdenv.mkDerivation (rec { homepage = http://mldonkey.sourceforge.net/; }; + patches = [ ./gcc44mips64.patch ]; + buildInputs = [ ocaml zlib ncurses bzip2 file gd libpng ]; configureFlags = [ "--disable-gui" ]; } // (if (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux") then diff --git a/pkgs/applications/networking/p2p/mldonkey/gcc44mips64.patch b/pkgs/applications/networking/p2p/mldonkey/gcc44mips64.patch new file mode 100644 index 00000000000..41449dcdd05 --- /dev/null +++ b/pkgs/applications/networking/p2p/mldonkey/gcc44mips64.patch @@ -0,0 +1,103 @@ +Patch fixing CryptoPP so: +- it builds properly in mips64 with gcc 4.4 (gcc 4.4 does not have the 'h' asm constraint) +- it runs properly in mips64 (where lack of templated *Precision functions gave wrong numbers). + An assertion check failed without this. + +diff --git a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc +index 9208e1c..6b12b0a 100644 +--- a/src/utils/lib/CryptoPP.cc ++++ b/src/utils/lib/CryptoPP.cc +@@ -890,35 +890,6 @@ unsigned int Parity(unsigned long value) + return (unsigned int)value&1; + } + +-unsigned int BytePrecision(unsigned long value) +-{ +- unsigned int i; +- for (i=sizeof(value); i; --i) +- if (value >> (i-1)*8) +- break; +- +- return i; +-} +- +-unsigned int BitPrecision(unsigned long value) +-{ +- if (!value) +- return 0; +- +- unsigned int l=0, h=8*sizeof(value); +- +- while (h-l > 1) +- { +- unsigned int t = (l+h)/2; +- if (value >> t) +- l = t; +- else +- h = t; +- } +- +- return h; +-} +- + unsigned long Crop(unsigned long value, unsigned int size) + { + if (size < 8*sizeof(value)) +@@ -1880,7 +1851,10 @@ public: + #elif defined(__x86_64__) + __asm__("mulq %3" : "=d" (r.m_halfs.high), "=a" (r.m_halfs.low) : "a" (a), "rm" (b) : "cc"); + #elif defined(__mips64) +- __asm__("dmultu %2,%3" : "=h" (r.m_halfs.high), "=l" (r.m_halfs.low) : "r" (a), "r" (b)); ++ //typedef unsigned int uint128_t __attribute__((mode(TI))); ++ __uint128_t tmp = (__uint128_t) a * b; ++ r.m_halfs.high = tmp >> 64; ++ r.m_halfs.low = tmp; + #elif defined(_M_IX86) + // for testing + word64 t = (word64)a * b; +diff --git a/src/utils/lib/CryptoPP.h b/src/utils/lib/CryptoPP.h +index d2ec1b2..775a898 100644 +--- a/src/utils/lib/CryptoPP.h ++++ b/src/utils/lib/CryptoPP.h +@@ -1869,10 +1869,39 @@ template inline const T& STDMAX(const T& a, const T& b) + // #define GETBYTE(x, y) (((byte *)&(x))[y]) + + CRYPTOPP_DLL unsigned int Parity(unsigned long); +-CRYPTOPP_DLL unsigned int BytePrecision(unsigned long); +-CRYPTOPP_DLL unsigned int BitPrecision(unsigned long); + CRYPTOPP_DLL unsigned long Crop(unsigned long, unsigned int size); + ++template ++unsigned int BitPrecision(const T &value) ++{ ++ if (!value) ++ return 0; ++ ++ unsigned int l=0, h=8*sizeof(value); ++ ++ while (h-l > 1) ++ { ++ unsigned int t = (l+h)/2; ++ if (value >> t) ++ l = t; ++ else ++ h = t; ++ } ++ ++ return h; ++} ++ ++template ++unsigned int BytePrecision(const T &value) ++{ ++ unsigned int i; ++ for (i=sizeof(value); i; --i) ++ if (value >> (i-1)*8) ++ break; ++ ++ return i; ++} ++ + inline unsigned int BitsToBytes(unsigned int bitCount) + { + return ((bitCount+7)/(8)); diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 3c2e94c0595..53710c54eaf 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, perl, pkgconfig, gtk, libpcap, flex, bison}: stdenv.mkDerivation rec { - version = "1.4.0"; + version = "1.4.2"; name = "wireshark-${version}"; src = fetchurl { url = "http://www.wireshark.org/download/src/${name}.tar.bz2"; - sha256 = "1c0df77d11c643b1142b6ed3fd21e0c79b3f05f1749fe10e9ba5fd3beee8b743"; + sha256 = "1cj9n3yhahj6pabx1h1gas6b6dhwsljjz2w3ngky3a4g6bnf3ij4"; }; configureFlags = "--with-pcap=${libpcap}"; buildInputs = [perl pkgconfig gtk libpcap flex bison]; diff --git a/pkgs/applications/office/openoffice/default.nix b/pkgs/applications/office/openoffice/default.nix index 9c8b7cdb362..7c27bef0e45 100644 --- a/pkgs/applications/office/openoffice/default.nix +++ b/pkgs/applications/office/openoffice/default.nix @@ -6,24 +6,40 @@ , libXinerama, openssl, gperf, cppunit, GConf, ORBit2 }: -let version = "3.2.0"; in +let version = "3.2.1"; in stdenv.mkDerivation rec { name = "openoffice.org-${version}"; builder = ./builder.sh; - downloadRoot = "http://download.services.openoffice.org/files/stable"; + downloadRoot = "http://openoffice.mirrorbrain.org/files/stable"; versionDirs = true; src = fetchurl { url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_core.tar.bz2"; - sha256 = "0jl14rxmvhz86jlhhwqlbr9nfi9p271aknqxada9775qfm6bjjml"; + sha256 = "0gj2hinhnzkazh44k1an05x5cj7n6721f2grqrkjh31cm38r9p6i"; }; patches = [ ./oo.patch ./root-required.patch ]; + postPatch = + /* Compiling with GCC 4.5 fails: + + Compiling: cppu/source/AffineBridge/AffineBridge.cxx + [...] + ../../inc/uno/lbnames.h:67:2: error: #error "Supported gcc majors are 2 , 3 and 4 <= 4.4. Unsupported gcc major version." + + However, we can't compile with GCC 4.4 because then we'd end up with + two different versions of libstdc++ (because the deps are compiled + with 4.5), which isn't supported (link time error.) + + Thus, force compilation with 4.5 and hope for the best. */ + '' sed -i "cppu/inc/uno/lbnames.h" \ + -e 's/#[[:blank:]]*error "Supported.*$//g' + ''; + src_system = fetchurl { url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_system.tar.bz2"; - sha256 = "0nihw4iyh9qc188dkyfjr3zvp6ym6i1spm16j0cyh5rgxcrn6ycp"; + sha256 = "0giy3sza64ij19w7b06rxcrkrb5kq2fvkz486vh3mv08s8xa8zfc"; }; preConfigure = '' diff --git a/pkgs/applications/science/geometry/drgeo/default.nix b/pkgs/applications/science/geometry/drgeo/default.nix index ff52d366765..2b10ec238c9 100644 --- a/pkgs/applications/science/geometry/drgeo/default.nix +++ b/pkgs/applications/science/geometry/drgeo/default.nix @@ -11,7 +11,8 @@ rec { configureFlags = []; /* doConfigure should be specified separately */ - phaseNames = ["doConfigure" "doPreBuild" "doMakeInstall"]; + phaseNames = ["doPatch" "doConfigure" "doPreBuild" "doMakeInstall"]; + patches = [ ./struct.patch ]; doPreBuild = fullDepEntry ('' cp drgeo.desktop.in drgeo.desktop diff --git a/pkgs/applications/science/geometry/drgeo/struct.patch b/pkgs/applications/science/geometry/drgeo/struct.patch new file mode 100644 index 00000000000..7364cae5f58 --- /dev/null +++ b/pkgs/applications/science/geometry/drgeo/struct.patch @@ -0,0 +1,68 @@ +-- drgeo-1.1.0/debian/patches/00list +++ drgeo-1.1.0/debian/patches/00list +@ -7 +7 @@ + +07-fix_ftbfs-gcc-4.5.dpatch +nly in patch2: +nchanged: +-- drgeo-1.1.0.orig/debian/patches/07-fix_ftbfs-gcc-4.5.dpatch +++ drgeo-1.1.0/debian/patches/07-fix_ftbfs-gcc-4.5.dpatch +@ -0,0 +1,58 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07-fix_ftbfs-gcc-4.5.dpatch by Fabrice Coutadeur +## +## Description: fix FTBFS with gcc 4.5 with undefined reference to +## `drgeoDialogData' +## Author: Petr Gajdos +## Origin: https://build.opensuse.org/package/files?package=drgeo&project=openSUSE%3A11.3%3AContrib + +...@dpatch@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' drgeo-1.1.0~/geo/drgeo_dialog.cc drgeo-1.1.0/geo/drgeo_dialog.cc +--- drgeo-1.1.0~/geo/drgeo_dialog.cc 2003-10-27 10:17:25.000000000 +0000 ++++ drgeo-1.1.0/geo/drgeo_dialog.cc 2010-11-13 07:26:03.258908003 +0000 +@@ -38,12 +38,7 @@ + // Used in the style dialod callback, I know it's ugly, but so easy + static drgeoFigure *selected_figure; + +-struct +-{ +- drgeoPoint mouse; +- drgeoFigure *figure; +-} +-drgeoDialogData; ++DialogData drgeoDialogData; + + + static void drgeo_edit_dialog_cb (GtkWidget * dialog, +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' drgeo-1.1.0~/geo/drgeo_dialog.h drgeo-1.1.0/geo/drgeo_dialog.h +--- drgeo-1.1.0~/geo/drgeo_dialog.h 2003-06-12 22:30:23.000000000 +0000 ++++ drgeo-1.1.0/geo/drgeo_dialog.h 2010-11-13 07:26:03.258908003 +0000 +@@ -34,4 +34,11 @@ + } + + #endif /* __cplusplus */ ++ ++typedef struct ++{ ++ drgeoPoint mouse; ++ drgeoFigure *figure; ++} DialogData; ++ + #endif +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' drgeo-1.1.0~/geo/drgeo_figure.cc drgeo-1.1.0/geo/drgeo_figure.cc +--- drgeo-1.1.0~/geo/drgeo_figure.cc 2005-07-14 07:30:01.000000000 +0000 ++++ drgeo-1.1.0/geo/drgeo_figure.cc 2010-11-13 07:26:03.258908003 +0000 +@@ -48,12 +48,7 @@ + #include "drgeo_dialog.h" + #include "traite.h" + +-extern struct +-{ +- drgeoPoint mouse; +- drgeoFigure *figure; +-} +-drgeoDialogData; ++extern DialogData drgeoDialogData; + + typedef struct drgeoSearchValue + { diff --git a/pkgs/applications/science/logic/coq/coq-8.3-make-3.82-compat.patch b/pkgs/applications/science/logic/coq/coq-8.3-make-3.82-compat.patch new file mode 100644 index 00000000000..5176aa33ec8 --- /dev/null +++ b/pkgs/applications/science/logic/coq/coq-8.3-make-3.82-compat.patch @@ -0,0 +1,84 @@ +From: glondu +Date: Tue, 19 Oct 2010 13:22:08 +0000 (+0000) +Subject: Fix mixed implicit and normal rules +X-Git-Url: https://gforge.inria.fr/plugins/scmgit/cgi-bin/gitweb.cgi?p=coq%2Fcoq-svn.git;a=commitdiff_plain;h=86eb08bad450dd3fa77b11e4a34d2f493ab80d85 + +Fix mixed implicit and normal rules + +This fixes build with GNU Make 3.82. See threads: + + https://sympa-roc.inria.fr/wws/arc/coqdev/2010-10/msg00025.html + http://thread.gmane.org/gmane.comp.gnu.make.bugs/4912 + +git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/branches/v8.3@13566 85f007b7-540e-0410-9357-904b9bb8a0f7 +--- + +diff --git a/Makefile b/Makefile +index b1edc01..ea73c51 100644 +--- a/Makefile ++++ b/Makefile +@@ -160,9 +160,19 @@ else + stage1 $(STAGE1_TARGETS) : always + $(call stage-template,1) + ++ifneq (,$(STAGE1_IMPLICITS)) ++$(STAGE1_IMPLICITS) : always ++ $(call stage-template,1) ++endif ++ + stage2 $(STAGE2_TARGETS) : stage1 + $(call stage-template,2) + ++ifneq (,$(STAGE2_IMPLICITS)) ++$(STAGE2_IMPLICITS) : stage1 ++ $(call stage-template,2) ++endif ++ + # Nota: + # - world is one of the targets in $(STAGE2_TARGETS), hence launching + # "make" or "make world" leads to recursion into stage1 then stage2 +diff --git a/Makefile.common b/Makefile.common +index cc38980..46bf217 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -365,7 +365,7 @@ DATE=$(shell LANG=C date +"%B %Y") + + SOURCEDOCDIR=dev/source-doc + +-CAML_OBJECT_PATTERNS:=%.cmo %.cmx %.cmi %.cma %.cmxa %.cmxs %.dep.ps %.dot ++CAML_OBJECT_PATTERNS:=%.cmo %.cmx %.o %.cmi %.cma %.cmxa %.a %.cmxs %.dep.ps %.dot + + ### Targets forwarded by Makefile to a specific stage: + +@@ -374,10 +374,12 @@ CAML_OBJECT_PATTERNS:=%.cmo %.cmx %.cmi %.cma %.cmxa %.cmxs %.dep.ps %.dot + STAGE1_TARGETS:= $(STAGE1) $(COQDEPBOOT) \ + $(GENFILES) \ + source-doc revision toplevel/mltop.byteml toplevel/mltop.optml \ +- $(STAGE1_ML4:.ml4=.ml4-preprocessed) %.o ++ $(STAGE1_ML4:.ml4=.ml4-preprocessed) ++ ++STAGE1_IMPLICITS:= + + ifdef CM_STAGE1 +- STAGE1_TARGETS+=$(CAML_OBJECT_PATTERNS) ++ STAGE1_IMPLICITS+=$(CAML_OBJECT_PATTERNS) + endif + + ## Enumeration of targets that require being done at stage2 +@@ -402,12 +404,13 @@ STAGE2_TARGETS:=$(COQBINARIES) lib kernel byterun library proofs tactics \ + printers debug initplugins plugins \ + world install coqide coqide-files coq coqlib \ + coqlight states check init theories theories-light \ +- $(DOC_TARGETS) $(VO_TARGETS) validate \ +- %.vo %.glob states/% install-% %.ml4-preprocessed \ ++ $(DOC_TARGETS) $(VO_TARGETS) validate ++ ++STAGE2_IMPLICITS:= %.vo %.glob states/% install-% %.ml4-preprocessed \ + $(DOC_TARGET_PATTERNS) + + ifndef CM_STAGE1 +- STAGE2_TARGETS+=$(CAML_OBJECT_PATTERNS) ++ STAGE2_IMPLICITS+=$(CAML_OBJECT_PATTERNS) + endif + + diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index 741b780a237..a804d9f84e6 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { buildFlags = "world"; # Debug with "world VERBOSE=1"; - patches = [ ./configure.patch ]; + patches = [ ./configure.patch ./coq-8.3-make-3.82-compat.patch ]; postPatch = '' UNAME=$(type -tp uname) diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix index 148e95acee0..7b97e1a82c0 100644 --- a/pkgs/applications/science/math/yacas/default.nix +++ b/pkgs/applications/science/math/yacas/default.nix @@ -9,10 +9,29 @@ stdenv.mkDerivation rec { }; # Perl is only for the documentation - buildInputs = [ perl ]; + buildNativeInputs = [ perl ]; patches = [ ./gcc43.patch ]; + crossAttrs = { + # Trick to get host-built programs needed for the cross-build. + # If yacas had proper makefiles, this would not be needed. + preConfigure = '' + ./configure + pushd src + make mkfastprimes + cp mkfastprimes ../.. + popd + pushd manmake + make manripper removeduplicates + cp manripper removeduplicates ../.. + popd + ''; + preBuild = '' + cp ../mkfastprimes ../manripper ../removeduplicates src + ''; + }; + meta = { description = "Easy to use, general purpose Computer Algebra System"; homepage = http://yacas.sourceforge.net/; diff --git a/pkgs/applications/science/misc/simgrid/default.nix b/pkgs/applications/science/misc/simgrid/default.nix index 10d5798b331..5ba30a0f830 100644 --- a/pkgs/applications/science/misc/simgrid/default.nix +++ b/pkgs/applications/science/misc/simgrid/default.nix @@ -1,11 +1,11 @@ -{ fetchurl, stdenv, cmake, ruby }: +{ fetchurl, stdenv, cmake, perl, ruby }: stdenv.mkDerivation rec { - name = "simgrid-3.4.1"; + name = "simgrid-3.5"; src = fetchurl { - url = "https://gforge.inria.fr/frs/download.php/26944/${name}.tar.bz2"; - sha256 = "acd2bb2c1abf59e9b190279b1c38582b7c1edd4b6ef4c6a9b01100740f1a6b28"; + url = "https://gforge.inria.fr/frs/download.php/28017/${name}.tar.gz"; + sha256 = "1vd4pvrcyii1nfwyca3kpbwshbc965lfpn083zd8rigg6ydchq8y"; }; /* FIXME: Ruby currently disabled because of this: @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { ld: cannot find -lruby-1.8.7-p72 */ - buildInputs = [ cmake /* ruby */ ]; + buildInputs = [ cmake perl /* ruby */ ]; preConfigure = # Make it so that libsimgrid.so will be found when running programs from @@ -28,14 +28,31 @@ stdenv.mkDerivation rec { makeFlags = "VERBOSE=1"; + preBuild = + /* Work around this: + + [ 20%] Generating _msg_handle_simulator.c, _msg_handle_client.c, _msg_handle_server.c + cd /tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/build/teshsuite/gras/msg_handle && ../../../bin/gras_stub_generator msg_handle /tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/teshsuite/gras/msg_handle/msg_handle.xml + ../../../bin/gras_stub_generator: error while loading shared libraries: libsimgrid.so.3.5: cannot open shared object file: No such file or directory + make[2]: *** [teshsuite/gras/msg_handle/_msg_handle_simulator.c] Error 127 + make[2]: Leaving directory `/tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/build' + + */ + '' export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH" + echo "\$LD_LIBRARY_PATH is \`$LD_LIBRARY_PATH'" + ''; + patchPhase = '' for i in "src/smpi/"* do sed -i "$i" -e's|/bin/bash|/bin/sh|g' done - ''; - installPhase = "make install-simgrid"; + for i in $(grep -rl /usr/bin/perl .) + do + sed -i "$i" -e's|/usr/bin/perl|${perl}/bin/perl|g' + done + ''; # Fixing the few tests that fail is left as an exercise to the reader. doCheck = false; diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix index 1b7fc738303..5feb8a429e3 100644 --- a/pkgs/applications/version-management/fossil/default.nix +++ b/pkgs/applications/version-management/fossil/default.nix @@ -12,22 +12,23 @@ stdenv.mkDerivation { sha256 = "1yx35gq9ialvnvjn1r5yar4zxgy0rkxzyz9paxwy8qan3qb53mwz"; }; - buildInputs = [ zlib openssl tcl ]; - buildNativeInputs = [ zlib openssl ]; + buildInputs = [ zlib openssl ]; + buildNativeInputs = [ tcl ]; doCheck = true; checkTarget = "test"; - crossAttrs = { - doCheck = false; - }; - installPhase = '' ensureDir $out/bin INSTALLDIR=$out/bin make install ''; + crossAttrs = { + doCheck = false; + makeFlagsArray = [ "TCC=${stdenv.cross.config}-gcc" ]; + }; + meta = { description = "Simple, high-reliability, distributed software configuration management."; longDescription = '' diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix index ff4154e0e5f..11391cea975 100644 --- a/pkgs/applications/video/MPlayer/default.nix +++ b/pkgs/applications/video/MPlayer/default.nix @@ -1,19 +1,35 @@ { alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true , xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true , stdenv, fetchurl, x11, freetype, fontconfig, zlib -, alsaLib, libX11, libXv, libtheora, libcaca -, libXinerama, libXrandr, libdvdnav -, cdparanoia, cddaSupport ? true -, pulseaudio, pulseSupport ? true -, amrnb, amrwb, amrSupport ? false -, jackaudioSupport ? false, jackaudio -, x264Support ? true, x264 -, xvidSupport ? true, xvidcore -, lameSupport ? true, lame +, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null +, libXinerama ? null, libXrandr ? null, libdvdnav ? null +, cdparanoia ? null, cddaSupport ? true +, amrnb ? null, amrwb ? null, amrSupport ? false +, x11Support ? true, libX11 ? null, libXext ? null +, jackaudioSupport ? false, jackaudio ? null +, x264Support ? false, x264 ? null +, xvidSupport ? false, xvidcore ? null +, lameSupport ? true, lame ? null , screenSaverSupport ? true, libXScrnSaver -, mesa, pkgconfig, unzip, yasm +, pulseSupport ? false, pulseaudio +, mesa, pkgconfig, unzip, yasm, freefont_ttf +, vdpauSupport ? false, libvdpau ? null }: +assert alsaSupport -> alsaLib != null; +assert x11Support -> libX11 != null; +assert xvSupport -> (libXv != null && x11Support); +assert theoraSupport -> libtheora != null; +assert cacaSupport -> libcaca != null; +assert xineramaSupport -> (libXinerama != null && x11Support); +assert randrSupport -> (libXrandr != null && x11Support); +assert dvdnavSupport -> libdvdnav != null; +assert cddaSupport -> cdparanoia != null; +assert jackaudioSupport -> jackaudio != null; +assert amrSupport -> (amrnb != null && amrwb != null); +assert screenSaverSupport -> libXScrnSaver != null; +assert vdpauSupport -> libvdpau != null; + let codecs_src = @@ -49,15 +65,16 @@ let in stdenv.mkDerivation rec { - name = "MPlayer-1.0-pre31984"; + name = "MPlayer-1.0-pre20101227"; src = fetchurl { - url = "http://www.loegria.net/misc/${name}.tar.bz2"; - sha256 = "0mg6kggja113rsvvsk05gk50xl5qwzsms6pmb4ylc99mflh7m9km"; + url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2; + sha256 = "0q9rvjz3byvs0qlnb9jbnw3qs6c3vdcqaqxm1rnql8kqic442hv2"; }; buildInputs = - [ x11 libXv freetype zlib mesa pkgconfig yasm ] + [ freetype zlib pkgconfig ] + ++ stdenv.lib.optional x11Support [ libX11 libXext mesa ] ++ stdenv.lib.optional alsaSupport alsaLib ++ stdenv.lib.optional xvSupport libXv ++ stdenv.lib.optional theoraSupport libtheora @@ -72,20 +89,42 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional xvidSupport xvidcore ++ stdenv.lib.optional pulseSupport pulseaudio ++ stdenv.lib.optional screenSaverSupport libXScrnSaver - ++ stdenv.lib.optional lameSupport lame; + ++ stdenv.lib.optional lameSupport lame + ++ stdenv.lib.optional vdpauSupport libvdpau; + + buildNativeInputs = [ yasm ]; configureFlags = '' ${if cacaSupport then "--enable-caca" else "--disable-caca"} ${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""} ${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""} ${if codecs != null then "--codecsdir=${codecs}" else ""} - --enable-runtime-cpudetection - --enable-x11 + ${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""} + ${if x11Support then "--enable-x11" else ""} --disable-xanim --disable-ivtv ''; - NIX_LDFLAGS = "-lX11 -lXext"; + NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else ""; + + # Provide a reasonable standard font. Maybe we should symlink here. + postInstall = + '' + mkdir -p $out/share/mplayer + cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf + ''; + + crossAttrs = { + preConfigure = '' + configureFlags="`echo $configureFlags | + sed -e 's/--build[^ ]\+//' \ + -e 's/--host[^ ]\+//' \ + -e 's/--codecsdir[^ ]\+//' \ + -e 's/--enable-runtime-cpudetection//' `" + configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux + --cc=$crossConfig-gcc --as=$crossConfig-as" + ''; + }; meta = { description = "A movie player that supports many video formats"; diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index b7a7d1ed31f..4c93a277e98 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -44,6 +44,9 @@ stdenv.mkDerivation { [ # Xen looks for headers in /usr/include and for libraries using # ldconfig. Don't do that. ./has-header.patch + + # GCC 4.5 compatibility. + ./gcc-4.5.patch ]; buildInputs = @@ -101,6 +104,10 @@ stdenv.mkDerivation { ${flip concatMapStrings stubdomSrcs (x: let src = fetchurl x; in '' cp ${src} stubdom/${src.name} '')} + + # Hack to get `gcc -m32' to work without having 32-bit Glibc headers. + mkdir -p tools/include/gnu + touch tools/include/gnu/stubs-32.h ''; postBuild = diff --git a/pkgs/applications/virtualization/xen/gcc-4.5.patch b/pkgs/applications/virtualization/xen/gcc-4.5.patch new file mode 100644 index 00000000000..a8412d69fd3 --- /dev/null +++ b/pkgs/applications/virtualization/xen/gcc-4.5.patch @@ -0,0 +1,39 @@ +http://lists.xensource.com/archives/html/xen-devel/2010-07/msg01276.html + +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c xen-4.0.1//extras/mini-os/arch/x86/mm.c +--- xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/arch/x86/mm.c 2010-12-22 20:10:05.000000000 +0100 +@@ -281,7 +281,7 @@ + /* + * Mark portion of the address space read only. + */ +-extern void shared_info; ++extern char shared_info[PAGE_SIZE]; + static void set_readonly(void *text, void *etext) + { + unsigned long start_address = +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/minios.mk xen-4.0.1//extras/mini-os/minios.mk +--- xen-4.0.1-orig//extras/mini-os/minios.mk 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/minios.mk 2010-12-22 20:03:11.000000000 +0100 +@@ -10,6 +10,7 @@ + DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) + DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline) + DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline ++DEF_CFLAGS += -Wno-uninitialized + DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION) + + DEF_ASFLAGS += -D__ASSEMBLY__ +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/netfront.c xen-4.0.1//extras/mini-os/netfront.c +--- xen-4.0.1-orig//extras/mini-os/netfront.c 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/netfront.c 2010-12-22 19:56:59.000000000 +0100 +@@ -25,8 +25,8 @@ + + + +-#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE) +-#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE) ++#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE) ++#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE) + #define GRANT_INVALID_REF 0 + + diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix index 5394b7f507b..02096cd6141 100644 --- a/pkgs/applications/window-managers/icewm/default.nix +++ b/pkgs/applications/window-managers/icewm/default.nix @@ -1,18 +1,25 @@ -{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, imlib, xlibs }: +{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, imlib, xlibs, automake, pkgconfig, + gtk }: stdenv.mkDerivation rec { - name = "icewm-1.2.37"; + name = "icewm-1.3.6"; buildInputs = [ gettext libjpeg libtiff libungif libpng imlib xlibs.libX11 xlibs.libXft xlibs.libXext xlibs.libXinerama xlibs.libXrandr + pkgconfig gtk ]; src = fetchurl { url = "mirror://sourceforge/icewm/${name}.tar.gz"; - sha256 = "15852k96z2w19v3d02jynxyf6ld378hbkd6lpy64byysrmjh3dmz"; + sha256 = "1pr7rc10rddwvy4ncng4mf5fpxd1nqjsw34xba9ngsg32rg57b91"; }; + # The fuloong2f is not supported by 1.3.6 still + preConfigure = '' + cp ${automake}/share/automake*/config.{sub,guess} . + ''; + meta = { description = "A window manager for the X Window System"; homepage = http://www.icewm.org/; diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index abb133cd50a..2b4e382928f 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -122,14 +122,9 @@ rec { http://ftp.cc.uoc.gr/mirrors/nongnu.org/ http://ftp.twaren.net/Unix/NonGNU/ http://mirror.csclub.uwaterloo.ca/nongnu/ - http://mirror.publicns.net/pub/nongnu/ http://nongnu.askapache.com/ - http://nongnu.bigsearcher.com/ http://savannah.c3sl.ufpr.br/ http://www.centervenus.com/mirrors/nongnu/ - http://www.de-mirrors.de/nongnu/ - http://www.very-clever.com/download/nongnu/ - http://www.wikifusion.info/nongnu/ ]; # BitlBee mirrors, see http://www.bitlbee.org/main.php/mirrors.html . diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh index 674c2b89b52..fae37342940 100644 --- a/pkgs/build-support/gcc-cross-wrapper/builder.sh +++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh @@ -1,34 +1,51 @@ source $stdenv/setup +mkdir $out +mkdir $out/bin +mkdir $out/nix-support # Force gcc to use ld-wrapper.sh when calling ld. cflagsCompile="-B$out/bin/" if test -z "$nativeLibc"; then - cflagsCompile="$cflagsCompile -B$libc/lib/ -isystem $libc/include" + cflagsCompile="$cflagsCompile -B$gccLibs/lib -B$libc/lib/ -isystem $libc/include" ldflags="$ldflags -L$libc/lib" # Get the proper dynamic linker for glibc and uclibc. dlinker=`eval 'echo $libc/lib/ld*.so.?'` if [ -n "$dlinker" ]; then ldflagsBefore="-dynamic-linker $dlinker" + + # The same as above, but put into files, useful for the gcc builder. + echo $dlinker > $out/nix-support/dynamic-linker + # This trick is to avoid dependencies on the cross-toolchain gcc + # for libgcc, libstdc++, ... + # -L is for libtool's .la files, and -rpath for the usual fixupPhase + # shrinking rpaths. + if [ -n "$gccLibs" ]; then + ldflagsBefore="$ldflagsBefore -rpath $gccLibs/lib" + fi fi + + echo "$cflagsCompile -B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags + + echo "-L$libc/lib" > $out/nix-support/libc-ldflags + + # The dynamic linker is passed in `ldflagsBefore' to allow + # explicit overrides of the dynamic linker by callers to gcc/ld + # (the *last* value counts, so ours should come first). + echo "$ldflagsBefore" > $out/nix-support/libc-ldflags-before fi if test -n "$nativeTools"; then gccPath="$nativePrefix/bin" ldPath="$nativePrefix/bin" else - ldflags="$ldflags -L$gcc/lib" + ldflags="$ldflags -L$gcc/lib -L$gcc/lib64" gccPath="$gcc/bin" ldPath="$binutils/$crossConfig/bin" fi -mkdir $out -mkdir $out/bin -mkdir $out/nix-support - - doSubstitute() { local src=$1 local dst=$2 diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix index 362e378273d..8bf820e3d34 100644 --- a/pkgs/build-support/gcc-cross-wrapper/default.nix +++ b/pkgs/build-support/gcc-cross-wrapper/default.nix @@ -13,6 +13,23 @@ assert nativeTools -> nativePrefix != ""; assert !nativeTools -> gcc != null && binutils != null; assert !noLibc -> (!nativeLibc -> libc != null); +let + chosenName = if name == "" then gcc.name else name; + gccLibs = stdenv.mkDerivation { + name = chosenName + "-libs"; + phases = [ "installPhase" ]; + installPhase = '' + echo $out + ensureDir $out + cp -Rd ${gcc}/${cross.config}/lib $out/lib + chmod -R +w $out/lib + for a in $out/lib/*.la; do + sed -i -e s,${gcc}/${cross.config}/lib,$out/lib,g $a + done + rm -f $out/lib/*.py + ''; + }; +in stdenv.mkDerivation { builder = ./builder.sh; setupHook = ./setup-hook.sh; @@ -22,7 +39,8 @@ stdenv.mkDerivation { addFlags = ./add-flags; inherit nativeTools nativeLibc nativePrefix gcc libc binutils; crossConfig = if (cross != null) then cross.config else null; - name = if name == "" then gcc.name else name; + gccLibs = if gcc != null then gccLibs else null; + name = chosenName; langC = if nativeTools then true else gcc.langC; langCC = if nativeTools then true else gcc.langCC; langF77 = if nativeTools then false else gcc ? langFortran; diff --git a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh index 491de8f7f98..98baafb4878 100644 --- a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh @@ -75,14 +75,18 @@ if test "$dontLink" != "1"; then # Add the flags that should be passed to the linker (and prevent # `ld-wrapper' from adding NIX_CROSS_LDFLAGS again). for i in $NIX_CROSS_LDFLAGS_BEFORE; do - extraBefore=(${extraBefore[@]} "-Wl,$i") + if test "${i:0:3}" = "-L/"; then + extraBefore=(${extraBefore[@]} "$i") + else + extraBefore=(${extraBefore[@]} "-Wl,$i") + fi done for i in $NIX_CROSS_LDFLAGS; do - if test "${i:0:3}" = "-L/"; then - extraAfter=(${extraAfter[@]} "$i") - else - extraAfter=(${extraAfter[@]} "-Wl,$i") - fi + if test "${i:0:3}" = "-L/"; then + extraAfter=(${extraAfter[@]} "$i") + else + extraAfter=(${extraAfter[@]} "-Wl,$i") + fi done export NIX_CROSS_LDFLAGS_SET=1 diff --git a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh index 0c98062a2db..a7be09283ee 100644 --- a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh @@ -26,7 +26,7 @@ crossStripDirs() { dirs=${dirsNew} if test -n "${dirs}"; then - header "stripping (with flags $stripFlags) in $dirs" + header "cross stripping (with flags $stripFlags) in $dirs" # libc_nonshared.a should never be stripped, or builds will break. find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $crossConfig-strip $stripFlags || true stopNest @@ -68,7 +68,9 @@ if test -n "@libc@"; then crossAddCVars @libc@ fi -configureFlags="$configureFlags --build=$system --host=$crossConfig" +if test "$dontSetConfigureCross" != "1"; then + configureFlags="$configureFlags --build=$system --host=$crossConfig" +fi # Disabling the tests when cross compiling, as usually the tests are meant for # native compilations. doCheck="" diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index c97fd4eb495..4e486f8fc64 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -50,7 +50,25 @@ stdenv.mkDerivation { langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; zlib = if (gcc != null && gcc ? langVhdl) then zlib else null; - shell = if shell == "" then stdenv.shell else shell; + shell = if shell == "" then stdenv.shell else + if builtins.isAttrs shell then (shell + shell.shellPath) + else shell; + + crossAttrs = { + shell = shell.hostDrv + shell.hostDrv.shellPath; + libc = libc.hostDrv; + coreutils = coreutils.hostDrv; + binutils = binutils.hostDrv; + gcc = gcc.hostDrv; + # + # This is not the best way to do this. I think the reference should be + # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I + # do this sufficient if/else. + dynamicLinker = + (if stdenv.cross.arch == "arm" then "ld-linux.so.3" else + if stdenv.cross.arch == "mips" then "ld.so.1" else + abort "don't know the name of the dynamic linker for this platform"); + }; meta = let gcc_ = if gcc != null then gcc else {}; in @@ -67,6 +85,7 @@ stdenv.mkDerivation { if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else if stdenv.system == "armv5tel-linux" then "ld-linux.so.3" else if stdenv.system == "powerpc-linux" then "ld.so.1" else + if stdenv.system == "mips64-linux" then "ld.so.1" else abort "don't know the name of the dynamic linker for this platform") else ""; } diff --git a/pkgs/build-support/gcc-wrapper/default2.nix b/pkgs/build-support/gcc-wrapper/default2.nix deleted file mode 100644 index efade01963b..00000000000 --- a/pkgs/build-support/gcc-wrapper/default2.nix +++ /dev/null @@ -1,72 +0,0 @@ -# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't -# know where the C library and standard header files are. Therefore -# the compiler produced by that package cannot be installed directly -# in a user environment and used from the command line. This -# stdenv.mkDerivation provides a wrapper that sets up the right environment -# variables so that the compiler and the linker just "work". - -{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" -, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" -, zlib ? null -}: - -assert nativeTools -> nativePrefix != ""; -assert !nativeTools -> gcc != null && binutils != null && coreutils != null; -assert !nativeLibc -> libc != null; - -# For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper -assert (gcc != null && gcc ? langVhdl && gcc.langVhdl) -> zlib != null; - -let - - gccVersion = (builtins.parseDrvName gcc.name).version; - gccName = (builtins.parseDrvName gcc.name).name; - -in - -stdenv.mkDerivation { - name = - (if name != "" then name else gccName + "-wrapper") + - (if gcc != null && gccVersion != "" then "-" + gccVersion else ""); - - builder = ./builder.sh; - setupHook = ./setup-hook.sh; - gccWrapper = ./gcc-wrapper.sh; - gnatWrapper = ./gnat-wrapper.sh; - gnatlinkWrapper = ./gnatlink-wrapper.sh; - ldWrapper = ./ld-wrapper2.sh; - utils = ./utils.sh; - addFlags = ./add-flags; - - inherit nativeTools nativeLibc nativePrefix gcc; - libc = if nativeLibc then null else libc; - binutils = if nativeTools then null else binutils; - # The wrapper scripts use 'cat', so we may need coreutils - coreutils = if nativeTools then null else coreutils; - - langC = if nativeTools then true else gcc.langC; - langCC = if nativeTools then true else gcc.langCC; - langFortran = if nativeTools then false else gcc ? langFortran; - langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; - langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; - zlib = if (gcc != null && gcc ? langVhdl) then zlib else null; - shell = if shell == "" then stdenv.shell else shell; - - meta = - let gcc_ = if gcc != null then gcc else {}; in - (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) // - { description = - stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_ - + " (wrapper script)"; - }; - - # The dynamic linker has different names on different Linux platforms. - dynamicLinker = - if !nativeLibc then - (if stdenv.system == "i686-linux" then "ld-linux.so.2" else - if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else - if stdenv.system == "armv5tel-linux" then "ld-linux.so.3" else - if stdenv.system == "powerpc-linux" then "ld.so.1" else - abort "don't know the name of the dynamic linker for this platform") - else ""; -} diff --git a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh index 3ca9e815a8f..74b6273848e 100644 --- a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh @@ -82,6 +82,13 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then rpath="$rpath $1 " } + libs="" + addToLibs() { + libs="$libs $1" + } + + rpath="" + # First, find all -L... switches. allParams=("${params[@]}" ${extra[@]}) n=0 @@ -93,6 +100,16 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then elif test "$p" = "-L"; then addToLibPath ${p2} n=$((n + 1)) + elif test "$p" = "-l"; then + addToLibs ${p2} + n=$((n + 1)) + elif test "${p:0:2}" = "-l"; then + addToLibs ${p:2} + elif test "$p" = "-dynamic-linker"; then + # Ignore the dynamic linker argument, or it + # will get into the next 'elif'. We don't want + # the dynamic linker path rpath to go always first. + n=$((n + 1)) elif [[ "$p" =~ ^[^-].*\.so($|\.) ]]; then # This is a direct reference to a shared library, so add # its directory to the rpath. @@ -105,24 +122,16 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then # Second, for each directory in the library search path (-L...), # see if it contains a dynamic library used by a -l... flag. If # so, add the directory to the rpath. - rpath="" + # It's important to add the rpath in the order of -L..., so + # the link time chosen objects will be those of runtime linking. for i in $libPath; do - n=0 - while test $n -lt ${#allParams[*]}; do - p=${allParams[n]} - p2=${allParams[$((n+1))]} - if test "${p:0:2}" = "-l" -a -f "$i/lib${p:2}.so"; then - addToRPath $i - break - elif test "$p" = "-l" -a -f "$i/lib${p2}"; then - # I haven't seen `-l foo', but you never know... + for j in $libs; do + if test -f "$i/lib$j.so"; then addToRPath $i break fi - n=$((n + 1)) done - done diff --git a/pkgs/build-support/gcc-wrapper/ld-wrapper2.sh b/pkgs/build-support/gcc-wrapper/ld-wrapper2.sh deleted file mode 100644 index 99ba3968ae3..00000000000 --- a/pkgs/build-support/gcc-wrapper/ld-wrapper2.sh +++ /dev/null @@ -1,154 +0,0 @@ -#! @shell@ -e - -if test -n "$NIX_LD_WRAPPER_START_HOOK"; then - source "$NIX_LD_WRAPPER_START_HOOK" -fi - -if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then - source @out@/nix-support/add-flags.sh -fi - -source @out@/nix-support/utils.sh - - -# Optionally filter out paths not refering to the store. -params=("$@") -if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ - -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then - rest=() - n=0 - while test $n -lt ${#params[*]}; do - p=${params[n]} - p2=${params[$((n+1))]} - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then - skip $p - elif test "$p" = "-L" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "$p" = "-rpath" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "$p" = "-dynamic-linker" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "${p:0:1}" = "/" && badPath "$p"; then - # We cannot skip this; barf. - echo "impure path \`$p' used in link" >&2 - exit 1 - else - rest=("${rest[@]}" "$p") - fi - n=$((n + 1)) - done - params=("${rest[@]}") -fi - - -extra=() -extraBefore=() - -if test -z "$NIX_LDFLAGS_SET"; then - extra=(${extra[@]} $NIX_LDFLAGS) - extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE) -fi - - -# Add all used dynamic libraries to the rpath. -if test "$NIX_DONT_SET_RPATH" != "1"; then - - libPath="" - addToLibPath() { - local path="$1" - if test "${path:0:1}" != "/"; then return 0; fi - case "$path" in - *..*|*./*|*/.*|*//*) - local path2 - if path2=$(readlink -f "$path"); then - path="$path2" - fi - ;; - esac - case $libPath in - *\ $path\ *) return 0 ;; - esac - libPath="$libPath $path " - } - - addToRPath() { - # If the path is not in the store, don't add it to the rpath. - # This typically happens for libraries in /tmp that are later - # copied to $out/lib. If not, we're screwed. - if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi - case $rpath in - *\ $1\ *) return 0 ;; - esac - rpath="$rpath $1 " - } - - libs="" - addToLibs() { - libs="$libs $1" - } - - rpath="" - - # First, find all -L... switches. - allParams=("${params[@]}" ${extra[@]}) - n=0 - while test $n -lt ${#allParams[*]}; do - p=${allParams[n]} - p2=${allParams[$((n+1))]} - if test "${p:0:3}" = "-L/"; then - addToLibPath ${p:2} - elif test "$p" = "-L"; then - addToLibPath ${p2} - n=$((n + 1)) - elif test "$p" = "-l"; then - addToLibs ${p2} - n=$((n + 1)) - elif test "${p:0:2}" = "-l"; then - addToLibs ${p:2} - elif [[ "$p" =~ ^[^-].*\.so($|\.) ]]; then - # This is a direct reference to a shared library, so add - # its directory to the rpath. - path="$(dirname "$p")"; - addToRPath "${path}" - fi - n=$((n + 1)) - done - - # Second, for each directory in the library search path (-L...), - # see if it contains a dynamic library used by a -l... flag. If - # so, add the directory to the rpath. - - for i in $libs; do - for j in $libPath; do - if test -f "$j/lib$i.so"; then - addToRPath $j - break - fi - done - done - - - # Finally, add `-rpath' switches. - for i in $rpath; do - extra=(${extra[@]} -rpath $i) - done -fi - - -# Optionally print debug info. -if test "$NIX_DEBUG" = "1"; then - echo "original flags to @ld@:" >&2 - for i in "${params[@]}"; do - echo " $i" >&2 - done - echo "extra flags to @ld@:" >&2 - for i in ${extra[@]}; do - echo " $i" >&2 - done -fi - -if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then - source "$NIX_LD_WRAPPER_EXEC_HOOK" -fi - -exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]} diff --git a/pkgs/desktops/gnome-2.28/default.nix b/pkgs/desktops/gnome-2.28/default.nix index 0efd9d20dfa..7e8c4192052 100644 --- a/pkgs/desktops/gnome-2.28/default.nix +++ b/pkgs/desktops/gnome-2.28/default.nix @@ -228,7 +228,7 @@ pkgs.makeOverridable # Removed from recent GNOME releases, but still required scrollkeeper = import ./desktop/scrollkeeper { - inherit (pkgs) stdenv fetchurl pkgconfig perl perlXMLParser libxml2 libxslt docbook_xml_dtd_42; + inherit (pkgs) stdenv fetchurl pkgconfig perl perlXMLParser libxml2 libxslt docbook_xml_dtd_42 automake; }; # scrollkeeper replacement diff --git a/pkgs/desktops/gnome-2.28/desktop/scrollkeeper/default.nix b/pkgs/desktops/gnome-2.28/desktop/scrollkeeper/default.nix index a63d179ff94..97dcbf4e004 100644 --- a/pkgs/desktops/gnome-2.28/desktop/scrollkeeper/default.nix +++ b/pkgs/desktops/gnome-2.28/desktop/scrollkeeper/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, pkgconfig, perl, perlXMLParser, libxml2, libxslt, docbook_xml_dtd_42}: +{stdenv, fetchurl, pkgconfig, perl, perlXMLParser, libxml2, libxslt, docbook_xml_dtd_42, automake}: stdenv.mkDerivation { name = "scrollkeeper-0.3.14"; @@ -6,9 +6,13 @@ stdenv.mkDerivation { url = mirror://gnome/sources/scrollkeeper/0.3/scrollkeeper-0.3.14.tar.bz2; sha256 = "08n1xgj1f53zahwm0wpn3jid3rfbhi3iwby0ilaaldnid5qriqgc"; }; + + # The fuloong2f is not supported by scrollkeeper-0.3.14 config.guess preConfigure = " substituteInPlace extract/dtds/Makefile.am --replace /usr/bin/xmlcatalog xmlcatalog + cp ${automake}/share/automake*/config.{sub,guess} . "; + buildInputs = [pkgconfig perl perlXMLParser libxml2 libxslt]; configureFlags = "--with-xml-catalog=${docbook_xml_dtd_42}/xml/dtd/docbook/docbook.cat"; } diff --git a/pkgs/desktops/kde-4.4/support/phonon/phonon-4.4.1-gst-plugins-include.patch b/pkgs/desktops/kde-4.4/support/phonon/phonon-4.4.1-gst-plugins-include.patch new file mode 100644 index 00000000000..46782840570 --- /dev/null +++ b/pkgs/desktops/kde-4.4/support/phonon/phonon-4.4.1-gst-plugins-include.patch @@ -0,0 +1,263 @@ +From 1e3a6c25bc258021899c0a31ea9b68ea656d8f6b Mon Sep 17 00:00:00 2001 +From: Yury G. Kudryashov +Date: Sat, 8 May 2010 18:42:35 +0400 +Subject: [PATCH] Find include directories as well + +Makes it possible to compile phonon if gstreamer and gst-plugins-base are +installed into different prefixes. Theoretically, should work even if each +plugin is installed into dedicated prefix, but this feature is not tested. +--- + cmake/FindGStreamerPlugins.cmake | 160 +++++++++++++++----------------------- + gstreamer/CMakeLists.txt | 4 +- + gstreamer/ConfigureChecks.cmake | 10 +- + 3 files changed, 72 insertions(+), 102 deletions(-) + +diff --git a/cmake/FindGStreamerPlugins.cmake b/cmake/FindGStreamerPlugins.cmake +index f6d70d5..9e7a4d0 100644 +--- a/cmake/FindGStreamerPlugins.cmake ++++ b/cmake/FindGStreamerPlugins.cmake +@@ -2,19 +2,63 @@ + # Once done this will define + # + # GSTREAMERPLUGINSBASE_FOUND - system has GStreamer_Plugins +-# GSTREAMERPLUGINSBASE_INCLUDE_DIR - the GStreamer_Plugins include directory ++# GSTREAMERPLUGINSBASE_INCLUDE_DIRS - the GStreamer_Plugins include directories + # GSTREAMERPLUGINSBASE_LIBRARIES - the libraries needed to use GStreamer_Plugins +-# GSTREAMERPLUGINSBASE_DEFINITIONS - Compiler switches required for using GStreamer_Plugins ++# ++# The following variables are set for each plugin PLUGINNAME: ++# ++# GSTREAMER_PLUGIN_PLUGINNAME_FOUND - plugin is found ++# GSTREAMER_PLUGIN_PLUGINNAME_INCLUDE_DIR - plugin include directory ++# GSTREAMER_PLUGIN_PLUGINNAME_LIBRARY - the library needed to use plugin + # + # (c)2009 Nokia Corporation ++# (c)2010 Yury G. Kudryashov + + FIND_PACKAGE(PkgConfig REQUIRED) + + IF (NOT WIN32) + # don't make this check required - otherwise you can't use macro_optional_find_package on this one +- PKG_CHECK_MODULES( PKG_GSTREAMER gstreamer-plugins-base-0.10 ) ++ PKG_CHECK_MODULES( PKG_GSTREAMER_PLUGINSBASE gstreamer-plugins-base-0.10 ) + ENDIF (NOT WIN32) + ++MACRO(MACRO_FIND_GSTREAMER_PLUGIN _plugin _header) ++ STRING(TOUPPER ${_plugin} _upper) ++ IF (NOT WIN32) ++ # don't make this check required - otherwise you can't use macro_optional_find_package on this one ++ PKG_CHECK_MODULES( PKG_GSTREAMER_${_upper} gstreamer-${_plugin}-0.10 ) ++ ENDIF (NOT WIN32) ++ ++ FIND_LIBRARY(GSTREAMER_PLUGIN_${_upper}_LIBRARY NAMES gst${_plugin}-0.10 ++ PATHS ++ ${PKG_GSTREAMER_PLUGINSBASE_LIBRARY_DIRS} ++ ${PKG_GSTREAMER_${_upper}_LIBRARY_DIRS} ++ ) ++ ++ FIND_PATH(GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR ++ NAMES gst/${_plugin}/${_header} ++ PATHS ++ ${PKG_GSTREAMER_PLUGINSBASE_INCLUDE_DIRS} ++ ${PKG_GSTREAMER_${_upper}_INCLUDE_DIRS} ++ ) ++ ++ IF(GSTREAMER_PLUGIN_${_upper}_LIBRARY AND GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR) ++ SET(GSTREAMER_PLUGIN_${_upper}_FOUND TRUE) ++ LIST(APPEND GSTREAMERPLUGINSBASE_INCLUDE_DIRS GSTREAMER_${_upper}_INCLUDE_DIR) ++ LIST(APPEND GSTREAMERPLUGINSBASE_LIBRARIES GSTREAMER_${_upper}_LIBRARY) ++ ELSE(GSTREAMER_PLUGIN_${_upper}_LIBRARY AND GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR) ++ MESSAGE(STATUS "Could not find ${_plugin} plugin") ++ MESSAGE(STATUS "${_upper} library: ${GSTREAMER_${_upper}_LIBRARY}") ++ MESSAGE(STATUS "${_upper} include dir: ${GSTREAMER_${_upper}_INCLUDE_DIR}") ++ SET(GSTREAMER_PLUGIN_${_upper}_FOUND FALSE) ++ SET(GSTREAMER_PLUGIN_${_upper}_LIBRARY GSTREAMER_${_upper}_LIBRARY-NOTFOUND) ++ SET(GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR GSTREAMER_${_upper}_INCLUDE_DIR-NOTFOUND) ++ SET(GSTREAMERPLUGINSBASE_FOUND FALSE) ++ ENDIF(GSTREAMER_PLUGIN_${_upper}_LIBRARY AND GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR) ++ ++ MARK_AS_ADVANCED(GSTREAMER_PLUGIN_${_upper}_LIBRARY ++ GSTREAMER_PLUGIN_${_upper}_INCLUDE_DIR) ++ENDMACRO(MACRO_FIND_GSTREAMER_PLUGIN) ++ + # + # Base plugins: + # audio +@@ -31,87 +75,21 @@ ENDIF (NOT WIN32) + # The gstinterfaces-0.10 library is found by FindGStreamer.cmake + # + +-FIND_LIBRARY(GSTREAMER_PLUGIN_AUDIO_LIBRARIES NAMES gstaudio-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_CDDA_LIBRARIES NAMES gstcdda-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_NETBUFFER_LIBRARIES NAMES gstnetbuffer-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_PBUTILS_LIBRARIES NAMES gstpbutils-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_RIFF_LIBRARIES NAMES gstriff-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_RTP_LIBRARIES NAMES gstrtp-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_RTSP_LIBRARIES NAMES gstrtsp-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_SDP_LIBRARIES NAMES gstsdp-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_TAG_LIBRARIES NAMES gsttag-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +-FIND_LIBRARY(GSTREAMER_PLUGIN_VIDEO_LIBRARIES NAMES gstvideo-0.10 +- PATHS +- ${PKG_GSTREAMER_LIBRARY_DIRS} +- ) +- +-IF (GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND +- GSTREAMER_PLUGIN_CDDA_LIBRARIES AND +- GSTREAMER_PLUGIN_NETBUFFER_LIBRARIES AND +- GSTREAMER_PLUGIN_PBUTILS_LIBRARIES AND +- GSTREAMER_PLUGIN_RIFF_LIBRARIES AND +- GSTREAMER_PLUGIN_RTP_LIBRARIES AND +- GSTREAMER_PLUGIN_RTSP_LIBRARIES AND +- GSTREAMER_PLUGIN_SDP_LIBRARIES AND +- GSTREAMER_PLUGIN_TAG_LIBRARIES AND +- GSTREAMER_PLUGIN_VIDEO_LIBRARIES) +- SET(GSTREAMERPLUGINSBASE_FOUND TRUE) +-ELSE (GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND +- GSTREAMER_PLUGIN_CDDA_LIBRARIES AND +- GSTREAMER_PLUGIN_NETBUFFER_LIBRARIES AND +- GSTREAMER_PLUGIN_PBUTILS_LIBRARIES AND +- GSTREAMER_PLUGIN_RIFF_LIBRARIES AND +- GSTREAMER_PLUGIN_RTP_LIBRARIES AND +- GSTREAMER_PLUGIN_RTSP_LIBRARIES AND +- GSTREAMER_PLUGIN_SDP_LIBRARIES AND +- GSTREAMER_PLUGIN_TAG_LIBRARIES AND +- GSTREAMER_PLUGIN_VIDEO_LIBRARIES) +- SET(GSTREAMERPLUGINSBASE_FOUND FALSE) +-ENDIF (GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND +- GSTREAMER_PLUGIN_CDDA_LIBRARIES AND +- GSTREAMER_PLUGIN_NETBUFFER_LIBRARIES AND +- GSTREAMER_PLUGIN_PBUTILS_LIBRARIES AND +- GSTREAMER_PLUGIN_RIFF_LIBRARIES AND +- GSTREAMER_PLUGIN_RTP_LIBRARIES AND +- GSTREAMER_PLUGIN_RTSP_LIBRARIES AND +- GSTREAMER_PLUGIN_SDP_LIBRARIES AND +- GSTREAMER_PLUGIN_TAG_LIBRARIES AND +- GSTREAMER_PLUGIN_VIDEO_LIBRARIES) ++SET(GSTREAMER_PLUGINSBASE_FOUND TRUE) ++MACRO_FIND_GSTREAMER_PLUGIN(audio audio.h) ++MACRO_FIND_GSTREAMER_PLUGIN(cdda gstcddabasesrc.h) ++MACRO_FIND_GSTREAMER_PLUGIN(netbuffer gstnetbuffer.h) ++MACRO_FIND_GSTREAMER_PLUGIN(pbutils pbutils.h) ++MACRO_FIND_GSTREAMER_PLUGIN(riff riff-ids.h) ++MACRO_FIND_GSTREAMER_PLUGIN(rtp gstrtpbuffer.h) ++MACRO_FIND_GSTREAMER_PLUGIN(rtsp gstrtspdefs.h) ++MACRO_FIND_GSTREAMER_PLUGIN(sdp gstsdp.h) ++MACRO_FIND_GSTREAMER_PLUGIN(tag tag.h) ++MACRO_FIND_GSTREAMER_PLUGIN(video video.h) + + IF (GSTREAMERPLUGINSBASE_FOUND) +- SET(GSTREAMERPLUGINS_FOUND TRUE) +-ELSE (GSTREAMERPLUGINSBASE_FOUND) +- SET(GSTREAMERPLUGINS_FOUND FALSE) +-ENDIF (GSTREAMERPLUGINSBASE_FOUND) +- +-IF (GSTREAMERPLUGINS_FOUND) ++ LIST(REMOVE_DUPLICATES GSTREAMERPLUGINSBASE_LIBRARIES) ++ LIST(REMOVE_DUPLICATES GSTREAMERPLUGINSBASE_INCLUDE_DIRS) + IF (NOT GStreamer_Plugins_FIND_QUIETLY) + MESSAGE(STATUS "Found GStreamer Plugins: + ${GSTREAMER_PLUGIN_AUDIO_LIBRARIES} +@@ -125,20 +103,10 @@ IF (GSTREAMERPLUGINS_FOUND) + ${GSTREAMER_PLUGIN_TAG_LIBRARIES} + ${GSTREAMER_PLUGIN_VIDEO_LIBRARIES}") + ENDIF (NOT GStreamer_Plugins_FIND_QUIETLY) +-ELSE (GSTREAMERPLUGINS_FOUND) ++ELSE (GSTREAMERPLUGINSBASE_FOUND) ++ SET(GSTREAMERPLUGINSBASE_LIBRARIES GSTREAMERPLUGINSBASE_LIBRARIES-NOTFOUND) ++ SET(GSTREAMERPLUGINSBASE_INCLUDE_DIRS GSTREAMERPLUGINSBASE_INCLUDE_DIRS-NOTFOUND) + IF (GStreamer_Plugins_FIND_REQUIRED) + MESSAGE(SEND_ERROR "Could NOT find GStreamer Plugins") + ENDIF (GStreamer_Plugins_FIND_REQUIRED) +-ENDIF (GSTREAMERPLUGINS_FOUND) +- +-MARK_AS_ADVANCED(GSTREAMERPLUGINS_DEFINITIONS +- GSTREAMER_PLUGIN_AUDIO_LIBRARIES +- GSTREAMER_PLUGIN_CDDA_LIBRARIES +- GSTREAMER_PLUGIN_NETBUFFER_LIBRARIES +- GSTREAMER_PLUGIN_PBUTILS_LIBRARIES +- GSTREAMER_PLUGIN_RIFF_LIBRARIES +- GSTREAMER_PLUGIN_RTP_LIBRARIES +- GSTREAMER_PLUGIN_RTSP_LIBRARIES +- GSTREAMER_PLUGIN_SDP_LIBRARIES +- GSTREAMER_PLUGIN_TAG_LIBRARIES +- GSTREAMER_PLUGIN_VIDEO_LIBRARIES) ++ENDIF (GSTREAMERPLUGINSBASE_FOUND) +diff --git a/gstreamer/CMakeLists.txt b/gstreamer/CMakeLists.txt +index d529fb6..c42710b 100644 +--- a/gstreamer/CMakeLists.txt ++++ b/gstreamer/CMakeLists.txt +@@ -20,6 +20,8 @@ if (BUILD_PHONON_GSTREAMER) + include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${GSTREAMER_INCLUDE_DIR} ++ ${GSTREAMER_PLUGIN_VIDEO_INCLUDE_DIR} ++ ${GSTREAMER_PLUGIN_AUDIO_INCLUDE_DIR} + ${GLIB2_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${X11_X11_INCLUDE_PATH}) +@@ -78,7 +80,7 @@ if (BUILD_PHONON_GSTREAMER) + ${QT_QTOPENGL_LIBRARY} + ${PHONON_LIBS} ${OPENGL_gl_LIBRARY} + ${GSTREAMER_LIBRARIES} ${GSTREAMER_BASE_LIBRARY} ${GSTREAMER_INTERFACE_LIBRARY} +- ${GSTREAMER_PLUGIN_VIDEO_LIBRARIES} ${GSTREAMER_PLUGIN_AUDIO_LIBRARIES} ++ ${GSTREAMER_PLUGIN_VIDEO_LIBRARY} ${GSTREAMER_PLUGIN_AUDIO_LIBRARY} + ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES}) + if(ALSA_FOUND) + target_link_libraries(phonon_gstreamer ${ASOUND_LIBRARY}) +diff --git a/gstreamer/ConfigureChecks.cmake b/gstreamer/ConfigureChecks.cmake +index 095a0e9..73616fa 100644 +--- a/gstreamer/ConfigureChecks.cmake ++++ b/gstreamer/ConfigureChecks.cmake +@@ -16,8 +16,8 @@ macro_optional_find_package(GStreamer) + macro_log_feature(GSTREAMER_FOUND "GStreamer" "gstreamer 0.10 is required for the multimedia backend" "http://gstreamer.freedesktop.org/modules/" FALSE "0.10") + + macro_optional_find_package(GStreamerPlugins) +-macro_log_feature(GSTREAMER_PLUGIN_VIDEO_LIBRARIES "GStreamer video plugin" "The gstreamer video plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend" "http://gstreamer.freedesktop.org/modules/" FALSE "0.10") +-macro_log_feature(GSTREAMER_PLUGIN_AUDIO_LIBRARIES "GStreamer audio plugin" "The gstreamer audio plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend" "http://gstreamer.freedesktop.org/modules/" FALSE "0.10") ++macro_log_feature(GSTREAMER_PLUGIN_VIDEO_FOUND "GStreamer video plugin" "The gstreamer video plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend" "http://gstreamer.freedesktop.org/modules/" FALSE "0.10") ++macro_log_feature(GSTREAMER_PLUGIN_AUDIO_FOUND "GStreamer audio plugin" "The gstreamer audio plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend" "http://gstreamer.freedesktop.org/modules/" FALSE "0.10") + + macro_optional_find_package(GLIB2) + macro_log_feature(GLIB2_FOUND "GLib2" "GLib 2 is required to compile the gstreamer backend for Phonon" "http://www.gtk.org/download/" FALSE) +@@ -31,8 +31,8 @@ macro_log_feature(LIBXML2_FOUND "LibXml2" "LibXml2 is required to compile the gs + macro_optional_find_package(OpenGL) + macro_log_feature(OPENGL_FOUND "OpenGL" "OpenGL support is required to compile the gstreamer backend for Phonon" "" FALSE) + +-if (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_LIBRARIES AND GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) ++if (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_FOUND AND GSTREAMER_PLUGIN_AUDIO_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) + set(BUILD_PHONON_GSTREAMER TRUE) +-else (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_LIBRARIES AND GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) ++else (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_FOUND AND GSTREAMER_PLUGIN_AUDIO_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) + set(BUILD_PHONON_GSTREAMER FALSE) +-endif (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_LIBRARIES AND GSTREAMER_PLUGIN_AUDIO_LIBRARIES AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) ++endif (GSTREAMER_FOUND AND GSTREAMER_PLUGIN_VIDEO_FOUND AND GSTREAMER_PLUGIN_AUDIO_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND LIBXML2_FOUND AND OPENGL_FOUND) +-- +1.7.1 + diff --git a/pkgs/development/compilers/dev86/default.nix b/pkgs/development/compilers/dev86/default.nix index aa44b14d844..0dfb0be96f9 100644 --- a/pkgs/development/compilers/dev86/default.nix +++ b/pkgs/development/compilers/dev86/default.nix @@ -1,18 +1,23 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl }: stdenv.mkDerivation { - name = "dev86-0.16.17"; + name = "dev86-0.16.18"; + src = fetchurl { - url = http://homepage.ntlworld.com/robert.debath/dev86/Dev86src-0.16.17.tar.gz; - md5 = "e7bbfdbe61c2fb964994a087e29b0087"; + url = http://www.debath.co.uk/dev86/Dev86src-0.16.18.tar.gz; + sha256 = "1wcg2x8i2fq7kqgazx2il3qfmikyi4kfb23vm45yxlwq72l55604"; }; - patches = [ ./dev86-0.16.17-noelks-1.patch ]; - - preBuild = " - makeFlags=\"PREFIX=$out\" - "; + makeFlags = "PREFIX=$(out)"; + # Awful hackery to get dev86 to compile with recent gcc/binutils. + # See http://bugs.gentoo.org/214964 for some inconclusive + # discussion. + preBuild = + '' + substituteInPlace makefile.in --replace "-O2" "" --replace "-O" "" + ''; + meta = { description = "Linux 8086 development environment"; homepage = http://www.debath.co.uk/; diff --git a/pkgs/development/compilers/dev86/dev86-0.16.17-noelks-1.patch b/pkgs/development/compilers/dev86/dev86-0.16.17-noelks-1.patch deleted file mode 100644 index fd0d9dfae31..00000000000 --- a/pkgs/development/compilers/dev86/dev86-0.16.17-noelks-1.patch +++ /dev/null @@ -1,22 +0,0 @@ -Submitted By: Andrew "Weibullguy" Rowland -Date: 2007-10-23 -Initial Package Version: 0.16.17 -Origin: Fedora Project -Description: Suppresses elksemu -Upstream Status: Unknown - ---- dev86-0.16.17/makefile.in.noelks 2006-01-25 17:03:02.000000000 -0500 -+++ dev86-0.16.17/makefile.in 2006-01-25 17:03:19.000000000 -0500 -@@ -89,10 +89,10 @@ - - #ifdef GNUMAKE - all: check_config bcc86 cpp unproto copt as86 ar86 ld86 objdump86 \ -- library lib-bsd alt-libs elksemu -+ library lib-bsd alt-libs - - install: check_config install-bcc install-man \ -- install-lib install-emu -+ install-lib - - install-all: install install-other - diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix index 34aab8de401..2b7e40d1ffa 100644 --- a/pkgs/development/compilers/fpc/lazarus.nix +++ b/pkgs/development/compilers/fpc/lazarus.nix @@ -24,7 +24,7 @@ rec { export NIX_LDFLAGS='-lXi -lX11 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lc -lXext -lpango-1.0 -latk-1.0' export LCL_PLATFORM=gtk2 ensureDir $out/share - tar xf ${fpc.src} --strip-components=1 -C $out/share + tar xf ${fpc.src} --strip-components=1 -C $out/share -m sed -e 's@/usr/fpcsrc@'"$out/share/fpcsrc@" -i ide/include/unix/lazbaseconf.inc '') ["minInit" "defEnsureDir" "doUnpack"]; diff --git a/pkgs/development/compilers/gcc-4.3/default.nix b/pkgs/development/compilers/gcc-4.3/default.nix index b9d0d9bff5d..57fc0f805c4 100644 --- a/pkgs/development/compilers/gcc-4.3/default.nix +++ b/pkgs/development/compilers/gcc-4.3/default.nix @@ -127,7 +127,8 @@ stdenv.mkDerivation ({ passthru = { inherit langC langCC langFortran langVhdl langTreelang enableMultilib; }; - enableParallelBuilding = true; + # ghdl does not build fine with parallel building + enableParallelBuilding = if langVhdl then false else true; meta = { homepage = "http://gcc.gnu.org/"; diff --git a/pkgs/development/compilers/gcc-4.4/builder.sh b/pkgs/development/compilers/gcc-4.4/builder.sh index b9724e7ad50..abe14b457ab 100644 --- a/pkgs/development/compilers/gcc-4.4/builder.sh +++ b/pkgs/development/compilers/gcc-4.4/builder.sh @@ -61,10 +61,39 @@ if test "$noSysDirs" = "1"; then EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib" fi else - EXTRA_FLAGS_TARGET="$EXTRA_FLAGS" - EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS" + if test -z "$NIX_GCC_CROSS"; then + EXTRA_FLAGS_TARGET="$EXTRA_FLAGS" + EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS" + else + # This the case of cross-building the gcc. + # We need special flags for the target, different than those of the build + # Assertion: + test -e $NIX_GCC_CROSS/nix-support/orig-libc + + # Figure out what extra flags to pass to the gcc compilers + # being generated to make sure that they use our glibc. + extraFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-cflags)" + extraLDFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-ldflags) $(cat $NIX_GCC_CROSS/nix-support/libc-ldflags-before)" + + # Use *real* header files, otherwise a limits.h is generated + # that does not include Glibc's limits.h (notably missing + # SSIZE_MAX, which breaks the build). + NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include + + # The path to the Glibc binaries such as `crti.o'. + glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib" + + extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags" + extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + + EXTRA_FLAGS_TARGET="$extraFlags" + for i in $extraLDFlags; do + EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS_TARGET -Wl,$i" + done + fi fi + # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find # the startfiles. # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx @@ -160,7 +189,7 @@ postInstall() { } -if test -z "$targetConfig"; then +if test -z "$targetConfig" && test -z "$crossConfig"; then if test -z "$profiledCompiler"; then buildFlags="bootstrap $buildFlags" else diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix index e4206cabd8a..6c2897c56c4 100644 --- a/pkgs/development/compilers/gcc-4.4/default.nix +++ b/pkgs/development/compilers/gcc-4.4/default.nix @@ -126,7 +126,9 @@ stdenv.mkDerivation ({ inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic libcCross; - buildInputs = [ texinfo gmp mpfr gettext which ] + buildNativeInputs = [ texinfo which ]; + + buildInputs = [ gmp mpfr gettext ] ++ (optional (ppl != null) ppl) ++ (optional (cloogppl != null) cloogppl) ++ (optionals langTreelang [bison flex]) @@ -176,6 +178,50 @@ stdenv.mkDerivation ({ LD = "ld"; CC = "gcc"; + crossAttrs = { + AR = "${stdenv.cross.config}-ar"; + LD = "${stdenv.cross.config}-ld"; + CC = "${stdenv.cross.config}-gcc"; + CXX = "${stdenv.cross.config}-gcc"; + AR_FOR_TARGET = "${stdenv.cross.config}-ar"; + LD_FOR_TARGET = "${stdenv.cross.config}-ld"; + CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; + NM_FOR_TARGET = "${stdenv.cross.config}-nm"; + CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; + # If we are making a cross compiler, cross != null + NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else ""; + configureFlags = " + ${if enableMultilib then "" else "--disable-multilib"} + ${if enableShared then "" else "--disable-shared"} + ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""} + ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""} + ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""} + ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} + ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""} + --with-gmp=${gmp.hostDrv} + --with-mpfr=${mpfr.hostDrv} + --disable-libstdcxx-pch + --without-included-gettext + --with-system-zlib + --enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langTreelang "treelang" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ) + ) + } + ${if langAda then " --enable-libada" else ""} + ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} + ${if cross != null then crossConfigureFlags else ""} + --target=${stdenv.cross.config} + "; + }; + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find # the library headers and binaries, regarless of the language being # compiled. @@ -201,7 +247,8 @@ stdenv.mkDerivation ({ passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl enableMultilib version; }; - enableParallelBuilding = true; + # ghdl does not build fine with parallel building + enableParallelBuilding = if langVhdl then false else true; meta = { homepage = http://gcc.gnu.org/; diff --git a/pkgs/development/compilers/gcc-4.5/builder.sh b/pkgs/development/compilers/gcc-4.5/builder.sh index 6c3ced85d75..aedd5b46b12 100644 --- a/pkgs/development/compilers/gcc-4.5/builder.sh +++ b/pkgs/development/compilers/gcc-4.5/builder.sh @@ -54,11 +54,52 @@ if test "$noSysDirs" = "1"; then EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i" done - if test -z "$targetConfig"; then - EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" + if test -n "$targetConfig"; then + # Cross-compiling, we need gcc not to read ./specs in order to build + # the g++ compiler (after the specs for the cross-gcc are created). + # Having LIBRARY_PATH= makes gcc read the specs from ., and the build + # breaks. Having this variable comes from the default.nix code to bring + # gcj in. + unset LIBRARY_PATH + unset CPATH + if test -z "$crossStageStatic"; then + EXTRA_TARGET_CFLAGS="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include" + EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib" + fi + else + if test -z "$NIX_GCC_CROSS"; then + EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS" + EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" + else + # This the case of cross-building the gcc. + # We need special flags for the target, different than those of the build + # Assertion: + test -e $NIX_GCC_CROSS/nix-support/orig-libc + + # Figure out what extra flags to pass to the gcc compilers + # being generated to make sure that they use our glibc. + extraFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-cflags)" + extraLDFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-ldflags) $(cat $NIX_GCC_CROSS/nix-support/libc-ldflags-before)" + + # Use *real* header files, otherwise a limits.h is generated + # that does not include Glibc's limits.h (notably missing + # SSIZE_MAX, which breaks the build). + NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include + + # The path to the Glibc binaries such as `crti.o'. + glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib" + + extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags" + extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + + EXTRA_TARGET_CFLAGS="$extraFlags" + for i in $extraLDFlags; do + EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i" + done + fi fi + # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find # the startfiles. # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx @@ -68,17 +109,17 @@ if test "$noSysDirs" = "1"; then NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS" \ + CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS" \ + LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \ ) if test -z "$targetConfig"; then makeFlagsArray=( \ "${makeFlagsArray[@]}" \ BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - BOOT_LDFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ + BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ ) fi @@ -102,6 +143,7 @@ if test -n "$targetConfig"; then dontStrip=1 fi + preConfigure() { if test -n "$newlibSrc"; then tar xvf "$newlibSrc" -C .. @@ -117,6 +159,14 @@ preConfigure() { rm -Rf zlib fi + # Patch the configure script so it finds glibc headers + # It's important for example in order not to get libssp built, because it's + # functionality is in glibc already. + glibc_headers="$(cat $NIX_GCC/nix-support/orig-libc)/include" + sed -i \ + -e s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers, \ + gcc/configure + if test -n "$crossMingw" -a -n "$crossStageStatic"; then mkdir -p ../mingw # --with-build-sysroot expects that: @@ -131,6 +181,12 @@ preConfigure() { } +postConfigure() { + # Don't store the configure flags in the resulting executables. + sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile +} + + postInstall() { # Remove precompiled headers for now. They are very big and # probably not very useful yet. @@ -140,6 +196,14 @@ postInstall() { # previous gcc. rm -rf $out/libexec/gcc/*/*/install-tools rm -rf $out/lib/gcc/*/*/install-tools + + # More dependencies with the previous gcc or some libs (gccbug stores the build command line) + rm -rf $out/bin/gccbug + # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out + for i in $out/libexec/gcc/*/*/*; do + PREV_RPATH=`patchelf --print-rpath $i` + patchelf --set-rpath `echo $PREV_RPATH | sed 's,:[^:]*bootstrap-tools/lib,,'` $i + done # Get rid of some "fixed" header files rm -rf $out/lib/gcc/*/*/include/root @@ -151,7 +215,7 @@ postInstall() { fi done - for i in $out/bin/*-c++* $out/bin/*-g++*; do + for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do if cmp -s $out/bin/g++ $i; then ln -sfn g++ $i fi @@ -161,7 +225,7 @@ postInstall() { } -if test -z "$targetConfig"; then +if test -z "$targetConfig" && test -z "$crossConfig"; then if test -z "$profiledCompiler"; then buildFlags="bootstrap $buildFlags" else diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix index 38f4338d4ac..19efa57af8e 100644 --- a/pkgs/development/compilers/gcc-4.5/default.nix +++ b/pkgs/development/compilers/gcc-4.5/default.nix @@ -41,7 +41,7 @@ assert libelf != null -> zlib != null; with stdenv.lib; with builtins; -let version = "4.5.0"; +let version = "4.5.1"; javaEcj = fetchurl { # The `$(top_srcdir)/ecj.jar' file is automatically picked up at # `configure' time. @@ -136,7 +136,7 @@ stdenv.mkDerivation ({ }; patches = - [ ./softfp-hurd.patch ./dragonegg-2.7.patch ] + [ ] ++ optional (cross != null) ./libstdc++-target.patch ++ optional noSysDirs ./no-sys-dirs.patch # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its @@ -176,13 +176,30 @@ stdenv.mkDerivation ({ sed -i "${gnu_h}" \ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' '' + else if cross != null || stdenv.gcc.libc != null then + # On NixOS, use the right path to the dynamic linker instead of + # `/lib/ld*.so'. + let + libc = if (cross != null && libcCross != null) then libcCross else stdenv.gcc.libc; + in + '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." + for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h + do + grep -q LIBC_DYNAMIC_LINKER "$header" || continue + echo " fixing \`$header'..." + sed -i "$header" \ + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g' + done + '' else null; inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic libcCross crossMingw; - buildInputs = [ texinfo gmp mpfr mpc libelf gettext which ] - ++ (optional (perl != null) perl) + buildNativeInputs = [ texinfo which ] + ++ optional (perl != null) perl; + + buildInputs = [ gmp mpfr mpc libelf gettext ] ++ (optional (ppl != null) ppl) ++ (optional (cloogppl != null) cloogppl) ++ (optionals langTreelang [bison flex]) @@ -195,6 +212,11 @@ stdenv.mkDerivation ({ ++ (optionals langVhdl [gnat]) ; + configureFlagsArray = stdenv.lib.optionals + (ppl != null && ppl.dontDisableStatic == true) + [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" + "--with-stage1-libs=-lstdc++ -lgcc_s" ]; + configureFlags = " ${if enableMultilib then "" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} @@ -228,6 +250,8 @@ stdenv.mkDerivation ({ ) ) } + ${ # Trick that should be taken out once we have a mips64-linux not loongson2f + if cross == null && stdenv.system == "mips64-linux" then "--with-arch=loongson2f" else ""} ${if langAda then " --enable-libada" else ""} ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross != null then crossConfigureFlags else ""} @@ -235,6 +259,52 @@ stdenv.mkDerivation ({ targetConfig = if (cross != null) then cross.config else null; + crossAttrs = { + AR = "${stdenv.cross.config}-ar"; + LD = "${stdenv.cross.config}-ld"; + CC = "${stdenv.cross.config}-gcc"; + CXX = "${stdenv.cross.config}-gcc"; + AR_FOR_TARGET = "${stdenv.cross.config}-ar"; + LD_FOR_TARGET = "${stdenv.cross.config}-ld"; + CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; + NM_FOR_TARGET = "${stdenv.cross.config}-nm"; + CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; + # If we are making a cross compiler, cross != null + NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else ""; + dontStrip = true; + configureFlags = '' + ${if enableMultilib then "" else "--disable-multilib"} + ${if enableShared then "" else "--disable-shared"} + ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""} + ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""} + ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""} + ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} + ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""} + --with-gmp=${gmp.hostDrv} + --with-mpfr=${mpfr.hostDrv} + --disable-libstdcxx-pch + --without-included-gettext + --with-system-zlib + --enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langTreelang "treelang" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ) + ) + } + ${if langAda then " --enable-libada" else ""} + ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} + ${if cross != null then crossConfigureFlags else ""} + --target=${stdenv.cross.config} + ''; + }; + + # Needed for the cross compilation to work AR = "ar"; LD = "ld"; @@ -316,11 +386,13 @@ stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ]; }; } -// (if cross != null && cross.libc == "msvcrt" && crossStageStatic then rec { + +// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) { makeFlags = [ "all-gcc" "all-target-libgcc" ]; installTargets = "install-gcc install-target-libgcc"; -} else {}) -// (if langVhdl then rec { +} + +// optionalAttrs langVhdl rec { name = "ghdl-0.29"; ghdlSrc = fetchurl { @@ -353,4 +425,4 @@ stdenv.mkDerivation ({ platforms = with stdenv.lib.platforms; linux; }; -} else {})) +}) diff --git a/pkgs/development/compilers/gcc-4.5/dragonegg-2.7.patch b/pkgs/development/compilers/gcc-4.5/dragonegg-2.7.patch deleted file mode 100644 index 6b37672ddef..00000000000 --- a/pkgs/development/compilers/gcc-4.5/dragonegg-2.7.patch +++ /dev/null @@ -1,46 +0,0 @@ -Index: mainline/gcc/config/i386/i386.c -=================================================================== ---- mainline.orig/gcc/config/i386/i386.c 2010-04-02 09:11:58.733574308 +0200 -+++ mainline/gcc/config/i386/i386.c 2010-04-02 09:29:11.276111437 +0200 -@@ -4992,7 +4992,8 @@ - case, we return the original mode and warn ABI change if CUM isn't - NULL. */ - --static enum machine_mode -+extern enum machine_mode type_natural_mode (const_tree, CUMULATIVE_ARGS *); -+enum machine_mode - type_natural_mode (const_tree type, CUMULATIVE_ARGS *cum) - { - enum machine_mode mode = TYPE_MODE (type); -@@ -5123,7 +5124,9 @@ - See the x86-64 PS ABI for details. - */ - --static int -+extern int classify_argument (enum machine_mode, const_tree, -+ enum x86_64_reg_class [MAX_CLASSES], int); -+int - classify_argument (enum machine_mode mode, const_tree type, - enum x86_64_reg_class classes[MAX_CLASSES], int bit_offset) - { -@@ -5504,7 +5507,9 @@ - - /* Examine the argument and return set number of register required in each - class. Return 0 iff parameter should be passed in memory. */ --static int -+extern int examine_argument (enum machine_mode, const_tree, int, -+ int *, int *); -+int - examine_argument (enum machine_mode mode, const_tree type, int in_return, - int *int_nregs, int *sse_nregs) - { -@@ -6186,7 +6191,8 @@ - - /* Return true when TYPE should be 128bit aligned for 32bit argument passing - ABI. */ --static bool -+extern bool contains_aligned_value_p (tree); -+bool - contains_aligned_value_p (tree type) - { - enum machine_mode mode = TYPE_MODE (type); diff --git a/pkgs/development/compilers/gcc-4.5/gnat-cflags.patch b/pkgs/development/compilers/gcc-4.5/gnat-cflags.patch index e85e5076be6..bf2acf065e9 100644 --- a/pkgs/development/compilers/gcc-4.5/gnat-cflags.patch +++ b/pkgs/development/compilers/gcc-4.5/gnat-cflags.patch @@ -22,12 +22,12 @@ index f5057a0..337e0c6 100644 # Pretend that _Unwind_GetIPInfo is available for the target by default. This # should be autodetected during the configuration of libada and passed down to # here, but we need something for --disable-libada and hope for the best. -@@ -1838,7 +1838,7 @@ ADA_INCLUDE_SRCS =\ +@@ -193,7 +193,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) + # Link flags used to build gnat tools. By default we prefer to statically + # link with libgcc to avoid a dependency on shared libgcc (which is tricky + # to deal with as it may conflict with the libgcc provided by the system). +-GCC_LINK_FLAGS=-static-libgcc ++GCC_LINK_FLAGS=-static-libgcc $(CFLAGS_FOR_TARGET) - LIBGNAT=../$(RTSDIR)/libgnat.a + # End of variables for you to override. --GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES) -+GCC_LINK=$(CC) -static-libgcc $(CFLAGS_FOR_TARGET) $(ADA_INCLUDES) - - # when compiling the tools, the runtime has to be first on the path so that - # it hides the runtime files lying with the rest of the sources diff --git a/pkgs/development/compilers/gcc-4.5/softfp-hurd.patch b/pkgs/development/compilers/gcc-4.5/softfp-hurd.patch deleted file mode 100644 index 7e2a8a9c290..00000000000 --- a/pkgs/development/compilers/gcc-4.5/softfp-hurd.patch +++ /dev/null @@ -1,32 +0,0 @@ -This patch fixes undefined references to softp symbols (__multf3, __fixunstfsi, -__subtf3, etc.) in libgcc_s.so on GNU/Hurd. - -Taken from , with second -hunk adjusted so that it applies to GCC 4.5.0. - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 9e499cb..9aec392 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -3070,7 +3070,9 @@ case ${target} in - i[34567]86-*-darwin* | x86_64-*-darwin*) - tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp" - ;; -- i[34567]86-*-linux* | x86_64-*-linux* | i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu) -+ i[34567]86-*-linux* | x86_64-*-linux* | \ -+ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ -+ i[34567]86-*-gnu*) - tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp i386/t-linux" - ;; - ia64*-*-linux*) -diff --git a/libgcc/config.host b/libgcc/config.host ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -600,6 +600,7 @@ case ${host} in - i[34567]86-*-darwin* | x86_64-*-darwin* | \ - i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ - i[34567]86-*-linux* | x86_64-*-linux* | \ -+ i[34567]86-*-gnu* | \ - i[34567]86-*-solaris2* | \ - i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*) - if test "${host_address}" = 32; then diff --git a/pkgs/development/compilers/gcc-4.5/sources.nix b/pkgs/development/compilers/gcc-4.5/sources.nix index 4a9201d08eb..6059e03880b 100644 --- a/pkgs/development/compilers/gcc-4.5/sources.nix +++ b/pkgs/development/compilers/gcc-4.5/sources.nix @@ -1,26 +1,26 @@ /* Automatically generated by `update-gcc.sh', do not edit. - For GCC 4.5.0. */ + For GCC 4.5.1. */ { fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }: -assert version == "4.5.0"; +assert version == "4.5.1"; optional /* langC */ true (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2"; - sha256 = "19ykzyd938d4pblsihrsalk9ch1s23z57s0r5an8sqs7acv51r0g"; + sha256 = "0sjjw3qfcpdk0fs5d2rhl0xqcaclg86ifbq45dbk9ca072l3fyxm"; }) ++ optional langCC (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2"; - sha256 = "0hialil4v2hi7klr14x6h5z7b9ryzzy9kchr96s2p9hmsm7famlk"; + sha256 = "0j6ffb96b3r75hrjshg52llv21ax7r8jdx44hhj0maiisnl9wd55"; }) ++ optional langFortran (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2"; - sha256 = "0anby974dikygjmxr6h1pd9s24fdps84fki1dijzhqqvq6lr3hbb"; + sha256 = "0xgwjc3h5fc5c100bnw24c35255il33lj5qbgpxf0zl8di2q13aw"; }) ++ optional langJava (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2"; - sha256 = "0mlbxyhj7svjgby5vrpc49l2vk0k0878nlx0ap6jqq7xdyysvlcn"; + sha256 = "0mh37q4ibg05h1hdh39pkj1hycvdg6i79m4698knw7pppm14ax8q"; }) ++ optional langAda (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2"; - sha256 = "1yar842bixmh2n9siy8s383lg8mz611xjdbbacgcznwab601czzv"; + sha256 = "11chdbl7h046lnl83k79vj7dvgxz6kq7cnmwx94z644vaiflg153"; }) ++ [] diff --git a/pkgs/development/compilers/nasm/default.nix b/pkgs/development/compilers/nasm/default.nix index b6a09d06984..688a81f4b3e 100644 --- a/pkgs/development/compilers/nasm/default.nix +++ b/pkgs/development/compilers/nasm/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl}: stdenv.mkDerivation rec { - name = "nasm-2.05.01"; + name = "nasm-2.09"; src = fetchurl { - url = "mirror://sourceforge/nasm/${name}.tar.bz2"; - sha256 = "0p2rlshd68m2h7psyjz4440grxwryxppqzchx7cbmzahqr2yy1lj"; + url = http://www.nasm.us/pub/nasm/releasebuilds/2.09/nasm-2.09.tar.bz2; + sha256 = "06kv1ii8d3jwq5mczbyx6zc7k1acdwjdfjblv78mglf161i82j4m"; }; meta = { diff --git a/pkgs/development/compilers/ocaml/3.11.1.nix b/pkgs/development/compilers/ocaml/3.11.1.nix index e43bf3d08d5..60dc5157501 100644 --- a/pkgs/development/compilers/ocaml/3.11.1.nix +++ b/pkgs/development/compilers/ocaml/3.11.1.nix @@ -1,8 +1,8 @@ { stdenv, fetchurl, ncurses, x11 }: let - useX11 = stdenv.system != "armv5tel-linux"; - useNativeCompilers = stdenv.system != "armv5tel-linux"; + useX11 = stdenv.isi686 || stdenv.isx86_64; + useNativeCompilers = stdenv.isi686 || stdenv.isx86_64 || stdenv.isMips; inherit (stdenv.lib) optionals optionalString; in @@ -15,14 +15,18 @@ stdenv.mkDerivation rec { sha256 = "8c36a28106d4b683a15c547dfe4cb757a53fa9247579d1cc25bd06a22cc62e50"; }; + # Needed to avoid a SIGBUS on the final executable on mips + NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else ""; + prefixKey = "-prefix "; configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11 ]; buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt"; buildInputs = [ncurses] ++ optionals useX11 [ x11 ]; installTargets = "install" + optionalString useNativeCompilers " installopt"; - patchPhase = '' + prePatch = '' CAT=$(type -tp cat) sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang + patch -p0 < ${./mips64.patch} ''; postBuild = '' ensureDir $out/include diff --git a/pkgs/development/compilers/ocaml/mips64.patch b/pkgs/development/compilers/ocaml/mips64.patch new file mode 100644 index 00000000000..cdef9cafb93 --- /dev/null +++ b/pkgs/development/compilers/ocaml/mips64.patch @@ -0,0 +1,240 @@ +http://caml.inria.fr/mantis/view.php?id=4849 + +diff -bur ocaml-3.11.1/asmcomp/mips/arch.ml my_ocaml/asmcomp/mips/arch.ml +--- asmcomp/mips/arch.ml 2002-11-29 16:03:36.000000000 +0100 ++++ asmcomp/mips/arch.ml 2009-08-09 23:18:31.000000000 +0200 +@@ -35,7 +35,7 @@ + + let big_endian = + match Config.system with +- "ultrix" -> false ++ "ultrix" | "gnu" -> false + | "irix" -> true + | _ -> fatal_error "Arch_mips.big_endian" + +diff -bur ocaml-3.11.1/asmcomp/mips/emit.mlp my_ocaml/asmcomp/mips/emit.mlp +--- asmcomp/mips/emit.mlp 2004-01-05 21:25:56.000000000 +0100 ++++ asmcomp/mips/emit.mlp 2009-08-23 12:11:58.000000000 +0200 +@@ -58,7 +58,7 @@ + !stack_offset + + 4 * num_stack_slots.(0) + 8 * num_stack_slots.(1) + + (if !contains_calls then if !uses_gp then 8 else 4 else 0) in +- Misc.align size 16 ++ Misc.align size 16 (* n32 require quadword alignment *) + + let slot_offset loc cl = + match loc with +@@ -252,7 +252,7 @@ + | Lop(Icall_ind) -> + ` move $25, {emit_reg i.arg.(0)}\n`; + liveregs i live_25; +- ` jal {emit_reg i.arg.(0)}\n`; ++ ` jal $25\n`; (* {emit_reg i.arg.(0)}\n; Equivalent but avoids "Warning: MIPS PIC call to register other than $25" on GNU as *) + `{record_frame i.live}\n` + | Lop(Icall_imm s) -> + liveregs i 0; +@@ -269,7 +269,7 @@ + liveregs i 0; + ` move $25, {emit_reg i.arg.(0)}\n`; + liveregs i live_25; +- ` j {emit_reg i.arg.(0)}\n` ++ ` j $25\n` + | Lop(Itailcall_imm s) -> + if s = !function_name then begin + ` b {emit_label !tailrec_entry_point}\n` +@@ -277,11 +277,11 @@ + let n = frame_size() in + if !contains_calls then + ` lw $31, {emit_int(n - 4)}($sp)\n`; ++ ` la $25, {emit_symbol s}\n`; (* Rxd: put before gp restore *) + if !uses_gp then + ` lw $gp, {emit_int(n - 8)}($sp)\n`; + if n > 0 then + ` addu $sp, $sp, {emit_int n}\n`; +- ` la $25, {emit_symbol s}\n`; + liveregs i live_25; + ` j $25\n` + end +@@ -305,8 +305,13 @@ + begin match chunk with + Double_u -> + (* Destination is not 8-aligned, hence cannot use l.d *) ++ if big_endian then begin + ` ldl $24, {emit_addressing addr i.arg 0}\n`; +- ` ldr $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n`; ++ ` ldr $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n` ++ end else begin ++ ` ldl $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n`; ++ ` ldr $24, {emit_addressing addr i.arg 0}\n` ++ end; + ` dmtc1 $24, {emit_reg dest}\n` + | Single -> + ` l.s {emit_reg dest}, {emit_addressing addr i.arg 0}\n`; +@@ -328,8 +333,13 @@ + Double_u -> + (* Destination is not 8-aligned, hence cannot use l.d *) + ` dmfc1 $24, {emit_reg src}\n`; ++ if big_endian then begin + ` sdl $24, {emit_addressing addr i.arg 1}\n`; + ` sdr $24, {emit_addressing (offset_addressing addr 7) i.arg 1}\n` ++ end else begin ++ ` sdl $24, {emit_addressing (offset_addressing addr 7) i.arg 1}\n`; ++ ` sdr $24, {emit_addressing addr i.arg 1}\n` ++ end + | Single -> + ` cvt.s.d $f31, {emit_reg src}\n`; + ` s.s $f31, {emit_addressing addr i.arg 1}\n` +@@ -552,6 +562,7 @@ + (* There are really two groups of registers: + $sp and $30 always point to stack locations + $2 - $21 never point to stack locations. *) ++ if Config.system = "irix" then begin + ` .noalias $2,$sp; .noalias $2,$30; .noalias $3,$sp; .noalias $3,$30\n`; + ` .noalias $4,$sp; .noalias $4,$30; .noalias $5,$sp; .noalias $5,$30\n`; + ` .noalias $6,$sp; .noalias $6,$30; .noalias $7,$sp; .noalias $7,$30\n`; +@@ -561,7 +572,8 @@ + ` .noalias $14,$sp; .noalias $14,$30; .noalias $15,$sp; .noalias $15,$30\n`; + ` .noalias $16,$sp; .noalias $16,$30; .noalias $17,$sp; .noalias $17,$30\n`; + ` .noalias $18,$sp; .noalias $18,$30; .noalias $19,$sp; .noalias $19,$30\n`; +- ` .noalias $20,$sp; .noalias $20,$30; .noalias $21,$sp; .noalias $21,$30\n\n`; ++ ` .noalias $20,$sp; .noalias $20,$30; .noalias $21,$sp; .noalias $21,$30\n\n` ++ end; + let lbl_begin = Compilenv.make_symbol (Some "data_begin") in + ` .data\n`; + ` .globl {emit_symbol lbl_begin}\n`; +diff -bur ocaml-3.11.1/asmrun/mips.s my_ocaml/asmrun/mips.s +--- asmrun/mips.s 2004-07-13 14:18:53.000000000 +0200 ++++ asmrun/mips.s 2009-08-20 09:34:36.000000000 +0200 +@@ -187,7 +187,7 @@ + sw $30, caml_exception_pointer + /* Call C function */ + move $25, $24 +- jal $24 ++ jal $25 /* Rxd: $24 replaced by $25 to avoid this "Warning: MIPS PIC call to register other than $25" ? */ + /* Reload return address, alloc ptr, alloc limit */ + lw $31, 0($16) /* caml_last_return_address */ + lw $22, 0($17) /* caml_young_ptr */ +@@ -254,7 +254,7 @@ + sw $0, caml_last_return_address + /* Call the Caml code */ + move $25, $24 +- jal $24 ++ jal $25 /* Rxd: 24 replaced by 25 */ + $104: + /* Pop the trap frame, restoring caml_exception_pointer */ + lw $24, 0($sp) +@@ -384,3 +384,8 @@ + .word $104 /* return address into callback */ + .half -1 /* negative frame size => use callback link */ + .half 0 /* no roots here */ ++ ++#if defined(SYS_linux) ++ /* Mark stack as non-executable, PR#4564 */ ++ .section .note.GNU-stack,"",%progbits ++#endif +diff -bur ocaml-3.11.1/configure my_ocaml/configure +--- configure 2009-05-20 17:33:09.000000000 +0200 ++++ configure 2009-08-23 10:55:44.000000000 +0200 +@@ -40,7 +40,7 @@ + verbose=no + withcurses=yes + withsharedlibs=yes +-gcc_warnings="-Wall" ++gcc_warnings="-W -Wall" + partialld="ld -r" + + # Try to turn internationalization off, can cause config.guess to malfunction! +@@ -292,6 +292,9 @@ + # (For those who want to force "cc -64") + # Turn off warning "unused library" + bytecclinkopts="-Wl,-woff,84";; ++ gcc*,mips64el-*) ++ bytecccompopts="" ++ bytecclinkopts="-fno-defer-pop $gcc_warnings -Wl,-O1 -Wl,--as-needed";; + *,alpha*-*-unicos*) + # For the Cray T3E + bytecccompopts="-DUMK";; +@@ -468,6 +471,8 @@ + echo "64-bit integers must be doubleword-aligned." + echo "#define ARCH_ALIGN_INT64" >> m.h + fi;; ++ mips64el-*) ++ echo "#define ARCH_ALIGN_INT64" >> m.h;; + *) + sh ./runtest int64align.c + case $? in +@@ -636,6 +641,7 @@ + fi;; + i[3456]86-*-gnu*) arch=i386; system=gnu;; + mips-*-irix6*) arch=mips; system=irix;; ++ mips*-gnu*) arch=mips; system=gnu;; + hppa1.1-*-hpux*) arch=hppa; system=hpux;; + hppa2.0*-*-hpux*) arch=hppa; system=hpux;; + hppa*-*-linux*) arch=hppa; system=linux;; +@@ -672,7 +678,7 @@ + if test -z "$ccoption"; then + case "$arch,$system,$cc" in + alpha,digital,gcc*) nativecc=cc;; +- mips,*,gcc*) nativecc=cc;; ++ mips,irix,gcc*) nativecc=cc;; + *) nativecc="$bytecc";; + esac + else +@@ -687,6 +693,9 @@ + alpha,cc*,digital,*) nativecccompopts=-std1;; + mips,cc*,irix,*) nativecccompopts=-n32 + nativecclinkopts="-n32 -Wl,-woff,84";; ++ mips,gcc*,gnu,mips64el-*) ++ nativecccompopts="$gcc_warnings -fPIC" ++ nativecclinkopts="--as-needed";; + *,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix" + nativecclinkopts="-posix";; + *,*,rhapsody,*darwin[1-5].*) +@@ -725,6 +734,8 @@ + aspp='gcc -c -Wa,-xexplicit';; + mips,*,irix) as='as -n32 -O2 -nocpp -g0' + aspp='as -n32 -O2';; ++ mips,*,gnu) as='as -KPIC' ++ aspp='gcc -c -fPIC';; # got bus error without fPIC ? + power,*,elf) as='as -u -m ppc' + aspp='gcc -c';; + power,*,bsd) as='as' +@@ -756,6 +767,7 @@ + case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;; + amd64,*,linux) profiling='prof';; + amd64,*,gnu) profiling='prof';; ++ mips,*,gnu) profiling='prof';; + *) profiling='noprof';; + esac + +diff -bur ocaml-3.11.1/asmcomp/mips/proc.ml my_ocaml/asmcomp/mips/proc.ml +--- asmcomp/mips/proc.ml 2007-10-30 13:37:16.000000000 +0100 ++++ asmcomp/mips/proc.ml 2010-03-18 08:08:06.000000000 +0100 +@@ -114,7 +114,7 @@ + incr int + end else begin + loc.(i) <- stack_slot (make_stack !ofs) ty; +- ofs := !ofs + size_int ++ ofs := !ofs + 8 + end + | Float -> + if !float <= last_float then begin +@@ -143,7 +143,7 @@ + or float regs $f12...$f19. Each argument "consumes" both one slot + in the int register file and one slot in the float register file. + Extra arguments are passed on stack, in a 64-bits slot, right-justified +- (i.e. at +4 from natural address). *) ++ (i.e. at +4 from natural address for big endians). *) + + let loc_external_arguments arg = + let loc = Array.create (Array.length arg) Reg.dummy in +@@ -158,7 +158,7 @@ + end else begin + begin match arg.(i).typ with + Float -> loc.(i) <- stack_slot (Outgoing !ofs) Float +- | ty -> loc.(i) <- stack_slot (Outgoing (!ofs + 4)) ty ++ | ty -> loc.(i) <- stack_slot (Outgoing (!ofs + (if big_endian then 4 else 0))) ty + end; + ofs := !ofs + 8 + end + diff --git a/pkgs/development/interpreters/guile/cpp-4.5.patch b/pkgs/development/interpreters/guile/cpp-4.5.patch new file mode 100644 index 00000000000..7e7671f0da0 --- /dev/null +++ b/pkgs/development/interpreters/guile/cpp-4.5.patch @@ -0,0 +1,24 @@ +Fix doc snarfing with GCC 4.5. +From . + +diff --git a/scripts/snarf-check-and-output-texi b/scripts/snarf-check-and-output-texi +index ea33e17..8cd42e8 100755 +--- a/scripts/snarf-check-and-output-texi ++++ b/scripts/snarf-check-and-output-texi +@@ -267,6 +267,17 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" + (set! *file* file) + (set! *line* line)) + ++ ;; newer gccs like to throw around more location markers into the ++ ;; preprocessed source; these (hash . hash) bits are what they translate to ++ ;; in snarfy terms. ++ (('location ('string . file) ('int . line) ('hash . 'hash)) ++ (set! *file* file) ++ (set! *line* line)) ++ ++ (('location ('hash . 'hash) ('string . file) ('int . line) ('hash . 'hash)) ++ (set! *file* file) ++ (set! *line* line)) ++ + (('arglist rest ...) + (set! *args* (do-arglist rest))) diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 8dd7953a42d..dae6a69bcb6 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "1czhcrn6l63xhsw3fjmv88djflqxbdpxjhgmwwvscm8rv4wn7vmz"; }; + patches = [ ./cpp-4.5.patch ]; + buildNativeInputs = [ makeWrapper gawk ]; propagatedBuildInputs = [ readline gmp libtool ]; selfBuildNativeInput = true; @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { # One test fails. # ERROR: file: "libtest-asmobs", message: "file not found" + # This is fixed here: + # . doCheck = false; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/interpreters/spidermonkey/default.nix b/pkgs/development/interpreters/spidermonkey/default.nix index b63b38ebf29..e8d548df548 100644 --- a/pkgs/development/interpreters/spidermonkey/default.nix +++ b/pkgs/development/interpreters/spidermonkey/default.nix @@ -21,5 +21,7 @@ stdenv.mkDerivation rec { sed -e 's/ -ltermcap/ -lncurses/' -i ${makefile} ''; + CFLAGS = "-DPIC -fPIC -DJS_C_STRINGS_ARE_UTF8"; + makeFlags = "-f ${makefile} JS_DIST=\${out} BUILD_OPT=1 JS_READLINE=1"; } diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index ca1b7086e39..7205e0fa7ea 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -1,6 +1,7 @@ -{ stdenv, fetchurl, x11, libXrandr, pkgconfig +{ stdenv, fetchurl, pkgconfig , openglSupport ? false, mesa ? null , alsaSupport ? true, alsaLib ? null +, x11Support ? true, x11 ? null, libXrandr ? null , pulseaudioSupport ? true, pulseaudio ? null }: @@ -8,10 +9,18 @@ # PulseAudio. assert alsaSupport || pulseaudioSupport; -assert openglSupport -> mesa != null; +assert openglSupport -> (mesa != null && x11Support); +assert x11Support -> (x11 != null && libXrandr != null); assert alsaSupport -> alsaLib != null; assert pulseaudioSupport -> pulseaudio != null; +let + configureFlagsFun = attrs: '' + --disable-oss + --disable-x11-shared --disable-alsa-shared --enable-rpath --disable-pulseaudio-shared + ${if alsaSupport then "--with-alsa-prefix=${attrs.alsaLib}/lib" else ""} + ''; +in stdenv.mkDerivation rec { name = "SDL-1.2.14"; @@ -21,7 +30,7 @@ stdenv.mkDerivation rec { }; # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated. - propagatedBuildInputs = [ x11 libXrandr ] ++ + propagatedBuildInputs = stdenv.lib.optionals x11Support [ x11 libXrandr ] ++ stdenv.lib.optional pulseaudioSupport pulseaudio; buildInputs = [ pkgconfig ] ++ @@ -31,11 +40,11 @@ stdenv.mkDerivation rec { # XXX: By default, SDL wants to dlopen() PulseAudio, in which case # we must arrange to add it to its RPATH; however, `patchelf' seems # to fail at doing this, hence `--disable-pulseaudio-shared'. - configureFlags = '' - --disable-oss - --disable-x11-shared --disable-alsa-shared --enable-rpath --disable-pulseaudio-shared - ${if alsaSupport then "--with-alsa-prefix=${alsaLib}/lib" else ""} - ''; + configureFlags = configureFlagsFun { inherit alsaLib; }; + + crossAttrs = { + configureFlags = configureFlagsFun { alsaLib = alsaLib.hostDrv; }; + }; passthru = {inherit openglSupport;}; diff --git a/pkgs/development/libraries/aalib/default.nix b/pkgs/development/libraries/aalib/default.nix index d3230c1fedc..2da006a6ceb 100644 --- a/pkgs/development/libraries/aalib/default.nix +++ b/pkgs/development/libraries/aalib/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, ncurses}: +{stdenv, fetchurl, ncurses, automake}: stdenv.mkDerivation { name = "aalib-1.4rc4"; @@ -7,6 +7,12 @@ stdenv.mkDerivation { url = mirror://sourceforge/aa-project/aalib-1.4rc4.tar.gz; md5 = "d5aa8e9eae07b7441298b5c30490f6a6"; }; + + # The fuloong2f is not supported by aalib still + preConfigure = '' + cp ${automake}/share/automake*/config.{sub,guess} . + ''; + buildInputs = [ncurses]; inherit ncurses; } diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix index 06dd8cb2fb9..5ce81105fa3 100644 --- a/pkgs/development/libraries/acl/default.nix +++ b/pkgs/development/libraries/acl/default.nix @@ -1,21 +1,29 @@ -{stdenv, fetchurl, gettext, attr, libtool}: +{ stdenv, fetchurl, gettext, attr }: -stdenv.mkDerivation { - name = "acl-2.2.47"; +stdenv.mkDerivation rec { + name = "acl-2.2.49"; src = fetchurl { - url = http://nixos.org/tarballs/acl_2.2.47-1.tar.gz; - sha256 = "1j39g62fki0iyji9s62slgwdfskpkqy7rmjlqcnmsvsnxbxhc294"; + url = "mirror://savannah/acl/${name}.src.tar.gz"; + sha256 = "1mg5nxr0r9y08lmyxmm2lfss5jz1xzbs0npsc8597x2f5rsz9ixr"; }; - buildInputs = [gettext attr libtool]; + buildNativeInputs = [gettext]; + buildInputs = [ attr ]; - configureFlags = "MAKE=make LIBTOOL=libtool MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip ECHO=echo SED=sed AWK=gawk"; + # Upstream use C++-style comments in C code. Remove them. + # This comment breaks compilation if too strict gcc flags are used. + patchPhase = '' + echo "Removing C++-style comments from include/acl.h" + sed -e '/^\/\//d' -i include/acl.h + ''; + + configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip ECHO=echo SED=sed AWK=gawk"; installTargets = "install install-lib install-dev"; meta = { - homepage = ftp://oss.sgi.com/projects/xfs/cmd_tars/; + homepage = http://savannah.nongnu.org/projects/acl; description = "Library and tools for manipulating access control lists"; }; } diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix index 532f97a9fdf..6477b443dcf 100644 --- a/pkgs/development/libraries/attr/default.nix +++ b/pkgs/development/libraries/attr/default.nix @@ -1,22 +1,21 @@ -{stdenv, fetchurl, libtool, gettext}: +{ stdenv, fetchurl, gettext }: -stdenv.mkDerivation { - name = "attr-2.4.43"; +stdenv.mkDerivation rec { + name = "attr-2.4.44"; src = fetchurl { - # The SGI site throws away old versions, so don't use it. - url = mirror://gentoo/distfiles/attr_2.4.43-1.tar.gz; - sha256 = "1gy5zspj8ynxv6q29r24d18cfvq06zirg1pxcdg27bg2ncrv4n6k"; + url = "mirror://savannah/attr/${name}.src.tar.gz"; + sha256 = "16244r2vrd57i5fnf7dz3yi2mcckc47jr9y539jvljrzwnw18qlz"; }; - buildInputs = [libtool gettext]; + buildNativeInputs = [gettext]; - configureFlags = "MAKE=make LIBTOOL=libtool MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk"; + configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk"; installTargets = "install install-lib install-dev"; meta = { - homepage = ftp://oss.sgi.com/projects/xfs/cmd_tars/; + homepage = http://savannah.nongnu.org/projects/attr/; description = "Library and tools for manipulating extended attributes"; }; } diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index 8e6f6749533..6d1074165b5 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -1,16 +1,19 @@ {stdenv, fetchurl}: -let version = "7.1"; in +let + version = if stdenv.isMips then "7.2alpha4" else "7.1"; +in stdenv.mkDerivation ({ name = "boehm-gc-${version}"; src = fetchurl { url = "http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-${version}.tar.gz"; - sha256 = "0c5zrsdw0rsli06lahcqwwz0prgah340fhfg7ggfgvz3iw1gdkp3"; + sha256 = (if version == "7.1" then "0c5zrsdw0rsli06lahcqwwz0prgah340fhfg7ggfgvz3iw1gdkp3" + else if version == "7.2alpha4" then "1ya9hr1wbx0hrx29q5zy2k51ml71k9mhqzqs7f505qr9s6jsfh0b" + else throw "Version unknown"); }; - patches = - stdenv.lib.optional (stdenv.system == "i686-cygwin") + patches = stdenv.lib.optional (stdenv.system == "i686-cygwin") ./cygwin-pthread-dl.patch; doCheck = true; diff --git a/pkgs/development/libraries/ccrtp/default.nix b/pkgs/development/libraries/ccrtp/default.nix index 11b8fba8b04..1b00e52a5b6 100644 --- a/pkgs/development/libraries/ccrtp/default.nix +++ b/pkgs/development/libraries/ccrtp/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, openssl, pkgconfig, libgcrypt, commoncpp2 }: stdenv.mkDerivation { - name = "ccrtp-1.7.1"; + name = "ccrtp-1.7.2"; src = fetchurl { - url = mirror://gnu/ccrtp/ccrtp-1.7.1.tar.gz; - sha256 = "0psi91r0fgawpa5x4jiq7lkr180agdi25gi0mfriqcmykxg7r1jn"; + url = mirror://gnu/ccrtp/ccrtp-1.7.2.tar.gz; + sha256 = "1vz759f0342ih95sc7vmzx8als7y2ddr0s3jaaj03x22r7xaqzwy"; }; buildInputs = [ openssl pkgconfig libgcrypt commoncpp2 ]; diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix index b1372d79cb5..ca662d30eb0 100644 --- a/pkgs/development/libraries/cloog-ppl/default.nix +++ b/pkgs/development/libraries/cloog-ppl/default.nix @@ -1,16 +1,32 @@ -{ fetchurl, stdenv, ppl }: +{ fetchurl, stdenv, ppl, static ? false }: + +let + + # --with-host-libstdcxx helps when *ppl* is built statically. + # But I will suppose that this is statically built only when ppl is also + # statically built. + staticFlags = + assert static -> ppl.dontDisableStatic == true; + if static then " --enable-static --disable-shared --with-host-libstdcxx=-lstdc++" else ""; + +in stdenv.mkDerivation rec { - name = "cloog-ppl-0.15.7"; + name = "cloog-ppl-0.15.9"; src = fetchurl { url = "mirror://gcc/infrastructure/${name}.tar.gz"; - sha256 = "0zb96524jk2l78gr5gw0wq3dnvdsmyr2av59v89zv5xcps417q55"; + sha256 = "19a2n75k3d3n8llng25f2g88lpvd4zn0lm073rkndjw6l6yd8m4c"; }; propagatedBuildInputs = [ ppl ]; - configureFlags = "--with-ppl=${ppl}"; + configureFlags = "--with-ppl=${ppl}" + staticFlags; + dontDisableStatic = if static then true else false; + + crossAttrs = { + configureFlags = "--with-ppl=${ppl.hostDrv}" + staticFlags; + }; doCheck = true; diff --git a/pkgs/development/libraries/commoncpp2/default.nix b/pkgs/development/libraries/commoncpp2/default.nix index 8f519a4b43c..81fb723c70a 100644 --- a/pkgs/development/libraries/commoncpp2/default.nix +++ b/pkgs/development/libraries/commoncpp2/default.nix @@ -1,15 +1,19 @@ { fetchurl, stdenv }: stdenv.mkDerivation rec { - name = "commoncpp2-1.8.0"; + name = "commoncpp2-1.8.1"; src = fetchurl { url = "mirror://gnu/commoncpp/${name}.tar.gz"; - sha256 = "0a7arpm9l3s5qics5m77lyx1yl7998lkypydqwx11nj730034nmc"; + sha256 = "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"; }; doCheck = true; + preBuild = '' + echo '#include ' >> inc/cc++/config.h + ''; + meta = { description = "GNU Common C++, a portable, highly optimized C++ class framework"; diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix index c9d14fe8465..0da4d5da3e7 100644 --- a/pkgs/development/libraries/cyrus-sasl/default.nix +++ b/pkgs/development/libraries/cyrus-sasl/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, db4, gettext} : +{ stdenv, fetchurl, openssl, db4, gettext, automake} : stdenv.mkDerivation { name = "cyrus-sasl-2.1.23"; @@ -9,6 +9,7 @@ stdenv.mkDerivation { }; preConfigure='' configureFlags="--with-openssl=${openssl} --with-plugindir=$out/lib/sasl2 --with-configdir=$out/lib/sasl2 --enable-login" + cp ${automake}/share/automake*/config.{sub,guess} config ''; buildInputs = [ openssl db4 gettext ]; patches = [ ./cyrus-sasl-2.1.22-bad-elif.patch ]; diff --git a/pkgs/development/libraries/directfb/default.nix b/pkgs/development/libraries/directfb/default.nix index 0a3c5e5d7b2..55a8a823e1c 100644 --- a/pkgs/development/libraries/directfb/default.nix +++ b/pkgs/development/libraries/directfb/default.nix @@ -1,6 +1,7 @@ -{stdenv, fetchurl, perl, zlib, libjpeg, freetype, - SDL, libX11, xproto, xextproto, libXext, libpng, - renderproto, libXrender, giflib}: +{stdenv, fetchurl, perl, zlib, libjpeg, freetype, libpng, giflib +, enableX11 ? true, libX11, xproto, xextproto, libXext, renderproto, libXrender +, enableSDL ? true, SDL }: + let s = import ./src-for-default.nix; in stdenv.mkDerivation { inherit (s) name; @@ -8,22 +9,30 @@ stdenv.mkDerivation { url = s.url; sha256 = s.hash; }; - buildInputs = [perl zlib libjpeg freetype SDL - xproto libX11 libXext xextproto libpng - renderproto libXrender giflib + + buildNativeInputs = [ perl ]; + + buildInputs = [ zlib libjpeg freetype giflib libpng ] + ++ stdenv.lib.optional enableSDL SDL + ++ stdenv.lib.optionals enableX11 [ + xproto libX11 libXext xextproto + renderproto libXrender ]; + NIX_LDFLAGS="-lgcc_s"; + configureFlags = [ "--enable-sdl" "--enable-zlib" "--with-gfxdrivers=all" "--enable-devmem" "--enable-fbdev" - "--enable-x11" "--enable-mmx" "--enable-sse" "--enable-sysfs" "--with-software" "--with-smooth-scaling" + ] ++ stdenv.lib.optionals enableX11 [ + "--enable-x11" ]; } diff --git a/pkgs/development/libraries/farsight2/default.nix b/pkgs/development/libraries/farsight2/default.nix index b77540ce795..f504849e2d5 100644 --- a/pkgs/development/libraries/farsight2/default.nix +++ b/pkgs/development/libraries/farsight2/default.nix @@ -1,16 +1,22 @@ -{stdenv, fetchurl, libnice, pkgconfig, python, glib, gstreamer, gstPluginsBase}: +{stdenv, fetchurl, libnice, pkgconfig, python, glib, gstreamer, gstPluginsBase, + pygobject, gst_python}: -stdenv.mkDerivation { - name = "farsight2-0.0.16"; +stdenv.mkDerivation rec { + name = "farsight2-0.0.22"; src = fetchurl { - url = http://farsight.freedesktop.org/releases/farsight2/farsight2-0.0.16.tar.gz; + url = "http://farsight.freedesktop.org/releases/farsight2/${name}.tar.gz"; sha256 = "07yjndkx1p7ij1ifxsnbqbr8943wmq768x4812khka7dx6ii1sv9"; }; - buildInputs = [ libnice pkgconfig python glib gstreamer gstPluginsBase ]; + buildInputs = [ libnice pkgconfig python glib gstreamer gstPluginsBase + pygobject gst_python ]; - configureFlags = "--disable-python"; + preBuild = '' + sed -e '/^[[] -z/d' -i python/Makefile + find . -name Makefile -execdir sed -e '/^[.]NOEXPORT:/d' -i '{}' ';' + find . -name Makefile -execdir sed -r -e 's/^ {8,8}/\t/' -i '{}' ';' + ''; patches = [./makefile.patch]; diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix index 01479564dd7..d9f9d0af01d 100644 --- a/pkgs/development/libraries/ffmpeg/default.nix +++ b/pkgs/development/libraries/ffmpeg/default.nix @@ -1,5 +1,5 @@ {stdenv, fetchurl, faad2, libtheora, speex, libvorbis, x264, pkgconfig, xvidcore, lame, yasm -, libvpx}: +, vpxSupport ? false, libvpx ? null}: stdenv.mkDerivation { name = "ffmpeg-0.6"; @@ -12,25 +12,26 @@ stdenv.mkDerivation { # `--enable-gpl' (as well as the `postproc' and `swscale') mean that # the resulting library is GPL'ed, so it can only be used in GPL'ed # applications. - configureFlags = '' - --enable-gpl - --enable-postproc - --enable-swscale - --disable-ffserver - --disable-ffplay - --enable-libfaad - --enable-shared - --enable-libtheora - --enable-libvorbis - --enable-libspeex - --enable-libx264 - --enable-libxvid - --enable-libmp3lame - --enable-runtime-cpudetect - --enable-libvpx - ''; + configureFlags = [ + "--enable-gpl" + "--enable-postproc" + "--enable-swscale" + "--disable-ffserver" + "--disable-ffplay" + "--enable-libfaad" + "--enable-shared" + "--enable-libtheora" + "--enable-libvorbis" + "--enable-libspeex" + "--enable-libx264" + "--enable-libxvid" + "--enable-libmp3lame" + "--enable-runtime-cpudetect" + ] ++ + stdenv.lib.optional vpxSupport "--enable-libvpx"; - buildInputs = [faad2 libtheora speex libvorbis x264 pkgconfig xvidcore lame yasm libvpx]; + buildInputs = [ faad2 libtheora speex libvorbis x264 pkgconfig xvidcore lame yasm ] + ++ stdenv.lib.optional vpxSupport libvpx; meta = { homepage = http://www.ffmpeg.org/; diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix index d6f1d118f82..448fd04edd8 100644 --- a/pkgs/development/libraries/gdbm/default.nix +++ b/pkgs/development/libraries/gdbm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, automake }: stdenv.mkDerivation rec { name = "gdbm-1.8.3"; @@ -9,6 +9,11 @@ stdenv.mkDerivation rec { patches = [ ./install.patch ]; + # The fuloong2f is not supported by gdbm 1.8.3 still + preConfigure = '' + cp ${automake}/share/automake*/config.{sub,guess} . + ''; + meta = { description = "GNU DBM key/value database library"; homepage = http://www.gnu.org/software/gdbm/; diff --git a/pkgs/development/libraries/gettext/0.18.nix b/pkgs/development/libraries/gettext/0.17.nix similarity index 85% rename from pkgs/development/libraries/gettext/0.18.nix rename to pkgs/development/libraries/gettext/0.17.nix index f7f0cb0018c..6b094fdc839 100644 --- a/pkgs/development/libraries/gettext/0.18.nix +++ b/pkgs/development/libraries/gettext/0.17.nix @@ -1,13 +1,11 @@ -# XXX: Remove me when `stdenv-updates' is merged. - { stdenv, fetchurl, libiconv }: stdenv.mkDerivation (rec { - name = "gettext-0.18.1.1"; + name = "gettext-0.17"; src = fetchurl { url = "mirror://gnu/gettext/${name}.tar.gz"; - sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k"; + sha256 = "1fipjpaxxwifdw6cbr7mkxp1yvy643i38nhlh7124bqnisxki5i0"; }; configureFlags = "--disable-csharp"; @@ -23,11 +21,6 @@ stdenv.mkDerivation (rec { fi ''; - crossAttrs = { - buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv) - stdenv.gccCross.libc.libiconv.hostDrv; - }; - meta = { description = "GNU gettext, a well integrated set of translation tools and documentation"; @@ -53,7 +46,6 @@ stdenv.mkDerivation (rec { homepage = http://www.gnu.org/software/gettext/; maintainers = [ stdenv.lib.maintainers.ludo ]; - platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 6b094fdc839..ddcfc327a9e 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -1,11 +1,13 @@ +# XXX: Remove me when `stdenv-updates' is merged. + { stdenv, fetchurl, libiconv }: stdenv.mkDerivation (rec { - name = "gettext-0.17"; + name = "gettext-0.18.1.1"; src = fetchurl { url = "mirror://gnu/gettext/${name}.tar.gz"; - sha256 = "1fipjpaxxwifdw6cbr7mkxp1yvy643i38nhlh7124bqnisxki5i0"; + sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k"; }; configureFlags = "--disable-csharp"; @@ -21,6 +23,13 @@ stdenv.mkDerivation (rec { fi ''; + crossAttrs = { + buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv) + stdenv.gccCross.libc.libiconv.hostDrv; + # Gettext fails to guess the cross compiler + configureFlags = "CXX=${stdenv.cross.config}-g++"; + }; + meta = { description = "GNU gettext, a well integrated set of translation tools and documentation"; @@ -46,6 +55,7 @@ stdenv.mkDerivation (rec { homepage = http://www.gnu.org/software/gettext/; maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/libraries/glib/2.24.x.nix b/pkgs/development/libraries/glib/2.24.x.nix index 5c97ab3c7d8..941697875b0 100644 --- a/pkgs/development/libraries/glib/2.24.x.nix +++ b/pkgs/development/libraries/glib/2.24.x.nix @@ -8,8 +8,9 @@ stdenv.mkDerivation rec { sha256 = "014c3da960bf17117371075c16495f05f36501db990851ceea658f15d2ea6d04"; }; - buildInputs = [ pkgconfig gettext perl ] + buildInputs = [ pkgconfig gettext ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; + buildNativeInputs = [ perl ]; propagatedBuildInputs = [ zlib ]; diff --git a/pkgs/development/libraries/glibc-2.11/audit-suid.patch b/pkgs/development/libraries/glibc-2.11/audit-suid.patch deleted file mode 100644 index 74ec4b763db..00000000000 --- a/pkgs/development/libraries/glibc-2.11/audit-suid.patch +++ /dev/null @@ -1,224 +0,0 @@ -Fix for glibc vulnerability. -http://www.securityfocus.com/bid/44347 - -From: -http://repo.or.cz/w/glibc.git/patch/8e9f92e9d5d7737afdacf79b76d98c4c42980508 - -From 8e9f92e9d5d7737afdacf79b76d98c4c42980508 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Sun, 24 Oct 2010 21:43:15 -0400 -Subject: [PATCH] Require suid bit on audit objects in privileged programs - ---- - ChangeLog | 15 +++++++++++++++ - elf/dl-deps.c | 2 +- - elf/dl-load.c | 20 +++++++++++--------- - elf/dl-open.c | 2 +- - elf/rtld.c | 16 +++++++--------- - include/dlfcn.h | 1 + - sysdeps/generic/ldsodefs.h | 6 ++---- - 7 files changed, 38 insertions(+), 24 deletions(-) - -diff --git a/elf/dl-deps.c b/elf/dl-deps.c -index a58de5c..a51fb6e 100644 ---- a/elf/dl-deps.c -+++ b/elf/dl-deps.c -@@ -62,7 +62,7 @@ openaux (void *a) - { - struct openaux_args *args = (struct openaux_args *) a; - -- args->aux = _dl_map_object (args->map, args->name, 0, -+ args->aux = _dl_map_object (args->map, args->name, - (args->map->l_type == lt_executable - ? lt_library : args->map->l_type), - args->trace_mode, args->open_mode, -diff --git a/elf/dl-load.c b/elf/dl-load.c -index a7162eb..aa8738f 100644 ---- a/elf/dl-load.c -+++ b/elf/dl-load.c -@@ -1812,7 +1812,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader, - if MAY_FREE_DIRS is true. */ - - static int --open_path (const char *name, size_t namelen, int preloaded, -+open_path (const char *name, size_t namelen, int secure, - struct r_search_path_struct *sps, char **realname, - struct filebuf *fbp, struct link_map *loader, int whatcode, - bool *found_other_class) -@@ -1894,7 +1894,7 @@ open_path (const char *name, size_t namelen, int preloaded, - /* Remember whether we found any existing directory. */ - here_any |= this_dir->status[cnt] != nonexisting; - -- if (fd != -1 && __builtin_expect (preloaded, 0) -+ if (fd != -1 && __builtin_expect (secure, 0) - && INTUSE(__libc_enable_secure)) - { - /* This is an extra security effort to make sure nobody can -@@ -1963,7 +1963,7 @@ open_path (const char *name, size_t namelen, int preloaded, - - struct link_map * - internal_function --_dl_map_object (struct link_map *loader, const char *name, int preloaded, -+_dl_map_object (struct link_map *loader, const char *name, - int type, int trace_mode, int mode, Lmid_t nsid) - { - int fd; -@@ -2067,7 +2067,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, - for (l = loader; l; l = l->l_loader) - if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH")) - { -- fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs, -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, -+ &l->l_rpath_dirs, - &realname, &fb, loader, LA_SER_RUNPATH, - &found_other_class); - if (fd != -1) -@@ -2082,14 +2083,15 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, - && main_map != NULL && main_map->l_type != lt_loaded - && cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH, - "RPATH")) -- fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs, -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, -+ &main_map->l_rpath_dirs, - &realname, &fb, loader ?: main_map, LA_SER_RUNPATH, - &found_other_class); - } - - /* Try the LD_LIBRARY_PATH environment variable. */ - if (fd == -1 && env_path_list.dirs != (void *) -1) -- fd = open_path (name, namelen, preloaded, &env_path_list, -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list, - &realname, &fb, - loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded, - LA_SER_LIBPATH, &found_other_class); -@@ -2098,12 +2100,12 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, - if (fd == -1 && loader != NULL - && cache_rpath (loader, &loader->l_runpath_dirs, - DT_RUNPATH, "RUNPATH")) -- fd = open_path (name, namelen, preloaded, -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, - &loader->l_runpath_dirs, &realname, &fb, loader, - LA_SER_RUNPATH, &found_other_class); - - if (fd == -1 -- && (__builtin_expect (! preloaded, 1) -+ && (__builtin_expect (! (mode & __RTLD_SECURE), 1) - || ! INTUSE(__libc_enable_secure))) - { - /* Check the list of libraries in the file /etc/ld.so.cache, -@@ -2169,7 +2171,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, - && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL - || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) - && rtld_search_dirs.dirs != (void *) -1) -- fd = open_path (name, namelen, preloaded, &rtld_search_dirs, -+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, - &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); - - /* Add another newline when we are tracing the library loading. */ -diff --git a/elf/dl-open.c b/elf/dl-open.c -index c394b3f..cf8e8cc 100644 ---- a/elf/dl-open.c -+++ b/elf/dl-open.c -@@ -223,7 +223,7 @@ dl_open_worker (void *a) - - /* Load the named object. */ - struct link_map *new; -- args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0, -+ args->map = new = _dl_map_object (call_map, file, lt_loaded, 0, - mode | __RTLD_CALLMAP, args->nsid); - - /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is -diff --git a/elf/rtld.c b/elf/rtld.c -index 5ecc4fe..06b534a 100644 ---- a/elf/rtld.c -+++ b/elf/rtld.c -@@ -589,7 +589,6 @@ struct map_args - /* Argument to map_doit. */ - char *str; - struct link_map *loader; -- int is_preloaded; - int mode; - /* Return value of map_doit. */ - struct link_map *map; -@@ -627,16 +626,17 @@ static void - map_doit (void *a) - { - struct map_args *args = (struct map_args *) a; -- args->map = _dl_map_object (args->loader, args->str, -- args->is_preloaded, lt_library, 0, args->mode, -- LM_ID_BASE); -+ args->map = _dl_map_object (args->loader, args->str, lt_library, 0, -+ args->mode, LM_ID_BASE); - } - - static void - dlmopen_doit (void *a) - { - struct dlmopen_args *args = (struct dlmopen_args *) a; -- args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT, -+ args->map = _dl_open (args->fname, -+ (RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT -+ | __RTLD_SECURE), - dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv), - __environ); - } -@@ -806,8 +806,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where) - - args.str = fname; - args.loader = main_map; -- args.is_preloaded = 1; -- args.mode = 0; -+ args.mode = __RTLD_SECURE; - - unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded; - -@@ -1054,7 +1053,6 @@ of this helper program; chances are you did not intend to run this program.\n\ - - args.str = rtld_progname; - args.loader = NULL; -- args.is_preloaded = 0; - args.mode = __RTLD_OPENEXEC; - (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit, - &args); -@@ -1066,7 +1064,7 @@ of this helper program; chances are you did not intend to run this program.\n\ - else - { - HP_TIMING_NOW (start); -- _dl_map_object (NULL, rtld_progname, 0, lt_library, 0, -+ _dl_map_object (NULL, rtld_progname, lt_library, 0, - __RTLD_OPENEXEC, LM_ID_BASE); - HP_TIMING_NOW (stop); - -diff --git a/include/dlfcn.h b/include/dlfcn.h -index a67426d..af92483 100644 ---- a/include/dlfcn.h -+++ b/include/dlfcn.h -@@ -9,6 +9,7 @@ - #define __RTLD_OPENEXEC 0x20000000 - #define __RTLD_CALLMAP 0x10000000 - #define __RTLD_AUDIT 0x08000000 -+#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */ - - #define __LM_ID_CALLER -2 - -diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h -index fcc943b..fa4b6b2 100644 ---- a/sysdeps/generic/ldsodefs.h -+++ b/sysdeps/generic/ldsodefs.h -@@ -824,11 +824,9 @@ extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *), - - /* Open the shared object NAME and map in its segments. - LOADER's DT_RPATH is used in searching for NAME. -- If the object is already opened, returns its existing map. -- For preloaded shared objects PRELOADED is set to a non-zero -- value to allow additional security checks. */ -+ If the object is already opened, returns its existing map. */ - extern struct link_map *_dl_map_object (struct link_map *loader, -- const char *name, int preloaded, -+ const char *name, - int type, int trace_mode, int mode, - Lmid_t nsid) - internal_function attribute_hidden; --- -1.6.5.GIT - diff --git a/pkgs/development/libraries/glibc-2.11/builder.sh b/pkgs/development/libraries/glibc-2.11/builder.sh deleted file mode 100644 index cbdb55b121b..00000000000 --- a/pkgs/development/libraries/glibc-2.11/builder.sh +++ /dev/null @@ -1,41 +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 - - # Include the Linux kernel headers in Glibc, except the `scsi' - # subdirectory, which Glibc provides itself. - (cd $out/include && ln -s $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) - - # 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.11/ignore-origin.patch b/pkgs/development/libraries/glibc-2.11/ignore-origin.patch deleted file mode 100644 index ce3efca5859..00000000000 --- a/pkgs/development/libraries/glibc-2.11/ignore-origin.patch +++ /dev/null @@ -1,85 +0,0 @@ -Fix for CVE-2010-3847. - -2010-10-18 Andreas Schwab - - * elf/dl-load.c (is_dst): Remove last parameter. - (_dl_dst_count): Ignore $ORIGIN in privileged programs. - (_dl_dst_substitute): Likewise. ---- - elf/dl-load.c | 30 +++++++++++++----------------- - 1 files changed, 13 insertions(+), 17 deletions(-) - -diff --git a/elf/dl-load.c b/elf/dl-load.c -index a7162eb..776f7e4 100644 ---- a/elf/dl-load.c -+++ b/elf/dl-load.c -@@ -169,8 +169,7 @@ local_strdup (const char *s) - - - static size_t --is_dst (const char *start, const char *name, const char *str, -- int is_path, int secure) -+is_dst (const char *start, const char *name, const char *str, int is_path) - { - size_t len; - bool is_curly = false; -@@ -199,11 +198,6 @@ is_dst (const char *start, const char *name, const char *str, - && (!is_path || name[len] != ':')) - return 0; - -- if (__builtin_expect (secure, 0) -- && ((name[len] != '\0' && (!is_path || name[len] != ':')) -- || (name != start + 1 && (!is_path || name[-2] != ':')))) -- return 0; -- - return len; - } - -@@ -218,13 +212,12 @@ _dl_dst_count (const char *name, int is_path) - { - size_t len; - -- /* $ORIGIN is not expanded for SUID/GUID programs (except if it -- is $ORIGIN alone) and it must always appear first in path. */ -+ /* $ORIGIN is not expanded for SUID/GUID programs. */ - ++name; -- if ((len = is_dst (start, name, "ORIGIN", is_path, -- INTUSE(__libc_enable_secure))) != 0 -- || (len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0 -- || (len = is_dst (start, name, "LIB", is_path, 0)) != 0) -+ if (((len = is_dst (start, name, "ORIGIN", is_path)) != 0 -+ && !INTUSE(__libc_enable_secure)) -+ || (len = is_dst (start, name, "PLATFORM", is_path)) != 0 -+ || (len = is_dst (start, name, "LIB", is_path)) != 0) - ++cnt; - - name = strchr (name + len, '$'); -@@ -256,9 +249,12 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, - size_t len; - - ++name; -- if ((len = is_dst (start, name, "ORIGIN", is_path, -- INTUSE(__libc_enable_secure))) != 0) -+ if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0) - { -+ /* Ignore this path element in SUID/SGID programs. */ -+ if (INTUSE(__libc_enable_secure)) -+ repl = (const char *) -1; -+ else - #ifndef SHARED - if (l == NULL) - repl = _dl_get_origin (); -@@ -266,9 +262,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, - #endif - repl = l->l_origin; - } -- else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0) -+ else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0) - repl = GLRO(dl_platform); -- else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0) -+ else if ((len = is_dst (start, name, "LIB", is_path)) != 0) - repl = DL_DST_LIB; - - if (repl != NULL && repl != (const char *) -1) --- -1.7.2.3 diff --git a/pkgs/development/libraries/glibc-2.11/locale-override.patch b/pkgs/development/libraries/glibc-2.11/locale-override.patch deleted file mode 100644 index 108d0e35dac..00000000000 --- a/pkgs/development/libraries/glibc-2.11/locale-override.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c -*** glibc-2.9-20081208-orig/locale/loadarchive.c 2005-09-09 18:56:52.000000000 +0200 ---- glibc-2.9-20081208/locale/loadarchive.c 2009-04-19 13:54:26.000000000 +0200 -*************** -*** 124,129 **** ---- 124,142 ---- - } - - -+ static int -+ open_locale_archive () -+ { -+ int fd = -1; -+ char *path = getenv ("LOCALE_ARCHIVE"); -+ if (path) -+ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE); -+ if (fd < 0) -+ fd = open_not_cancel_2 (archfname, 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,209 **** - archmapped = &headmap; - - /* The archive has never been opened. */ -! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); - if (fd < 0) - /* Cannot open the archive, for whatever reason. */ - return NULL; ---- 216,222 ---- - archmapped = &headmap; - - /* The archive has never been opened. */ -! fd = open_locale_archive (); - if (fd < 0) - /* Cannot open the archive, for whatever reason. */ - return NULL; -*************** -*** 394,400 **** - if (fd == -1) - { - struct stat64 st; -! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); - if (fd == -1) - /* Cannot open the archive, for whatever reason. */ - return NULL; ---- 407,413 ---- - if (fd == -1) - { - struct stat64 st; -! fd = open_locale_archive (); - if (fd == -1) - /* Cannot open the archive, for whatever reason. */ - return NULL; -diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h -*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h 2006-10-11 18:24:05.000000000 +0200 ---- glibc-2.9-20081208/sysdeps/generic/unsecvars.h 2009-04-19 13:55:34.000000000 +0200 -*************** -*** 16,21 **** ---- 16,22 ---- - "LD_SHOW_AUXV\0" \ - "LD_USE_LOAD_BIAS\0" \ - "LOCALDOMAIN\0" \ -+ "LOCALE_ARCHIVE\0" \ - "LOCPATH\0" \ - "MALLOC_TRACE\0" \ - "NIS_PATH\0" \ diff --git a/pkgs/development/libraries/glibc-2.11/mod_nano.patch b/pkgs/development/libraries/glibc-2.11/mod_nano.patch deleted file mode 100644 index 2fb35b3df38..00000000000 --- a/pkgs/development/libraries/glibc-2.11/mod_nano.patch +++ /dev/null @@ -1,31 +0,0 @@ -commit 89b432d7a5befb85048c97e881b2106e8df58e43 -Author: Ulrich Drepper -Date: Sun Nov 22 10:23:12 2009 -0800 - - Fix up a bit more for recent API changes. - -diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h -index 5f10c7f..88b87f1 100644 ---- a/sysdeps/unix/sysv/linux/sys/timex.h -+++ b/sysdeps/unix/sysv/linux/sys/timex.h -@@ -85,6 +85,9 @@ struct timex - #define MOD_TIMECONST ADJ_TIMECONST - #define MOD_CLKB ADJ_TICK - #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ -+#define MOD_TAI ADJ_TAI -+#define MOD_MICRO ADJ_MICRO -+#define MOD_NANO ADJ_NANO - - - /* Status codes (timex.status) */ -@@ -108,8 +111,9 @@ struct timex - #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ - #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ - -+/* Read-only bits */ - #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ -- STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ -+ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) - - /* Clock states (time_state) */ - #define TIME_OK 0 /* clock synchronized, no leap second */ diff --git a/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch deleted file mode 100644 index dc09b509870..00000000000 --- a/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c -*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c 2008-07-30 21:14:22.000000000 +0200 ---- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c 2008-12-10 11:39:32.000000000 +0100 -*************** -*** 505,512 **** - 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; - ---- 505,510 ---- -*************** -*** 702,707 **** ---- 700,707 ---- - - while (!no_more) - { -+ enum nss_status inet6_status = NSS_STATUS_UNAVAIL; -+ enum nss_status status = NSS_STATUS_UNAVAIL; - nss_gethostbyname4_r fct4 - = __nss_lookup_function (nip, "gethostbyname4_r"); - if (fct4 != NULL) diff --git a/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch b/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch deleted file mode 100644 index d200ece52df..00000000000 --- a/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch +++ /dev/null @@ -1,12 +0,0 @@ -Make sure `nscd' et al. are linked against `libssp'. - ---- glibc-2.11/nscd/Makefile 2009-10-30 18:17:08.000000000 +0100 -+++ glibc-2.11/nscd/Makefile 2009-11-22 01:19:37.000000000 +0100 -@@ -126,6 +126,7 @@ CFLAGS-res_hconf.c += $(nscd-cflags) - ifeq (yesyes,$(have-fpie)$(build-shared)) - relro-LDFLAGS += -Wl,-z,now - -+$(objpfx)nscd: LDFLAGS += -lssp - $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o)) - $(+link-pie) - endif diff --git a/pkgs/development/libraries/glibc-2.11/builder2.sh b/pkgs/development/libraries/glibc-2.12/builder.sh similarity index 95% rename from pkgs/development/libraries/glibc-2.11/builder2.sh rename to pkgs/development/libraries/glibc-2.12/builder.sh index 7d1a05131c2..9a1c1490019 100644 --- a/pkgs/development/libraries/glibc-2.11/builder2.sh +++ b/pkgs/development/libraries/glibc-2.12/builder.sh @@ -1,6 +1,3 @@ -### XXX: This file should replace `builder.sh' in the `stdenv-updates' -### branch! - # Glibc cannot have itself in its RPATH. export NIX_NO_SELF_RPATH=1 diff --git a/pkgs/development/libraries/glibc-2.11/common.nix b/pkgs/development/libraries/glibc-2.12/common.nix similarity index 76% rename from pkgs/development/libraries/glibc-2.11/common.nix rename to pkgs/development/libraries/glibc-2.12/common.nix index a44f011ae0c..0ffc8d7a0e8 100644 --- a/pkgs/development/libraries/glibc-2.11/common.nix +++ b/pkgs/development/libraries/glibc-2.12/common.nix @@ -11,9 +11,20 @@ cross : let # For GNU/Hurd, see below. - date = "20100512"; - rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f"; - version = if hurdHeaders != null then date else "2.11.1"; + version = if hurdHeaders != null then "20100512" else "2.12.2"; + + needsPortsNative = stdenv.isMips || stdenv.isArm; + needsPortsCross = cross.arch == "mips" || cross.arch == "arm"; + needsPorts = if (stdenv ? cross) && stdenv.cross != null then true + else if cross == null then needsPortsNative + else needsPortsCross; + + srcPorts = fetchurl { + # These should work equally well for 2.12.2 + url = "mirror://gnu/glibc/glibc-ports-2.12.1.tar.bz2"; + sha256 = "041ix0nq7nc5r7jf80jsdlw4idah2mjp5nf7khybhc4cs1kc31ir"; + }; + in assert (cross != null) -> (gccCross != null); @@ -56,31 +67,29 @@ stdenv.mkDerivation ({ 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 - ++ [ - /* Make it possible to override the locale-archive in NixOS. */ - ./locale-override.patch + /* Allow nixos and nix handle the locale-archive. */ + ./nix-locale-archive.patch - /* Have rpcgen(1) look for cpp(1) in $PATH. */ - ./rpcgen-path.patch + ]; - /* Make sure `nscd' et al. are linked against `libssp'. */ - ./stack-protector-link.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 - /* Fix for CVE-2010-3856. */ - ./audit-suid.patch - - /* Fix for CVE-2010-3856. */ - ./ignore-origin.patch - ] - - ++ stdenv.lib.optional (fetchgit == null) - /* MOD_NANO definition, for ntp (taken from glibc upstream) */ - ./mod_nano.patch; + # 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" + "--localedir=/var/run/current-system/sw/lib/locale" (if kernelHeaders != null then "--with-headers=${kernelHeaders}/include" else "--without-headers") @@ -96,8 +105,12 @@ stdenv.mkDerivation ({ "--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" + ]; + buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ] ++ stdenv.lib.optional (mig != null) mig; @@ -114,9 +127,9 @@ stdenv.mkDerivation ({ NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686"; } -# FIXME: This is way too broad and causes the *native* glibc to have a -# different store path dependending on whether `cross' is null or not. -// args // +# 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}" + @@ -130,18 +143,13 @@ stdenv.mkDerivation ({ # See . url = "git://git.sv.gnu.org/hurd/glibc.git"; sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e"; - inherit rev; + rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f"; } else fetchurl { url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; - sha256 = "18azb6518ryqhkfmddr25p0h1s2msrmx7dblij58sjlnzh61vq34"; + sha256 = "05hjz816a2hmzc44gxxi9vrdx6l9f23az794zj45xsxr94yfpy12"; }; - srcPorts = fetchurl { - url = "mirror://gnu/glibc/glibc-ports-2.11.tar.bz2"; - sha256 = "12b53f5k4gcr8rr1kg2ycf2701rygqsyf9r8gz4j3l9flaqi5liq"; - }; - # `fetchurl' is a function and thus should not be passed to the # `derivation' primitive. fetchurl = null; @@ -155,12 +163,12 @@ stdenv.mkDerivation ({ sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" done - tar xvjf "$srcPorts" + ${if needsPorts then "tar xvf ${srcPorts}" else ""} mkdir ../build cd ../build - configureScript="../$sourceRoot/configure" + configureScript="`pwd`/../$sourceRoot/configure" ${preConfigure} ''; diff --git a/pkgs/development/libraries/glibc-2.11/default.nix b/pkgs/development/libraries/glibc-2.12/default.nix similarity index 93% rename from pkgs/development/libraries/glibc-2.11/default.nix rename to pkgs/development/libraries/glibc-2.12/default.nix index a9d82e677b1..31a8ef13a4f 100644 --- a/pkgs/development/libraries/glibc-2.11/default.nix +++ b/pkgs/development/libraries/glibc-2.12/default.nix @@ -50,9 +50,6 @@ in # thing. inherit propagatedBuildInputs; }; - - # XXX: Remove this hack in `stdenv-updates'. - builder = ./builder2.sh; } else { }) @@ -77,5 +74,10 @@ in 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.11/info.nix b/pkgs/development/libraries/glibc-2.12/info.nix similarity index 100% rename from pkgs/development/libraries/glibc-2.11/info.nix rename to pkgs/development/libraries/glibc-2.12/info.nix diff --git a/pkgs/development/libraries/glibc-2.11/locales-builder.sh b/pkgs/development/libraries/glibc-2.12/locales-builder.sh similarity index 100% rename from pkgs/development/libraries/glibc-2.11/locales-builder.sh rename to pkgs/development/libraries/glibc-2.12/locales-builder.sh diff --git a/pkgs/development/libraries/glibc-2.11/locales.nix b/pkgs/development/libraries/glibc-2.12/locales.nix similarity index 80% rename from pkgs/development/libraries/glibc-2.11/locales.nix rename to pkgs/development/libraries/glibc-2.12/locales.nix index 821eddd41f0..d598e0e094d 100644 --- a/pkgs/development/libraries/glibc-2.11/locales.nix +++ b/pkgs/development/libraries/glibc-2.12/locales.nix @@ -26,10 +26,15 @@ in 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 \ - LOCALEDEF="localedef --prefix=$TMPDIR" \ localedir=$out/lib/locale \ - ${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""} ''; installPhase = diff --git a/pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch b/pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch new file mode 100644 index 00000000000..aca904f7ff4 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch @@ -0,0 +1,116 @@ +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.12/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.12/nss-skip-unavail.patch new file mode 100644 index 00000000000..e48dc2bc0a6 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.12/nss-skip-unavail.patch @@ -0,0 +1,21 @@ +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.11/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.12/rpcgen-path.patch similarity index 100% rename from pkgs/development/libraries/glibc-2.11/rpcgen-path.patch rename to pkgs/development/libraries/glibc-2.12/rpcgen-path.patch diff --git a/pkgs/development/libraries/glpk/default.nix b/pkgs/development/libraries/glpk/default.nix index d767cf4e3f3..1970ab57c9b 100644 --- a/pkgs/development/libraries/glpk/default.nix +++ b/pkgs/development/libraries/glpk/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv }: stdenv.mkDerivation rec { - name = "glpk-4.44"; + name = "glpk-4.45"; src = fetchurl { url = "mirror://gnu/glpk/${name}.tar.gz"; - sha256 = "0vby7idacxr4mzj2jrdrawrp91rl135zvnr3al5kdrqy0ik476i8"; + sha256 = "13797cvyrvhga22klap9y370dlbnh40z5cf1dfkdjdj47mhwn1wj"; }; doCheck = true; diff --git a/pkgs/development/libraries/gmp/4.nix b/pkgs/development/libraries/gmp/4.nix new file mode 100644 index 00000000000..c5a59045bbe --- /dev/null +++ b/pkgs/development/libraries/gmp/4.nix @@ -0,0 +1,59 @@ +{stdenv, fetchurl, m4, cxx ? true, static ? false}: + +let + staticFlags = if static then " --enable-static --disable-shared" else ""; +in + +stdenv.mkDerivation rec { + name = "gmp-4.3.2"; + + src = fetchurl { + url = "mirror://gnu/gmp/${name}.tar.bz2"; + sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck"; + }; + + buildNativeInputs = [m4]; + + # Prevent the build system from using sub-architecture-specific + # instructions (e.g., SSE2 on i686). + preConfigure = "ln -sf configfsf.guess config.guess"; + + configureFlags = (if cxx then "--enable-cxx" else "--disable-cxx") + + staticFlags; + + dontDisableStatic = if static then true else false; + + doCheck = true; + + meta = { + description = "GMP, the GNU multiple precision arithmetic library"; + + longDescription = + '' GMP is a free library for arbitrary precision arithmetic, operating + on signed integers, rational numbers, and floating point numbers. + There is no practical limit to the precision except the ones implied + by the available memory in the machine GMP runs on. GMP has a rich + set of functions, and the functions have a regular interface. + + The main target applications for GMP are cryptography applications + and research, Internet security applications, algebra systems, + computational algebra research, etc. + + GMP is carefully designed to be as fast as possible, both for small + operands and for huge operands. The speed is achieved by using + fullwords as the basic arithmetic type, by using fast algorithms, + with highly optimised assembly code for the most common inner loops + for a lot of CPUs, and by a general emphasis on speed. + + GMP is faster than any other bignum library. The advantage for GMP + increases with the operand sizes for many operations, since GMP uses + asymptotically faster algorithms. + ''; + + homepage = http://gmplib.org/; + license = "LGPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/libraries/gmp/default.nix b/pkgs/development/libraries/gmp/default.nix index ac20bc68f4d..338debaa81e 100644 --- a/pkgs/development/libraries/gmp/default.nix +++ b/pkgs/development/libraries/gmp/default.nix @@ -1,27 +1,61 @@ -{stdenv, fetchurl, m4, cxx ? true}: +{stdenv, fetchurl, m4, cxx ? true, static ? false}: + +let + staticFlags = if static then " --enable-static --disable-shared" else ""; +in stdenv.mkDerivation rec { - name = "gmp-4.3.2"; + name = "gmp-5.0.1"; src = fetchurl { url = "mirror://gnu/gmp/${name}.tar.bz2"; - sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck"; + sha256 = "1yrr14l6vvhm1g27y8nb3c75j0i4ii4k1gw7ik08safk3zq119m2"; }; buildNativeInputs = [m4]; + # Prevent the build system from using sub-architecture-specific + # instructions (e.g., SSE2 on i686). preConfigure = "ln -sf configfsf.guess config.guess"; - configureFlags = if cxx then "--enable-cxx" else "--disable-cxx"; + configureFlags = if cxx then "--enable-cxx" else "--disable-cxx" + + staticFlags; + + dontDisableStatic = if static then true else false; doCheck = true; enableParallelBuilding = true; meta = { - description = "A free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"; + description = "GMP, the GNU multiple precision arithmetic library"; + + longDescription = + '' GMP is a free library for arbitrary precision arithmetic, operating + on signed integers, rational numbers, and floating point numbers. + There is no practical limit to the precision except the ones implied + by the available memory in the machine GMP runs on. GMP has a rich + set of functions, and the functions have a regular interface. + + The main target applications for GMP are cryptography applications + and research, Internet security applications, algebra systems, + computational algebra research, etc. + + GMP is carefully designed to be as fast as possible, both for small + operands and for huge operands. The speed is achieved by using + fullwords as the basic arithmetic type, by using fast algorithms, + with highly optimised assembly code for the most common inner loops + for a lot of CPUs, and by a general emphasis on speed. + + GMP is faster than any other bignum library. The advantage for GMP + increases with the operand sizes for many operations, since GMP uses + asymptotically faster algorithms. + ''; + homepage = http://gmplib.org/; - license = "LGPL"; + license = "LGPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix index 666e5f539ed..04676611245 100644 --- a/pkgs/development/libraries/gnutls/default.nix +++ b/pkgs/development/libraries/gnutls/default.nix @@ -5,11 +5,11 @@ assert guileBindings -> guile != null; stdenv.mkDerivation rec { - name = "gnutls-2.10.2"; + name = "gnutls-2.10.4"; src = fetchurl { url = "mirror://gnu/gnutls/${name}.tar.bz2"; - sha256 = "09479y0qy91qg20kkq9j0yy4agnpi4knb8ciq83cq0lvqqzplbp8"; + sha256 = "1j2zfjipvzqfamyygndckjksizb5dd7f9wazvfciwrzya1jf7gxq"; }; configurePhase = '' diff --git a/pkgs/development/libraries/gstreamer/default.nix b/pkgs/development/libraries/gstreamer/default.nix index 37c88580a8a..723d4176e35 100644 --- a/pkgs/development/libraries/gstreamer/default.nix +++ b/pkgs/development/libraries/gstreamer/default.nix @@ -13,6 +13,8 @@ rec { gnonlin = callPackage ./gnonlin { }; + gst_python = callPackage ./gst-python {}; + # Header files are in include/${prefix}/ prefix = "gstreamer-0.10"; } diff --git a/pkgs/development/libraries/gstreamer/gnonlin/default.nix b/pkgs/development/libraries/gstreamer/gnonlin/default.nix index 907f569faed..1ba33f07b1e 100644 --- a/pkgs/development/libraries/gstreamer/gnonlin/default.nix +++ b/pkgs/development/libraries/gstreamer/gnonlin/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchurl, pkgconfig, gstPluginsBase, gstreamer }: stdenv.mkDerivation rec { - name = "gnonlin-0.10.14"; + name = "gnonlin-0.10.15"; src = fetchurl { urls = [ - "http://gstreamer.freedesktop.org/src/gnonlin/${name}.tar.gz" - "mirror://gentoo/distfiles/${name}.tar.gz" + "http://gstreamer.freedesktop.org/src/gnonlin/${name}.tar.bz2" + "mirror://gentoo/distfiles/${name}.tar.bz2" ]; - sha256 = "10gp3hz9a6hrrmdaa3i2ry79fyr402il1qr0vpsd6ayn02gcj93w"; + sha256 = "1yz0i3vzpadz5axwdb310bypl4rm1xy2n6mgajja0w2z6afnrfv0"; }; buildInputs = [ gstPluginsBase gstreamer pkgconfig ]; diff --git a/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix b/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix index e8ea3f2152c..9132e6b0a8f 100644 --- a/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix +++ b/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix @@ -1,14 +1,14 @@ { fetchurl, stdenv, pkgconfig, gstPluginsBase, bzip2, liboil }: stdenv.mkDerivation rec { - name = "gst-ffmpeg-0.10.9"; + name = "gst-ffmpeg-0.10.11"; src = fetchurl { urls = [ "http://gstreamer.freedesktop.org/src/gst-ffmpeg/${name}.tar.bz2" "mirror://gentoo/distfiles/${name}.tar.bz2" ]; - sha256 = "05cg5jzl8wccsr495hgs7cgdkc6dfi1v218fsm5fv2slgly1pvb3"; + sha256 = "0bk9k9sccx9nvhjakacvq8gd6vp63x9ddmjrqkfdhkmgwlwa2dpz"; }; propagatedBuildInputs = [ gstPluginsBase ]; diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix index dc8d84886c0..4a1a2de4dac 100644 --- a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix +++ b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix @@ -18,7 +18,10 @@ stdenv.mkDerivation rec { sha256 = "1mw5n1w7l0hgyzf75srdxlh3knfgrmddbs2ah1f97s8b710qd4v3"; }; - patchPhase = "sed -i 's@/bin/echo@echo@g' configure"; + patchPhase = '' + sed -i 's@/bin/echo@echo@g' configure + sed -i -e 's/^ /\t/' docs/{libs,plugins}/Makefile.in + ''; # TODO : v4l, libvisual buildInputs = diff --git a/pkgs/development/libraries/gstreamer/gst-python/default.nix b/pkgs/development/libraries/gstreamer/gst-python/default.nix new file mode 100644 index 00000000000..98a2a07aa61 --- /dev/null +++ b/pkgs/development/libraries/gstreamer/gst-python/default.nix @@ -0,0 +1,30 @@ +{ fetchurl, stdenv, pkgconfig, python, gstreamer + , gstPluginsBase, pygtk +}: + +stdenv.mkDerivation rec { + name = "gst-python-0.10.19"; + + src = fetchurl { + urls = [ + "${meta.homepage}/src/gst-python/${name}.tar.bz2" + "mirror://gentoo/distfiles/${name}.tar.bz2" + ]; + sha256 = "956f81a8c15daa3f17e688a0dc5a5d18a3118141066952d3b201a6ac0c52b415"; + }; + + buildInputs = + [ pkgconfig gstPluginsBase pygtk ] + ; + + propagatedBuildInputs = [ gstreamer python ]; + + meta = { + homepage = http://gstreamer.freedesktop.org; + + description = "Python bindings for GStreamer"; + + license = "LGPLv2+"; + }; +} + diff --git a/pkgs/development/libraries/gstreamer/gstreamer/default.nix b/pkgs/development/libraries/gstreamer/gstreamer/default.nix index 0b43fa7d2c8..7edf0325b2a 100644 --- a/pkgs/development/libraries/gstreamer/gstreamer/default.nix +++ b/pkgs/development/libraries/gstreamer/gstreamer/default.nix @@ -14,6 +14,10 @@ stdenv.mkDerivation rec { buildInputs = [ perl bison flex pkgconfig ]; propagatedBuildInputs = [ glib libxml2 ]; + patchPhase = '' + sed -i -e 's/^ /\t/' docs/gst/Makefile.in docs/libs/Makefile.in docs/plugins/Makefile.in + ''; + configureFlags = '' --disable-examples --enable-failing-tests --localstatedir=/var --disable-gtk-doc --disable-docbook ''; diff --git a/pkgs/development/libraries/libao/default.nix b/pkgs/development/libraries/libao/default.nix index 856980f1025..ae70e775dd1 100644 --- a/pkgs/development/libraries/libao/default.nix +++ b/pkgs/development/libraries/libao/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, pulseaudio +{ stdenv, fetchurl, pkgconfig, pulseaudio, alsaLib , usePulseAudio }: stdenv.mkDerivation { @@ -8,7 +8,8 @@ stdenv.mkDerivation { sha256 = "e52e05af6b10f42d2ee9845df1a581bf2b352060eabf7946aee0a600c3878954"; }; - buildInputs = [ pkgconfig ] ++ stdenv.lib.optional usePulseAudio pulseaudio; + buildInputs = [ pkgconfig alsaLib ] ++ (if usePulseAudio then [ pulseaudio ] + else [ alsaLib ]); meta = { longDescription = '' diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix index 2121449af5a..fb45563a179 100644 --- a/pkgs/development/libraries/libedit/default.nix +++ b/pkgs/development/libraries/libedit/default.nix @@ -1,17 +1,19 @@ { stdenv, fetchurl, ncurses}: stdenv.mkDerivation rec { - name = "libedit-20090923-3.0"; + name = "libedit-20100424-3.0"; src = fetchurl { url = "http://www.thrysoee.dk/editline/${name}.tar.gz"; - sha256 = "02j66qbd1c9wfghpjb8dzshkcj4i0n9xanxy81552j3is9ilxjka"; + sha256 = "11hxaq58gym7kqccjhxywjxdibffzg545z1aj997y1dn0rckhav0"; }; postInstall = '' - sed -i s/-lcurses/-lncurses/g $out/lib/pkgconfig/libedit.pc + sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc ''; + configureFlags = "--enable-widec"; + propagatedBuildInputs = [ ncurses ]; meta = { diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix index 438cc212b54..038fbef69e5 100644 --- a/pkgs/development/libraries/libgcrypt/default.nix +++ b/pkgs/development/libraries/libgcrypt/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, libgpgerror }: stdenv.mkDerivation rec { - name = "libgcrypt-1.4.5"; + name = "libgcrypt-1.4.6"; src = fetchurl { url = "mirror://gnupg/libgcrypt/${name}.tar.bz2"; - sha256 = "0h4ypld775rm1g15v134pkq9wc6ixszn6766gqv7bpi4ady90vs9"; + sha256 = "11bbpjlqwp0nh4q76wmsk6z1812anqrj28nh6d9mcyrmdgd30jry"; }; propagatedBuildInputs = [ libgpgerror ]; diff --git a/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch b/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch new file mode 100644 index 00000000000..1d8b385e0c5 --- /dev/null +++ b/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch @@ -0,0 +1,73 @@ +Taken from openwrt: +https://dev.openwrt.org/browser/packages/libs/libmad/patches/001-mips_removal_h_constraint.patch?rev=18548 + +diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h +--- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030 ++++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930 +@@ -299,6 +299,23 @@ + + # elif defined(FPM_MIPS) + ++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */ ++#if defined (__GNUC__) && defined (__GNUC_MINOR__) ++#define __GNUC_PREREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++#define __GNUC_PREREQ(maj, min) 0 ++#endif ++ ++#if __GNUC_PREREQ(4,4) ++ typedef unsigned int u64_di_t __attribute__ ((mode (DI))); ++# define MAD_F_MLX(hi, lo, x, y) \ ++ do { \ ++ u64_di_t __ll = (u64_di_t) (x) * (y); \ ++ hi = __ll >> 32; \ ++ lo = __ll; \ ++ } while (0) ++#else + /* + * This MIPS version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). +@@ -328,6 +345,7 @@ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) + # endif ++#endif /* __GNU_PREREQ(4,4) */ + + # if defined(OPT_SPEED) + # define mad_f_scale64(hi, lo) \ +diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h +--- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030 ++++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930 +@@ -344,6 +344,23 @@ + + # elif defined(FPM_MIPS) + ++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */ ++#if defined (__GNUC__) && defined (__GNUC_MINOR__) ++#define __GNUC_PREREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++#define __GNUC_PREREQ(maj, min) 0 ++#endif ++ ++#if __GNUC_PREREQ(4,4) ++ typedef unsigned int u64_di_t __attribute__ ((mode (DI))); ++# define MAD_F_MLX(hi, lo, x, y) \ ++ do { \ ++ u64_di_t __ll = (u64_di_t) (x) * (y); \ ++ hi = __ll >> 32; \ ++ lo = __ll; \ ++ } while (0) ++#else + /* + * This MIPS version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). +@@ -373,6 +390,7 @@ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) + # endif ++#endif /* __GNU_PREREQ(4,4) */ + + # if defined(OPT_SPEED) + # define mad_f_scale64(hi, lo) \ diff --git a/pkgs/development/libraries/libmad/default.nix b/pkgs/development/libraries/libmad/default.nix index 83070b92ac6..178e65d2506 100644 --- a/pkgs/development/libraries/libmad/default.nix +++ b/pkgs/development/libraries/libmad/default.nix @@ -8,11 +8,13 @@ stdenv.mkDerivation { sha256 = "bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690"; }; - patches = [ ./pkgconfig.patch ]; + patches = [ ./001-mips_removal_h_constraint.patch ./pkgconfig.patch ]; + + buildNativeInputs = [ autoconf ]; # The -fforce-mem flag has been removed in GCC 4.3. preConfigure = '' - ${autoconf}/bin/autoconf + autoconf substituteInPlace configure --replace "-fforce-mem" "" ''; diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix index a2fdeb09ce0..0f33174bf9f 100644 --- a/pkgs/development/libraries/libtasn1/default.nix +++ b/pkgs/development/libraries/libtasn1/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "libtasn1-2.8"; + name = "libtasn1-2.9"; src = fetchurl { url = "mirror://gnu/libtasn1/${name}.tar.gz"; - sha256 = "0njl5l9h48v2ikfim96yxpnwjhhfwfmszz4i08psw60bn7s78z9b"; + sha256 = "1i0jnk810hg88jh3bhq63yn0n2cfmpmhrdm1ypv8rc68z9anii7s"; }; doCheck = true; diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix new file mode 100644 index 00000000000..b6f8260bc19 --- /dev/null +++ b/pkgs/development/libraries/libvdpau/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchurl, pkgconfig, xlibs }: + +stdenv.mkDerivation rec { + name = "libvdpau-0.4.1"; + + src = fetchurl { + url = "http://people.freedesktop.org/~aplattner/vdpau/${name}.tar.gz"; + sha256 = "16zmmbawfnvrxjqvgfwxjfd1wh3vyz2cmvxza6cgf4j9qs36y6q6"; + }; + + buildInputs = [ pkgconfig xlibs.libX11 ]; + + meta = { + homepage = http://people.freedesktop.org/~aplattner/vdpau/; + description = "Library to use the Video Decode and Presentation API for Unix (VDPAU)"; + license = "bsd"; + }; +} diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix index 7cd2e4d639b..e6c8149edc0 100644 --- a/pkgs/development/libraries/libvpx/default.nix +++ b/pkgs/development/libraries/libvpx/default.nix @@ -11,14 +11,25 @@ stdenv.mkDerivation rec { patchPhase = '' sed -e 's,/bin/bash,${bash}/bin/bash,' -i configure build/make/version.sh \ examples/gen_example_code.sh + sed -e '/enable linux/d' -i configure ''; - configurePhase = '' + configureScript = "../configure"; + + preConfigure = '' mkdir -p build cd build - ../configure --disable-install-srcs --disable-examples --enable-vp8 --enable-runtime-cpu-detect --enable-shared --enable-pic ''; + configureFlags = [ + "--disable-install-srcs" + "--disable-examples" + "--enable-vp8" + "--enable-runtime-cpu-detect" + "--enable-shared" + "--enable-pic" + ]; + installPhase = '' make quiet=false DIST_DIR=$out install ''; diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix index 1ae5d3054f4..aea9e53eef6 100644 --- a/pkgs/development/libraries/libxcrypt/default.nix +++ b/pkgs/development/libraries/libxcrypt/default.nix @@ -1,7 +1,8 @@ {stdenv, fetchurl}: -# I could not build it in armv5tel-linux +# I could not build it in armv5tel-linux or the fuloon2f assert stdenv.system != "armv5tel-linux"; +assert stdenv.system != "mips64-linux"; stdenv.mkDerivation { name = "libxcrypt-3.0.2"; diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index d878135923d..9b449be1335 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { configureFlags = "--disable-gallium" + + (if stdenv.system == "mips64-linux" then + " --with-dri-drivers=swrast --with-driver=dri" else "") + (if stdenv.isDarwin then " --disable-egl" else ""); buildInputs = diff --git a/pkgs/development/libraries/mpc/default.nix b/pkgs/development/libraries/mpc/default.nix index e5ae5b76323..c66c99cc576 100644 --- a/pkgs/development/libraries/mpc/default.nix +++ b/pkgs/development/libraries/mpc/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, gmp, mpfr }: stdenv.mkDerivation rec { - name = "mpc-0.8.1"; + name = "mpc-0.8.2"; src = fetchurl { url = "http://www.multiprecision.org/mpc/download/${name}.tar.gz"; - sha256 = "1r73zqw8lnf0bkfsxn0znbwbfyacg94pd0l4aaixh7r5awvn0r76"; + sha256 = "1iw0ag28l5r88k7kpn6i89rqn3yhk2irqzk0d1mlb1la3paghydf"; }; buildInputs = [ gmp mpfr ]; diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index 1bfd1448200..51d33f9593c 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, gmp}: stdenv.mkDerivation rec { - name = "mpfr-2.4.2"; + name = "mpfr-3.0.0"; src = fetchurl { url = "mirror://gnu/mpfr/${name}.tar.bz2"; - sha256 = "1fpjphja2ridy1wfc53mcbavj4axl28ibvnawj1217flm045mry7"; + sha256 = "07w24h8by7n319p2vwwa1xdcg7qzkd1aqm84lfcbfv2kaff5yklg"; }; buildInputs = [ gmp ]; @@ -31,5 +31,8 @@ stdenv.mkDerivation rec { ''; license = "LGPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index dd3d60e4812..67c3bc5fe93 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -7,6 +7,10 @@ stdenv.mkDerivation ( rec { url = "mirror://gnu/ncurses/${name}.tar.gz"; sha256 = "1x4q6kma6zgg438llbgiac3kik7j2lln9v97jdffv3fyqyjxx6qa"; }; + + crossAttrs = { + patches = [ ./wint_t.patch ]; + }; configureFlags = '' --with-shared --includedir=''${out}/include --without-debug diff --git a/pkgs/development/libraries/ncurses/wint_t.patch b/pkgs/development/libraries/ncurses/wint_t.patch new file mode 100644 index 00000000000..c9b34efd0bd --- /dev/null +++ b/pkgs/development/libraries/ncurses/wint_t.patch @@ -0,0 +1,14 @@ +http://www.mail-archive.com/freewrt-developers@freewrt.org/msg01326.html +--- ncurses-5.6.orig/ncurses/curses.priv.h 2006-12-10 01:55:14.000000000 0100 ++++ ncurses-5.6/ncurses/curses.priv.h 2008-02-11 13:12:04.000000000 +0100 +@@ -253,6 +253,10 @@ color_t; + #include + #include + ++#ifndef _WINT_T ++#include ++#endif ++ + #if NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT + #define if_EXT_COLORS(stmt) stmt + #define NetPair(value,p) (value).ext_color = (p), \ diff --git a/pkgs/development/libraries/opencv/changeset_r3190.diff b/pkgs/development/libraries/opencv/changeset_r3190.diff new file mode 100644 index 00000000000..4a614659e72 --- /dev/null +++ b/pkgs/development/libraries/opencv/changeset_r3190.diff @@ -0,0 +1,20 @@ +--- opencv/src/highgui/cvcap_ffmpeg.cpp ++++ opencv/src/highgui/cvcap_ffmpeg.cpp +@@ -49,6 +49,15 @@ + #if !defined(WIN32) || defined(__MINGW32__) + // some versions of FFMPEG assume a C99 compiler, and don't define INT64_C +-#ifndef INT64_C +-#define INT64_C ++#if !defined INT64_C || !defined UINT64_C ++# if __WORDSIZE == 64 ++# define INT64_C(c) c ## UL ++# else ++# define INT64_C(c) c ## ULL ++# endif ++# if __WORDSIZE == 64 ++# define UINT64_C(c) c ## UL ++# else ++# define UINT64_C(c) c ## ULL ++# endif + #define __STDC_CONSTANT_MACROS + // force re-inclusion of stdint.h to get INT64_C macro diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix index 1b64875d631..c8b77d5f572 100644 --- a/pkgs/development/libraries/opencv/default.nix +++ b/pkgs/development/libraries/opencv/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ cmake gtk glib libjpeg libpng libtiff jasper ffmpeg pkgconfig xineLib gstreamer ]; + patches = [ ./changeset_r3190.diff ]; + meta = { description = "Open Computer Vision Library with more than 500 algorithms"; homepage = http://opencv.willowgarage.com/; diff --git a/pkgs/development/libraries/openssl/1.x.nix b/pkgs/development/libraries/openssl/1.x.nix new file mode 100644 index 00000000000..eae32de30e4 --- /dev/null +++ b/pkgs/development/libraries/openssl/1.x.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, perl }: + +let + opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ] + (throw "openssl needs its platform name cross building" null) + stdenv.cross; +in + +stdenv.mkDerivation (rec { + name = "openssl-1.0.0"; + + src = fetchurl { + url = "http://www.openssl.org/source/${name}.tar.gz"; + sha1 = "3f800ea9fa3da1c0f576d689be7dca3d55a4cb62"; + }; + + buildNativeInputs = [ perl ]; + + configureScript = "./config"; + + configureFlags="--libdir=lib shared"; + + crossAttrs = { + preConfigure='' + export cross=$crossSystem- + ''; + configureFlags="--libdir=lib ${opensslCrossSystem} shared"; + buildPhase = '' + make CC=$crossConfig-gcc \ + AR="$crossConfig-ar r" \ + RANLIB=$crossConfig-ranlib + ''; + }; + + meta = { + homepage = http://www.openssl.org/; + description = "A cryptographic library that implements the SSL and TLS protocols"; + }; +} +// +(if stdenv.isDarwin then { + patches = ./darwin-arch.patch; +} +else { }) +) diff --git a/pkgs/development/libraries/openssl/darwin-arch-1.patch b/pkgs/development/libraries/openssl/darwin-arch-1.patch new file mode 100644 index 00000000000..ad8e86c6791 --- /dev/null +++ b/pkgs/development/libraries/openssl/darwin-arch-1.patch @@ -0,0 +1,16 @@ +The patch is specific to nix: MacOS gcc supports -arch. +--- a/Configure ++++ b/Configure +@@ -549,9 +549,9 @@ my %table=( + "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", + "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +-"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +-"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +-"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"debug-darwin-i386-cc","cc:-g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"darwin64-x86_64-cc","cc:-O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + + ##### A/UX diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 7383c7d5237..54d4265e01c 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -7,11 +7,11 @@ let in stdenv.mkDerivation rec { - name = "openssl-1.0.0b"; + name = "openssl-1.0.0c"; src = fetchurl { url = "http://www.openssl.org/source/${name}.tar.gz"; - sha256 = "0cbk04cwmbf7l0bycqx8y04grfsx96mn2d8lbrydkqiyncplwysf"; + sha256 = "1sq4sswyjxnr08lyjcafwdha6j5jd2b48vxfg48kdapdwdnv6cgp"; }; patches = stdenv.lib.optional stdenv.isDarwin ./darwin-arch.patch; @@ -30,6 +30,15 @@ stdenv.mkDerivation rec { # It's configure does not like --build or --host export configureFlags="--libdir=lib --cross-compile-prefix=${stdenv.cross.config}- shared ${opensslCrossSystem}" ''; + + postInstall = '' + # Openssl installs readonly files, which otherwise we can't strip. + # This could at some stdenv hash change be put out of crossAttrs, too + chmod -R +w $out + + # Remove references to perl, to avoid depending on it at runtime + rm $out/bin/c_rehash $out/ssl/misc/CA.pl $out/ssl/misc/tsget + ''; configureScript = "./Configure"; }; diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index 1dd860aeaeb..65eb51af9b0 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, unicodeSupport ? false, cplusplusSupport ? true}: stdenv.mkDerivation { - name = "pcre-7.8"; + name = "pcre-8.10"; src = fetchurl { - url = mirror://sourceforge/pcre/pcre-7.8.tar.bz2; - sha256 = "1zsqk352mx2zklf9bgpg9d88ckfdssbbbiyslhrycfckw8m3qpvr"; + url = mirror://sourceforge/pcre/pcre-8.10.tar.bz2; + sha256 = "7ac4e016f6bad8c7d990e6de9bce58c04ff5dd8838be0c5ada0afad1d6a07480"; }; # The compiler on Darwin crashes with an internal error while building the @@ -17,6 +17,8 @@ stdenv.mkDerivation { ${if !cplusplusSupport then "--disable-cpp" else ""} '' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0"; + doCheck = true; + meta = { homepage = "http://www.pcre.org/"; description = "A library for Perl Compatible Regular Expressions"; diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix index ed4cc7f2497..677d578e242 100644 --- a/pkgs/development/libraries/ppl/default.nix +++ b/pkgs/development/libraries/ppl/default.nix @@ -1,17 +1,23 @@ -{ fetchurl, stdenv, gmpxx, perl, gnum4 }: +{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }: -let version = "0.10.2"; in +let + version = "0.10.2"; + staticFlags = if static then " --enable-static --disable-shared" else ""; +in stdenv.mkDerivation rec { name = "ppl-${version}"; src = fetchurl { - url = "ftp://ftp.cs.unipr.it/pub/ppl/releases/${version}/${name}.tar.bz2"; - sha256 = "0xz2f3lny4l9ji1ilg6pxv34sh4cbh535cnm68smynzp01wgnh7y"; + url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz"; + sha256 = "0lly44sac4jd72klnhhil3wha15vak76r6gy88sh0zjsaww9hf6h"; }; - buildInputs = [ perl gnum4 ]; + buildNativeInputs = [ perl gnum4 ]; propagatedBuildInputs = [ gmpxx ]; + dontDisableStatic = if static then true else false; + configureFlags = staticFlags; + # Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz # x86_64 box. Nevertheless, being a dependency of GCC, it probably ought # to be tested. diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix index 4bd1c97fb6c..9e5676e2012 100644 --- a/pkgs/development/libraries/x264/default.nix +++ b/pkgs/development/libraries/x264/default.nix @@ -13,7 +13,8 @@ stdenv.mkDerivation rec { sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; - configureFlags = [ "--enable-shared" ]; + configureFlags = [ "--enable-shared" ] + ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic"; buildInputs = [ yasm ]; diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix index 3de750c028a..5638e810edf 100644 --- a/pkgs/development/tools/analysis/valgrind/default.nix +++ b/pkgs/development/tools/analysis/valgrind/default.nix @@ -10,7 +10,8 @@ stdenv.mkDerivation rec { # Perl is needed for `cg_annotate'. # GDB is needed to provide a sane default for `--db-command'. - buildInputs = [ perl autoconf automake ] ++ stdenv.lib.optional (!stdenv.isDarwin) gdb; + buildNativeInputs = [ perl autoconf automake ]; + buildInputs = stdenv.lib.optional (!stdenv.isDarwin) gdb; configureFlags = if stdenv.system == "x86_64-linux" then ["--enable-only64bit"] else []; diff --git a/pkgs/development/tools/build-managers/gnumake/3.81.nix b/pkgs/development/tools/build-managers/gnumake/3.81.nix new file mode 100644 index 00000000000..d28198821e3 --- /dev/null +++ b/pkgs/development/tools/build-managers/gnumake/3.81.nix @@ -0,0 +1,46 @@ +{stdenv, fetchurl}: + +let version = "3.81"; in +stdenv.mkDerivation { + name = "gnumake-${version}"; + + src = fetchurl { + url = "mirror://gnu/make/make-${version}.tar.bz2"; + md5 = "354853e0b2da90c527e35aabb8d6f1e6"; + }; + + doCheck = true; + + patches = + [ + # Provide nested log output for subsequent pretty-printing by + # nix-log2xml. + ./log-3.81.patch + + # Purity: don't look for library dependencies (of the form + # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. + # Likewise, when searching for included Makefiles, don't look in + # /usr/include and friends. + ./impure-dirs.patch + ]; + + meta = { + description = "GNU Make, a program controlling the generation of non-source files from sources"; + + longDescription = + '' Make is a tool which controls the generation of executables and + other non-source files of a program from the program's source files. + + Make gets its knowledge of how to build your program from a file + called the makefile, which lists each of the non-source files and + how to compute it from other files. When you write a program, you + should write a makefile for it, so that it is possible to use Make + to build and install the program. + ''; + + homepage = http://www.gnu.org/software/make/; + + license = "GPLv2+"; + maintainers = [ stdenv.lib.maintainers.ludo ]; + }; +} diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix index 09ac6b9142e..cf33e7a5bbc 100644 --- a/pkgs/development/tools/build-managers/gnumake/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/default.nix @@ -1,19 +1,24 @@ {stdenv, fetchurl}: +let version = "3.82"; in stdenv.mkDerivation { - name = "gnumake-3.81"; - + name = "gnumake-${version}"; + src = fetchurl { - url = mirror://gnu/make/make-3.81.tar.bz2; - md5 = "354853e0b2da90c527e35aabb8d6f1e6"; + url = "mirror://gnu/make/make-${version}.tar.bz2"; + sha256 = "0ri98385hsd7li6rh4l5afcq92v8l2lgiaz85wgcfh4w2wzsghg2"; }; - + + /* On Darwin, there are 3 test failures that haven't been investigated + yet. */ + doCheck = !stdenv.isDarwin; + patches = [ # Provide nested log output for subsequent pretty-printing by # nix-log2xml. ./log.patch - + # Purity: don't look for library dependencies (of the form # `-lfoo') in /lib and /usr/lib. It's a stupid feature anyway. # Likewise, when searching for included Makefiles, don't look in @@ -22,8 +27,23 @@ stdenv.mkDerivation { ]; meta = { - description = "A program for automatically building non-source files from sources"; + description = "GNU Make, a program controlling the generation of non-source files from sources"; + + longDescription = + '' Make is a tool which controls the generation of executables and + other non-source files of a program from the program's source files. + + Make gets its knowledge of how to build your program from a file + called the makefile, which lists each of the non-source files and + how to compute it from other files. When you write a program, you + should write a makefile for it, so that it is possible to use Make + to build and install the program. + ''; + homepage = http://www.gnu.org/software/make/; - license = "GPL"; + + license = "GPLv3+"; + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/development/tools/build-managers/gnumake/log-3.81.patch b/pkgs/development/tools/build-managers/gnumake/log-3.81.patch new file mode 100644 index 00000000000..0f3ed6d7299 --- /dev/null +++ b/pkgs/development/tools/build-managers/gnumake/log-3.81.patch @@ -0,0 +1,125 @@ +diff -rc make-3.81-orig/job.c make-3.81/job.c +*** make-3.81-orig/job.c 2006-03-20 04:03:04.000000000 +0100 +--- make-3.81/job.c 2009-01-19 19:37:28.000000000 +0100 +*************** +*** 1083,1089 **** + appear. */ + + message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) +! ? "%s" : (char *) 0, p); + + /* Tell update_goal_chain that a command has been started on behalf of + this target. It is important that this happens here and not in +--- 1083,1089 ---- + appear. */ + + message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) +! ? (enable_nested_output ? "\e[3s\e[a%s\e[b" : "%s") : (char *) 0, p); + + /* Tell update_goal_chain that a command has been started on behalf of + this target. It is important that this happens here and not in +diff -rc make-3.81-orig/main.c make-3.81/main.c +*** make-3.81-orig/main.c 2006-03-20 03:36:37.000000000 +0100 +--- make-3.81/main.c 2009-01-19 19:41:41.000000000 +0100 +*************** +*** 886,891 **** +--- 886,900 ---- + } + + ++ static void close_nesting() ++ { ++ while (stdout_nesting_level--) ++ printf("\e[q"); ++ while (stderr_nesting_level--) ++ fprintf(stderr, "\e[q"); ++ } ++ ++ + #ifdef _AMIGA + int + main (int argc, char **argv) +*************** +*** 931,936 **** +--- 940,950 ---- + atexit (close_stdout); + #endif + ++ atexit(close_nesting); ++ ++ if (getenv("NIX_INDENT_MAKE")) ++ enable_nested_output = 1; ++ + /* Needed for OS/2 */ + initialize_main(&argc, &argv); + +*************** +*** 3095,3100 **** +--- 3109,3120 ---- + + /* Use entire sentences to give the translators a fighting chance. */ + ++ if (entering && enable_nested_output) ++ { ++ printf("\e[p"); ++ stdout_nesting_level++; ++ } ++ + if (makelevel == 0) + if (starting_directory == 0) + if (entering) +*************** +*** 3124,3129 **** +--- 3144,3159 ---- + printf (_("%s[%u]: Leaving directory `%s'\n"), + program, makelevel, starting_directory); + ++ if (!entering && enable_nested_output) ++ { ++ printf("\e[q"); ++ stdout_nesting_level--; ++ } ++ + /* Flush stdout to be sure this comes before any stderr output. */ + fflush (stdout); + } ++ ++ int enable_nested_output = 0; ++ int stdout_nesting_level = 0; ++ int stderr_nesting_level = 0; +diff -rc make-3.81-orig/make.h make-3.81/make.h +*** make-3.81-orig/make.h 2006-02-16 00:54:43.000000000 +0100 +--- make-3.81/make.h 2009-01-19 19:32:03.000000000 +0100 +*************** +*** 609,611 **** +--- 609,614 ---- + #define ENULLLOOP(_v,_c) do{ errno = 0; \ + while (((_v)=_c)==0 && errno==EINTR); }while(0) + ++ extern int enable_nested_output; ++ extern int stdout_nesting_level; ++ extern int stderr_nesting_level; +diff -rc make-3.81-orig/remake.c make-3.81/remake.c +*** make-3.81-orig/remake.c 2006-03-20 03:36:37.000000000 +0100 +--- make-3.81/remake.c 2009-01-19 19:39:40.000000000 +0100 +*************** +*** 1120,1126 **** +--- 1120,1137 ---- + /* The normal case: start some commands. */ + if (!touch_flag || file->cmds->any_recurse) + { ++ if (enable_nested_output) ++ { ++ log_working_directory (1); ++ fprintf(stderr, "\e[pbuilding %s\n", file->name); ++ stderr_nesting_level++; ++ } + execute_file_commands (file); ++ if (enable_nested_output) ++ { ++ fprintf(stderr, "\e[q"); ++ stderr_nesting_level--; ++ } + return; + } + diff --git a/pkgs/development/tools/build-managers/gnumake/log.patch b/pkgs/development/tools/build-managers/gnumake/log.patch index 0f3ed6d7299..ca0d6340790 100644 --- a/pkgs/development/tools/build-managers/gnumake/log.patch +++ b/pkgs/development/tools/build-managers/gnumake/log.patch @@ -93,9 +93,9 @@ diff -rc make-3.81-orig/make.h make-3.81/make.h *************** *** 609,611 **** --- 609,614 ---- - #define ENULLLOOP(_v,_c) do{ errno = 0; \ - while (((_v)=_c)==0 && errno==EINTR); }while(0) + #define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ + while((_v)==0 && errno==EINTR) + extern int enable_nested_output; + extern int stdout_nesting_level; + extern int stderr_nesting_level; diff --git a/pkgs/development/tools/misc/binutils/as-pr10856.patch b/pkgs/development/tools/misc/binutils/as-pr10856.patch deleted file mode 100644 index 695d3e35670..00000000000 --- a/pkgs/development/tools/misc/binutils/as-pr10856.patch +++ /dev/null @@ -1,83 +0,0 @@ -Fix a regression in GNU as: -http://sourceware.org/bugzilla/show_bug.cgi?id=10856 . - -The bug appears to be responsible for invalid code generated for -Crypto++: -http://groups.google.com/group/cryptopp-users/browse_thread/thread/7ce734e479586640/29c6649b7c7adee2?#29c6649b7c7adee2 . - -diff -u -r1.77.2.1 -r1.77.2.2 ---- a/gas/expr.c 2009/09/11 15:28:43 1.77.2.1 -+++ b/gas/expr.c 2009/10/28 08:23:48 1.77.2.2 -@@ -1997,6 +1997,7 @@ - /* Help out with CSE. */ - valueT final_val = expressionP->X_add_number; - symbolS *add_symbol = expressionP->X_add_symbol; -+ symbolS *orig_add_symbol = add_symbol; - symbolS *op_symbol = expressionP->X_op_symbol; - operatorT op = expressionP->X_op; - valueT left, right; -@@ -2078,6 +2079,7 @@ - left = right; - seg_left = seg_right; - add_symbol = op_symbol; -+ orig_add_symbol = expressionP->X_op_symbol; - op = O_symbol; - break; - } -@@ -2122,18 +2124,19 @@ - { - if (op == O_bit_exclusive_or || op == O_bit_inclusive_or) - { -- if (seg_right != absolute_section || right != 0) -+ if (!(seg_right == absolute_section && right == 0)) - { - seg_left = seg_right; - left = right; - add_symbol = op_symbol; -+ orig_add_symbol = expressionP->X_op_symbol; - } - op = O_symbol; - break; - } - else if (op == O_left_shift || op == O_right_shift) - { -- if (seg_left != absolute_section || left != 0) -+ if (!(seg_left == absolute_section && left == 0)) - { - op = O_symbol; - break; -@@ -2149,6 +2152,7 @@ - seg_left = seg_right; - left = right; - add_symbol = op_symbol; -+ orig_add_symbol = expressionP->X_op_symbol; - op = O_symbol; - break; - } -@@ -2158,11 +2162,11 @@ - op = O_symbol; - break; - } -- else if (left != right -- || ((seg_left != reg_section || seg_right != reg_section) -- && (seg_left != undefined_section -- || seg_right != undefined_section -- || add_symbol != op_symbol))) -+ else if (!(left == right -+ && ((seg_left == reg_section && seg_right == reg_section) -+ || (seg_left == undefined_section -+ && seg_right == undefined_section -+ && add_symbol == op_symbol)))) - return 0; - else if (op == O_bit_and || op == O_bit_inclusive_or) - { -@@ -2233,7 +2237,8 @@ - op = O_constant; - else if (seg_left == reg_section && final_val == 0) - op = O_register; -- else if (add_symbol != expressionP->X_add_symbol) -+ else if (seg_left == undefined_section -+ && add_symbol != orig_add_symbol) - final_val += left; - expressionP->X_add_symbol = add_symbol; - } diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 1bb110e35fd..1928061c81d 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -1,14 +1,14 @@ -{stdenv, fetchurl, noSysDirs, cross ? null}: +{stdenv, fetchurl, noSysDirs, zlib, cross ? null}: let - basename = "binutils-2.20"; + basename = "binutils-2.21"; in stdenv.mkDerivation rec { name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}"; src = fetchurl { url = "mirror://gnu/binutils/${basename}.tar.bz2"; - sha256 = "1c3m789p5rwmmnck5ms4zcnc40axss3gxzivz571al1vmbq0kpz1"; + sha256 = "1iyhc42zfa0j2gaxy4zvpk47sdqj4rqvib0mb8597ss8yidyrav0"; }; patches = [ @@ -16,10 +16,10 @@ stdenv.mkDerivation rec { # RUNPATH instead of RPATH on binaries. This is important because # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime. ./new-dtags.patch - - ./as-pr10856.patch ]; + buildInputs = [ zlib ]; + inherit noSysDirs; preConfigure = '' @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { ''; configureFlags = "--disable-werror" # needed for dietlibc build + + stdenv.lib.optionalString (stdenv.system == "mips64-linux") + " --enable-fix-loongson2f-nop" + stdenv.lib.optionalString (cross != null) " --target=${cross.config}"; meta = { diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index 1c6d1dacc7f..c27c7ab291a 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -17,7 +17,8 @@ stdenv.mkDerivation rec { configureFlags = "--with-ncurses=${ncurses}"; - buildInputs = [ ncurses pkgconfig emacs ]; + buildInputs = [ ncurses ]; + buildNativeInputs = [ pkgconfig emacs ]; postInstall = '' # Install Emacs mode. @@ -31,6 +32,11 @@ stdenv.mkDerivation rec { cp xcscope.el{,c} "$out/share/emacs/site-lisp" ''; + crossAttrs = { + postInstall = ""; + propagatedBuildInputs = [ ncurses.hostDrv ]; + }; + meta = { description = "Cscope, a developer's tool for browsing source code"; diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 31c92621ad7..00aeed1b41b 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -13,7 +13,10 @@ stdenv.mkDerivation rec { sha256 = "1w0h6hya0bl46xddd57mdzwmffplwglhnh9x9hv46ll4mf44ni5z"; }; - buildInputs = [ ncurses readline gmp mpfr expat texinfo python ] + # I think python is not a native input, but I leave it + # here while I will not need it cross building + buildNativeInputs = [ texinfo python ]; + buildInputs = [ ncurses readline gmp mpfr expat ] ++ stdenv.lib.optional doCheck dejagnu; configureFlags = @@ -22,6 +25,14 @@ stdenv.mkDerivation rec { '' + stdenv.lib.optionalString (target != null) " --target=${target.config}"; + crossAttrs = { + configureFlags = + '' --with-gmp=${gmp.hostDrv} --with-mpfr=${mpfr.hostDrv} --with-system-readline + --with-expat --with-libexpat-prefix=${expat.hostDrv} + '' + stdenv.lib.optionalString (target != null) + " --target=${target.config}"; + }; + postInstall = '' # Remove Info files already provided by Binutils and other packages. rm -v $out/share/info/{standards,configure,bfd}.info diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix index 0c73ba1f738..df417c3e55e 100644 --- a/pkgs/development/tools/misc/gnum4/default.nix +++ b/pkgs/development/tools/misc/gnum4/default.nix @@ -1,15 +1,18 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "gnum4-1.4.13"; + name = "gnum4-1.4.15"; src = fetchurl { - url = mirror://gnu/m4/m4-1.4.13.tar.bz2; - sha256 = "01pcrajrk2rqhxbrij3j07ywyxlq7ih43a8pzvhdlxhlwfazxipw"; + url = mirror://gnu/m4/m4-1.4.15.tar.bz2; + sha256 = "1ygzshj4h6l6wh52vjqczkyahmv67r3yzi1m6nkh94qgndffmbqa"; }; doCheck = !stdenv.isDarwin; + # Upstream is aware of it; it may be in the next release. + patches = [ ./s_isdir.patch ]; + meta = { homepage = http://www.gnu.org/software/m4/; description = "GNU M4, a macro processor"; diff --git a/pkgs/development/tools/misc/gnum4/s_isdir.patch b/pkgs/development/tools/misc/gnum4/s_isdir.patch new file mode 100644 index 00000000000..a009a4ba446 --- /dev/null +++ b/pkgs/development/tools/misc/gnum4/s_isdir.patch @@ -0,0 +1,14 @@ +Fails to build with glibc 2.12.1 without this patch. + +http://lists.gnu.org/archive/html/bug-m4/2010-05/msg00002.html + +--- a/src/path.c ++++ b/src/path.c +@@ -22,6 +22,7 @@ + /* Handling of path search of included files via the builtins "include" + and "sinclude". */ + + #include "m4.h" ++#include "sys/stat.h" + + struct includes diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index c89fe7e280c..8c15eec8094 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, m4, perl, lzma }: stdenv.mkDerivation rec { - name = "libtool-2.2.6b"; + name = "libtool-2.4"; src = fetchurl { - url = "mirror://gnu/libtool/${name}.tar.lzma"; - sha256 = "1bmpp31sfjl3nzj8psvnsqrrv4gwnqzii8dxpxr6djz508yavsv6"; + url = "mirror://gnu/libtool/${name}.tar.gz"; + sha256 = "0bpnvmqryzqpiz184phdg3z38a16ad7dd5bfbmn1jkm9cfmmgpqk"; }; buildNativeInputs = [ lzma m4 perl ]; diff --git a/pkgs/development/tools/misc/patchelf/0.6.nix b/pkgs/development/tools/misc/patchelf/0.6.nix index dfd0b077411..3774c44480d 100644 --- a/pkgs/development/tools/misc/patchelf/0.6.nix +++ b/pkgs/development/tools/misc/patchelf/0.6.nix @@ -4,8 +4,8 @@ stdenv.mkDerivation rec { name = "patchelf-0.6pre22275"; src = fetchurl { - url = "http://hydra.nixos.org/build/479721/download/3/patchelf-0.6pre22275.tar.gz"; - sha256 = "ccce84285d145b300e5727b1562f4f334c53721fc7b388928c3fb5b9a90c7d80"; + url = "http://hydra.nixos.org/build/504657/download/2/patchelf-0.6pre22813.tar.bz2"; + sha256 = "1ml86wyl35ik3lixkcz2vlzvbcancj0dygwfh5ambjmazp2q19mh"; }; meta = { diff --git a/pkgs/development/tools/misc/texinfo/default.nix b/pkgs/development/tools/misc/texinfo/default.nix index 09fe6ed029c..111f2d14200 100644 --- a/pkgs/development/tools/misc/texinfo/default.nix +++ b/pkgs/development/tools/misc/texinfo/default.nix @@ -8,16 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"; }; - buildInputs = [ ncurses lzma ]; - - # !!! This should be set as usual attributes - we set them as - # crossAttrs only not to change the usual stdenv hash - # (in the normal stdenv, these get mapped all to buildNativeInputs, - # but unfortunately in the opposite order, thus getting a new hash) - crossAttrs = { - buildNativeInputs = [ lzma ]; - buildInputs = [ ncurses ]; - }; + buildInputs = [ ncurses ]; + buildNativeInputs = [ lzma ]; # Disabled because we don't have zdiff in the stdenv bootstrap. #doCheck = true; diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix index 3e49c73e853..143704126f4 100644 --- a/pkgs/development/tools/profiling/oprofile/default.nix +++ b/pkgs/development/tools/profiling/oprofile/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, binutils, popt, makeWrapper, gawk, which, gnugrep +{ stdenv, fetchurl, binutils, popt, makeWrapper, gawk, which, gnugrep, zlib , qt ? null, libX11 ? null, libXext ? null, libpng ? null }: # libX11 is needed because the Qt build stuff automatically adds `-lX11'. @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { s|^PATH=.*$||g" ''; - buildInputs = [ binutils popt makeWrapper gawk which gnugrep ] + buildInputs = [ binutils zlib popt makeWrapper gawk which gnugrep ] ++ stdenv.lib.optionals (qt != null) [ qt libX11 libXext libpng ]; configureFlags = diff --git a/pkgs/games/freedink/default.nix b/pkgs/games/freedink/default.nix index cb3f032539e..f41063272ce 100644 --- a/pkgs/games/freedink/default.nix +++ b/pkgs/games/freedink/default.nix @@ -2,11 +2,11 @@ , pkgconfig, fontconfig, libzip, zip, zlib }: stdenv.mkDerivation rec { - name = "freedink-1.08.20100420"; + name = "freedink-1.08.20101114"; src = fetchurl { url = "mirror://gnu/freedink/${name}.tar.gz"; - sha256 = "0jw0690k7wgsga74nd8m1c3k34xmzgav6z0hhpx507krw2mkbm90"; + sha256 = "0h3i7p7awk5flymh22xaazm2r56hv86z2il2gmbzrr6xh434zffa"; }; buildInputs = [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx pkgconfig fontconfig libzip zip zlib] ; diff --git a/pkgs/games/gnuchess/default.nix b/pkgs/games/gnuchess/default.nix index db4961eaaf6..24556d83148 100644 --- a/pkgs/games/gnuchess/default.nix +++ b/pkgs/games/gnuchess/default.nix @@ -1,4 +1,6 @@ -a : +{builderDefsPackage, flex} @ x: +builderDefsPackage +(a : let fetchurl = a.fetchurl; @@ -31,4 +33,4 @@ rec { meta = { description = "GNU Chess playing program"; }; -} +}) x diff --git a/pkgs/games/instead/default.nix b/pkgs/games/instead/default.nix index 344daca2a0d..d7fcb7a3f4e 100644 --- a/pkgs/games/instead/default.nix +++ b/pkgs/games/instead/default.nix @@ -21,6 +21,10 @@ let url = http://instead-games.googlecode.com/files/instead-vinny-0.1.zip; sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1"; }) + (fetchurl { + url = http://instead-games.googlecode.com/files/instead-toilet-1.1.zip; + sha256 = "17mlkr93y77pxhimq0v9f0w78fz8alkxwjwsr8z67p458iw6s1wr"; + }) ]; in diff --git a/pkgs/games/prboom/default.nix b/pkgs/games/prboom/default.nix new file mode 100644 index 00000000000..f66e2295a22 --- /dev/null +++ b/pkgs/games/prboom/default.nix @@ -0,0 +1,20 @@ +{stdenv, fetchurl, SDL, SDL_mixer, SDL_net, mesa}: + +stdenv.mkDerivation { + name = "prboom-2.5.0"; + src = fetchurl { + url = mirror://sourceforge/prboom/prboom-2.5.0.tar.gz; + sha256 = "1bjb04q8dk232956k30qlpq6q0hxb904yh1nflr87jcc1x3iqv12"; + }; + + buildInputs = [ SDL SDL_mixer SDL_net mesa ]; + crossAttrs = { + propagatedBuildInputs = [ SDL.hostDrv SDL_mixer.hostDrv SDL_net.hostDrv ]; + configureFlags = "--disable-gl --disable-cpu-opt --without-x --disable-sdltest + ac_cv_type_uid_t=yes ac_cv_type_gid_t=yes"; + + postInstall = '' + mv $out/games/ $out/bin + ''; + }; +} diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index 2ba2da12b34..c8f98522773 100644 --- a/pkgs/games/scummvm/default.nix +++ b/pkgs/games/scummvm/default.nix @@ -10,6 +10,18 @@ stdenv.mkDerivation { buildInputs = [SDL zlib mpeg2dec]; + crossAttrs = { + preConfigure = '' + # Remove the --build flag set by the gcc cross wrapper setup + # hook + export configureFlags="--host=${stdenv.cross.config}" + ''; + postConfigure = '' + # They use 'install -s', that calls the native strip instead of the cross + sed -i 's/-c -s/-c/' ports.mk; + ''; + }; + meta = { description = "Program to run certain classic graphical point-and-click adventure games (such as Monkey Island)"; homepage = http://www.scummvm.org/; diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix index 91a37494744..7f04e7e1e58 100644 --- a/pkgs/lib/misc.nix +++ b/pkgs/lib/misc.nix @@ -215,11 +215,15 @@ rec { innerClosePropagation = ready: list: if list == [] then ready else - innerClosePropagation - (ready ++ [(head list)]) - ((tail list) - ++ (maybeAttrNullable "propagatedBuildInputs" [] (head list)) - ++ (maybeAttrNullable "propagatedBuildNativeInputs" [] (head list))); + if ! isAttrs (head list) then + builtins.trace ("not an attrSet: ${lib.showVal (head list)}") + innerClosePropagation ready (tail list) + else + innerClosePropagation + (ready ++ [(head list)]) + ((tail list) + ++ (maybeAttrNullable "propagatedBuildInputs" [] (head list)) + ++ (maybeAttrNullable "propagatedBuildNativeInputs" [] (head list))); closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);}); diff --git a/pkgs/lib/platforms.nix b/pkgs/lib/platforms.nix index 635b195e1d6..e9ed1e226e7 100644 --- a/pkgs/lib/platforms.nix +++ b/pkgs/lib/platforms.nix @@ -2,7 +2,8 @@ let lists = import ./lists.nix; in rec { gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */ - linux = ["i686-linux" "x86_64-linux" "powerpc-linux" "armv5tel-linux" ]; + linux = ["i686-linux" "x86_64-linux" "powerpc-linux" "armv5tel-linux" + "mips64-linux"]; darwin = ["i686-darwin" "powerpc-darwin" "x86_64-darwin"]; freebsd = ["i686-freebsd" "x86_64-freebsd" "powerpc-freebsd"]; openbsd = ["i686-openbsd" "x86_64-openbsd"]; diff --git a/pkgs/misc/busybox/default.nix b/pkgs/misc/busybox/default.nix index 1d190cf661d..a63411367e8 100644 --- a/pkgs/misc/busybox/default.nix +++ b/pkgs/misc/busybox/default.nix @@ -1,33 +1,69 @@ -{stdenv, fetchurl, enableStatic ? false}: +{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}: let - basicConfigure = '' - make defconfig - sed -i 's,.*CONFIG_PREFIX.*,CONFIG_PREFIX="'$out'",' .config - sed -i 's,.*CONFIG_INSTALL_NO_USR.*,CONFIG_INSTALL_NO_USR=y,' .config - '' + - (if enableStatic then '' - sed -i 's,.*CONFIG_STATIC.*,CONFIG_STATIC=y,' .config + configParser = '' + function parseconfig { + set -x + while read LINE; do + NAME=`echo "$LINE" | cut -d \ -f 1` + OPTION=`echo "$LINE" | cut -d \ -f 2` + + if test -z "$NAME"; then + continue + fi + + if test "$NAME" == "CLEAR"; then + echo "parseconfig: CLEAR" + echo > .config + fi + + echo "parseconfig: removing $NAME" + sed -i /^$NAME=/d .config + + echo "parseconfig: setting $NAME=$OPTION" + echo "$NAME=$OPTION" >> .config + done + set +x + } + ''; + + nixConfig = '' + CONFIG_PREFIX "$out" + CONFIG_INSTALL_NO_USR n + ''; + + staticConfig = (if enableStatic then '' + CONFIG_STATIC y '' else ""); in -stdenv.mkDerivation { - name = "busybox-1.16.0"; +stdenv.mkDerivation rec { + name = "busybox-1.18.0"; src = fetchurl { - url = http://busybox.net/downloads/busybox-1.16.0.tar.bz2; - sha256 = "1n738zk01yi2sjrx2y36hpzxbslas8b91vzykcifr0p1j7ym0lim"; + url = "http://busybox.net/downloads/${name}.tar.bz2"; + sha256 = "007bc8k6sc62iyjmyv3di2c8xdxvdhvqg68c7pn40m0455lmx79s"; }; - configurePhase = basicConfigure; + configurePhase = '' + make defconfig + ${configParser} + cat << EOF | parseconfig + ${staticConfig} + ${extraConfig} + ${nixConfig} + $extraCrossConfig + EOF + make oldconfig + ''; crossAttrs = { - configurePhase = basicConfigure + '' - sed -i 's,.*CONFIG_CROSS_COMPILER_PREFIX.*,CONFIG_CROSS_COMPILER_PREFIX="'$crossConfig-'",' .config + extraCrossConfig = '' + CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-" '' + (if (stdenv.cross.platform.kernelMajor == "2.4") then '' - sed -i 's,.*CONFIG_IONICE.*,CONFIG_IONICE=n,' .config + CONFIG_IONICE n '' else ""); }; } diff --git a/pkgs/misc/cups/drivers/splix/default.nix b/pkgs/misc/cups/drivers/splix/default.nix index 02970073b11..b832e928bef 100644 --- a/pkgs/misc/cups/drivers/splix/default.nix +++ b/pkgs/misc/cups/drivers/splix/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0bwivrwwvh6hzvnycpzqs7a0capgycahc4s3v9ihx552fgy07xwp"; }; + patches = [ ./splix-2.0.0-gcc45.patch ]; + preBuild='' makeFlags="V=1 DISABLE_JBIG=1 CUPSFILTER=$out/lib/cups/filter CUPSPPD=$out/share/cups/model" ''; diff --git a/pkgs/misc/cups/drivers/splix/splix-2.0.0-gcc45.patch b/pkgs/misc/cups/drivers/splix/splix-2.0.0-gcc45.patch new file mode 100644 index 00000000000..5ccdcb2514c --- /dev/null +++ b/pkgs/misc/cups/drivers/splix/splix-2.0.0-gcc45.patch @@ -0,0 +1,18 @@ +Fixing build with gcc 4.5 + +http://bugs.gentoo.org/show_bug.cgi?id=318581 + +downloaded from +http://gentoo-overlays.zugaina.org/gentoo/portage/net-print/splix/files/splix-2.0.0-gcc45.patch + +--- splix-old/src/ppdfile.cpp ++++ splix-new/src/ppdfile.cpp +@@ -282,7 +282,7 @@ + * Opérateur d'assignation + * Assignment operator + */ +-void PPDFile::Value::operator = (const PPDFile::Value::Value &val) ++void PPDFile::Value::operator = (const PPDFile::Value &val) + { + if (_preformatted) + delete[] _preformatted; diff --git a/pkgs/misc/uboot/nanonote.nix b/pkgs/misc/uboot/nanonote.nix new file mode 100644 index 00000000000..ff7c7742265 --- /dev/null +++ b/pkgs/misc/uboot/nanonote.nix @@ -0,0 +1,59 @@ +{stdenv, fetchurl, fetchgit}: + +# We should enable this check once we have the cross target system information +# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux"; + +# All this file is made for the Marvell Sheevaplug + +stdenv.mkDerivation { + name = "uboot-qb-2010.06"; + + src = fetchurl { + url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2010.06.tar.bz2"; + sha256 = "1j0bl8x5i5m1pn62z450gbw30pbrj7sgs3fjp2l2giczv49cn33r"; + }; + + srcPatches = fetchgit { + url = "git://projects.qi-hardware.com/openwrt-xburst.git"; + rev = "3244d5ef9f93802f9b9b6f4405636424abf6fa83"; + sha256 = "99dde9c3c4c66722d3ee2223d306bc84289a8aa77d0b5918ca49c2f4032ab38f"; + }; + + patchPhase = '' + cp -R $srcPatches/package/uboot-xburst/files/* . + for a in $srcPatches/package/uboot-xburst/patches/*; do + patch -p1 < $a + done + chmod +w -R * + sed -i -e 's/console=ttyS0,57600n8//' include/configs/qi_lb60.h + ''; + + # Remove the cross compiler prefix, and add reiserfs support + configurePhase = '' + make mrproper + make qi_lb60_config + sed -i /CROSS_COMPILE/d include/config.mk + ''; + + buildPhase = '' + # A variable named 'src' used to affect the build in some uboot... + unset src + if test -z "$crossConfig"; then + make clean all + else + make clean all ARCH=mips CROSS_COMPILE=$crossConfig- + fi + ''; + + dontStrip = true; + NIX_STRIP_DEBUG = false; + + installPhase = '' + ensureDir $out + cp u-boot-nand.bin $out + cp u-boot u-boot.map $out + + ensureDir $out/bin + cp tools/{envcrc,mkimage} $out/bin + ''; +} diff --git a/pkgs/os-specific/gnu/hurd/default.nix b/pkgs/os-specific/gnu/hurd/default.nix index cfd88692ead..50802d3425b 100644 --- a/pkgs/os-specific/gnu/hurd/default.nix +++ b/pkgs/os-specific/gnu/hurd/default.nix @@ -1,9 +1,11 @@ { fetchgit, stdenv, autoconf, automake, libtool, texinfo , machHeaders, mig, headersOnly ? true , cross ? null, gccCross ? null, glibcCross ? null +, hurdPartedCross ? null, libuuid ? null , buildTarget ? "all", installTarget ? "install" }: assert (cross != null) -> (gccCross != null); +assert (hurdPartedCross != null) -> (libuuid != null); let # Unfortunately we can't use `master@{DATE}', see @@ -26,12 +28,15 @@ stdenv.mkDerivation ({ }; buildInputs = [ autoconf automake libtool texinfo mig ] + ++ stdenv.lib.optional (hurdPartedCross != null) hurdPartedCross + ++ stdenv.lib.optional (libuuid != null) libuuid ++ stdenv.lib.optional (gccCross != null) gccCross ++ stdenv.lib.optional (glibcCross != null) glibcCross; propagatedBuildInputs = [ machHeaders ]; - configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ]; + configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ] + ++ stdenv.lib.optional (hurdPartedCross != null) [ "--with-parted" ]; preConfigure = "autoreconf -vfi"; diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix index 727db1c9642..5ebf5264439 100644 --- a/pkgs/os-specific/linux/alsa-lib/default.nix +++ b/pkgs/os-specific/linux/alsa-lib/default.nix @@ -14,6 +14,12 @@ stdenv.mkDerivation rec { postPatch = '' sed -i -e 's|//int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);|/\*int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);\*/|' include/pcm.h ''; + + crossAttrs = { + patchPhase = '' + sed -i s/extern/static/g include/iatomic.h + ''; + }; meta = { description = "ALSA, the Advanced Linux Sound Architecture libraries"; @@ -33,5 +39,10 @@ stdenv.mkDerivation rec { See http://thread.gmane.org/gmane.linux.distributions.nixos/3435 */ ./alsa-plugin-dirs.patch + + /* patch provided by larsc on irc. + it may be a compiler problem on mips; without this, alsa does not build + on mips, because lacks some symbols atomic_add/atomic_sub */ + ./mips-atomic.patch ]; } diff --git a/pkgs/os-specific/linux/alsa-lib/mips-atomic.patch b/pkgs/os-specific/linux/alsa-lib/mips-atomic.patch new file mode 100644 index 00000000000..3af7c5d4deb --- /dev/null +++ b/pkgs/os-specific/linux/alsa-lib/mips-atomic.patch @@ -0,0 +1,39 @@ +diff --git a/include/iatomic.h b/include/iatomic.h +index e92dbfd..364bc5c 100644 +--- a/include/iatomic.h ++++ b/include/iatomic.h +@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t; + * Atomically adds @i to @v. Note that the guaranteed useful range + * of an atomic_t is only 24 bits. + */ +-extern __inline__ void atomic_add(int i, atomic_t * v) ++static __inline__ void atomic_add(int i, atomic_t * v) + { + unsigned long temp; + +@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v) + * Atomically subtracts @i from @v. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +-extern __inline__ void atomic_sub(int i, atomic_t * v) ++static __inline__ void atomic_sub(int i, atomic_t * v) + { + unsigned long temp; + +@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v) + /* + * Same as above, but return the result value + */ +-extern __inline__ int atomic_add_return(int i, atomic_t * v) ++static __inline__ int atomic_add_return(int i, atomic_t * v) + { + unsigned long temp, result; + +@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v) + return result; + } + +-extern __inline__ int atomic_sub_return(int i, atomic_t * v) ++static __inline__ int atomic_sub_return(int i, atomic_t * v) + { + unsigned long temp, result; diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix index e20163bfc97..ad092fa7821 100644 --- a/pkgs/os-specific/linux/alsa-utils/default.nix +++ b/pkgs/os-specific/linux/alsa-utils/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1c7pl5k3d60wacnha8zfn2dixz7hiiaxvijis4559y15bs8mxl5p"; }; - buildInputs = [ alsaLib gettext ncurses ]; + buildInputs = [ alsaLib ncurses ]; + buildNativeInputs = [ gettext ]; configureFlags = "--disable-xmlto"; diff --git a/pkgs/os-specific/linux/dmidecode/default.nix b/pkgs/os-specific/linux/dmidecode/default.nix index 4e9c49e4f58..7a291cba26c 100644 --- a/pkgs/os-specific/linux/dmidecode/default.nix +++ b/pkgs/os-specific/linux/dmidecode/default.nix @@ -8,6 +8,12 @@ stdenv.mkDerivation rec { sha256 = "1h72r5scrpvgw60hif5msjg6vw2x0jd6z094lhbh6cjk6gls6x2d"; }; + # Taken from gentoo, to build with gnumake 3.82 + # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/dmidecode/dmidecode-2.10.ebuild?r1=1.5&r2=1.6 + patchPhase = '' + sed -i -e '/^PROGRAMS !=/d' Makefile + ''; + makeFlags = "prefix=$(out)"; meta = { diff --git a/pkgs/os-specific/linux/fbterm/stdenv.nix b/pkgs/os-specific/linux/fbterm/stdenv.nix new file mode 100644 index 00000000000..893dba11b60 --- /dev/null +++ b/pkgs/os-specific/linux/fbterm/stdenv.nix @@ -0,0 +1,35 @@ +# Quick version to be able to cross-build fbterm meanwhile builderDefs cannot +# cross-build with an equivalent to the stdenvCross adapter. +{ stdenv, fetchurl, gpm, freetype, fontconfig, pkgconfig, ncurses }: + +let + version="1.5"; + name="fbterm-1.5"; + hash="05qzc6g9a79has3cy7dlw70n4pn13r552a2i1g4xy23acnpvvjsb"; + url="http://fbterm.googlecode.com/files/fbterm-${version}.tar.gz"; +in + +stdenv.mkDerivation { + inherit name; + + src = fetchurl { + inherit url; + sha256 = hash; + }; + + buildNativeInputs = [ ncurses ]; + buildInputs = [ gpm freetype fontconfig pkgconfig ]; + + patchPhase = '' + sed -e '/ifdef SYS_signalfd/atypedef long long loff_t;' -i src/fbterm.cpp + + sed -e '/install-exec-hook:/,/^[^\t]/{d}; /.NOEXPORT/iinstall-exec-hook:\ + ' -i src/Makefile.in + + export HOME=$PWD; + + export NIX_LDFLAGS="$NIX_LDFLAGS -lfreetype" + # This is only relevant cross-building + export NIX_CROSS_LDFLAGS="$NIX_CROSS_LDFLAGS -lfreetype" + ''; +} diff --git a/pkgs/os-specific/linux/hal/default.nix b/pkgs/os-specific/linux/hal/default.nix index 6672b111d17..718d54f3106 100644 --- a/pkgs/os-specific/linux/hal/default.nix +++ b/pkgs/os-specific/linux/hal/default.nix @@ -7,6 +7,12 @@ assert stdenv ? glibc; +let + isPC = stdenv.isi686 || stdenv.isx86_64; + changeDmidecode = if isPC then + "--replace /usr/sbin/dmidecode ${dmidecode}/sbin/dmidecode" + else ""; +in stdenv.mkDerivation rec { name = "hal-0.5.14"; @@ -19,8 +25,7 @@ stdenv.mkDerivation rec { pkgconfig python pciutils expat libusb dbus.libs dbus_glib glib libuuid perl perlXMLParser gettext zlib gperf consolekit policykit - # !!! libsmbios is broken; it doesn't install headers. - ] ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") [ libsmbios ]; + ]; # !!! Hm, maybe the pci/usb.ids location should be in /etc, so that # we don't have to rebuild HAL when we update the PCI/USB IDs. @@ -34,7 +39,7 @@ stdenv.mkDerivation rec { ''; propagatedBuildInputs = [ libusb ] - ++ stdenv.lib.optionals (stdenv.system != "armv5tel-linux") [ libsmbios ]; + ++ stdenv.lib.optional isPC libsmbios; preConfigure = '' for i in hald/linux/probing/probe-smbios.c hald/linux/osspec.c \ @@ -44,7 +49,7 @@ stdenv.mkDerivation rec { tools/linux/hal-*-linux do substituteInPlace $i \ - --replace /usr/sbin/dmidecode ${dmidecode}/sbin/dmidecode \ + ${changeDmidecode} \ ${if udev != null then "--replace /sbin/udevadm ${udev}/sbin/udevadm" else ""} \ --replace /bin/mount ${utillinuxng}/bin/mount \ --replace /bin/umount ${utillinuxng}/bin/umount \ diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 77d53adeb81..c54ac4c2c73 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,19 +1,22 @@ { stdenv, fetchurl, bison, flex, autoconf, automake }: stdenv.mkDerivation rec { - name = "kbd-1.15.1"; + name = "kbd-1.15.2"; src = fetchurl { url = "ftp://ftp.altlinux.org/pub/people/legion/kbd/${name}.tar.gz"; - sha256 = "1klrxas8vjikx6jm6m2lcpmn88lhxb6p3whwgdwq9d9flf1qrf4i"; + sha256 = "0ff674y6d3b6ix08b9l2yzv8igns768biyp5y92vip7iz4xv2p2j"; }; - buildInputs = [ bison flex autoconf automake ]; + buildNativeInputs = [ bison flex autoconf automake ]; - # We get a warning in armv5tel-linux, so we disable -Werror in it - patchPhase = if (stdenv.system == "armv5tel-linux") then '' - sed -i s/-Werror// src/Makefile.am - '' else ""; + # We get a warning in armv5tel-linux and the fuloong2f, + # so we disable -Werror in it + patchPhase = if (stdenv.system == "armv5tel-linux" || + stdenv.system == "mips64-linux") + then '' + sed -i s/-Werror// src/Makefile.am + '' else ""; # Grrr, kbd 1.15.1 doesn't include a configure script. preConfigure = "autoreconf"; diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix index 82840f8a51f..a85e6f79bf1 100644 --- a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix +++ b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation { if stdenv.system == "x86_64-linux" then "x86_64" else if stdenv.system == "powerpc-linux" then "powerpc" else if stdenv.system == "armv5tel-linux" then "arm" else + if stdenv.system == "mips64-linux" then "mips" else abort "don't know what the kernel include directory is called for this platform"; buildInputs = [perl]; diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix index 936ef5ec40d..a4e86658193 100644 --- a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix +++ b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix @@ -26,6 +26,7 @@ stdenv.mkDerivation { if stdenv.system == "x86_64-linux" then "x86_64" else if stdenv.system == "powerpc-linux" then "powerpc" else if stdenv.system == "armv5tel-linux" then "arm" else + if stdenv.platform ? kernelArch then stdenv.platform.kernelArch else abort "don't know what the kernel include directory is called for this platform"; buildInputs = [perl]; diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh index e7d25e86883..bb030abaa6c 100644 --- a/pkgs/os-specific/linux/kernel/builder.sh +++ b/pkgs/os-specific/linux/kernel/builder.sh @@ -68,81 +68,88 @@ installPhase() { if test "$arch" = um; then ensureDir $out/bin cp linux $out/bin - else + elif test "$kernelTarget" != "vmlinux"; then + # In any case we copy the 'vmlinux' ELF in the next lines cp arch/$archDir/boot/$kernelTarget $out fi cp vmlinux $out - # Install the modules in $out/lib/modules with matching paths - # in modules.dep (i.e., refererring to $out/lib/modules, not - # /lib/modules). The depmod_opts= is to prevent the kernel - # from passing `-b PATH' to depmod. - export MODULE_DIR=$out/lib/modules/ - substituteInPlace Makefile --replace '-b $(INSTALL_MOD_PATH)' '' - make modules_install \ - DEPMOD=$module_init_tools/sbin/depmod depmod_opts= \ - $makeFlags "${makeFlagsArray[@]}" \ - $installFlags "${installFlagsArray[@]}" + if grep -q "CONFIG_MODULES=y" .config; then + # Install the modules in $out/lib/modules with matching paths + # in modules.dep (i.e., refererring to $out/lib/modules, not + # /lib/modules). The depmod_opts= is to prevent the kernel + # from passing `-b PATH' to depmod. + export MODULE_DIR=$out/lib/modules/ + substituteInPlace Makefile --replace '-b $(INSTALL_MOD_PATH)' '' + make modules_install \ + DEPMOD=$module_init_tools/sbin/depmod depmod_opts= \ + $makeFlags "${makeFlagsArray[@]}" \ + $installFlags "${installFlagsArray[@]}" - if test -z "$dontStrip"; then - # Strip the kernel modules. - echo "Stripping kernel modules..." - if [ -z "$crossConfig" ]; then - find $out -name "*.ko" -print0 | xargs -0 strip -S - else - find $out -name "*.ko" -print0 | xargs -0 $crossConfig-strip -S - fi + if test -z "$dontStrip"; then + # Strip the kernel modules. + echo "Stripping kernel modules..." + if [ -z "$crossConfig" ]; then + find $out -name "*.ko" -print0 | xargs -0 strip -S + else + find $out -name "*.ko" -print0 | xargs -0 $crossConfig-strip -S + fi + fi + + # move this to install later on + # largely copied from early FC3 kernel spec files + version=$(cd $out/lib/modules && ls -d *) + + # remove symlinks and create directories + rm -f $out/lib/modules/$version/build + rm -f $out/lib/modules/$version/source + mkdir $out/lib/modules/$version/build + + # copy config + cp .config $out/lib/modules/$version/build/.config + ln -s $out/lib/modules/$version/build/.config $out/config + + if test "$arch" != um; then + # copy all Makefiles and Kconfig files + ln -s $out/lib/modules/$version/build $out/lib/modules/$version/source + cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/$version/build + cp Module.symvers $out/lib/modules/$version/build + + if test "$dontStrip" = "1"; then + # copy any debugging info that can be found + cp --parents -rv `find -name \*.debug -o -name debug.a` \ + "$out/lib/modules/$version/build" + fi + + # weed out unneeded stuff + rm -rf $out/lib/modules/$version/build/Documentation + rm -rf $out/lib/modules/$version/build/scripts + rm -rf $out/lib/modules/$version/build/include + + # copy architecture dependent files + cp -a arch/$archDir/scripts $out/lib/modules/$version/build/ || true + cp -a arch/$archDir/*lds $out/lib/modules/$version/build/ || true + cp -a arch/$archDir/Makefile*.cpu $out/lib/modules/$version/build/arch/$archDir/ || true + cp -a --parents arch/$archDir/kernel/asm-offsets.s $out/lib/modules/$version/build/arch/$archDir/kernel/ || true + + # copy scripts + rm -f scripts/*.o + rm -f scripts/*/*.o + cp -a scripts $out/lib/modules/$version/build + + # copy include files + includeDir=$out/lib/modules/$version/build/include + mkdir -p $includeDir + (cd include && cp -a * $includeDir) + (cd arch/$archDir/include && cp -a * $includeDir || true) + (cd arch/$archDir/include && cp -a asm/* $includeDir/asm/ || true) + (cd arch/$archDir/include/asm/mach-generic && cp -a * $includeDir/ || true) + fi fi - # move this to install later on - # largely copied from early FC3 kernel spec files - version=$(cd $out/lib/modules && ls -d *) - - # remove symlinks and create directories - rm -f $out/lib/modules/$version/build - rm -f $out/lib/modules/$version/source - mkdir $out/lib/modules/$version/build - - # copy config - cp .config $out/lib/modules/$version/build/.config - ln -s $out/lib/modules/$version/build/.config $out/config - - if test "$arch" != um; then - # copy all Makefiles and Kconfig files - ln -s $out/lib/modules/$version/build $out/lib/modules/$version/source - cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/$version/build - cp Module.symvers $out/lib/modules/$version/build - - if test "$dontStrip" = "1"; then - # copy any debugging info that can be found - cp --parents -rv `find -name \*.debug -o -name debug.a` \ - "$out/lib/modules/$version/build" - fi - - # weed out unneeded stuff - rm -rf $out/lib/modules/$version/build/Documentation - rm -rf $out/lib/modules/$version/build/scripts - rm -rf $out/lib/modules/$version/build/include - - # copy architecture dependent files - cp -a arch/$archDir/scripts $out/lib/modules/$version/build/ || true - cp -a arch/$archDir/*lds $out/lib/modules/$version/build/ || true - cp -a arch/$archDir/Makefile*.cpu $out/lib/modules/$version/build/arch/$archDir/ || true - cp -a --parents arch/$archDir/kernel/asm-offsets.s $out/lib/modules/$version/build/arch/$archDir/kernel/ || true - - # copy scripts - rm -f scripts/*.o - rm -f scripts/*/*.o - cp -a scripts $out/lib/modules/$version/build - - # copy include files - includeDir=$out/lib/modules/$version/build/include - mkdir -p $includeDir - (cd include && cp -a * $includeDir) - (cd arch/$archDir/include && cp -a * $includeDir || true) - (cd arch/$archDir/include && cp -a asm/* $includeDir/asm/ || true) - (cd arch/$archDir/include/asm/mach-generic && cp -a * $includeDir/ || true) + if test -n "$postInstall"; then + eval "$postInstall"; fi } diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index da3f6862a10..42cefd5b584 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -34,11 +34,12 @@ , preConfigure ? "" , extraMeta ? {} , ubootChooser ? null +, postInstall ? "" , ... }: assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" - || stdenv.system == "armv5tel-linux"; + || stdenv.system == "armv5tel-linux" || stdenv.system == "mips64-linux"; assert stdenv.platform.name == "sheevaplug" -> stdenv.platform.uboot != null; @@ -69,7 +70,7 @@ stdenv.mkDerivation { generateConfig = ./generate-config.pl; - inherit preConfigure src module_init_tools localVersion; + inherit preConfigure src module_init_tools localVersion postInstall; patches = map (p: p.patch) kernelPatches; @@ -94,6 +95,7 @@ stdenv.mkDerivation { if stdenv.system == "i686-linux" then "i386" else if stdenv.system == "x86_64-linux" then "x86_64" else if stdenv.system == "armv5tel-linux" then "arm" else + if stdenv.system == "mips64-linux" then "mips" else abort "Platform ${stdenv.system} is not supported."; crossAttrs = let diff --git a/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.34.nix b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.34.nix new file mode 100644 index 00000000000..0eb291d5b55 --- /dev/null +++ b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.34.nix @@ -0,0 +1,241 @@ +args @ { stdenv, fetchurl, fetchsvn, userModeLinux ? false, extraConfig ? "" +, ... }: + +let + configWithPlatform = kernelPlatform : + '' + # Don't include any debug features. + DEBUG_KERNEL n + + # Support drivers that need external firmware. + STANDALONE n + + # Make /proc/config.gz available. + IKCONFIG_PROC y + + # Optimize with -O2, not -Os. + CC_OPTIMIZE_FOR_SIZE n + + # Enable the kernel's built-in memory tester. + MEMTEST y + + # Include the CFQ I/O scheduler in the kernel, rather than as a + # module, so that the initrd gets a good I/O scheduler. + IOSCHED_CFQ y + + # Disable some expensive (?) features. + FTRACE n + KPROBES n + NUMA? n + PM_TRACE_RTC n + + # Enable various subsystems. + ACCESSIBILITY y # Accessibility support + AUXDISPLAY y # Auxiliary Display support + DONGLE y # Serial dongle support + HIPPI y + MTD_COMPLEX_MAPPINGS y # needed for many devices + NET_POCKET y # enable pocket and portable adapters + SCSI_LOWLEVEL y # enable lots of SCSI devices + SCSI_LOWLEVEL_PCMCIA y + SPI y # needed for many devices + SPI_MASTER y + WAN y + + # Networking options. + IP_PNP n + IPV6_PRIVACY y + NETFILTER_ADVANCED y + IP_VS_PROTO_TCP y + IP_VS_PROTO_UDP y + IP_VS_PROTO_ESP y + IP_VS_PROTO_AH y + IP_DCCP_CCID3 n # experimental + CLS_U32_PERF y + CLS_U32_MARK y + + # Wireless networking. + IPW2100_MONITOR y # support promiscuous mode + IPW2200_MONITOR y # support promiscuous mode + IWL4965 y # Intel Wireless WiFi 4965AGN + IWL5000 y # Intel Wireless WiFi 5000AGN + HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver + HOSTAP_FIRMWARE_NVRAM y + + # Some settings to make sure that fbcondecor works - in particular, + # disable tileblitting and the drivers that need it. + + # Enable various FB devices. + FB y + FB_EFI y + FB_NVIDIA_I2C y # Enable DDC Support + FB_RIVA_I2C y + FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support + FB_ATY_GX y # Mach64 GX support + FB_SAVAGE_I2C y + FB_SAVAGE_ACCEL y + FB_SIS_300 y + FB_SIS_315 y + FB_3DFX_ACCEL y + FB_GEODE y + + # Video configuration + # The intel drivers already require KMS + DRM_I915_KMS y + + # Sound. + SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode + SND_HDA_INPUT_BEEP y # Support digital beep via input layer + SND_USB_CAIAQ_INPUT y + PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible) + + # USB serial devices. + USB_SERIAL_GENERIC y # USB Generic Serial Driver + USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices + USB_SERIAL_KEYSPAN_USA28 y + USB_SERIAL_KEYSPAN_USA28X y + USB_SERIAL_KEYSPAN_USA28XA y + USB_SERIAL_KEYSPAN_USA28XB y + USB_SERIAL_KEYSPAN_USA19 y + USB_SERIAL_KEYSPAN_USA18X y + USB_SERIAL_KEYSPAN_USA19W y + USB_SERIAL_KEYSPAN_USA19QW y + USB_SERIAL_KEYSPAN_USA19QI y + USB_SERIAL_KEYSPAN_USA49W y + USB_SERIAL_KEYSPAN_USA49WLC y + + # Filesystem options - in particular, enable extended attributes and + # ACLs for all filesystems that support them. + EXT2_FS_XATTR y # Ext2 extended attributes + EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists + EXT2_FS_SECURITY y # Ext2 Security Labels + EXT2_FS_XIP y # Ext2 execute in place support + EXT4_FS_POSIX_ACL y + EXT4_FS_SECURITY y + REISERFS_FS_XATTR y + REISERFS_FS_POSIX_ACL y + REISERFS_FS_SECURITY y + JFS_POSIX_ACL y + JFS_SECURITY y + XFS_QUOTA y + XFS_POSIX_ACL y + XFS_RT y # XFS Realtime subvolume support + OCFS2_DEBUG_MASKLOG n + BTRFS_FS_POSIX_ACL y + UBIFS_FS_XATTR y + UBIFS_FS_ADVANCED_COMPR y + NFSD_V2_ACL y + NFSD_V3 y + NFSD_V3_ACL y + NFSD_V4 y + CIFS_XATTR y + CIFS_POSIX y + + # Security related features. + STRICT_DEVMEM y # Filter access to /dev/mem + SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default + + # Misc. options. + 8139TOO_8129 y + 8139TOO_PIO n # PIO is slower + AIC79XX_DEBUG_ENABLE n + AIC7XXX_DEBUG_ENABLE n + AIC94XX_DEBUG n + B43_PCMCIA y + BLK_DEV_BSG n + BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support + BLK_DEV_IDEACPI y # IDE ACPI support + BLK_DEV_INTEGRITY y + BSD_PROCESS_ACCT_V3 y + BT_HCIUART_BCSP y + BT_HCIUART_H4 y # UART (H4) protocol support + BT_HCIUART_LL y + BT_RFCOMM_TTY y # RFCOMM TTY support + CPU_FREQ_DEBUG n + CRASH_DUMP n + DMAR? n # experimental + DVB_DYNAMIC_MINORS y # we use udev + FUSION y # Fusion MPT device support + IDE_GD_ATAPI y # ATAPI floppy support + IRDA_ULTRA y # Ultra (connectionless) protocol + JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels + JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels + JOYSTICK_XPAD_FF y # X-Box gamepad rumble support + JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED + KALLSYMS_EXTRA_PASS n + LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support + LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger + LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback + LOGO n # not needed + MEDIA_ATTACH y + MEGARAID_NEWGEN y + MICROCODE_AMD y + MODVERSIONS y + MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension + MTRR_SANITIZER y + NET_FC y # Fibre Channel driver support + PPP_MULTILINK y # PPP multilink support + REGULATOR y # Voltage and Current Regulator Support + SCSI_LOGGING y # SCSI logging facility + SERIAL_8250 y # 8250/16550 and compatible serial support + SLIP_COMPRESSED y # CSLIP compressed headers + SLIP_SMART y + THERMAL_HWMON y # Hardware monitoring support + USB_DEBUG n + USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators + X86_CHECK_BIOS_CORRUPTION y + X86_MCE y + + ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""} + ${extraConfig} + ''; +in + +import ./generic.nix ( + + rec { + version = "qi_lb60-2.6.34.1-openwrt-22513"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.34.1.tar.bz2"; + sha256 = "0v78yvkwr100v7bnrkkabxmpv5hjg1ngrjbr5d0kkzsw4d7bmm5x"; + }; + + srcPatch = fetchsvn { + url = "svn://svn.openwrt.org/openwrt/trunk/target/linux"; + rev = 22513; + sha256 = "0b7wzgqnbq8sq32z9ik08n1b7fnc9v9d91zwvb6qz7vj3dlrxw3g"; + }; + + preConfigure = '' + cp -R ${srcPatch}/generic/files/* . + chmod +w -R * + GLOBIGNORE='.:..:*preinit_as_init*' + for a in ${srcPatch}/generic/patches-2.6.34/* ${srcPatch}/xburst/patches-2.6.34/* ; do + echo applying patch $a + patch -p1 < $a + done + unset GLOBIGNORE + cat ${srcPatch}/generic/config-2.6.34 ${srcPatch}/xburst/config-2.6.34 \ + ${srcPatch}/xburst/qi_lb60/config-2.6.34 > arch/mips/configs/qi_lb60_defconfig + ''; + + postInstall = '' + set -x + gzip -9 -c $out/vmlinux.bin > $out/vmlinux.bin.gz + KERNEL_ENTRY="0x`$crossConfig-nm $out/vmlinux 2>/dev/null | + grep " kernel_entry" | cut -f1 -d ' '`" + mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \ + -e $KERNEL_ENTRY -n "MIPS Nix Linux-2.6.34" \ + -d $out/vmlinux.bin.gz $out/uImage + set +x + ''; + + config = configWithPlatform stdenv.platform; + configCross = configWithPlatform stdenv.cross.platform; + + features.iwlwifi = true; + } + + // removeAttrs args ["extraConfig"] +) diff --git a/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.35.nix b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.35.nix new file mode 100644 index 00000000000..ac0b000f9cd --- /dev/null +++ b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.35.nix @@ -0,0 +1,241 @@ +args @ { stdenv, fetchurl, fetchsvn, userModeLinux ? false, extraConfig ? "" +, ... }: + +let + configWithPlatform = kernelPlatform : + '' + # Don't include any debug features. + DEBUG_KERNEL n + + # Support drivers that need external firmware. + STANDALONE n + + # Make /proc/config.gz available. + IKCONFIG_PROC y + + # Optimize with -O2, not -Os. + CC_OPTIMIZE_FOR_SIZE n + + # Enable the kernel's built-in memory tester. + MEMTEST y + + # Include the CFQ I/O scheduler in the kernel, rather than as a + # module, so that the initrd gets a good I/O scheduler. + IOSCHED_CFQ y + + # Disable some expensive (?) features. + FTRACE n + KPROBES n + NUMA? n + PM_TRACE_RTC n + + # Enable various subsystems. + ACCESSIBILITY y # Accessibility support + AUXDISPLAY y # Auxiliary Display support + DONGLE y # Serial dongle support + HIPPI y + MTD_COMPLEX_MAPPINGS y # needed for many devices + NET_POCKET y # enable pocket and portable adapters + SCSI_LOWLEVEL y # enable lots of SCSI devices + SCSI_LOWLEVEL_PCMCIA y + SPI y # needed for many devices + SPI_MASTER y + WAN y + + # Networking options. + IP_PNP n + IPV6_PRIVACY y + NETFILTER_ADVANCED y + IP_VS_PROTO_TCP y + IP_VS_PROTO_UDP y + IP_VS_PROTO_ESP y + IP_VS_PROTO_AH y + IP_DCCP_CCID3 n # experimental + CLS_U32_PERF y + CLS_U32_MARK y + + # Wireless networking. + IPW2100_MONITOR y # support promiscuous mode + IPW2200_MONITOR y # support promiscuous mode + IWL4965 y # Intel Wireless WiFi 4965AGN + IWL5000 y # Intel Wireless WiFi 5000AGN + HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver + HOSTAP_FIRMWARE_NVRAM y + + # Some settings to make sure that fbcondecor works - in particular, + # disable tileblitting and the drivers that need it. + + # Enable various FB devices. + FB y + FB_EFI y + FB_NVIDIA_I2C y # Enable DDC Support + FB_RIVA_I2C y + FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support + FB_ATY_GX y # Mach64 GX support + FB_SAVAGE_I2C y + FB_SAVAGE_ACCEL y + FB_SIS_300 y + FB_SIS_315 y + FB_3DFX_ACCEL y + FB_GEODE y + + # Video configuration + # The intel drivers already require KMS + DRM_I915_KMS y + + # Sound. + SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode + SND_HDA_INPUT_BEEP y # Support digital beep via input layer + SND_USB_CAIAQ_INPUT y + PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible) + + # USB serial devices. + USB_SERIAL_GENERIC y # USB Generic Serial Driver + USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices + USB_SERIAL_KEYSPAN_USA28 y + USB_SERIAL_KEYSPAN_USA28X y + USB_SERIAL_KEYSPAN_USA28XA y + USB_SERIAL_KEYSPAN_USA28XB y + USB_SERIAL_KEYSPAN_USA19 y + USB_SERIAL_KEYSPAN_USA18X y + USB_SERIAL_KEYSPAN_USA19W y + USB_SERIAL_KEYSPAN_USA19QW y + USB_SERIAL_KEYSPAN_USA19QI y + USB_SERIAL_KEYSPAN_USA49W y + USB_SERIAL_KEYSPAN_USA49WLC y + + # Filesystem options - in particular, enable extended attributes and + # ACLs for all filesystems that support them. + EXT2_FS_XATTR y # Ext2 extended attributes + EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists + EXT2_FS_SECURITY y # Ext2 Security Labels + EXT2_FS_XIP y # Ext2 execute in place support + EXT4_FS_POSIX_ACL y + EXT4_FS_SECURITY y + REISERFS_FS_XATTR y + REISERFS_FS_POSIX_ACL y + REISERFS_FS_SECURITY y + JFS_POSIX_ACL y + JFS_SECURITY y + XFS_QUOTA y + XFS_POSIX_ACL y + XFS_RT y # XFS Realtime subvolume support + OCFS2_DEBUG_MASKLOG n + BTRFS_FS_POSIX_ACL y + UBIFS_FS_XATTR y + UBIFS_FS_ADVANCED_COMPR y + NFSD_V2_ACL y + NFSD_V3 y + NFSD_V3_ACL y + NFSD_V4 y + CIFS_XATTR y + CIFS_POSIX y + + # Security related features. + STRICT_DEVMEM y # Filter access to /dev/mem + SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default + + # Misc. options. + 8139TOO_8129 y + 8139TOO_PIO n # PIO is slower + AIC79XX_DEBUG_ENABLE n + AIC7XXX_DEBUG_ENABLE n + AIC94XX_DEBUG n + B43_PCMCIA y + BLK_DEV_BSG n + BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support + BLK_DEV_IDEACPI y # IDE ACPI support + BLK_DEV_INTEGRITY y + BSD_PROCESS_ACCT_V3 y + BT_HCIUART_BCSP y + BT_HCIUART_H4 y # UART (H4) protocol support + BT_HCIUART_LL y + BT_RFCOMM_TTY y # RFCOMM TTY support + CPU_FREQ_DEBUG n + CRASH_DUMP n + DMAR? n # experimental + DVB_DYNAMIC_MINORS y # we use udev + FUSION y # Fusion MPT device support + IDE_GD_ATAPI y # ATAPI floppy support + IRDA_ULTRA y # Ultra (connectionless) protocol + JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels + JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels + JOYSTICK_XPAD_FF y # X-Box gamepad rumble support + JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED + KALLSYMS_EXTRA_PASS n + LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support + LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger + LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback + LOGO n # not needed + MEDIA_ATTACH y + MEGARAID_NEWGEN y + MICROCODE_AMD y + MODVERSIONS y + MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension + MTRR_SANITIZER y + NET_FC y # Fibre Channel driver support + PPP_MULTILINK y # PPP multilink support + REGULATOR y # Voltage and Current Regulator Support + SCSI_LOGGING y # SCSI logging facility + SERIAL_8250 y # 8250/16550 and compatible serial support + SLIP_COMPRESSED y # CSLIP compressed headers + SLIP_SMART y + THERMAL_HWMON y # Hardware monitoring support + USB_DEBUG n + USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators + X86_CHECK_BIOS_CORRUPTION y + X86_MCE y + + ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""} + ${extraConfig} + ''; +in + +import ./generic.nix ( + + rec { + version = "qi_lb60-2.6.35-openwrt-22513"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.35.tar.bz2"; + sha256 = "1kxz87nwksx4hvq1i45i9w1zq1fb09rvf8i6jin3cbh36v1y5chq"; + }; + + srcPatch = fetchsvn { + url = "svn://svn.openwrt.org/openwrt/trunk/target/linux"; + rev = 22530; + sha256 = "1j5ls7dg0pvdxh6isczmq4r0lkwhz1c1s46mvdkcjsm3qq633fpc"; + }; + + preConfigure = '' + cp -R ${srcPatch}/generic/files/* . + chmod +w -R * + GLOBIGNORE='.:..:*preinit_as_init*' + for a in ${srcPatch}/generic/patches-2.6.35/* ${srcPatch}/xburst/patches-2.6.35/* ; do + echo applying patch $a + patch -p1 < $a + done + unset GLOBIGNORE + cat ${srcPatch}/generic/config-2.6.35 ${srcPatch}/xburst/config-2.6.35 \ + ${srcPatch}/xburst/qi_lb60/config-2.6.35 > arch/mips/configs/qi_lb60_defconfig + ''; + + postInstall = '' + set -x + gzip -9 -c $out/vmlinux.bin > $out/vmlinux.bin.gz + KERNEL_ENTRY="0x`$crossConfig-nm $out/vmlinux 2>/dev/null | + grep " kernel_entry" | cut -f1 -d ' '`" + mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \ + -e $KERNEL_ENTRY -n "MIPS Nix Linux-2.6.35" \ + -d $out/vmlinux.bin.gz $out/uImage + set +x + ''; + + config = configWithPlatform stdenv.platform; + configCross = configWithPlatform stdenv.cross.platform; + + features.iwlwifi = true; + } + + // removeAttrs args ["extraConfig"] +) diff --git a/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.36.nix b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.36.nix new file mode 100644 index 00000000000..ed5eabf025b --- /dev/null +++ b/pkgs/os-specific/linux/kernel/linux-nanonote-jz-2.6.36.nix @@ -0,0 +1,241 @@ +args @ { stdenv, fetchurl, fetchsvn, userModeLinux ? false, extraConfig ? "" +, ... }: + +let + configWithPlatform = kernelPlatform : + '' + # Don't include any debug features. + DEBUG_KERNEL n + + # Support drivers that need external firmware. + STANDALONE n + + # Make /proc/config.gz available. + IKCONFIG_PROC y + + # Optimize with -O2, not -Os. + CC_OPTIMIZE_FOR_SIZE n + + # Enable the kernel's built-in memory tester. + MEMTEST y + + # Include the CFQ I/O scheduler in the kernel, rather than as a + # module, so that the initrd gets a good I/O scheduler. + IOSCHED_CFQ y + + # Disable some expensive (?) features. + FTRACE n + KPROBES n + NUMA? n + PM_TRACE_RTC n + + # Enable various subsystems. + ACCESSIBILITY y # Accessibility support + AUXDISPLAY y # Auxiliary Display support + DONGLE y # Serial dongle support + HIPPI y + MTD_COMPLEX_MAPPINGS y # needed for many devices + NET_POCKET y # enable pocket and portable adapters + SCSI_LOWLEVEL y # enable lots of SCSI devices + SCSI_LOWLEVEL_PCMCIA y + SPI y # needed for many devices + SPI_MASTER y + WAN y + + # Networking options. + IP_PNP n + IPV6_PRIVACY y + NETFILTER_ADVANCED y + IP_VS_PROTO_TCP y + IP_VS_PROTO_UDP y + IP_VS_PROTO_ESP y + IP_VS_PROTO_AH y + IP_DCCP_CCID3 n # experimental + CLS_U32_PERF y + CLS_U32_MARK y + + # Wireless networking. + IPW2100_MONITOR y # support promiscuous mode + IPW2200_MONITOR y # support promiscuous mode + IWL4965 y # Intel Wireless WiFi 4965AGN + IWL5000 y # Intel Wireless WiFi 5000AGN + HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver + HOSTAP_FIRMWARE_NVRAM y + + # Some settings to make sure that fbcondecor works - in particular, + # disable tileblitting and the drivers that need it. + + # Enable various FB devices. + FB y + FB_EFI y + FB_NVIDIA_I2C y # Enable DDC Support + FB_RIVA_I2C y + FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support + FB_ATY_GX y # Mach64 GX support + FB_SAVAGE_I2C y + FB_SAVAGE_ACCEL y + FB_SIS_300 y + FB_SIS_315 y + FB_3DFX_ACCEL y + FB_GEODE y + + # Video configuration + # The intel drivers already require KMS + DRM_I915_KMS y + + # Sound. + SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode + SND_HDA_INPUT_BEEP y # Support digital beep via input layer + SND_USB_CAIAQ_INPUT y + PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible) + + # USB serial devices. + USB_SERIAL_GENERIC y # USB Generic Serial Driver + USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices + USB_SERIAL_KEYSPAN_USA28 y + USB_SERIAL_KEYSPAN_USA28X y + USB_SERIAL_KEYSPAN_USA28XA y + USB_SERIAL_KEYSPAN_USA28XB y + USB_SERIAL_KEYSPAN_USA19 y + USB_SERIAL_KEYSPAN_USA18X y + USB_SERIAL_KEYSPAN_USA19W y + USB_SERIAL_KEYSPAN_USA19QW y + USB_SERIAL_KEYSPAN_USA19QI y + USB_SERIAL_KEYSPAN_USA49W y + USB_SERIAL_KEYSPAN_USA49WLC y + + # Filesystem options - in particular, enable extended attributes and + # ACLs for all filesystems that support them. + EXT2_FS_XATTR y # Ext2 extended attributes + EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists + EXT2_FS_SECURITY y # Ext2 Security Labels + EXT2_FS_XIP y # Ext2 execute in place support + EXT4_FS_POSIX_ACL y + EXT4_FS_SECURITY y + REISERFS_FS_XATTR y + REISERFS_FS_POSIX_ACL y + REISERFS_FS_SECURITY y + JFS_POSIX_ACL y + JFS_SECURITY y + XFS_QUOTA y + XFS_POSIX_ACL y + XFS_RT y # XFS Realtime subvolume support + OCFS2_DEBUG_MASKLOG n + BTRFS_FS_POSIX_ACL y + UBIFS_FS_XATTR y + UBIFS_FS_ADVANCED_COMPR y + NFSD_V2_ACL y + NFSD_V3 y + NFSD_V3_ACL y + NFSD_V4 y + CIFS_XATTR y + CIFS_POSIX y + + # Security related features. + STRICT_DEVMEM y # Filter access to /dev/mem + SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default + + # Misc. options. + 8139TOO_8129 y + 8139TOO_PIO n # PIO is slower + AIC79XX_DEBUG_ENABLE n + AIC7XXX_DEBUG_ENABLE n + AIC94XX_DEBUG n + B43_PCMCIA y + BLK_DEV_BSG n + BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support + BLK_DEV_IDEACPI y # IDE ACPI support + BLK_DEV_INTEGRITY y + BSD_PROCESS_ACCT_V3 y + BT_HCIUART_BCSP y + BT_HCIUART_H4 y # UART (H4) protocol support + BT_HCIUART_LL y + BT_RFCOMM_TTY y # RFCOMM TTY support + CPU_FREQ_DEBUG n + CRASH_DUMP n + DMAR? n # experimental + DVB_DYNAMIC_MINORS y # we use udev + FUSION y # Fusion MPT device support + IDE_GD_ATAPI y # ATAPI floppy support + IRDA_ULTRA y # Ultra (connectionless) protocol + JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels + JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels + JOYSTICK_XPAD_FF y # X-Box gamepad rumble support + JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED + KALLSYMS_EXTRA_PASS n + LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support + LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger + LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback + LOGO n # not needed + MEDIA_ATTACH y + MEGARAID_NEWGEN y + MICROCODE_AMD y + MODVERSIONS y + MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension + MTRR_SANITIZER y + NET_FC y # Fibre Channel driver support + PPP_MULTILINK y # PPP multilink support + REGULATOR y # Voltage and Current Regulator Support + SCSI_LOGGING y # SCSI logging facility + SERIAL_8250 y # 8250/16550 and compatible serial support + SLIP_COMPRESSED y # CSLIP compressed headers + SLIP_SMART y + THERMAL_HWMON y # Hardware monitoring support + USB_DEBUG n + USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators + X86_CHECK_BIOS_CORRUPTION y + X86_MCE y + + ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""} + ${extraConfig} + ''; +in + +import ./generic.nix ( + + rec { + version = "qi_lb60-2.6.35-openwrt-24283"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.36.tar.bz2"; + sha256 = "15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04"; + }; + + srcPatch = fetchsvn { + url = "svn://svn.openwrt.org/openwrt/trunk/target/linux"; + rev = 24283; + sha256 = "4e30266bbaf004acb10b5c182d0c01c7aba685956d36e76ea7c24dd55ae51c10"; + }; + + preConfigure = '' + cp -R ${srcPatch}/generic/files/* . + chmod +w -R * + GLOBIGNORE='.:..:*preinit_as_init*' + for a in ${srcPatch}/generic/patches-2.6.36/* ${srcPatch}/xburst/patches-2.6.36/* ; do + echo applying patch $a + patch -p1 < $a + done + unset GLOBIGNORE + cat ${srcPatch}/generic/config-2.6.36 ${srcPatch}/xburst/config-2.6.36 \ + ${srcPatch}/xburst/qi_lb60/config-2.6.36 > arch/mips/configs/qi_lb60_defconfig + ''; + + postInstall = '' + set -x + gzip -9 -c $out/vmlinux.bin > $out/vmlinux.bin.gz + KERNEL_ENTRY="0x`$crossConfig-nm $out/vmlinux 2>/dev/null | + grep " kernel_entry" | cut -f1 -d ' '`" + mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \ + -e $KERNEL_ENTRY -n "MIPS Nix Linux-2.6.36" \ + -d $out/vmlinux.bin.gz $out/uImage + set +x + ''; + + config = configWithPlatform stdenv.platform; + configCross = configWithPlatform stdenv.cross.platform; + + features.iwlwifi = true; + } + + // removeAttrs args ["extraConfig"] +) diff --git a/pkgs/os-specific/linux/kernel/mips_restart.patch b/pkgs/os-specific/linux/kernel/mips_restart.patch new file mode 100644 index 00000000000..42a9b4f253c --- /dev/null +++ b/pkgs/os-specific/linux/kernel/mips_restart.patch @@ -0,0 +1,12 @@ +diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c +index 9996094..ae167df 100644 +--- a/arch/mips/kernel/process.c ++++ b/arch/mips/kernel/process.c +@@ -142,7 +142,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, + childregs->regs[7] = 0; /* Clear error flag */ + + childregs->regs[2] = 0; /* Child gets zero as return value */ +- regs->regs[2] = p->pid; + + if (childregs->cp0_status & ST0_CU0) { + childregs->regs[28] = (unsigned long) ti; diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 19c7f06b8f7..3ad48033f7a 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -186,9 +186,9 @@ in no_xsave = { name = "no-xsave"; patch = fetchurl { - url = "http://cvs.fedoraproject.org/viewvc/devel/kernel/fix_xen_guest_on_old_EC2.patch?revision=1.1&view=co"; + url = "http://kernel.ubuntu.com/git?p=rtg/ubuntu-maverick.git;a=blobdiff_plain;f=arch/x86/xen/enlighten.c;h=f7ff4c7d22954ab5eda464320241300bd5a32ee5;hp=1ea06f842a921557e958110e22941d53a2822f3c;hb=1a30f99;hpb=8f2ff69dce18ed856a8d1b93176f768b47eeed86"; name = "no-xsave.patch"; - sha256 = "02f51f9b636b105c81a3ed62145abdc0ecb043b8114eb10257854577f617f894"; + sha256 = "18732s3vmav5rpg6zqpiw2i0ll83pcc4gw266h6545pmbh9p7hky"; }; features.noXsave = true; }; @@ -198,6 +198,16 @@ in patch = ./dell-rfkill.patch; }; + sheevaplug_modules_2_6_35 = + { name = "sheevaplug_modules-2.6.35"; + patch = ./sheevaplug_modules-2.6.35.patch; + }; + + mips_restart_2_6_36 = + { name = "mips_restart_2_6_36"; + patch = ./mips_restart.patch; + }; + guruplug_defconfig = { # Default configuration for the GuruPlug. From # . diff --git a/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch b/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch new file mode 100644 index 00000000000..5b62fb90670 --- /dev/null +++ b/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch @@ -0,0 +1,63 @@ +http://www.mail-archive.com/armedslack@lists.armedslack.org/msg00212.html + +From d0679c730395d0bde9a46939e7ba255b4ba7dd7c Mon Sep 17 00:00:00 2001 +From: Andi Kleen +Date: Tue, 2 Feb 2010 14:40:02 -0800 +Subject: [PATCH] kbuild: move -fno-dwarf2-cfi-asm to powerpc only + +Better dwarf2 unwind information is a good thing, it allows better +debugging with kgdb and crash and helps systemtap. + +Commit 003086497f07f7f1e67c0c295e261740f822b377 ("Build with +-fno-dwarf2-cfi-asm") disabled some CFI information globally to work +around a module loader bug on powerpc. + +But this disables the better unwind tables for all architectures, not just +powerpc. Move the workaround to powerpc and also add a suitable comment +that's it really a workaround. + +This improves dwarf2 unwind tables on x86 at least. + +Signed-off-by: Andi Kleen +Cc: Kyle McMartin +Signed-off-by: Andrew Morton +Acked-by: Benjamin Herrenschmidt +Signed-off-by: Michal Marek +--- + Makefile | 3 --- + arch/powerpc/Makefile | 5 +++++ + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 03053c6..2e74a68 100644 +--- a/Makefile ++++ b/Makefile +@@ -579,6 +579,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) + # disable invalid "can't wrap" optimizations for signed / pointers + KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) + ++# revert to pre-gcc-4.4 behaviour of .eh_frame ++KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) ++ + # conserve stack if available + KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) + +diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile +index 1a54a3b..42dcd3f 100644 +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -112,11 +112,6 @@ KBUILD_CFLAGS += $(call cc-option,-mspe=no) + # kernel considerably. + KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) + +-# FIXME: the module load should be taught about the additional relocs +-# generated by this. +-# revert to pre-gcc-4.4 behaviour of .eh_frame +-KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) +- + # Never use string load/store instructions as they are + # often slow when they are implemented at all + KBUILD_CFLAGS += -mno-string +-- +1.7.3.1 + diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index c3967f4f1ab..b8cd2b18bc7 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,26 +1,58 @@ -{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}: +{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross}: assert stdenv.isLinux; -let version = "1.5.15"; in +let + version = "1.5.20"; + baseMakeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"]; +in stdenv.mkDerivation { name = "klibc-${version}"; src = fetchurl { - url = "mirror://kernel/linux/libs/klibc/klibc-${version}.tar.bz2"; - sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb"; + url = "mirror://kernel/linux/libs/klibc/1.5/klibc-${version}.tar.bz2"; + sha256 = "07683dn18r3k35d6pp0sn88pqcx7dldqx3m6f2gz45i1j094qp7m"; + }; + + patches = [ ./make382.patch ]; + + # Trick to make this build on nix. It expects to have the kernel sources + # instead of only the linux kernel headers. + # So it cannot run the 'make headers_install' it wants to run. + # We don't install the headers, so klibc will not be useful as libc, but + # usually in nixpkgs we only use the userspace tools comming with klibc. + prePatch = '' + sed -i -e /headers_install/d scripts/Kbuild.install + ''; + + makeFlags = baseMakeFlags; + + inherit linuxHeaders; + + crossAttrs = { + makeFlags = baseMakeFlags ++ [ "CROSS_COMPILE=${stdenv.cross.config}-" + "KLIBCARCH=${stdenv.cross.arch}" ]; + + patchPhase = '' + sed -i 's/-fno-pic -mno-abicalls/& -mabi=32/' usr/klibc/arch/mips/MCONFIG + sed -i /KLIBCKERNELSRC/d scripts/Kbuild.install + # Wrong check for __mips64 in klibc + sed -i s/__mips64__/__mips64/ usr/include/fcntl.h + ''; + + linuxHeaders = linuxHeadersCross; }; - makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"]; - + # The AEABI option concerns only arm systems, and does not affect the build for + # other systems. preBuild = '' sed -i /CONFIG_AEABI/d defconfig echo "CONFIG_AEABI=y" >> defconfig makeFlags=$(eval "echo $makeFlags") mkdir linux - cp -prsd ${linuxHeaders}/include linux/ + cp -prsd $linuxHeaders/include linux/ chmod -R u+w linux/include/ ''; # */ @@ -32,5 +64,5 @@ stdenv.mkDerivation { cp usr/dash/sh $dir/ ''; - buildInputs = [perl bison mktemp]; + buildNativeInputs = [ perl bison mktemp ]; } diff --git a/pkgs/os-specific/linux/klibc/make382.patch b/pkgs/os-specific/linux/klibc/make382.patch new file mode 100644 index 00000000000..e9e9aba4e79 --- /dev/null +++ b/pkgs/os-specific/linux/klibc/make382.patch @@ -0,0 +1,35 @@ +To avoid an endless loop with gnumake 3.82 +http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg228690.html + +Index: packages/klibc/klibc-make.patch +--- klibc-1.5.19/scripts/Kbuild.include.orig 2010-08-19 09:39:45.986816591 +0200 ++++ klibc-1.5.19/scripts/Kbuild.include 2010-08-19 09:49:15.010816591 +0200 +@@ -127,7 +127,7 @@ + # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file + # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars + # +-if_changed = $(if $(strip $(filter-out $(PHONY),$?) \ ++if_changed = $(if $(strip $(filter-out $(PHONY) FORCE,$?) \ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ + @set -e; \ + $(echo-cmd) $(cmd_$(1)); \ +@@ -135,7 +135,7 @@ + + # execute the command and also postprocess generated .d dependencies + # file +-if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \ ++if_changed_dep = $(if $(strip $(filter-out $(PHONY) FORCE,$?) \ + $(filter-out FORCE $(wildcard $^),$^) \ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ + @set -e; \ +@@ -147,7 +147,7 @@ + # Usage: $(call if_changed_rule,foo) + # will check if $(cmd_foo) changed, or any of the prequisites changed, + # and if so will execute $(rule_foo) +-if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \ ++if_changed_rule = $(if $(strip $(filter-out $(PHONY) FORCE,$?) \ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ + @set -e; \ + $(rule_$(1))) diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index 46f40167a7e..d8cb393ac38 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -1,18 +1,29 @@ -{stdenv, fetchurl, attr}: +{stdenv, fetchurl, attr, perl}: assert stdenv.isLinux; -stdenv.mkDerivation { - name = "libcap-2.09"; +stdenv.mkDerivation rec { + name = "libcap-${version}"; + version = "2.19"; src = fetchurl { - url = mirror://kernel/linux/libs/security/linux-privs/kernel-2.6/libcap-2.09.tar.bz2; - sha256 = "0sq15y8yfm7knf6jhqcycb9wz52n3r1sriii66xk0djvd4hw69jr"; + url = "mirror://kernel/linux/libs/security/linux-privs/kernel-2.6/${name}.tar.gz"; + sha256 = "0fdsz9j741npvh222f8p1y6l516z9liibiwdpdr3a4zg53m0pw45"; }; - buildInputs = [attr]; + buildNativeInputs = [perl]; + propagatedBuildInputs = [attr]; - preBuild = '' - makeFlagsArray=(LIBDIR=$out/lib INCDIR=$out/include SBINDIR=$out/sbin MANDIR=$out/man PAM_CAP=no) - ''; + preConfigure = "cd libcap"; + + makeFlags = "lib=lib prefix=$(out)"; + + passthru = { + postinst = n : '' + ensureDir $out/share/doc/${n} + cp ../License $out/share/doc/${n}/License + ''; + }; + + postInstall = passthru.postinst name; } diff --git a/pkgs/os-specific/linux/libcap/man.nix b/pkgs/os-specific/linux/libcap/man.nix new file mode 100644 index 00000000000..9aac3c4e1f5 --- /dev/null +++ b/pkgs/os-specific/linux/libcap/man.nix @@ -0,0 +1,15 @@ +{stdenv, libcap}: + +assert stdenv.isLinux; + +stdenv.mkDerivation rec { + name = "libcap-docs-${libcap.version}"; + + inherit (libcap) src; + + makeFlags = "MANDIR=$(out)/share/man"; + + preConfigure = "cd doc"; + + postInstall = libcap.postinst name; +} diff --git a/pkgs/os-specific/linux/libcap/pam.nix b/pkgs/os-specific/linux/libcap/pam.nix new file mode 100644 index 00000000000..4cefa825c8a --- /dev/null +++ b/pkgs/os-specific/linux/libcap/pam.nix @@ -0,0 +1,17 @@ +{stdenv, pam, libcap}: + +assert stdenv.isLinux; + +stdenv.mkDerivation rec { + name = "cap_pam.so-${libcap.version}"; + + inherit (libcap) src; + + buildInputs = [ libcap pam ]; + + preConfigure = "cd pam_cap"; + + makeFlags = "${libcap.makeFlags} PAM_CAP=yes"; + + postInstall = libcap.postinst name; +} diff --git a/pkgs/os-specific/linux/libcap/progs.nix b/pkgs/os-specific/linux/libcap/progs.nix new file mode 100644 index 00000000000..1b38848e77e --- /dev/null +++ b/pkgs/os-specific/linux/libcap/progs.nix @@ -0,0 +1,15 @@ +{stdenv, libcap}: + +assert stdenv.isLinux; + +stdenv.mkDerivation rec { + name = "libcap-progs-${libcap.version}"; + + inherit (libcap) src makeFlags; + + buildInputs = [ libcap ]; + + preConfigure = "cd progs"; + + postInstall = libcap.postinst name; +} diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix index cffb7e8353d..9a2dc2d28ac 100644 --- a/pkgs/os-specific/linux/lvm2/default.nix +++ b/pkgs/os-specific/linux/lvm2/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { src = fetchurl { url = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${v}.tgz"; - sha256 = "2a4157b91b7ad5ea84359e8548b64947611beea01862e010be71f54b649e7ad1"; + sha256 = "1lbskrj4pxbipq8f0qhql3p1nqa796v4i1cy6n2fmmbs3fwmfh9a"; }; configureFlags = "--disable-readline --enable-udev_rules --enable-udev_sync"; diff --git a/pkgs/os-specific/linux/mingetty/default.nix b/pkgs/os-specific/linux/mingetty/default.nix index fc3c50e1986..b27baa5480b 100644 --- a/pkgs/os-specific/linux/mingetty/default.nix +++ b/pkgs/os-specific/linux/mingetty/default.nix @@ -8,6 +8,10 @@ stdenv.mkDerivation { sha256 = "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"; }; + crossAttrs = { + makeFlags = "CC=${stdenv.cross.config}-gcc"; + }; + preInstall = '' ensureDir $out/sbin $out/share/man/man8 makeFlagsArray=(SBINDIR=$out/sbin MANDIR=$out/share/man/man8) diff --git a/pkgs/os-specific/linux/mountall/default.nix b/pkgs/os-specific/linux/mountall/default.nix index 360a7d80c12..134f7577c96 100644 --- a/pkgs/os-specific/linux/mountall/default.nix +++ b/pkgs/os-specific/linux/mountall/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, autoconf, automake, libtool }: +{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, autoconf, automake, libtool, gettext }: stdenv.mkDerivation { name = "mountall-2.15"; @@ -10,9 +10,9 @@ stdenv.mkDerivation { patches = [ ./no-plymouth.patch ]; - preConfigure = "autoreconf"; + preConfigure = "rm -R aclocal.m4; gettextize -f; autoreconf -vfi"; - buildInputs = [ pkgconfig libnih dbus.libs udev autoconf automake libtool ]; + buildInputs = [ pkgconfig libnih dbus.libs udev autoconf automake libtool gettext ]; meta = { homepage = https://launchpad.net/ubuntu/+source/mountall; diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 996965b9580..cf05d0fbaed 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-gss" "--disable-nfsv4" "--disable-nfsv41" "--disable-tirpc" "--with-statedir=/var/lib/nfs" - ]; + ] + ++ stdenv.lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc}/bin/rpcgen"; patchPhase = '' @@ -33,7 +34,8 @@ stdenv.mkDerivation rec { installFlags="statedir=$TMPDIR" # hack to make `make install' work ''; - doCheck = true; + # One test fails on mips. + doCheck = if stdenv.isMips then false else true; meta = { description = "Linux user-space NFS utilities"; diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh index bad0d8aabd2..830745ea6b7 100755 --- a/pkgs/os-specific/linux/nvidia-x11/builder.sh +++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh @@ -28,9 +28,7 @@ installPhase() { # Install libGL and friends. ensureDir $out/lib - cp -prd libcuda.* libGL.* libnvidia-cfg.* libnvidia-compiler.* libnvidia-tls.* libnvidia-glcore.* libOpenCL.* libvdpau.* libXv* tls $out/lib/ - ensureDir $out/lib/vdpau - cp -p libvdpau_* $out/lib/vdpau + cp -prd libcuda.* libGL.* libnvidia-cfg.* libnvidia-compiler.* libnvidia-tls.* libnvidia-glcore.* libOpenCL.* libXv* libvdpau_nvidia* tls $out/lib/ ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so.1 @@ -41,9 +39,11 @@ installPhase() { ln -snf libnvidia-tls.so.$versionNumber $out/lib/tls/libnvidia-tls.so.1 ln -snf libXvMCNVIDIA.so.$versionNumber $out/lib/libXvMCNVIDIA_dynamic.so.1 ln -snf libcuda.so.$versionNumber $out/lib/libcuda.so.1 + ln -snf libvdpau_nvidia.so.$versionNumber $out/lib/libvdpau_nvidia.so patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.* patchelf --set-rpath $out/lib:$glPath $out/lib/libXvMCNVIDIA.so.*.* + patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.* patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.* if test -z "$libsOnly"; then diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index f27c6af31bb..692643505e1 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -9,7 +9,9 @@ stdenv.mkDerivation { }; buildInputs = [ flex cracklib ] - ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") libxcrypt; + ++ stdenv.lib.optional + (stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux") + libxcrypt; postInstall = '' mv -v $out/sbin/unix_chkpwd{,.orig} diff --git a/pkgs/os-specific/linux/procps/builder.sh b/pkgs/os-specific/linux/procps/builder.sh deleted file mode 100644 index 436df18fef5..00000000000 --- a/pkgs/os-specific/linux/procps/builder.sh +++ /dev/null @@ -1,6 +0,0 @@ -source $stdenv/setup - -export DESTDIR=$out - -genericBuild - diff --git a/pkgs/os-specific/linux/procps/default.nix b/pkgs/os-specific/linux/procps/default.nix index 4a74218aa36..dce0e36edb4 100644 --- a/pkgs/os-specific/linux/procps/default.nix +++ b/pkgs/os-specific/linux/procps/default.nix @@ -1,12 +1,26 @@ -{stdenv, fetchurl, ncurses}: +{ stdenv, fetchurl, ncurses }: stdenv.mkDerivation { name = "procps-3.2.8"; - builder = ./builder.sh; + src = fetchurl { url = http://procps.sourceforge.net/procps-3.2.8.tar.gz; sha256 = "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"; }; - patches = [./makefile.patch ./procps-build.patch]; - buildInputs = [ncurses]; + + patches = + [ ./makefile.patch + ./procps-build.patch + ./gnumake3.82.patch + ./linux-ver-init.patch + ]; + + buildInputs = [ ncurses ]; + + makeFlags = "DESTDIR=$(out)"; + + meta = { + homepage = http://procps.sourceforge.net/; + description = "Utilities that give information about processes using the /proc filesystem"; + }; } diff --git a/pkgs/os-specific/linux/procps/gnumake3.82.patch b/pkgs/os-specific/linux/procps/gnumake3.82.patch new file mode 100644 index 00000000000..2b1f28d4bce --- /dev/null +++ b/pkgs/os-specific/linux/procps/gnumake3.82.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 09fb3ed..59eba16 100644 +--- a/Makefile ++++ b/Makefile +@@ -174,7 +174,7 @@ INSTALL := $(BINFILES) $(MANFILES) + # want this rule first, use := on ALL, and ALL not filled in yet + all: do_all + +--include */module.mk ++-include proc/module.mk ps/module.mk + + do_all: $(ALL) + diff --git a/pkgs/os-specific/linux/procps/linux-ver-init.patch b/pkgs/os-specific/linux/procps/linux-ver-init.patch new file mode 100644 index 00000000000..9f93784a1fd --- /dev/null +++ b/pkgs/os-specific/linux/procps/linux-ver-init.patch @@ -0,0 +1,23 @@ +https://bugs.gentoo.org/303120 + +make sure the linux version constructor runs before the libproc constructor +since the latter uses variables setup by the former + +fix by Chris Coleman + +Index: proc/version.c +=================================================================== +RCS file: /cvsroot/procps/procps/proc/version.c,v +retrieving revision 1.7 +diff -u -p -r1.7 version.c +--- a/proc/version.c 9 Feb 2003 07:27:16 -0000 1.7 ++++ b/proc/version.c 14 Nov 2010 00:22:44 -0000 +@@ -33,7 +33,7 @@ void display_version(void) { + + int linux_version_code; + +-static void init_Linux_version(void) __attribute__((constructor)); ++static void init_Linux_version(void) __attribute__((constructor(100))); + static void init_Linux_version(void) { + static struct utsname uts; + int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix index 8315ee4835d..c088d3c5b1b 100644 --- a/pkgs/os-specific/linux/sysvinit/default.nix +++ b/pkgs/os-specific/linux/sysvinit/default.nix @@ -6,14 +6,21 @@ stdenv.mkDerivation { name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version; src = fetchurl { - url = "http://www.very-clever.com/download/nongnu/sysvinit/sysvinit-${version}.tar.bz2"; + url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2"; sha256 = "068mvzaz808a673zigyaqb63xc8bndh2klk16zi5c83rw70wifv0"; }; - patches = [ ./sysvinit-2.85-exec.patch ]; + prePatch = '' + # Patch some minimal hard references, so halt/shutdown work + sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h + ''; makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man"; + crossAttrs = { + makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc"; + }; + preInstall = '' substituteInPlace src/Makefile --replace /usr / diff --git a/pkgs/os-specific/linux/sysvinit/sysvinit-2.85-exec.patch b/pkgs/os-specific/linux/sysvinit/sysvinit-2.85-exec.patch deleted file mode 100644 index ef3d0f66b2f..00000000000 --- a/pkgs/os-specific/linux/sysvinit/sysvinit-2.85-exec.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ruN sysvinit-2.85/src/halt.c sysvinit-2.85.new/src/halt.c ---- sysvinit-2.85/src/halt.c 2001-11-27 13:12:03.000000000 +0100 -+++ sysvinit-2.85.new/src/halt.c 2005-10-18 20:09:47.000000000 +0200 -@@ -53,6 +53,10 @@ - #define KERNEL_MONITOR 1 /* If halt() puts you into the kernel monitor. */ - #define RUNLVL_PICKY 0 /* Be picky about the runlevel */ - -+#ifndef EXEC_PATH -+ #define EXEC_PATH "/sbin/shutdown" -+#endif -+ - extern int ifdown(void); - extern int hddown(void); - extern void write_wtmp(char *user, char *id, int pid, int type, char *line); -@@ -139,7 +143,7 @@ - args[i++] = "now"; - args[i++] = NULL; - -- execv("/sbin/shutdown", args); -+ execv(EXEC_PATH, args); - execv("/etc/shutdown", args); - execv("/bin/shutdown", args); diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix index 83de2ae38ef..ce95dbaba92 100644 --- a/pkgs/os-specific/linux/uclibc/default.nix +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -1,48 +1,72 @@ -{stdenv, fetchurl, linuxHeaders, cross ? null, gccCross ? null}: +{stdenv, fetchurl, linuxHeaders, libiconv, cross ? null, gccCross ? null, +extraConfig ? ""}: assert stdenv.isLinux; assert cross != null -> gccCross != null; let - enableArmEABI = (cross == null && stdenv.platform.kernelArch == "arm") - || (cross != null && cross.arch == "arm"); + configParser = '' + function parseconfig { + set -x + while read LINE; do + NAME=`echo "$LINE" | cut -d \ -f 1` + OPTION=`echo "$LINE" | cut -d \ -f 2` - configArmEABI = if enableArmEABI then - ''-e 's/.*CONFIG_ARM_OABI.*//' \ - -e 's/.*CONFIG_ARM_EABI.*/CONFIG_ARM_EABI=y/' '' else ""; + if test -z "$NAME"; then + continue + fi - enableBigEndian = (cross != null && cross.bigEndian); - - configBigEndian = if enableBigEndian then "" - else - ''-e 's/.*ARCH_BIG_ENDIAN.*/#ARCH_BIG_ENDIAN=y/' \ - -e 's/.*ARCH_WANTS_BIG_ENDIAN.*/#ARCH_WANTS_BIG_ENDIAN=y/' \ - -e 's/.*ARCH_WANTS_LITTLE_ENDIAN.*/ARCH_WANTS_LITTLE_ENDIAN=y/' ''; + if test "$NAME" == "CLEAR"; then + echo "parseconfig: CLEAR" + echo > .config + fi + + echo "parseconfig: removing $NAME" + sed -i /^$NAME=/d .config + + if test "$OPTION" != n; then + echo "parseconfig: setting $NAME=$OPTION" + echo "$NAME=$OPTION" >> .config + fi + done + set +x + } + ''; + + archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else ""; + crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else ""; + + nixConfig = '' + RUNTIME_PREFIX "/" + DEVEL_PREFIX "/" + UCLIBC_HAS_WCHAR y + UCLIBC_HAS_FTW y + UCLIBC_HAS_RPC y + DO_C99_MATH y + UCLIBC_HAS_PROGRAM_INVOCATION_NAME y + KERNEL_HEADERS "${linuxHeaders}/include" + ''; - archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else ""; - crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else ""; in stdenv.mkDerivation { - name = "uclibc-0.9.30.3" + stdenv.lib.optionalString (cross != null) + name = "uclibc-0.9.31" + stdenv.lib.optionalString (cross != null) ("-" + cross.config); src = fetchurl { - url = http://www.uclibc.org/downloads/uClibc-0.9.30.3.tar.bz2; - sha256 = "0f1fpdwampbw7pf79i64ipj0azk4kbc9wl81ynlp19p92k4klz0h"; + url = http://www.uclibc.org/downloads/uClibc-0.9.31.tar.bz2; + sha256 = "1yk328fnz0abgh2vm2r68y65ckfkx97rdp8hbg4xvmx5s94kblw0"; }; + # 'ftw' needed to build acl, a coreutils dependency configurePhase = '' make defconfig ${archMakeFlag} - sed -e s@/usr/include@${linuxHeaders}/include@ \ - -e 's@^RUNTIME_PREFIX.*@RUNTIME_PREFIX="/"@' \ - -e 's@^DEVEL_PREFIX.*@DEVEL_PREFIX="/"@' \ - -e 's@.*UCLIBC_HAS_WCHAR.*@UCLIBC_HAS_WCHAR=y@' \ - -e 's@.*UCLIBC_HAS_RPC.*@UCLIBC_HAS_RPC=y@' \ - -e 's@.*DO_C99_MATH.*@DO_C99_MATH=y@' \ - -e 's@.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*@UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y@' \ - ${configArmEABI} \ - ${configBigEndian} \ - -i .config + ${configParser} + cat << EOF | parseconfig + ${nixConfig} + ${extraConfig} + ${if cross != null then stdenv.lib.attrByPath [ "uclibc" "extraConfig" ] "" cross else ""} + $extraCrossConfig + EOF make oldconfig ''; @@ -59,6 +83,11 @@ stdenv.mkDerivation { (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .) sed -i s@/lib/@$out/lib/@g $out/lib/libc.so ''; + + passthru = { + # Derivations may check for the existance of this attribute, to know what to link to. + inherit libiconv; + }; meta = { homepage = http://www.uclibc.org/; diff --git a/pkgs/os-specific/linux/util-linux-ng/default.nix b/pkgs/os-specific/linux/util-linux-ng/default.nix index ca21deb6489..2ae172c6c19 100644 --- a/pkgs/os-specific/linux/util-linux-ng/default.nix +++ b/pkgs/os-specific/linux/util-linux-ng/default.nix @@ -1,28 +1,23 @@ { stdenv, fetchurl, ncurses ? null }: stdenv.mkDerivation rec { - name = "util-linux-ng-2.17.2"; + name = "util-linux-ng-2.18"; src = fetchurl { - url = "mirror://kernel/linux/utils/util-linux-ng/v2.17/${name}.tar.bz2"; - sha256 = "13qifk3i1x59q45fpdz8qnnm7vrhd2zshy5295vhpcjsd8dq1bn9"; + url = "mirror://kernel/linux/utils/util-linux-ng/v2.18/${name}.tar.bz2"; + sha256 = "1k1in1ba9kvh0kplri9765wh0yk68qrkk1a55dqsm21qfryc1idq"; }; - configureFlags = '' - --disable-use-tty-group - --enable-write - ${if ncurses == null then "--without-ncurses" else ""} - ''; - - buildInputs = stdenv.lib.optional (ncurses != null) ncurses; - # !!! It would be better to obtain the path to the mount helpers # (/sbin/mount.*) through an environment variable, but that's # somewhat risky because we have to consider that mount can setuid # root... - preConfigure = '' - substituteInPlace mount/mount.c --replace /sbin/mount. /var/run/current-system/sw/sbin/mount. - substituteInPlace mount/umount.c --replace /sbin/umount. /var/run/current-system/sw/sbin/umount. + configureFlags = '' + --disable-use-tty-group + --enable-write + --enable-fs-paths-default=/var/run/current-system/sw/sbin:/sbin + ${if ncurses == null then "--without-ncurses" else ""} ''; + buildInputs = stdenv.lib.optional (ncurses != null) ncurses; } diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index 5ab57b2cb3e..cb664eac253 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -8,13 +8,23 @@ stdenv.mkDerivation rec { sha256 = "1990i19ddzn8gg5xwm53yn7d0mya885f48sd2hyvr7dvzyaw7ch8"; }; - buildInputs = [ flex bison ncurses ]; + buildNativeInputs = [ flex bison ]; + buildInputs = [ ncurses ]; preConfigure = '' sed -e 's/[$](MKDIR)/mkdir -p /' -i doc/Makefile.in ''; - + + # Its configure script does not allow --disable-static + # Disabling this, we make cross-builds easier, because having + # cross-built static libraries we either have to disable stripping + # or fixing the gpm users, because there -lgpm will fail. + postInstall = '' + rm -f $out/lib/*.a + ln -s $out/lib/libgpm.so.2 $out/lib/libgpm.so + ''; + meta = { homepage = http://www.nico.schottelius.org/software/gpm/; description = "A daemon that provides mouse support on the Linux console"; diff --git a/pkgs/servers/http/apache-httpd/default.nix b/pkgs/servers/http/apache-httpd/default.nix index 970ab2784a0..ab3f6233185 100644 --- a/pkgs/servers/http/apache-httpd/default.nix +++ b/pkgs/servers/http/apache-httpd/default.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation rec { buildInputs = [perl apr aprutil pcre] ++ stdenv.lib.optional sslSupport openssl; + # An apr-util header file includes an apr header file + # through #include "" (quotes) + # passing simply CFLAGS did not help, then I go by NIX_CFLAGS_COMPILE + NIX_CFLAGS_COMPILE = "-iquote ${apr}/include/apr-1"; + configureFlags = '' --with-z=${zlib} --with-pcre=${pcre} diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix index 0f4b610f412..f29d4354a06 100644 --- a/pkgs/shells/bash/default.nix +++ b/pkgs/shells/bash/default.nix @@ -2,7 +2,10 @@ assert interactive -> readline != null; -let realName = "bash-4.1"; in +let + realName = "bash-4.1"; + baseConfigureFlags = if interactive then "--with-installed-readline" else "--disable-readline"; +in stdenv.mkDerivation rec { name = "${realName}-p${toString (builtins.length patches)}"; @@ -33,12 +36,17 @@ stdenv.mkDerivation rec { in import ./bash-patches.nix patch; - # Note: Bison is needed because the patches above modify parse.y. - buildNativeInputs = [bison]; - buildInputs = stdenv.lib.optional (texinfo != null) texinfo - ++ stdenv.lib.optional interactive readline; + crossAttrs = { + configureFlags = baseConfigureFlags + + " bash_cv_job_control_missing=nomissing bash_cv_sys_named_pipes=nomissing"; + }; - configureFlags = if interactive then "--with-installed-readline" else "--disable-readline"; + configureFlags = baseConfigureFlags; + + # Note: Bison is needed because the patches above modify parse.y. + buildNativeInputs = [bison] + ++ stdenv.lib.optional (texinfo != null) texinfo + ++ stdenv.lib.optional interactive readline; postInstall = '' # Add an `sh' -> `bash' symlink. @@ -73,4 +81,8 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.ludo ]; }; + + passthru = { + shellPath = "/bin/bash"; + }; } diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 0075820a5ad..5e135524af9 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -179,7 +179,9 @@ rec { in buildDrv // { inherit hostDrv buildDrv; }; - } // { inherit cross; }; + } // { + inherit cross gccCross binutilsCross; + }; /* Modify a stdenv so that the specified attributes are added to @@ -240,17 +242,18 @@ rec { */ addCoverageInstrumentation = stdenv: addAttrsToDerivation - { NIX_CFLAGS_COMPILE = "-O0 --coverage"; - - # This is an uberhack to prevent libtool from removing gcno - # files. This has been fixed in libtool, but there are - # packages out there with old ltmain.sh scripts. - # See http://www.mail-archive.com/libtool@gnu.org/msg10725.html + { postUnpack = '' + # This is an uberhack to prevent libtool from removing gcno + # files. This has been fixed in libtool, but there are + # packages out there with old ltmain.sh scripts. + # See http://www.mail-archive.com/libtool@gnu.org/msg10725.html for i in $(find -name ltmain.sh); do substituteInPlace $i --replace '*.$objext)' '*.$objext | *.gcno)' done + + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -O0 --coverage" ''; } diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 40acb8cfece..11af6d371cd 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -10,7 +10,7 @@ # system, e.g., cygwin and mingw builds on i686-cygwin. Most people # can ignore it. -{system, stdenvType ? system, allPackages ? import ../..}: +{system, stdenvType ? system, allPackages ? import ../.., platform}: assert system != "i686-cygwin" -> system == stdenvType; @@ -41,7 +41,7 @@ rec { # Linux standard environment. - stdenvLinux = (import ./linux {inherit system allPackages;}).stdenvLinux; + stdenvLinux = (import ./linux {inherit system allPackages platform;}).stdenvLinux; # MinGW/MSYS standard environment. @@ -55,6 +55,7 @@ rec { if stdenvType == "i686-linux" then stdenvLinux else if stdenvType == "x86_64-linux" then stdenvLinux else if stdenvType == "armv5tel-linux" then stdenvLinux else + if stdenvType == "mips64-linux" then stdenvLinux else if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if stdenvType == "i686-mingw" then stdenvMinGW else if stdenvType == "i686-darwin" then stdenvNix else diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index f19addc8a51..c4d6a3666d0 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -96,7 +96,8 @@ let isLinux = result.system == "i686-linux" || result.system == "x86_64-linux" || result.system == "powerpc-linux" - || result.system == "armv5tel-linux"; + || result.system == "armv5tel-linux" + || result.system == "mips64-linux"; isSunOS = result.system == "i386-sunos"; isCygwin = result.system == "i686-cygwin"; isFreeBSD = result.system == "i686-freebsd" @@ -118,6 +119,9 @@ let || result.system == "x86_64-openbsd"; is64bit = result.system == "x86_64-linux" || result.system == "x86_64-darwin"; + isMips = result.system == "mips-linux" + || result.system == "mips64-linux"; + isArm = result.system == "armv5tel-linux"; # Utility function: allow stdenv to be easily regenerated with # a different setup script. (See all-packages.nix for an diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 948b6ca3ad6..ba06666ca89 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -231,6 +231,9 @@ if test "$NIX_NO_SELF_RPATH" != "1"; then if test -n "$NIX_LIB64_IN_SELF_RPATH"; then export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS" fi + if test -n "$NIX_LIB32_IN_SELF_RPATH"; then + export NIX_LDFLAGS="-rpath $out/lib32 $NIX_LDFLAGS" + fi fi diff --git a/pkgs/stdenv/linux/bootstrap/i686/default.nix b/pkgs/stdenv/linux/bootstrap/i686/default.nix index f83fa44360d..1d709766bfd 100644 --- a/pkgs/stdenv/linux/bootstrap/i686/default.nix +++ b/pkgs/stdenv/linux/bootstrap/i686/default.nix @@ -7,7 +7,7 @@ curl = ./curl.bz2; bootstrapTools = { - url = http://nixos.org/tarballs/stdenv-linux/i686/r16022/bootstrap-tools.cpio.bz2; - sha256 = "1x014icv3dxfs55qzshxjs9gaczmhwlrn144p4314zvl4xz6wq3f"; + url = http://nixos.org/tarballs/stdenv-linux/i686/r24519/bootstrap-tools.cpio.bz2; + sha256 = "0imypaxy6piwbk8ff2y1nr7yk49pqmdgdbv6g8miq1zs5yfip6ij"; }; } diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 b/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 new file mode 100755 index 00000000000..f86964d119c Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/cpio b/pkgs/stdenv/linux/bootstrap/loongson2f/cpio new file mode 100755 index 00000000000..bf6fd66be23 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/cpio differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 b/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 new file mode 100755 index 00000000000..f227a24bf71 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix new file mode 100644 index 00000000000..a87f07e00ce --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix @@ -0,0 +1,13 @@ +{ + sh = ./sh; + bzip2 = ./bzip2; + mkdir = ./mkdir; + cpio = ./cpio; + ln = ./ln; + curl = ./curl.bz2; + + bootstrapTools = { + url = "file:///root/cross-bootstrap-tools.cpio.bz2"; + sha256 = "00aavbk76qjj2gdlmpaaj66r8nzl4d7pyl8cv1gigyzgpbr5vv3j"; + }; +} diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/ln b/pkgs/stdenv/linux/bootstrap/loongson2f/ln new file mode 100755 index 00000000000..d8afd276424 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/ln differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir b/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir new file mode 100755 index 00000000000..3a95ccf18d6 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/sh b/pkgs/stdenv/linux/bootstrap/loongson2f/sh new file mode 100755 index 00000000000..f8ef0a74d6b Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/sh differ diff --git a/pkgs/stdenv/linux/bootstrap/x86_64/default.nix b/pkgs/stdenv/linux/bootstrap/x86_64/default.nix index ffd23a86603..d9b9b460db2 100644 --- a/pkgs/stdenv/linux/bootstrap/x86_64/default.nix +++ b/pkgs/stdenv/linux/bootstrap/x86_64/default.nix @@ -4,7 +4,7 @@ { bootstrapTools = { - url = http://nixos.org/tarballs/stdenv-linux/x86_64/r16022/bootstrap-tools.cpio.bz2; - sha256 = "1hwmyd9x9lhmb1ckwap2lvf7wi34p1j23v5bw41drym4mfp97ynz"; + url = http://nixos.org/tarballs/stdenv-linux/x86_64/r23302/bootstrap-tools.cpio.bz2; + sha256 = "0w89kqhx47yl0jifp2vffp073pyrqha5f312kp971smi4h41drna"; }; } diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 71aee5912e7..2203601f836 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -5,7 +5,7 @@ # ensuring purity of components produced by it. # The function defaults are for easy testing. -{system ? "i686-linux", allPackages ? import ../../top-level/all-packages.nix}: +{system ? "i686-linux", allPackages ? import ../../top-level/all-packages.nix, platform}: rec { @@ -14,6 +14,7 @@ rec { else if system == "x86_64-linux" then import ./bootstrap/x86_64 else if system == "powerpc-linux" then import ./bootstrap/powerpc else if system == "armv5tel-linux" then import ./bootstrap/armv5tel + else if system == "mips64-linux" then import ./bootstrap/loongson2f else abort "unsupported platform for the pure Linux stdenv"; @@ -22,6 +23,7 @@ rec { export NIX_ENFORCE_PURITY=1 havePatchELF=1 ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} + ${if system == "mips64-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} ''; @@ -89,7 +91,10 @@ rec { shell = "${bootstrapTools}/bin/sh"; initialPath = [bootstrapTools] ++ extraPath; fetchurlBoot = fetchurl; - inherit gcc extraAttrs; + inherit gcc; + # Having the proper 'platform' in all the stdenvs allows getting proper + # linuxHeaders for example. + extraAttrs = extraAttrs // { inherit platform; }; overrides = overrides // { inherit fetchurl; }; @@ -149,24 +154,46 @@ rec { # 2) These are the packages that we can build with the first - # stdenv. We only need Glibc (in step 3). + # stdenv. We only need binutils, because recent glibcs + # require recent binutils, and those in bootstrap-tools may + # be too old. (in step 3). stdenvLinuxBoot1Pkgs = allPackages { - inherit system; + inherit system platform; bootStdenv = stdenvLinuxBoot1; }; - - # 3) Build Glibc with the bootstrap tools. The result is the full, - # dynamically linked, final Glibc. - stdenvLinuxGlibc = stdenvLinuxBoot1Pkgs.glibc; + firstBinutils = stdenvLinuxBoot1Pkgs.binutils; + + # 3) 2nd stdenv that we will use to build only the glibc. + stdenvLinuxBoot2 = stdenvBootFun { + gcc = wrapGCC { + libc = bootstrapGlibc; + binutils = firstBinutils; + coreutils = bootstrapTools; + }; + inherit fetchurl; + }; + + + # 4) These are the packages that we can build with the 2nd + # stdenv. We only need Glibc (in step 5). + stdenvLinuxBoot2Pkgs = allPackages { + inherit system platform; + bootStdenv = stdenvLinuxBoot2; + }; - # 4) Construct a second stdenv identical to the first, except that + # 5) Build Glibc with the bootstrap tools. The result is the full, + # dynamically linked, final Glibc. + stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc; + + + # 6) Construct a third stdenv identical to the 2nd, except that # this one uses the Glibc built in step 3. It still uses - # the rest of the bootstrap tools, including GCC. - stdenvLinuxBoot2 = removeAttrs (stdenvBootFun { + # the recent binutils and rest of the bootstrap tools, including GCC. + stdenvLinuxBoot3 = stdenvBootFun { gcc = wrapGCC { - binutils = bootstrapTools; + binutils = stdenvLinuxBoot1Pkgs.binutils; coreutils = bootstrapTools; libc = stdenvLinuxGlibc; }; @@ -175,26 +202,38 @@ rec { inherit (stdenvLinuxBoot1Pkgs) perl; }; inherit fetchurl; - }) ["gcc" "binutils"]; - - - # 5) The packages that can be built using the second stdenv. - stdenvLinuxBoot2Pkgs = allPackages { - inherit system; - bootStdenv = stdenvLinuxBoot2; }; + + # 7) The packages that can be built using the third stdenv. + stdenvLinuxBoot3Pkgs = allPackages { + inherit system platform; + bootStdenv = stdenvLinuxBoot3; + }; - # 6) Construct a third stdenv identical to the second, except that + gccWithStaticLibs = stdenvLinuxBoot3Pkgs.gcc.gcc.override (rec { + ppl = stdenvLinuxBoot3Pkgs.ppl.override { + static = true; + gmpxx = stdenvLinuxBoot3Pkgs.gmpxx.override { + static = true; + }; + }; + cloogppl = stdenvLinuxBoot3Pkgs.cloogppl.override { + inherit ppl; + static = true; + }; + }); + + # 8) Construct a fourth stdenv identical to the second, except that # this one uses the dynamically linked GCC and Binutils from step # 5. The other tools (e.g. coreutils) are still from the # bootstrap tools. - stdenvLinuxBoot3 = stdenvBootFun { + stdenvLinuxBoot4 = stdenvBootFun { gcc = wrapGCC rec { - inherit (stdenvLinuxBoot2Pkgs) binutils; + inherit (stdenvLinuxBoot3Pkgs) binutils; coreutils = bootstrapTools; libc = stdenvLinuxGlibc; - gcc = stdenvLinuxBoot2Pkgs.gcc.gcc; + gcc = gccWithStaticLibs; name = ""; }; overrides = { @@ -204,19 +243,20 @@ rec { }; - # 7) The packages that can be built using the third stdenv. - stdenvLinuxBoot3Pkgs = allPackages { - inherit system; - bootStdenv = stdenvLinuxBoot3; + # 9) The packages that can be built using the fourth stdenv. + stdenvLinuxBoot4Pkgs = allPackages { + inherit system platform; + bootStdenv = stdenvLinuxBoot4; }; - # 8) Construct the final stdenv. It uses the Glibc, GCC and - # Binutils built above, and adds in dynamically linked versions - # of all other tools. + # 10) Construct the final stdenv. It uses the Glibc, GCC and + # Binutils built above, and adds in dynamically linked versions + # of all other tools. # - # When updating stdenvLinux, make sure that the result has no - # dependency (`nix-store -qR') on bootstrapTools. + # When updating stdenvLinux, make sure that the result has no + # dependency (`nix-store -qR') on bootstrapTools or the + # first binutils built. stdenvLinux = import ../generic rec { name = "stdenv-linux"; @@ -225,30 +265,31 @@ rec { preHook = builtins.toFile "prehook.sh" commonPreHook; initialPath = - ((import ../common-path.nix) {pkgs = stdenvLinuxBoot3Pkgs;}) - ++ [stdenvLinuxBoot3Pkgs.patchelf]; + ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}) + ++ [stdenvLinuxBoot4Pkgs.patchelf]; gcc = wrapGCC rec { - inherit (stdenvLinuxBoot2Pkgs) binutils; - inherit (stdenvLinuxBoot3Pkgs) coreutils; + inherit (stdenvLinuxBoot3Pkgs) binutils; + inherit (stdenvLinuxBoot4Pkgs) coreutils; libc = stdenvLinuxGlibc; - gcc = stdenvLinuxBoot2Pkgs.gcc.gcc; - shell = stdenvLinuxBoot3Pkgs.bash + "/bin/bash"; + gcc = gccWithStaticLibs; + shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; name = ""; }; - shell = stdenvLinuxBoot3Pkgs.bash + "/bin/bash"; + shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; fetchurlBoot = fetchurl; extraAttrs = { - inherit (stdenvLinuxBoot2Pkgs) glibc; + inherit (stdenvLinuxBoot3Pkgs) glibc; + inherit platform; }; overrides = { inherit gcc; - inherit (stdenvLinuxBoot2Pkgs) binutils glibc; - inherit (stdenvLinuxBoot3Pkgs) + inherit (stdenvLinuxBoot3Pkgs) binutils glibc; + inherit (stdenvLinuxBoot4Pkgs) gzip bzip2 bash coreutils diffutils findutils gawk gnumake gnused gnutar gnugrep gnupatch patchelf attr acl; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 3f68738c310..b89523cbc85 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -10,7 +10,15 @@ rec { aclSupport = false; }); - gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibc + # bzip2 wants utime.h, a header 'legacy' in uclibc + uclibcForBzip2 = uclibc.override { + extraConfig = '' + UCLIBC_SUSV3_LEGACY y + UCLIBC_SUSV4_LEGACY y + ''; + }; + + gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibcForBzip2 stdenv.gcc.gcc; stdenvLinkStatic = overrideGCC stdenv gccLinkStatic; @@ -31,6 +39,49 @@ rec { #gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } ); + busyboxStaticSh = busybox.override { + extraConfig = '' + CLEAR + CONFIG_STATIC y + + CONFIG_ASH y + CONFIG_BASH_COMPAT y + CONFIG_ASH_ALIAS y + CONFIG_ASH_GETOPTS y + CONFIG_ASH_CMDCMD y + CONFIG_ASH_JOB_CONTROL y + CONFIG_ASH_BUILTIN_ECHO y + CONFIG_ASH_BUILTIN_PRINTF y + CONFIG_ASH_BUILTIN_TEST y + ''; + }; + + busyboxStaticLn = busybox.override { + extraConfig = '' + CLEAR + CONFIG_STATIC y + CONFIG_LN y + ''; + }; + + busyboxStaticMkdir = busybox.override { + extraConfig = '' + CLEAR + CONFIG_STATIC y + CONFIG_MKDIR y + ''; + }; + + busyboxStaticCpio = busybox.override { + extraConfig = '' + CLEAR + CONFIG_STATIC y + CONFIG_CPIO y + CONFIG_FEATURE_CPIO_O y + CONFIG_FEATURE_CPIO_P y + ''; + }; + build = stdenv.mkDerivation { @@ -43,7 +94,7 @@ rec { ensureDir $out/bin $out/lib $out/libexec # Copy what we need of Glibc. - cp -d ${glibc}/lib/ld-*.so* $out/lib + cp -d ${glibc}/lib/ld*.so* $out/lib cp -d ${glibc}/lib/libc*.so* $out/lib cp -d ${glibc}/lib/libc_nonshared.a $out/lib cp -d ${glibc}/lib/libm*.so* $out/lib @@ -80,7 +131,7 @@ rec { cp ${bzip2}/bin/bzip2 $out/bin cp -d ${gnumake}/bin/* $out/bin cp -d ${patch}/bin/* $out/bin - cp ${patchelf05}/bin/* $out/bin + cp ${patchelf}/bin/* $out/bin cp ${replace}/bin/* $out/bin cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep @@ -97,6 +148,7 @@ rec { rm -f $out/lib/gcc/*/*/include*/sound rm -rf $out/lib/gcc/*/*/include*/root rm -f $out/lib/gcc/*/*/include-fixed/asm + rm -rf $out/lib/gcc/*/*/plugin #rm -f $out/lib/gcc/*/*/*.a cp -rd ${gcc.gcc}/libexec/* $out/libexec mkdir $out/include @@ -105,10 +157,13 @@ rec { rm -rf $out/include/c++/*/ext/pb_ds rm -rf $out/include/c++/*/ext/parallel - cp -d ${gmp}/lib/libgmp*.so* $out/lib + cp -d ${gmpxx}/lib/libgmp*.so* $out/lib cp -d ${mpfr}/lib/libmpfr*.so* $out/lib cp -d ${ppl}/lib/libppl*.so* $out/lib cp -d ${cloogppl}/lib/libcloog*.so* $out/lib + cp -d ${mpc}/lib/libmpc*.so* $out/lib + cp -d ${zlib}/lib/libz.so* $out/lib + cp -d ${libelf}/lib/libelf.so* $out/lib # Copy binutils. for i in as ld ar ranlib nm strip readelf objdump; do @@ -137,10 +192,10 @@ rec { (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2 mkdir $out/in-nixpkgs - cp ${klibc}/lib/klibc/bin.static/sh $out/in-nixpkgs - cp ${klibc}/lib/klibc/bin.static/cpio $out/in-nixpkgs - cp ${klibc}/lib/klibc/bin.static/mkdir $out/in-nixpkgs - cp ${klibc}/lib/klibc/bin.static/ln $out/in-nixpkgs + cp ${busyboxStaticSh}/bin/busybox $out/in-nixpkgs/sh + cp ${busyboxStaticCpio}/bin/busybox $out/in-nixpkgs/cpio + cp ${busyboxStaticMkdir}/bin/busybox $out/in-nixpkgs/mkdir + cp ${busyboxStaticLn}/bin/busybox $out/in-nixpkgs/ln cp ${curlStatic}/bin/curl $out/in-nixpkgs cp ${bzip2Static}/bin/bzip2 $out/in-nixpkgs chmod u+w $out/in-nixpkgs/* diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index 2399e48b026..422dc6dd5fe 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -3,31 +3,49 @@ set -e # Unpack the bootstrap tools tarball. echo Unpacking the bootstrap tools... $mkdir $out -$bzip2 -d < $tarball | (cd $out && $cpio -V -i) +$bzip2 -d < $tarball | (cd $out && $cpio -i) # Set the ELF interpreter / RPATH in the bootstrap binaries. echo Patching the bootstrap tools... +if test -f $out/lib/ld.so.?; then + # MIPS case + LD_BINARY=$out/lib/ld.so.? +else + # i686, x86_64 and armv5tel + LD_BINARY=$out/lib/ld-*so.? +fi + # On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So # use a copy of patchelf. -LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf . +LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf . for i in $out/bin/* $out/libexec/gcc/*/*/*; do echo patching $i if ! test -L $i; then - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ - $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ - $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i fi done for i in $out/lib/librt* ; do echo patching $i if ! test -L $i; then - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ - $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ - $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i + fi +done + +for i in $out/lib/libgmp* $out/lib/libppl* $out/lib/libcloog* $out/lib/libmpc* $out/lib/libpcre* $out/lib/libstdc++*.so.*[0-9]; do + echo trying to patch $i + if test -f $i -a ! -L $i; then + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $LD_BINARY \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i fi done diff --git a/pkgs/tools/X11/vdpauinfo/default.nix b/pkgs/tools/X11/vdpauinfo/default.nix new file mode 100644 index 00000000000..23233861a06 --- /dev/null +++ b/pkgs/tools/X11/vdpauinfo/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchurl, pkgconfig, xlibs, libvdpau }: + +stdenv.mkDerivation rec { + name = "vdpauinfo-0.0.6"; + + src = fetchurl { + url = "http://people.freedesktop.org/~aplattner/vdpau/${name}.tar.gz"; + sha256 = "0m2llqjnwh3x6y56hik3znym2mfk1haq81a15p54m60ngf0mvfsj"; + }; + + buildInputs = [ pkgconfig xlibs.libX11 libvdpau ]; + + meta = { + homepage = http://people.freedesktop.org/~aplattner/vdpau/; + description = "Tool to query the Video Decode and Presentation API for Unix (VDPAU) abilities of the system"; + license = "bsd"; + }; +} diff --git a/pkgs/tools/X11/xtrace/default.nix b/pkgs/tools/X11/xtrace/default.nix index ad99c320dba..56f33e8330d 100644 --- a/pkgs/tools/X11/xtrace/default.nix +++ b/pkgs/tools/X11/xtrace/default.nix @@ -1,17 +1,24 @@ -{stdenv, fetchurl, libX11}: +{ stdenv, fetchurl, libX11, xauth, makeWrapper }: +let version = "1.0.2"; in stdenv.mkDerivation { - name = "xtrace-1.0.1"; + name = "xtrace-${version}"; src = fetchurl { - url = "https://alioth.debian.org/frs/download.php/3149/xtrace_1.0.1.orig.tar.gz"; - sha256 = "042rifm93mws7xbw86z0m1rmdijprlkijsi2882as1yf6gdbdqbm"; + url = "https://alioth.debian.org/frs/download.php/3201/xtrace_${version}.orig.tar.gz"; + sha256 = "0czywk2iwj9vifml0qjlbz8n9jnqjsm4zz22haii82bf4l5w3y04"; }; - buildInputs = [libX11]; + + buildInputs = [ libX11 makeWrapper ]; + + postInstall = + '' wrapProgram "$out/bin/xtrace" \ + --prefix PATH ':' "${xauth}/bin" + ''; meta = { homepage = http://xtrace.alioth.debian.org/; - description = "Trace X protocol connections"; - license = "free"; + description = "xtrace, a tool to trace X11 protocol connections"; + license = "GPLv2"; maintainers = with stdenv.lib.maintainers; [viric]; platforms = with stdenv.lib.platforms; linux; }; diff --git a/pkgs/tools/archivers/cromfs/default.nix b/pkgs/tools/archivers/cromfs/default.nix index feed8bbda9f..943525d3853 100644 --- a/pkgs/tools/archivers/cromfs/default.nix +++ b/pkgs/tools/archivers/cromfs/default.nix @@ -1,10 +1,10 @@ {stdenv, fetchurl, pkgconfig, fuse, perl}: stdenv.mkDerivation rec { - name = "cromfs-1.5.9"; + name = "cromfs-1.5.9.1"; src = fetchurl { url = "http://bisqwit.iki.fi/src/arch/${name}.tar.bz2"; - sha256 = "0vdpgx0g6yrhqsg50fhksdaaid4gf2gifrxd0xs3idhwg4jmg4ik"; + sha256 = "02k0nd7zvcksn7vjxlynsdgdvkayfzzhv622n9zkka94756lr0fk"; }; patchPhase = ''sed -i 's@/bin/bash@/bin/sh@g' configure; set -x''; diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix index a49b4de52b0..a38c7fcdd1e 100644 --- a/pkgs/tools/archivers/gnutar/default.nix +++ b/pkgs/tools/archivers/gnutar/default.nix @@ -1,14 +1,12 @@ {stdenv, fetchurl}: stdenv.mkDerivation rec { - name = "gnutar-1.22"; - + name = "gnutar-1.25"; + src = fetchurl { - url = "mirror://gnu/tar/tar-1.22.tar.bz2"; - sha256 = "0kdaadflxa6wznbbrp0xlxk9926hrr4yg7wr6m98ygvs35zvdvrw"; + url = "mirror://gnu/tar/tar-1.25.tar.bz2"; + sha256 = "0js9b1jd93kjk6dgf40y2fpgpnix247rk5aws2mjgwz0p10wxxpk"; }; - - patches = [./implausible.patch]; meta = { homepage = http://www.gnu.org/software/tar/; @@ -30,5 +28,8 @@ stdenv.mkDerivation rec { ''; license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/tools/archivers/gnutar/implausible.patch b/pkgs/tools/archivers/gnutar/implausible.patch deleted file mode 100644 index a3522c74350..00000000000 --- a/pkgs/tools/archivers/gnutar/implausible.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -rc tar-1.16.1-orig/src/extract.c tar-1.16.1/src/extract.c -*** tar-1.16.1-orig/src/extract.c 2006-12-07 14:26:00.000000000 +0100 ---- tar-1.16.1/src/extract.c 2007-05-24 11:39:47.000000000 +0200 -*************** -*** 194,200 **** - static void - check_time (char const *file_name, struct timespec t) - { -! if (t.tv_sec <= 0) - WARN ((0, 0, _("%s: implausibly old time stamp %s"), - file_name, tartime (t, true))); - else if (timespec_cmp (volume_start_time, t) < 0) ---- 194,200 ---- - static void - check_time (char const *file_name, struct timespec t) - { -! if (0 /* t.tv_sec <= 0 */) - WARN ((0, 0, _("%s: implausibly old time stamp %s"), - file_name, tartime (t, true))); - else if (timespec_cmp (volume_start_time, t) < 0) diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index 9321ff6e522..ff13c1a2ed0 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -10,9 +10,21 @@ stdenv.mkDerivation { sha256 = "08py2s9vw6dgw457lbklh1vsr3b8x8dlv7d8ygdfaxlx61l57gzp"; }; + crossAttrs = { + patchPhase = '' + sed -i -e 's/CC=gcc/CC=${stdenv.cross.config}-gcc/' \ + -e 's/AR=ar/AR=${stdenv.cross.config}-ar/' \ + -e 's/RANLIB=ranlib/RANLIB=${stdenv.cross.config}-ranlib/' \ + -e 's/bzip2recover test/bzip2recover/' \ + Makefile* + ''; + }; + sharedLibrary = !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; + preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'"; + makeFlags = if linkStatic then "LDFLAGS=-static" else ""; inherit linkStatic; diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index 7a25b69c013..b32bbb932e8 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -1,15 +1,13 @@ {stdenv, fetchurl}: stdenv.mkDerivation rec { - name = "gzip-1.3.13"; + name = "gzip-1.4"; src = fetchurl { url = "mirror://gnu/gzip/${name}.tar.gz"; - sha256 = "18vwa7x0b1sql9bs2d15n94fx3him1m6xpnwsfz52djjbjgzy1hx"; + sha256 = "1vhiyzls60fws48scw48wvwn8mpv1f4yhcsnafys239qvb9wyrni"; }; - patches = [ ./getopt.patch ]; - doCheck = true; meta = { diff --git a/pkgs/tools/compression/gzip/getopt.patch b/pkgs/tools/compression/gzip/getopt.patch deleted file mode 100644 index e61dd977810..00000000000 --- a/pkgs/tools/compression/gzip/getopt.patch +++ /dev/null @@ -1,54 +0,0 @@ -See http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00089.html . - -From dd0ebefe4fe761f6f422a400430db53c64dbffd7 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Tue, 6 Oct 2009 20:44:13 -0600 -Subject: [PATCH] getopt: fix compilation on darwin -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -* lib/getopt.in.h (includes): Leave breadcrumbs during system -include. -* lib/unistd.in.h (getopt): Use them to avoid recursive include. -Reported by Ludovic Courtès. - -Signed-off-by: Eric Blake ---- - ChangeLog | 5 +++++ - lib/getopt.in.h | 6 +++++- - lib/unistd.in.h | 2 +- - 3 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/lib/getopt.in.h b/lib/getopt.in.h -index 9de467a..7377f3c 100644 ---- a/lib/getopt.in.h -+++ b/lib/getopt.in.h -@@ -22,9 +22,13 @@ - @PRAGMA_SYSTEM_HEADER@ - #endif - --/* The include_next requires a split double-inclusion guard. */ -+/* The include_next requires a split double-inclusion guard. We must -+ also inform the replacement unistd.h to not recursively use -+ ; our definitions will be present soon enough. */ - #if @HAVE_GETOPT_H@ -+# define _GL_SYSTEM_GETOPT - # @INCLUDE_NEXT@ @NEXT_GETOPT_H@ -+# undef _GL_SYSTEM_GETOPT - #endif - - #ifndef _GL_GETOPT_H -diff --git a/lib/unistd.in.h b/lib/unistd.in.h -index 38e2e13..b6ea889 100644 ---- a/lib/unistd.in.h -+++ b/lib/unistd.in.h -@@ -49,7 +49,7 @@ - #endif - - /* Get getopt(), optarg, optind, opterr, optopt. */ --#if @GNULIB_UNISTD_H_GETOPT@ -+#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT - # include - #endif - diff --git a/pkgs/tools/compression/ncompress/builder.sh b/pkgs/tools/compression/ncompress/builder.sh index fb0824d8a28..7a3f34aae46 100644 --- a/pkgs/tools/compression/ncompress/builder.sh +++ b/pkgs/tools/compression/ncompress/builder.sh @@ -3,6 +3,7 @@ installFlags="PREFIX=$out" preBuild() { cp Makefile.def Makefile + sed -i GNUmakefile -e 's/compress %/%/g' } postInstall() { diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 2285d91e039..b6aa8e96013 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, lib}: stdenv.mkDerivation ({ - name = "xz-4.999.9beta"; + name = "xz-5.0.0"; src = fetchurl { - url = http://tukaani.org/xz/xz-4.999.9beta.tar.bz2; - sha256 = "0p51d9jng9vfh56idhjbc40n3ypapznwfb1npsvxh23n772140rk"; + url = http://tukaani.org/xz/xz-5.0.0.tar.bz2; + sha256 = "1n2nc00d83di0jl5d9qwpngkmlk3wqhs4w9q2ah680v9qijrxa27"; }; meta = { diff --git a/pkgs/tools/filesystems/btrfsprogs/default.nix b/pkgs/tools/filesystems/btrfsprogs/default.nix index 377f9591975..2a5574a829e 100644 --- a/pkgs/tools/filesystems/btrfsprogs/default.nix +++ b/pkgs/tools/filesystems/btrfsprogs/default.nix @@ -20,7 +20,8 @@ rec { configureFlags = []; makeFlags = ["prefix=$out"]; - phaseNames = ["doEnsureBtrfsImage" "doMakeInstall"]; + patches = [ ./glibc212.patch ]; + phaseNames = ["doPatch" "doEnsureBtrfsImage" "doMakeInstall"]; doEnsureBtrfsImage = a.fullDepEntry ('' if ! grep 'progs = ' Makefile | grep btrfs-image; then diff --git a/pkgs/tools/filesystems/btrfsprogs/glibc212.patch b/pkgs/tools/filesystems/btrfsprogs/glibc212.patch new file mode 100644 index 00000000000..8bc1873f540 --- /dev/null +++ b/pkgs/tools/filesystems/btrfsprogs/glibc212.patch @@ -0,0 +1,12 @@ +diff --git a/btrfsck.c b/btrfsck.c +index 73f1836..c1f47a1 100644 +--- a/btrfsck.c ++++ b/btrfsck.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include "kerncompat.h" + #include "ctree.h" + #include "disk-io.h" diff --git a/pkgs/tools/filesystems/mtdutils/default.nix b/pkgs/tools/filesystems/mtdutils/default.nix index 4dbd9fe4439..f2ce1b452cd 100644 --- a/pkgs/tools/filesystems/mtdutils/default.nix +++ b/pkgs/tools/filesystems/mtdutils/default.nix @@ -14,6 +14,9 @@ stdenv.mkDerivation { patchPhase = '' sed -i -e s,/usr/local,, -e s,/usr,$out, common.mk + + # gcc 4.5.1 issues a warning where 4.4.3 did not + sed -i -e s/-Werror// ubi-utils/old-utils/Makefile ''; buildInputs = [ libuuid lzo zlib acl ]; diff --git a/pkgs/tools/filesystems/xfsprogs/default.nix b/pkgs/tools/filesystems/xfsprogs/default.nix index 4e2cb448eab..16aefe18283 100644 --- a/pkgs/tools/filesystems/xfsprogs/default.nix +++ b/pkgs/tools/filesystems/xfsprogs/default.nix @@ -1,16 +1,20 @@ { stdenv, fetchurl, libtool, gettext, libuuid }: stdenv.mkDerivation rec { - name = "xfsprogs-3.0.3"; + name = "xfsprogs-3.1.3"; src = fetchurl { - url = "ftp://oss.sgi.com/projects/xfs/previous/${name}.tar.gz"; - sha256 = "158ddibsnwcihfvskwc9rknd28p81jk8z463slafp1gf355kmcsq"; + urls = [ "ftp://oss.sgi.com/projects/xfs/cmd_tars/${name}.tar.gz" "ftp://oss.sgi.com/projects/xfs/previous/${name}.tar.gz" ]; + sha256 = "1mazg6sl4gbm204ndgw585xvcsxg3hg22d989ww6lgmycp635l7s"; }; buildInputs = [ libtool gettext libuuid ]; configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip AWK=gawk --disable-shared"; + preConfigure = '' + configureFlags="$configureFlags root_sbindir=$out/sbin root_libdir=$out/lib" + ''; + disableStatic = false; meta = { description = "SGI XFS utilities"; diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 8052ce9fa56..21ce9215017 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -1,28 +1,35 @@ -{ stdenv, fetchurl, aclSupport ? false, acl ? null, perl, gmp ? null -, cross ? null, gccCross ? null }: +{ stdenv, fetchurl, aclSupport ? false, acl ? null, perl, gmp ? null}: assert aclSupport -> acl != null; -assert cross != null -> gccCross != null; -stdenv.mkDerivation (rec { - name = "coreutils-8.4"; +stdenv.mkDerivation rec { + name = "coreutils-8.7"; src = fetchurl { url = "mirror://gnu/coreutils/${name}.tar.gz"; - sha256 = "0zq11lykc7hfs9nsdnb8gqk354l82hswqj38607mvwj3b0zqvc4b"; + sha256 = "11ykd7glys6lcfb2mwgmkqmmffv1pan70j6sl9vcjpnlf9dvk7bw"; }; buildNativeInputs = [ perl ]; - buildInputs = - stdenv.lib.optional (gmp != null) gmp - ++ stdenv.lib.optional aclSupport acl - ++ stdenv.lib.optional (gccCross != null) gccCross; + buildInputs = [ gmp ] ++ stdenv.lib.optional aclSupport acl; + + crossAttrs = { + buildInputs = [ gmp ] + ++ stdenv.lib.optional aclSupport acl.hostDrv + ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv) + stdenv.gccCross.libc.libiconv.hostDrv; + + # Needed for fstatfs() + # I don't know why it is not properly detected cross building with glibc. + configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ]; + doCheck = false; + }; # The tests are known broken on Cygwin # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025), # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351), # and {Open,Free}BSD. - doCheck = (stdenv ? glibc) && (cross == null); + doCheck = (stdenv ? glibc); enableParallelBuilding = true; @@ -42,9 +49,3 @@ stdenv.mkDerivation (rec { maintainers = [ stdenv.lib.maintainers.ludo ]; }; } - -// - -(if cross != null - then { crossConfig = cross.config; } - else { })) diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index 2350ab26049..11ed1cf07b5 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -1,14 +1,14 @@ {stdenv, fetchurl, coreutils}: stdenv.mkDerivation rec { - name = "findutils-4.4.1"; + name = "findutils-4.4.2"; src = fetchurl { url = "mirror://gnu/findutils/${name}.tar.gz"; - sha256 = "0f61phan4q8w5i1lz768q973c1spfqgvc470jc89rpg0gxfvi9bp"; + sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3"; }; - buildInputs = [coreutils]; + buildNativeInputs = [coreutils]; patches = [ ./findutils-path.patch ./change_echo_path.patch ] # Note: the dietlibc patch is just to get findutils to compile. @@ -17,6 +17,11 @@ stdenv.mkDerivation rec { doCheck = true; + crossAttrs = { + # http://osdir.com/ml/bug-findutils-gnu/2009-08/msg00026.html + configureFlags = [ "gl_cv_func_wcwidth_works=yes" ]; + }; + meta = { homepage = http://www.gnu.org/software/findutils/; description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system"; diff --git a/pkgs/tools/misc/parallel/default.nix b/pkgs/tools/misc/parallel/default.nix index 05c1ffaa965..9cfa87f8383 100644 --- a/pkgs/tools/misc/parallel/default.nix +++ b/pkgs/tools/misc/parallel/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, perl }: stdenv.mkDerivation rec { - name = "parallel-20100922"; + name = "parallel-20101202"; src = fetchurl { url = "mirror://gnu/parallel/${name}.tar.bz2"; - sha256 = "0bn1pka242pgm5dm0wkd4zf63rwv0wxxb0fjdjivlxyid72r7g8d"; + sha256 = "156jnsf9dhmbi7r207fns2vphpnjdrbz5ndkp8m6d8b1p2qfj46i"; }; patchPhase = diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix index c4061949424..622753e2303 100644 --- a/pkgs/tools/misc/parted/default.nix +++ b/pkgs/tools/misc/parted/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, devicemapper, libuuid, gettext, readline -, utillinuxng, xz }: +, utillinuxng, xz, enableStatic ? false, hurd ? null }: stdenv.mkDerivation rec { name = "parted-2.3"; @@ -9,14 +9,26 @@ stdenv.mkDerivation rec { sha256 = "0sabj81nawcjm8ww34lxg65ka8crv3w2ab4crh8ypw5agg681836"; }; - buildInputs = [ xz libuuid gettext readline libuuid devicemapper ]; + buildNativeInputs = [ xz ]; + buildInputs = [ libuuid ] + ++ stdenv.lib.optional (readline != null) readline + ++ stdenv.lib.optional (gettext != null) gettext + ++ stdenv.lib.optional (devicemapper != null) devicemapper + ++ stdenv.lib.optional (hurd != null) hurd; - configureFlags = "--with-readline"; + configureFlags = + (if (readline != null) + then [ "--with-readline" ] + else [ "--without-readline" ]) + ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper" + ++ stdenv.lib.optional enableStatic "--enable-static"; doCheck = true; - # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'. - preCheck = "export PATH=\"${utillinuxng}/sbin:$PATH\""; + preCheck = + stdenv.lib.optionalString doCheck + # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'. + "export PATH=\"${utillinuxng}/sbin:$PATH\""; meta = { description = "GNU Parted, a tool to create, destroy, resize, check, and copy partitions"; diff --git a/pkgs/tools/misc/recutils/default.nix b/pkgs/tools/misc/recutils/default.nix new file mode 100644 index 00000000000..47536778f88 --- /dev/null +++ b/pkgs/tools/misc/recutils/default.nix @@ -0,0 +1,32 @@ +{ fetchurl, stdenv, gettext, emacs, curl, check, bc }: + +stdenv.mkDerivation rec { + name = "recutils-1.0"; + + src = fetchurl { + url = "mirror://gnu/recutils/${name}.tar.gz"; + sha256 = "1m8ir31wjybm9x8bv73f330kb2hkmc8lrpwgd5h9avva4x5b7g5d"; + }; + + doCheck = true; + + buildInputs = [ curl emacs ] ++ (stdenv.lib.optionals doCheck [ check bc ]); + + meta = { + description = "GNU Recutils, tools and libraries to access human-editable, text-based databases"; + + longDescription = + '' GNU Recutils is a set of tools and libraries to access + human-editable, text-based databases called recfiles. The data is + stored as a sequence of records, each record containing an arbitrary + number of named fields. + ''; + + homepage = http://www.gnu.org/software/recutils/; + + license = "GPLv3+"; + + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.ludo ]; + }; +} diff --git a/pkgs/tools/misc/xburst-tools/default.nix b/pkgs/tools/misc/xburst-tools/default.nix index 2408a1cd35c..685307bb022 100644 --- a/pkgs/tools/misc/xburst-tools/default.nix +++ b/pkgs/tools/misc/xburst-tools/default.nix @@ -1,5 +1,5 @@ -{stdenv, fetchgit, libusb, autoconf, automake, confuse -, gccCross ? null}: +{ stdenv, fetchgit, libusb, autoconf, automake, confuse +, gccCross ? null }: let version = "2010-07-29"; diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 33f11cdede5..57ce663080a 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl -, zlibSupport ? false, zlib -, sslSupport ? false, openssl -, scpSupport ? false, libssh2 +, zlibSupport ? false, zlib ? null +, sslSupport ? false, openssl ? null +, scpSupport ? false, libssh2 ? null , linkStatic ? false }: diff --git a/pkgs/tools/networking/fdm/default.nix b/pkgs/tools/networking/fdm/default.nix index b9e4558bc8f..0f563cb892a 100644 --- a/pkgs/tools/networking/fdm/default.nix +++ b/pkgs/tools/networking/fdm/default.nix @@ -33,6 +33,7 @@ rec { sed -i */Makefile -i Makefile -e 's@ -o root @ @' sed -i GNUmakefile -e 's@ -g $(BIN_OWNER) @ @' sed -i GNUmakefile -e 's@ -o $(BIN_GROUP) @ @' + sed -i */Makefile -i Makefile -e 's@-I-@@g' '') ["minInit" "doUnpack"]; meta = { diff --git a/pkgs/tools/networking/iftop/default.nix b/pkgs/tools/networking/iftop/default.nix index 79e8f4426cb..730b60c7aec 100644 --- a/pkgs/tools/networking/iftop/default.nix +++ b/pkgs/tools/networking/iftop/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, ncurses, libpcap}: +{stdenv, fetchurl, ncurses, libpcap, automake}: stdenv.mkDerivation rec { name = "iftop-0.17"; @@ -8,6 +8,10 @@ stdenv.mkDerivation rec { sha256 = "1b0fis53280qx85gldhmqfcpgyiwplzg43gxyngia1w3f1y58cnh"; }; + preConfigure = '' + cp ${automake}/share/automake*/config.{sub,guess} config + ''; + buildInputs = [ncurses libpcap]; meta = { diff --git a/pkgs/tools/networking/ncftp/default.nix b/pkgs/tools/networking/ncftp/default.nix index 5c5cf342da9..21bcb56bf0d 100644 --- a/pkgs/tools/networking/ncftp/default.nix +++ b/pkgs/tools/networking/ncftp/default.nix @@ -1,11 +1,13 @@ {stdenv, fetchurl, ncurses, coreutils}: +let version = "3.2.4"; in stdenv.mkDerivation { - name = "ncftp-3.2.3"; + name = "ncftp-${version}"; src = fetchurl { - url = ftp://ftp.ncftp.com/ncftp/ncftp-3.2.4-src.tar.bz2; - sha256 = "0v0cfc4kqsvmfighl47djw5nw82dl5j5g5i2s8wy375fllim0cv6"; + # `ncftp.com' got stolen, apparently, so resort to Debian. + url = "mirror://debian/pool/main/n/ncftp/ncftp_${version}.orig.tar.gz"; + sha256 = "6f26e7891f3eab27eebd2bbbe2bc87d5ae872e610eaf0bc5652aec520adcf68a"; }; preConfigure = '' @@ -22,6 +24,8 @@ stdenv.mkDerivation { meta = { description = "NcFTP Client (also known as just NcFTP) is a set of FREE application programs implementing the File Transfer Protocol (FTP)."; - homepage = http://www.ncftp.com/ncftp/; + + # Homeless! + # homepage = http://www.ncftp.com/ncftp/; }; } diff --git a/pkgs/tools/system/acct/default.nix b/pkgs/tools/system/acct/default.nix index b8d9f6a3179..003dbb45a2a 100644 --- a/pkgs/tools/system/acct/default.nix +++ b/pkgs/tools/system/acct/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv }: stdenv.mkDerivation rec { - name = "acct-6.5.4"; + name = "acct-6.5.5"; src = fetchurl { url = "mirror://gnu/acct/${name}.tar.gz"; - sha256 = "1fvrv70rnli1q7pn1j10z55f26awh54zwwann0s88yrjvpbzbhka"; + sha256 = "1mbg18acrva5m7kxc9pzhaknsqm4r90nrp7ax9jkm9wjkrxwhqs1"; }; doCheck = true; diff --git a/pkgs/tools/system/tm/default.nix b/pkgs/tools/system/tm/default.nix index a5e413690d0..0a4c1e58fc5 100644 --- a/pkgs/tools/system/tm/default.nix +++ b/pkgs/tools/system/tm/default.nix @@ -8,6 +8,10 @@ stdenv.mkDerivation { patchPhase = ''sed -i 's@/usr/bin/install@install@g' Makefile''; + crossAttrs = { + makeFlags = "CC=${stdenv.cross.config}-gcc"; + }; + src = fetchurl { url = http://vicerveza.homeunix.net/~viric/soft/tm/tm-0.4.1.tar.gz; sha256 = "3b389bc03b6964ad5ffa57a344b891fdbcf7c9b2604adda723a863f83657c4a0"; diff --git a/pkgs/tools/system/ts/default.nix b/pkgs/tools/system/ts/default.nix index 80778a3546a..032b37a3868 100644 --- a/pkgs/tools/system/ts/default.nix +++ b/pkgs/tools/system/ts/default.nix @@ -6,6 +6,10 @@ stdenv.mkDerivation { installPhase=''make install "PREFIX=$out"''; + crossAttrs = { + makeFlags = "CC=${stdenv.cross.config}-gcc"; + }; + src = fetchurl { url = http://vicerveza.homeunix.net/~viric/soft/ts/ts-0.6.6.tar.gz; sha256 = "0mdg123ppq8ibf4315l4qi0w3n7wlj4x8dq5gx8f680v4bjvc30g"; diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index 44b7715607c..4fde88d9262 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -1,15 +1,15 @@ {stdenv, fetchurl, coreutils ? null}: stdenv.mkDerivation { - name = "diffutils-2.8.1"; + name = "diffutils-3.0"; src = fetchurl { - url = mirror://gnu/diffutils/diffutils-2.8.1.tar.gz; - md5 = "71f9c5ae19b60608f6c7f162da86a428"; + url = mirror://gnu/diffutils/diffutils-3.0.tar.gz; + sha256 = "02g8i6jv0j0vr5nl13ns50lv2dbjy9kkk8jvp11n0g5fpdjizf9g"; }; /* If no explicit coreutils is given, use the one from stdenv. */ - buildInputs = [coreutils]; + buildNativeInputs = [coreutils]; meta = { homepage = http://www.gnu.org/software/diffutils/diffutils.html; diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index 839364ddb5b..c4f37f922c7 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,19 +1,18 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl, libsigsegv }: stdenv.mkDerivation rec { - name = "gawk-3.1.7"; + name = "gawk-3.1.8"; src = fetchurl { url = "mirror://gnu/gawk/${name}.tar.bz2"; - sha256 = "0wfyiqc28cxb5wjbdph4y33h1fdf56nj6cm7as546niwjsw7cazi"; + sha256 = "1d0jfh319w4h8l1zzqv248916wrc2add1b1aghri31rj9hn7pg2x"; }; doCheck = true; - # The libsigsegv provided with gawk has failing tests: - # I did like in Fedora: - # http://rpmfind.net//linux/RPM/fedora/devel/i386/gawk-3.1.7-2.fc13.i686.html - configureFlags = "--disable-libsigsegv"; + buildInputs = [ libsigsegv ]; + + configureFlags = [ "--with-libsigsegv-prefix=${libsigsegv}" ]; meta = { homepage = http://www.gnu.org/software/gawk/; diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 609213aaa67..f06be1b7336 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -1,16 +1,17 @@ -{stdenv, fetchurl, pcre}: +{ stdenv, fetchurl, pcre, libiconv ? null}: -let version = "2.5.4"; in +let version = "2.7"; in -stdenv.mkDerivation { +stdenv.mkDerivation ({ name = "gnugrep-${version}"; - + src = fetchurl { - url = "mirror://gnu/grep/grep-${version}.tar.bz2"; - sha256 = "0800lj1ywf43x5jnjyga56araak0f601sd9k5q1vv3s5057cdgha"; + url = "mirror://gnu/grep/grep-${version}.tar.gz"; + sha256 = "1b8vksfd1ngharac3ygaqim3lrf0yqap992sg0vfm7572l88655d"; }; - - buildInputs = [pcre]; + + buildInputs = [ pcre ] + ++ (stdenv.lib.optional (libiconv != null) libiconv); doCheck = if stdenv.isDarwin then false else true; @@ -31,7 +32,10 @@ stdenv.mkDerivation { ''; license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; passthru = {inherit pcre;}; -} +} // (if libiconv != null then { NIX_LDFLAGS="-L${libiconv}/lib -liconv"; } else {}) ) diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix index 513a98fdf07..782c0bec850 100644 --- a/pkgs/tools/text/gnupatch/default.nix +++ b/pkgs/tools/text/gnupatch/default.nix @@ -4,12 +4,12 @@ stdenv.mkDerivation rec { name = "patch-2.6.1"; src = - if !(stdenv ? glibc) + if stdenv.isDarwin then fetchurl { # Temporary fix for # http://lists.gnu.org/archive/html/bug-patch/2010-01/msg00004.html . - url = "http://nixos.org/tarballs/patch-2.6.1-2-g2c4e3ec.tar.gz"; - sha256 = "1rspyzrik5cnav3m2fxr8146bsq4mc0yw4x0r8nkl2x7i052yr2c"; + url = "ftp://alpha.gnu.org/gnu/patch/patch-2.6.1.87-94d8.tar.gz"; + sha256 = "0jnw8p0nvkmwi1a2z56bssqik8fvkb71zd2cpzl1sklnrg1g3b6p"; } else fetchurl { url = "mirror://gnu/patch/${name}.tar.gz"; sha256 = "1fc1jyq80nswkf492fiqdbl2bhvlw2wb44ghqlfd3zngx4qkfmni"; @@ -17,6 +17,10 @@ stdenv.mkDerivation rec { buildInputs = (stdenv.lib.optional doCheck ed); + crossAttrs = { + configureFlags = [ "ac_cv_func_strnlen_working=yes" ]; + }; + doCheck = true; meta = { diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index cea26999be0..66fcb3d1929 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -1,15 +1,12 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "gnused-4.1.5"; - + name = "gnused-4.2.1"; + src = fetchurl { - url = mirror://gnu/sed/sed-4.1.5.tar.gz; - md5 = "7a1cbbbb3341287308e140bd4834c3ba"; + url = mirror://gnu/sed/sed-4.2.1.tar.gz; + sha256 = "0q1hzjvr6pzhaagidg7pj76k1fzz5nl15np7p72w9zcpw0f58ww7"; }; - - # !!! hack: this should go away in gnused > 4.1.5 - patches = [./gettext-fix.patch]; meta = { homepage = http://www.gnu.org/software/sed/; @@ -24,6 +21,9 @@ stdenv.mkDerivation { multiple occurrences of a string within a file. ''; - license = "GPLv2+"; + license = "GPLv3+"; + + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/tools/text/gnused/gettext-fix.patch b/pkgs/tools/text/gnused/gettext-fix.patch deleted file mode 100644 index 8ef7e8b5ce4..00000000000 --- a/pkgs/tools/text/gnused/gettext-fix.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -rc sed-4.1.5-orig/configure sed-4.1.5/configure -*** sed-4.1.5-orig/configure Fri Feb 3 10:24:40 2006 ---- sed-4.1.5/configure Fri Jul 14 12:50:13 2006 -*************** -*** 11265,11277 **** - esac - done ;; - gettext-fix ) -! sed -e '/^mkinstalldirs *=/a\' \ -! -e "install_sh=$install_sh" \ - -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \ - intl/Makefile > intl/Makefile.tmp - mv intl/Makefile.tmp intl/Makefile -! sed -e '/^mkinstalldirs *=/a\' \ -! -e "install_sh=$install_sh" \ - -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \ - po/Makefile > po/Makefile.tmp - mv po/Makefile.tmp po/Makefile ;; ---- 11265,11277 ---- - esac - done ;; - gettext-fix ) -! sed -e "/^mkinstalldirs *=/a\\ -! install_sh=$install_sh" \ - -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \ - intl/Makefile > intl/Makefile.tmp - mv intl/Makefile.tmp intl/Makefile -! sed -e "/^mkinstalldirs *=/a\\ -! install_sh=$install_sh" \ - -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \ - po/Makefile > po/Makefile.tmp - mv po/Makefile.tmp po/Makefile ;; diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 060e5d5e2c7..243fe8dcab8 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ghostscript, perl }: +{ stdenv, fetchurl, ghostscript, perl, groff }: stdenv.mkDerivation rec { name = "groff-1.20.1"; @@ -8,10 +8,19 @@ stdenv.mkDerivation rec { sha256 = "01fq5i68p4s4fc6m8i90y5d28wk1x6zh2mkw85n0qqnb6n0qfidn"; }; - buildInputs = [ ghostscript perl ]; + buildInputs = [ ghostscript ]; + buildNativeInputs = [ perl ]; doCheck = true; + crossAttrs = { + # Trick to get the build system find the proper 'native' groff + # http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html + preBuild = '' + makeFlags="GROFF_BIN_PATH=${groff}/bin GROFFBIN=${groff}/bin/groff" + ''; + }; + meta = { description = "GNU Troff, a typesetting package that reads plain text and produces formatted output"; diff --git a/pkgs/tools/text/namazu/default.nix b/pkgs/tools/text/namazu/default.nix index 32a08c5367b..466a7e0c44b 100644 --- a/pkgs/tools/text/namazu/default.nix +++ b/pkgs/tools/text/namazu/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, perl }: stdenv.mkDerivation rec { - name = "namazu-2.0.18"; + name = "namazu-2.0.20"; src = fetchurl { url = "http://namazu.org/stable/${name}.tar.gz"; - sha256 = "12i5z830yh5sw3087gmna44742gcw2q7lpj6b94k8fj0h45cm26j"; + sha256 = "1czw3l6wmz8887wfjpgds9di8hcg0hsmbc0mc6bkahj8g7lvrnyd"; }; buildInputs = [ perl ]; @@ -21,7 +21,10 @@ stdenv.mkDerivation rec { export PERL5LIB="$out/lib/perl5/site_perl/5.10.0:$PERL5LIB" ''; - doCheck = true; + # FIXME: The `tests/namazu-6' test fails on GNU/Linux, presumably because + # phrase searching is broken somehow. However, it doesn't fail on other + # platforms. + doCheck = !stdenv.isLinux; meta = { description = "Namazu, a full-text search engine"; @@ -34,5 +37,8 @@ stdenv.mkDerivation rec { license = "GPLv2+"; homepage = http://namazu.org/; + + platforms = stdenv.lib.platforms.gnu; # arbitrary choice + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/tools/text/replace/default.nix b/pkgs/tools/text/replace/default.nix index 0182a3bb48d..01e58146ed8 100644 --- a/pkgs/tools/text/replace/default.nix +++ b/pkgs/tools/text/replace/default.nix @@ -8,8 +8,13 @@ stdenv.mkDerivation { sha256 = "1c2nkxx83vmlh1v3ib6r2xqh121gdb1rharwsimcb2h0xwc558dm"; }; - makeFlags = ["TREE=\$(out)"]; + makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man"; + crossAttrs = { + makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man CC=${stdenv.cross.config}-gcc"; + }; + + preInstall = "ensureDir \$out/share/man"; postInstall = "mv \$out/bin/replace \$out/bin/replace-literal"; patches = [./malloc.patch]; diff --git a/pkgs/tools/text/wdiff/default.nix b/pkgs/tools/text/wdiff/default.nix index 760ab077012..1b51e19c427 100644 --- a/pkgs/tools/text/wdiff/default.nix +++ b/pkgs/tools/text/wdiff/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "wdiff-0.6.3"; + name = "wdiff-0.6.5"; src = fetchurl { url = "mirror://gnu/wdiff/${name}.tar.gz"; - sha256 = "04x0snfyahw9si160zwghh5nmijn535iacbbfsd376w4p0k5zk08"; + sha256 = "1fij74hni4mi1zipf5is8kr1i9cssyyq5kqqhcxi0j7mynb5d1sm"; }; doCheck = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02b6bdec70b..715055cec94 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32,11 +32,11 @@ config ? null , crossSystem ? null -, platform ? (import ./platforms.nix).pc +, platform ? null }: -let config_ = config; in # rename the function argument +let config_ = config; platform_ = platform; in # rename the function arguments let @@ -70,6 +70,10 @@ let then configExpr { inherit pkgs; } else configExpr; + # Allow setting the platform in the config file. Otherwise, let's use a reasonable default (pc) + platform = if platform_ != null then platform_ + else getConfig [ "platform" ] (import ./platforms.nix).pc; + # Return an attribute from the Nixpkgs configuration file, or # a default value if the attribute doesn't exist. getConfig = attrPath: default: lib.attrByPath attrPath default config; @@ -188,7 +192,7 @@ let allStdenvs = import ../stdenv { - inherit system stdenvType; + inherit system stdenvType platform; allPackages = args: import ./all-packages.nix ({ inherit config; } // args); }; @@ -198,7 +202,7 @@ let gccCrossStageFinal; stdenv = - if bootStdenv != null then bootStdenv else + if bootStdenv != null then (bootStdenv // {inherit platform;}) else let changer = getConfig ["replaceStdenv"] null; in if changer != null then changer { @@ -536,7 +540,12 @@ let desktop_file_utils = callPackage ../tools/misc/desktop-file-utils { }; - dev86 = callPackage ../development/compilers/dev86 { }; + dev86 = callPackage ../development/compilers/dev86 { + /* Using GNU Make 3.82 leads to this: + make[4]: *** No rule to make target `__ldivmod.o)' + So use 3.81. */ + stdenv = overrideInStdenv stdenv [gnumake381]; + }; dnsmasq = callPackage ../tools/networking/dnsmasq { # TODO i18n can be installed as well, implement it? @@ -652,9 +661,7 @@ let gifsicle = callPackage ../tools/graphics/gifsicle { }; glusterfs = builderDefsPackage ../tools/filesystems/glusterfs { - inherit fuse; - bison = bison24; - flex = flex2535; + inherit fuse flex bison; }; glxinfo = callPackage ../tools/graphics/glxinfo { }; @@ -664,7 +671,13 @@ let inherit (gtkLibs) gtk glib; }; - gnugrep = callPackage ../tools/text/gnugrep { }; + gnugrep = + # Use libiconv only on non-GNU platforms (we can't test with + # `stdenv ? glibc' at this point.) + let gnu = stdenv.isLinux; in + callPackage ../tools/text/gnugrep { + libiconv = if gnu then null else libiconv; + }; gnupatch = callPackage ../tools/text/gnupatch { }; @@ -711,10 +724,8 @@ let ghostscript = null; }; - grub = import ../tools/misc/grub { - inherit fetchurl autoconf automake; - stdenv = stdenv_32bit; - buggyBiosCDSupport = (getConfig ["grub" "buggyBiosCDSupport"] true); + grub = callPackage_i686 ../tools/misc/grub { + buggyBiosCDSupport = getConfig ["grub" "buggyBiosCDSupport"] true; }; grub2 = callPackage ../tools/misc/grub/1.9x.nix { }; @@ -815,7 +826,9 @@ let lrzip = callPackage ../tools/compression/lrzip { }; - lsh = callPackage ../tools/networking/lsh { }; + # lsh installs `bin/nettle-lfib-stream' and so does Nettle. Give the + # former a lower priority than Nettle. + lsh = lowPrio (callPackage ../tools/networking/lsh { }); lshw = callPackage ../tools/system/lshw { }; @@ -841,13 +854,9 @@ let mcron = callPackage ../tools/system/mcron { }; - mdbtools = callPackage ../tools/misc/mdbtools { - flex = flex2535; - }; + mdbtools = callPackage ../tools/misc/mdbtools { }; - mdbtools_git = callPackage ../tools/misc/mdbtools/git.nix { - flex = flex2535; - }; + mdbtools_git = callPackage ../tools/misc/mdbtools/git.nix { }; miniupnpd = callPackage ../tools/networking/miniupnpd { }; @@ -860,9 +869,7 @@ let mldonkey = callPackage ../applications/networking/p2p/mldonkey { }; monit = builderDefsPackage ../tools/system/monit { - flex = flex2535; - bison = bison24; - inherit openssl; + inherit openssl flex bison; }; mpage = callPackage ../tools/text/mpage { }; @@ -1004,6 +1011,21 @@ let parted = callPackage ../tools/misc/parted { }; + hurdPartedCross = + if crossSystem != null && crossSystem.config == "i586-pc-gnu" + then (callPackage ../tools/misc/parted { + # Needs the Hurd's libstore. + hurd = hurdCrossIntermediate; + + # The Hurd wants a libparted.a. + enableStatic = true; + + gettext = null; + readline = null; + devicemapper = null; + }).hostDrv + else null; + patch = gnupatch; pbzip2 = callPackage ../tools/compression/pbzip2 { }; @@ -1097,6 +1119,8 @@ let rtmpdump = callPackage ../tools/video/rtmpdump { }; + recutils = callPackage ../tools/misc/recutils { }; + reiser4progs = callPackage ../tools/filesystems/reiser4progs { }; reiserfsprogs = callPackage ../tools/filesystems/reiserfsprogs { }; @@ -1307,9 +1331,7 @@ let wxGUI = getConfig [ "truecrypt" "wxGUI" ] true; }; - ttmkfdir = callPackage ../tools/misc/ttmkfdir { - flex = flex2534; - }; + ttmkfdir = callPackage ../tools/misc/ttmkfdir { }; unbound = callPackage ../tools/networking/unbound { }; @@ -1359,7 +1381,7 @@ let x11_ssh_askpass = callPackage ../tools/networking/x11-ssh-askpass { }; - xbursttools = import ../tools/misc/xburst-tools { + xbursttools = assert stdenv ? glibc; import ../tools/misc/xburst-tools { inherit stdenv fetchgit autoconf automake libusb confuse; # It needs a cross compiler for mipsel to build the firmware it will # load into the Ben Nanonote @@ -1507,7 +1529,7 @@ let gambit = callPackage ../development/compilers/gambit { }; - gcc = gcc44; + gcc = gcc45; gcc295 = wrapGCC (import ../development/compilers/gcc-2.95 { inherit fetchurl stdenv noSysDirs; @@ -1543,8 +1565,6 @@ let profiledCompiler = false; }); - gcc44 = gcc44_real; - gcc43 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.3) { inherit stdenv fetchurl texinfo gmp mpfr noSysDirs; profiledCompiler = true; @@ -1562,7 +1582,7 @@ let gcc44_realCross = lib.addMetaAttrs { platforms = []; } (makeOverridable (import ../development/compilers/gcc-4.4) { - inherit stdenv fetchurl texinfo gmp mpfr ppl cloogppl noSysDirs + inherit stdenv fetchurl texinfo gmp mpfr /* ppl cloogppl */ noSysDirs gettext which; binutilsCross = binutilsCross; libcCross = libcCross; @@ -1572,6 +1592,8 @@ let cross = assert crossSystem != null; crossSystem; }); + gcc45 = gcc45_real; + gcc45_realCross = lib.addMetaAttrs { platforms = []; } (makeOverridable (import ../development/compilers/gcc-4.5) { inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib @@ -1630,17 +1652,19 @@ let enableMultilib = true; })); - gcc44_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.4) { + gcc44 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.4) { inherit fetchurl stdenv texinfo gmp mpfr /* ppl cloogppl */ gettext which noSysDirs; profiledCompiler = true; })); - gcc45 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.5) { + gcc45_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.5) { inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib perl ppl cloogppl gettext which noSysDirs; - profiledCompiler = true; + # bootstrapping a profiled compiler does not work in the sheevaplug: + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944 + profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true; })); gccApple = @@ -1654,7 +1678,7 @@ let texinfo = texinfo49; }); - gfortran = gfortran43; + gfortran = gfortran45; gfortran40 = wrapGCC (gcc40.gcc.override { langFortran = true; @@ -1686,7 +1710,15 @@ let profiledCompiler = false; }); - gfortran44 = wrapGCC (gcc44_real.gcc.override { + gfortran44 = wrapGCC (gcc44.gcc.override { + name = "gfortran"; + langFortran = true; + langCC = false; + langC = false; + profiledCompiler = false; + }); + + gfortran45 = wrapGCC (gcc45_real.gcc.override { name = "gfortran"; langFortran = true; langCC = false; @@ -1696,7 +1728,7 @@ let gcj = gcj45; - gcj44 = wrapGCC (gcc44_real.gcc.override { + gcj44 = wrapGCC (gcc44.gcc.override { name = "gcj"; langJava = true; langFortran = false; @@ -1724,9 +1756,22 @@ let libXrandr xproto renderproto xextproto inputproto randrproto; }); - gnat = gnat44; + gnat = gnat45; - gnat44 = wrapGCC (gcc44_real.gcc.override { + gnat44 = wrapGCC (gcc44.gcc.override { + name = "gnat"; + langCC = false; + langC = true; + langAda = true; + profiledCompiler = false; + inherit gnatboot; + # We can't use the ppl stuff, because we would have + # libstdc++ problems. + cloogppl = null; + ppl = null; + }); + + gnat45 = wrapGCC (gcc45_real.gcc.override { name = "gnat"; langCC = false; langC = true; @@ -1912,9 +1957,7 @@ let # commented out because it's using the new configuration style proposal which is unstable hugs = callPackage ../development/compilers/hugs { }; - path64 = callPackage ../development/compilers/path64 { - stdenv = stdenv2; - }; + path64 = callPackage ../development/compilers/path64 { }; openjdkDarwin = callPackage ../development/compilers/openjdk-darwin { }; @@ -2089,19 +2132,12 @@ let nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else ""; gcc = baseGCC; libc = glibc; + shell = bash; inherit stdenv binutils coreutils zlib; }; wrapGCC = wrapGCCWith (import ../build-support/gcc-wrapper) glibc; - # To be removed on stdenv-updates - # By now this has at least the fix of setting the proper rpath when a file "libbla.so" - # is passed directly to the linker. - # This is of interest to programs built by cmake, because this is a common practice - # in cmake builds. - wrapGCC2 = wrapGCCWith (import ../build-support/gcc-wrapper/default2.nix) glibc; - stdenv2 = if (gcc.nativeTools) then stdenv else (overrideGCC stdenv (wrapGCC2 gcc.gcc)); - wrapGCCCross = {gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}: @@ -2385,7 +2421,9 @@ let automake110x = callPackage ../development/tools/misc/automake/automake-1.10.x.nix { }; - automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix { }; + automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix { + doCheck = if stdenv.isArm then false else true; + }; avrdude = callPackage ../development/tools/misc/avrdude { }; @@ -2394,12 +2432,12 @@ let }; binutilsCross = forceBuildDrv (import ../development/tools/misc/binutils { - inherit stdenv fetchurl; - noSysDirs = true; - cross = assert crossSystem != null; crossSystem; + inherit stdenv fetchurl zlib; + noSysDirs = true; + cross = assert crossSystem != null; crossSystem; }); - bison = bison23; + bison = bison24; bison1875 = callPackage ../development/tools/parsing/bison/bison-1.875.nix { }; @@ -2467,7 +2505,7 @@ let checkstyle = callPackage ../development/tools/analysis/checkstyle { }; - flex = flex254a; + flex = flex2535; flex2535 = callPackage ../development/tools/parsing/flex/flex-2.5.35.nix { }; @@ -2490,6 +2528,7 @@ let gnumake = callPackage ../development/tools/build-managers/gnumake { }; gnumake380 = callPackage ../development/tools/build-managers/gnumake-3.80 { }; + gnumake381 = callPackage ../development/tools/build-managers/gnumake/3.81.nix { }; gradle = callPackage ../development/tools/build-managers/gradle { }; @@ -2541,7 +2580,7 @@ let openocd = callPackage ../development/tools/misc/openocd { }; oprofile = import ../development/tools/profiling/oprofile { - inherit fetchurl stdenv binutils popt makeWrapper gawk which gnugrep; + inherit fetchurl stdenv binutils popt makeWrapper gawk which gnugrep zlib; # Optional build inputs for the (useless) GUI. /* @@ -2624,9 +2663,8 @@ let valkyrie = callPackage ../development/tools/analysis/valkyrie { }; xxdiff = builderDefsPackage (import ../development/tools/misc/xxdiff/3.2.nix) { - flex = flex2535; qt = qt3; - inherit pkgconfig makeWrapper bison python; + inherit pkgconfig makeWrapper bison python flex; inherit (xlibs) libXext libX11; }; @@ -2740,7 +2778,6 @@ let clanlib = callPackage ../development/libraries/clanlib { }; clapack = callPackage ../development/libraries/clapack { - stdenv = stdenv2; }; classads = callPackage ../development/libraries/classads { }; @@ -2844,12 +2881,14 @@ let farsight2 = callPackage ../development/libraries/farsight2 { inherit (gnome) glib; - inherit (gst_all) gstreamer gstPluginsBase; + inherit (gst_all) gstreamer gstPluginsBase gst_python; }; fcgi = callPackage ../development/libraries/fcgi { }; - ffmpeg = callPackage ../development/libraries/ffmpeg { }; + ffmpeg = callPackage ../development/libraries/ffmpeg { + vpxSupport = if !stdenv.isMips then true else false; + }; fftw = callPackage ../development/libraries/fftw { singlePrecision = false; @@ -2913,10 +2952,10 @@ let geos = callPackage ../development/libraries/geos { }; - gettext = gettext_0_17; + gettext = gettext_0_18; - gettext_0_17 = callPackage ../development/libraries/gettext { }; - gettext_0_18 = callPackage ../development/libraries/gettext/0.18.nix { }; + gettext_0_17 = callPackage ../development/libraries/gettext/0.17.nix { }; + gettext_0_18 = callPackage ../development/libraries/gettext { }; gd = callPackage ../development/libraries/gd { }; @@ -2928,7 +2967,7 @@ let glfw = callPackage ../development/libraries/glfw { }; - glibc = glibc211; + glibc = glibc212; glibc25 = callPackage ../development/libraries/glibc-2.5 { kernelHeaders = linuxHeaders; @@ -2952,15 +2991,15 @@ let installLocales = getConfig [ "glibc" "locales" ] false; }); - glibc211 = callPackage ../development/libraries/glibc-2.11 { + glibc212 = (callPackage ../development/libraries/glibc-2.12 { kernelHeaders = linuxHeaders; installLocales = getConfig [ "glibc" "locales" ] false; machHeaders = null; hurdHeaders = null; gccCross = null; - }; + }) // (if crossSystem != null then { hostDrv = glibc212Cross; } else {}); - glibc211Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11) + glibc212Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.12) (let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu"); in ({ inherit stdenv fetchurl; @@ -2975,7 +3014,7 @@ let then { inherit machHeaders hurdHeaders mig fetchgit; } else { })))); - glibcCross = glibc211Cross; + glibcCross = glibc212Cross; # We can choose: libcCrossChooser = name : if (name == "glibc") then glibcCross @@ -2996,9 +3035,9 @@ let installLocales = getConfig [ "glibc" "locales" ] false; }; - glibcLocales = callPackage ../development/libraries/glibc-2.11/locales.nix { }; + glibcLocales = callPackage ../development/libraries/glibc-2.12/locales.nix { }; - glibcInfo = callPackage ../development/libraries/glibc-2.11/info.nix { }; + glibcInfo = callPackage ../development/libraries/glibc-2.12/info.nix { }; glibc_multi = runCommand "${glibc.name}-multi" @@ -3038,7 +3077,9 @@ let cxx = false; } else - makeOverridable (import ../development/libraries/gmp) { + # We temporarily leave gmp 4 here, waiting for a new ppl/cloog-ppl that + # would build well with gmp 5. + makeOverridable (import ../development/libraries/gmp/4.nix) { inherit stdenv fetchurl m4; cxx = false; }; @@ -3290,6 +3331,12 @@ let libcaca = callPackage ../development/libraries/libcaca { }; libcanberra = callPackage ../development/libraries/libcanberra { + /* Using GNU Make 3.82 leads to this: + + Makefile:939: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. + + So use 3.81. */ + stdenv = overrideInStdenv stdenv [gnumake381]; gstreamer = gst_all.gstreamer; }; @@ -3407,7 +3454,7 @@ let inherit (gnome) glib; }; - libplist = callPackage ../development/libraries/libplist { stdenv = stdenv2; }; + libplist = callPackage ../development/libraries/libplist { }; libQGLViewer = callPackage ../development/libraries/libqglviewer { }; @@ -3561,6 +3608,8 @@ let libv4l = callPackage ../development/libraries/libv4l { }; + libvdpau = callPackage ../development/libraries/libvdpau { }; + libvirt = callPackage ../development/libraries/libvirt { }; libvncserver = builderDefsPackage (import ../development/libraries/libvncserver) { @@ -3688,9 +3737,7 @@ let ncurses = makeOverridable (import ../development/libraries/ncurses) { inherit fetchurl stdenv; - # The "! (stdenv ? cross)" is for the cross-built arm ncurses, which - # don't build for me in unicode. - unicode = (system != "i686-cygwin" && crossSystem == null); + unicode = system != "i686-cygwin"; }; neon = neon029; @@ -3741,8 +3788,7 @@ let openct = callPackage ../development/libraries/openct { }; opencv = callPackage ../development/libraries/opencv { - inherit (gst_all) gstreamer; - stdenv = stdenv2; + inherit (gst_all) gstreamer; }; # this ctl version is needed by openexr_viewers @@ -3791,16 +3837,13 @@ let plib = callPackage ../development/libraries/plib { }; - podofo = callPackage ../development/libraries/podofo { - stdenv = stdenv2; - }; + podofo = callPackage ../development/libraries/podofo { }; polkit = callPackage ../development/libraries/polkit { }; policykit = callPackage ../development/libraries/policykit { }; poppler = callPackage ../development/libraries/poppler { - stdenv = stdenv2; qt4Support = false; }; @@ -3902,6 +3945,7 @@ let SDL = callPackage ../development/libraries/SDL { openglSupport = mesaSupported; alsaSupport = true; + x11Support = true; pulseaudioSupport = false; # better go through ALSA }; @@ -4009,10 +4053,9 @@ let libjpeg libtiff libpng libxml2 libxslt sqlite icu cairo perl intltool automake libtool pkgconfig autoconf bison libproxy enchant - python ruby which; + python ruby which flex; inherit (gst_all) gstreamer gstPluginsBase gstFfmpeg gstPluginsGood; - flex = flex2535; inherit (xlibs) libXt renderproto libXrender; }).deepOverride {libsoup = gnome28.libsoup_2_31;}); @@ -4037,9 +4080,7 @@ let xapianBindings = callPackage ../development/libraries/xapian/bindings { # TODO perl php Java, tcl, C#, python }; - Xaw3d = callPackage ../development/libraries/Xaw3d { - flex = flex2533; - }; + Xaw3d = callPackage ../development/libraries/Xaw3d { }; xbase = callPackage ../development/libraries/xbase { }; @@ -4358,7 +4399,7 @@ let ps = procps; /* !!! Linux only */ }; - mysql = mysql5; + mysql = mysql51; mysql_jdbc = callPackage ../servers/sql/mysql/jdbc { }; @@ -4517,8 +4558,8 @@ let hostDrv = lib.overrideDerivation utillinuxng.hostDrv (args: { # `libblkid' fails to build on GNU/Hurd. configureFlags = args.configureFlags - + " --disable-libblkid --disable-mount --disable-fsck" - + " --enable-static"; + + " --disable-libblkid --disable-mount --disable-libmount" + + " --disable-fsck --enable-static"; doCheck = false; CPPFLAGS = # ugly hack for ugly software! lib.concatStringsSep " " @@ -4538,13 +4579,13 @@ let inherit fontconfig gpm freetype pkgconfig ncurses; }; + fbtermStdenv = callPackage ../os-specific/linux/fbterm/stdenv.nix { }; + fuse = callPackage ../os-specific/linux/fuse { }; fxload = callPackage ../os-specific/linux/fxload { }; - gpm = callPackage ../servers/gpm { - flex = flex2535; - }; + gpm = callPackage ../servers/gpm { }; hal = callPackage ../os-specific/linux/hal { }; @@ -4562,7 +4603,8 @@ let hurdCross = forceBuildDrv(import ../os-specific/gnu/hurd { inherit fetchgit stdenv autoconf libtool texinfo machHeaders - mig glibcCross; + mig glibcCross hurdPartedCross; + libuuid = libuuid.hostDrv; automake = automake111x; headersOnly = false; cross = assert crossSystem != null; crossSystem; @@ -4581,10 +4623,11 @@ let # intermediate GCC. gccCross = gccCrossStageStatic; - # This intermediate Hurd is only needed to build libpthread, which really - # only needs libihash. - buildTarget = "libihash"; - installTarget = "libihash-install"; + # This intermediate Hurd is only needed to build libpthread, which needs + # libihash, and to build Parted, which needs libstore and + # libshouldbeinlibc. + buildTarget = "libihash libstore libshouldbeinlibc"; + installTarget = "libihash-install libstore-install libshouldbeinlibc-install"; }); hurdHeaders = callPackage ../os-specific/gnu/hurd { @@ -4592,6 +4635,8 @@ let headersOnly = true; gccCross = null; glibcCross = null; + libuuid = null; + hurdPartedCross = null; }; hurdLibpthreadCross = forceBuildDrv(import ../os-specific/gnu/libpthread { @@ -4639,12 +4684,9 @@ let libcgroup = callPackage ../os-specific/linux/libcg { }; - libnl = callPackage ../os-specific/linux/libnl { - flex = flex2535; - bison = bison24; - }; + libnl = callPackage ../os-specific/linux/libnl { }; - linuxHeaders = linuxHeaders_2_6_28; + linuxHeaders = linuxHeaders_2_6_32; linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix { inherit stdenv fetchurl perl; @@ -4809,9 +4851,31 @@ let [ #kernelPatches.fbcondecor_2_6_35 kernelPatches.sec_perm_2_6_24 kernelPatches.aufs2_2_6_35 - ]; + ] ++ lib.optional (platform.kernelArch == "arm") + kernelPatches.sheevaplug_modules_2_6_35; }; + linux_nanonote_jz_2_6_34 = makeOverridable + (import ../os-specific/linux/kernel/linux-nanonote-jz-2.6.34.nix) { + inherit fetchurl fetchsvn stdenv perl mktemp module_init_tools ubootChooser; + }; + + linux_nanonote_jz_2_6_35 = makeOverridable + (import ../os-specific/linux/kernel/linux-nanonote-jz-2.6.35.nix) { + inherit fetchurl fetchsvn stdenv perl mktemp module_init_tools ubootChooser; + }; + + linux_nanonote_jz_2_6_36 = makeOverridable + (import ../os-specific/linux/kernel/linux-nanonote-jz-2.6.36.nix) { + inherit fetchurl fetchsvn stdenv perl mktemp module_init_tools ubootChooser; + kernelPatches = + [ #kernelPatches.fbcondecor_2_6_35 + kernelPatches.sec_perm_2_6_24 + #kernelPatches.aufs2_2_6_35 + kernelPatches.mips_restart_2_6_36 + ]; + }; + linux_2_6_35_oldI686 = linux_2_6_35.override { extraConfig = '' HIGHMEM64G? n @@ -4829,6 +4893,7 @@ let [ #kernelPatches.fbcondecor_2_6_35 kernelPatches.sec_perm_2_6_24 #kernelPatches.aufs2_2_6_35 + kernelPatches.mips_restart_2_6_36 ]; }; @@ -4946,6 +5011,9 @@ let linuxPackages_2_6_34 = recurseIntoAttrs (linuxPackagesFor linux_2_6_34 pkgs.linuxPackages_2_6_34); linuxPackages_2_6_35 = recurseIntoAttrs (linuxPackagesFor linux_2_6_35 pkgs.linuxPackages_2_6_35); linuxPackages_2_6_36 = recurseIntoAttrs (linuxPackagesFor linux_2_6_36 pkgs.linuxPackages_2_6_36); + linuxPackages_nanonote_jz_2_6_34 = recurseIntoAttrs (linuxPackagesFor linux_nanonote_jz_2_6_34 pkgs.linuxPackages_nanonote_jz_2_6_34); + linuxPackages_nanonote_jz_2_6_35 = recurseIntoAttrs (linuxPackagesFor linux_nanonote_jz_2_6_35 pkgs.linuxPackages_nanonote_jz_2_6_35); + linuxPackages_nanonote_jz_2_6_36 = recurseIntoAttrs (linuxPackagesFor linux_nanonote_jz_2_6_36 pkgs.linuxPackages_nanonote_jz_2_6_36); # The current default kernel / kernel modules. linux = linux_2_6_32; @@ -4981,6 +5049,12 @@ let libcap = callPackage ../os-specific/linux/libcap { }; + libcap_progs = callPackage ../os-specific/linux/libcap/progs.nix { }; + + libcap_pam = callPackage ../os-specific/linux/libcap/pam.nix { }; + + libcap_manpages = callPackage ../os-specific/linux/libcap/man.nix { }; + libnscd = callPackage ../os-specific/linux/libnscd { }; libnotify = callPackage ../development/libraries/libnotify { }; @@ -5042,7 +5116,6 @@ let pam_console = callPackage ../os-specific/linux/pam_console { libtool = libtool_1_5; - flex = if stdenv.system == "i686-linux" then flex else flex2533; }; pam_devperm = callPackage ../os-specific/linux/pam_devperm { }; @@ -5124,18 +5197,21 @@ let ubootChooser = name : if (name == "upstream") then ubootUpstream else if (name == "sheevaplug") then ubootSheevaplug + else if (name == "nanonote") then ubootNanonote else throw "Unknown uboot"; ubootUpstream = callPackage ../misc/uboot { }; ubootSheevaplug = callPackage ../misc/uboot/sheevaplug.nix { }; + ubootNanonote = callPackage ../misc/uboot/nanonote.nix { }; + ubootGuruplug = callPackage ../misc/uboot/guruplug.nix { }; uclibc = callPackage ../os-specific/linux/uclibc { }; uclibcCross = import ../os-specific/linux/uclibc { - inherit fetchurl stdenv; + inherit fetchurl stdenv libiconv; linuxHeaders = linuxHeadersCross; gccCross = gccCrossStageStatic; cross = assert crossSystem != null; crossSystem; @@ -5393,7 +5469,6 @@ let autopanosiftc = callPackage ../applications/graphics/autopanosiftc { }; avidemux = callPackage ../applications/video/avidemux { - stdenv = stdenv2; }; awesome = callPackage ../applications/window-managers/awesome { @@ -5438,15 +5513,13 @@ let blender = callPackage ../applications/misc/blender/2.49.nix { python = python26Base; - stdenv = stdenv2; }; blender_2_50 = lowPrio (import ../applications/misc/blender { - inherit fetchurl cmake mesa gettext libjpeg libpng zlib openal SDL openexr + inherit stdenv fetchurl cmake mesa gettext libjpeg libpng zlib openal SDL openexr libsamplerate libtiff ilmbase; inherit (xlibs) libXi; python = python31Base; - stdenv = stdenv2; }); bmp = callPackage ../applications/audio/bmp { @@ -5575,9 +5648,7 @@ let patches = getConfig [ "dwm" "patches" ] []; }; - eaglemode = callPackage ../applications/misc/eaglemode { - stdenv = stdenv2; - }; + eaglemode = callPackage ../applications/misc/eaglemode { }; eclipse = callPackage ../applications/editors/eclipse { # GTK 2.18 gives glitches such as mouse clicks on buttons not @@ -5598,6 +5669,15 @@ let emacs = emacs23; emacs22 = callPackage ../applications/editors/emacs-22 { + /* Using cpp 4.5, we get: + + make[1]: Entering directory `/tmp/nix-build-dhbj8qqmqxwp3iw6sjcgafsrwlwrix1f-emacs-22.3.drv-0/emacs-22.3/lib-src' + Makefile:148: *** recipe commences before first target. Stop. + + Apparently, this is because `lib-src/Makefile' is generated by + processing `lib-src/Makefile.in' with cpp, and the escaping rules for + literal backslashes have changed. */ + stdenv = overrideGCC stdenv gcc44; xaw3dSupport = getConfig [ "emacs" "xaw3dSupport" ] false; gtkGUI = getConfig [ "emacs" "gtkSupport" ] true; }; @@ -5685,10 +5765,13 @@ let evopedia = callPackage ../applications/misc/evopedia { }; - evince = callPackage ../applications/misc/evince { + # FIXME: Evince and other GNOME/GTK+ apps (e.g., Viking) provide + # `share/icons/hicolor/icon-theme.cache'. Arbitrarily give this one a + # higher priority. + evince = hiPrio (callPackage ../applications/misc/evince { inherit (gnome) gnomedocutils gnomeicontheme libgnome libgnomeui libglade glib gtk scrollkeeper gnome_keyring; - }; + }); evolution_data_server = (newScope (gnome // gtkLibs)) ../servers/evolution-data-server { @@ -5909,7 +5992,6 @@ let }; hugin = callPackage ../applications/graphics/hugin { - stdenv = stdenv2; }; i810switch = callPackage ../os-specific/linux/i810switch { }; @@ -5940,7 +6022,9 @@ let icecatWrapper = wrapFirefox icecat3Xul "icecat" ""; - icewm = callPackage ../applications/window-managers/icewm { }; + icewm = callPackage ../applications/window-managers/icewm { + inherit (gtkLibs) gtk; + }; id3v2 = callPackage ../applications/audio/id3v2 { }; @@ -6070,6 +6154,8 @@ let inherit (xlibs) libX11 libXau xproto libXt; }; + links2Stdenv = callPackage ../applications/networking/browsers/links2/stdenv.nix { }; + lxdvdrip = callPackage ../applications/video/lxdvdrip { }; lynx = callPackage ../applications/networking/browsers/lynx { }; @@ -6148,6 +6234,8 @@ let mpc123 = callPackage ../applications/audio/mpc123 { }; + mpg123 = callPackage ../applications/audio/mpg123 { }; + mpg321 = callPackage ../applications/audio/mpg321 { }; MPlayer = callPackage ../applications/video/MPlayer { }; @@ -6201,14 +6289,12 @@ let inherit (perlPackages) ArchiveZip CompressZlib; inherit (gnome) GConf ORBit2; neon = neon029; - stdenv = stdenv2; }; go_oo = callPackage ../applications/office/openoffice/go-oo.nix { inherit (perlPackages) ArchiveZip CompressZlib; inherit (gnome) GConf ORBit2; neon = neon029; - stdenv = stdenv2; }; opera = callPackage ../applications/networking/browsers/opera { @@ -6228,7 +6314,6 @@ let }; paraview = callPackage ../applications/graphics/paraview { - stdenv = stdenv2; }; partitionManager = newScope pkgs.kde4 ../tools/misc/partition-manager { }; @@ -6461,6 +6546,8 @@ let qt = qt3; }; + vdpauinfo = callPackage ../tools/X11/vdpauinfo { }; + veracity = callPackage ../applications/version-management/veracity {}; viewMtn = builderDefsPackage (import ../applications/version-management/viewmtn/0.10.nix) @@ -6475,7 +6562,8 @@ let vimHugeX = vim_configurable; vim_configurable = import ../applications/editors/vim/configurable.nix { - inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext composableDerivation lib; + inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext composableDerivation lib + getConfig; inherit (pkgs.xlibs) libX11 libXext libSM libXpm libXt libXaw libXau libXmu libICE; inherit (pkgs.gtkLibs) glib gtk; @@ -6733,17 +6821,13 @@ let wxGTK = wxGTK28.override { unicode = false; }; }; - gemrb = callPackage ../games/gemrb { - stdenv = stdenv2; - }; + gemrb = callPackage ../games/gemrb { }; gl117 = callPackage ../games/gl-117 {}; gltron = callPackage ../games/gltron { }; - gnuchess = builderDefsPackage (import ../games/gnuchess) { - flex = flex2535; - }; + gnuchess = callPackage ../games/gnuchess { }; gnugo = callPackage ../games/gnugo { }; @@ -6774,6 +6858,8 @@ let pioneers = callPackage ../games/pioneers { }; + prboom = callPackage ../games/prboom { }; + quake3demo = callPackage ../games/quake3/wrapper { name = "quake3-demo-${quake3game.name}"; description = "Demo of Quake 3 Arena, a classic first-person shooter"; @@ -6809,19 +6895,20 @@ let spaceOrbit = callPackage ../games/orbit { inherit (gnome) esound; }; - spring = callPackage ../games/spring { - stdenv = stdenv2; - }; + spring = callPackage ../games/spring { }; - springLobby = callPackage ../games/spring/spring-lobby.nix { - stdenv = stdenv2; - }; + springLobby = callPackage ../games/spring/spring-lobby.nix { }; stardust = callPackage ../games/stardust {}; superTux = callPackage ../games/super-tux { }; - superTuxKart = callPackage ../games/super-tux-kart { }; + superTuxKart = callPackage ../games/super-tux-kart { + /* With GNU Make 3.82, the build process is stuck in the `data' + directory, after displaying "Making all in tracks", and `pstree' + indicates that `make' doesn't launch any new process. */ + stdenv = overrideInStdenv stdenv [ gnumake381 ]; + }; tbe = callPackage ../games/the-butterfly-effect {}; @@ -6846,7 +6933,6 @@ let ultimatestunts = callPackage ../games/ultimatestunts { }; ultrastardx = callPackage ../games/ultrastardx { - stdenv = stdenv2; lua = lua5; }; @@ -6858,9 +6944,7 @@ let libjpeg = libjpeg62; }; - warzone2100 = callPackage ../games/warzone2100 { - flex = flex2535; - }; + warzone2100 = callPackage ../games/warzone2100 { }; xboard = builderDefsPackage (import ../games/xboard) { inherit (xlibs) libX11 xproto libXt libXaw libSM @@ -6941,8 +7025,7 @@ let kde4 = kde45; kde44 = makeOverridable (import ../desktops/kde-4.4) ( - applyGlobalOverrides (p: { kde4 = p.kde44; qt4 = p.qt46; }) // - { stdenv = pkgs.stdenv2; }); + applyGlobalOverrides (p: { kde4 = p.kde44; qt4 = p.qt46; })); kde45 = callPackage ../desktops/kde-4.5 { callPackage = @@ -6951,7 +7034,6 @@ let pkgs_for_45 = (applyGlobalOverrides (p: { kde4 = p.kde45; })); in pkgs_for_45.newScope pkgs_for_45.kde45; - stdenv = pkgs.stdenv2; }; kde46 = callPackage ../desktops/kde-4.6 { @@ -6961,7 +7043,6 @@ let pkgs_for_46 = (applyGlobalOverrides (p: { kde4 = p.kde46; })); in pkgs_for_46.newScope pkgs_for_46.kde46; - stdenv = pkgs.stdenv2; }; xfce = xfce4; @@ -7076,9 +7157,7 @@ let minisat = callPackage ../applications/science/logic/minisat {}; - opensmt = callPackage ../applications/science/logic/opensmt { - flex = flex2535; - }; + opensmt = callPackage ../applications/science/logic/opensmt { }; prover9 = callPackage ../applications/science/logic/prover9 { }; @@ -7093,16 +7172,13 @@ let ### SCIENCE / ELECTRONICS caneda = callPackage ../applications/science/electronics/caneda { - stdenv = stdenv2; # At the time of writing, it fails to build with qt47 qt4 = qt46; }; gtkwave = callPackage ../applications/science/electronics/gtkwave { }; - kicad = callPackage ../applications/science/electronics/kicad { - stdenv = stdenv2; - }; + kicad = callPackage ../applications/science/electronics/kicad { }; ngspice = callPackage ../applications/science/electronics/ngspice { }; @@ -7137,9 +7213,7 @@ let golly = callPackage ../applications/science/misc/golly { }; - simgrid = callPackage ../applications/science/misc/simgrid { - stdenv = stdenv2; - }; + simgrid = callPackage ../applications/science/misc/simgrid { }; tulip = callPackage ../applications/science/misc/tulip { qt = qt4; @@ -7147,7 +7221,6 @@ let vite = callPackage ../applications/science/misc/vite { qt = qt4; - stdenv = stdenv2; }; ### MISC @@ -7229,7 +7302,6 @@ let lilypond = callPackage ../misc/lilypond { inherit (gtkLibs) pango; - flex = flex2535; }; martyr = callPackage ../development/libraries/martyr { }; @@ -7262,9 +7334,7 @@ let import ../tools/package-management/nix/custom.nix { inherit fetchurl stdenv perl curl bzip2 openssl src preConfigure automake autoconf libtool configureFlags enableScripts lib libxml2 boehmgc - pkgconfig; - flex = flex2535; - bison = bison24; + pkgconfig flex bison; aterm = aterm25; db4 = db45; inherit docbook5_xsl libxslt docbook5 docbook_xml_dtd_43 w3m; @@ -7341,10 +7411,9 @@ let texLive = builderDefsPackage (import ../misc/tex/texlive) { inherit builderDefs zlib bzip2 ncurses libpng ed gd t1lib freetype icu perl ruby expat curl - libjpeg bison python fontconfig; + libjpeg bison python fontconfig flex; inherit (xlibs) libXaw libX11 xproto libXt libXpm libXmu libXext xextproto libSM libICE; - flex = flex2535; ghostscript = ghostscriptX; }; @@ -7394,13 +7463,9 @@ let vice = callPackage ../misc/emulators/vice { }; # Wine cannot be built in 64-bit; use a 32-bit build instead. - wine = callPackage_i686 ../misc/emulators/wine { - flex = pkgsi686Linux.flex2535; - }; + wine = callPackage_i686 ../misc/emulators/wine { }; - wineWarcraft = callPackage_i686 ../misc/emulators/wine/wine-warcraft.nix { - flex = pkgsi686Linux.flex2535; - }; + wineWarcraft = callPackage_i686 ../misc/emulators/wine/wine-warcraft.nix { }; x2x = callPackage ../tools/X11/x2x { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 053ccebc0c8..9655bc2d8bf 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -1575,11 +1575,11 @@ rec { }; ImageExifTool = buildPerlPackage rec { - name = "Image-ExifTool-8.12"; + name = "Image-ExifTool-8.41"; src = fetchurl { url = "http://www.sno.phy.queensu.ca/~phil/exiftool/${name}.tar.gz"; - sha256 = "1s95f6cyl4cwyymmzsn49llza2hggh9lb3fqdpa83k6vbrzs86dh"; + sha256 = "1fdjic0bhbai8zzl3287i9wcs88khiv8qx5slx9n3gzvbnxacvqg"; }; meta = { @@ -1601,6 +1601,7 @@ rec { licenses = [ "GPLv1+" /* or */ "Artistic" ]; maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.unix; }; }; diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index 7bd27ebf4f9..f4430678570 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -162,4 +162,62 @@ rec { uboot = "upstream"; ubootConfig = "integratorcp_config"; }; + + fuloong2f_n32 = { + name = "fuloong2f_n32"; + kernelMajor = "2.6"; + kernelHeadersBaseConfig = "fuloong2e_defconfig"; + kernelBaseConfig = "lemote2f_defconfig"; + kernelArch = "mips"; + kernelAutoModules = false; + kernelExtraConfig = + '' + BLK_DEV_RAM y + BLK_DEV_INITRD y + BLK_DEV_CRYPTOLOOP m + BLK_DEV_DM m + DM_CRYPT m + MD y + REISERFS_FS m + EXT4_FS m + USB_STORAGE_CYPRESS_ATACB m + + IP_PNP y + IP_PNP_DHCP y + IP_PNP_BOOTP y + NFS_FS y + ROOT_NFS y + TUN m + NFS_V4 y + NFS_V4_1 y + NFS_FSCACHE y + NFSD m + NFSD_V2_ACL y + NFSD_V3 y + NFSD_V3_ACL y + NFSD_V4 y + + # Fail to build + DRM n + SCSI_ADVANSYS n + USB_ISP1362_HCD n + SND_SOC n + SND_ALI5451 n + FB_SAVAGE n + SCSI_NSP32 n + ATA_SFF n + SUNGEM n + IRDA n + ATM_HE n + SCSI_ACARD n + BLK_DEV_CMD640_ENHANCED n + + FUSE_FS m + + # Needed for udev >= 150 + SYSFS_DEPRECATED_V2 n + ''; + kernelTarget = "vmlinux"; + uboot = null; + }; } diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index b2dc475e12a..fd865419487 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -4,10 +4,12 @@ let /* Basic list of packages to cross-build */ basicHostDrv = { + gccCrossStageFinal = nativePlatforms; bison.hostDrv = nativePlatforms; busybox.hostDrv = nativePlatforms; + coreutils.hostDrv = nativePlatforms; dropbear.hostDrv = nativePlatforms; - tightvnc.hostDrv = nativePlatforms; + tigervnc.hostDrv = nativePlatforms; #openoffice.hostDrv = nativePlatforms; wxGTK.hostDrv = nativePlatforms; #firefox = nativePlatforms; @@ -17,6 +19,8 @@ let nixUnstable.hostDrv = nativePlatforms; linuxPackages_2_6_32.kernel.hostDrv = linux; linuxPackages_2_6_33.kernel.hostDrv = linux; + linuxPackages_2_6_34.kernel.hostDrv = linux; + linuxPackages_2_6_35.kernel.hostDrv = linux; }; /* Basic list of packages to be natively built, @@ -62,6 +66,14 @@ let platform = pkgs.platforms.sheevaplug; libc = "uclibc"; openssl.system = "linux-generic32"; + uclibc.extraConfig = '' + CONFIG_ARM_OABI n + CONFIG_ARM_EABI y + ARCH_BIG_ENDIAN n + ARCH_WANTS_BIG_ENDIAN n + ARCH_WANTS_LITTLE_ENDIAN y + LINUXTHREADS_OLD y + ''; }; in { @@ -84,7 +96,7 @@ let platform = { name = "malta"; kernelMajor = "2.4"; - kernelBaseConfig = "malta_defconfig"; + kernelBaseConfig = "defconfig-malta"; kernelHeadersBaseConfig = "defconfig-malta"; uboot = null; kernelArch = "mips"; @@ -92,6 +104,15 @@ let kernelTarget = "vmlinux"; }; openssl.system = "linux-generic32"; + uclibc.extraConfig = '' + ARCH_BIG_ENDIAN n + ARCH_WANTS_BIG_ENDIAN n + ARCH_WANTS_LITTLE_ENDIAN y + LINUXTHREADS_OLD y + + # Without this, it does not build for linux 2.4 + UCLIBC_SUSV4_LEGACY y + ''; }; in { crossMipselLinux24 = mapTestOnCross crossSystem basic; @@ -134,7 +155,6 @@ let in { crossMingw32 = mapTestOnCross crossSystem { windows.wxMSW.hostDrv = nativePlatforms; - gccCrossStageFinal = nativePlatforms; }; }) // ( @@ -152,7 +172,6 @@ let }; in { crossGNU = mapTestOnCross crossSystem { - gccCrossStageFinal = nativePlatforms; hurdCross = nativePlatforms; mach.hostDrv = nativePlatforms; @@ -164,4 +183,110 @@ in { patch.hostDrv = nativePlatforms; zile.hostDrv = nativePlatforms; }; +}) // ( + +/* Linux on the fuloong */ +let + crossSystem = { + config = "mips64el-unknown-linux"; + bigEndian = false; + arch = "mips"; + float = "hard"; + withTLS = true; + libc = "glibc"; + platform = { + name = "fuloong-minipc"; + kernelMajor = "2.6"; + kernelBaseConfig = "lemote2f_defconfig"; + kernelHeadersBaseConfig = "fuloong2e_defconfig"; + uboot = null; + kernelArch = "mips"; + kernelAutoModules = false; + kernelTarget = "vmlinux"; + }; + openssl.system = "linux-generic32"; + gcc = { + arch = "loongson2f"; + abi = "n32"; + }; + }; +in { + fuloongminipc = mapTestOnCross crossSystem { + + coreutils_real.hostDrv = nativePlatforms; + ed.hostDrv = nativePlatforms; + grub2.hostDrv = nativePlatforms; + inetutils.hostDrv = nativePlatforms; + nixUnstable.hostDrv = nativePlatforms; + patch.hostDrv = nativePlatforms; + zile.hostDrv = nativePlatforms; + }; +}) // ( + +/* Linux on the Ben Nanonote */ +let + crossSystem = { + config = "mipsel-unknown-linux"; + bigEndian = false; + arch = "mips"; + float = "soft"; + withTLS = true; + libc = "glibc"; + platform = { + name = "ben_nanonote"; + kernelMajor = "2.6"; + kernelBaseConfig = "qi_lb60_defconfig"; + kernelHeadersBaseConfig = "malta_defconfig"; + uboot = "nanonote"; + kernelArch = "mips"; + kernelAutoModules = false; + kernelTarget = "vmlinux.bin"; + kernelExtraConfig = '' + SOUND y + SND y + SND_MIPS y + SND_SOC y + SND_JZ4740_SOC y + SND_JZ4740_SOC_QI_LB60 y + FUSE_FS m + MIPS_FPU_EMU y + ''; + }; + openssl.system = "linux-generic32"; + perl.arch = "mipsel-unknown"; + uclibc.extraConfig = '' + CONFIG_MIPS_ISA_1 n + CONFIG_MIPS_ISA_MIPS32 y + CONFIG_MIPS_N32_ABI n + CONFIG_MIPS_O32_ABI y + ARCH_BIG_ENDIAN n + ARCH_WANTS_BIG_ENDIAN n + ARCH_WANTS_LITTLE_ENDIAN y + LINUXTHREADS_OLD y + ''; + gcc = { + abi = "32"; + arch = "mips32"; + }; + mpg123.cpu = "generic_nofpu"; + }; +in { + nanonote = mapTestOnCross crossSystem { + + coreutils_real.hostDrv = nativePlatforms; + ed.hostDrv = nativePlatforms; + inetutils.hostDrv = nativePlatforms; + nixUnstable.hostDrv = nativePlatforms; + patch.hostDrv = nativePlatforms; + zile.hostDrv = nativePlatforms; + prboom.hostDrv = nativePlatforms; + vim.hostDrv = nativePlatforms; + lynx.hostDrv = nativePlatforms; + patchelf.hostDrv = nativePlatforms; + nix.hostDrv = nativePlatforms; + fossil.hostDrv = nativePlatforms; + binutils.hostDrv = nativePlatforms; + mpg123.hostDrv = nativePlatforms; + yacas.hostDrv = nativePlatforms; + }; }) diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix index a470098529f..0345ebba0c4 100644 --- a/pkgs/top-level/release-lib.nix +++ b/pkgs/top-level/release-lib.nix @@ -28,14 +28,14 @@ rec { crossMaintainers = with pkgs.lib.maintainers; [ viric ]; /* Set the Hydra scheduling priority for a job. The default - priority (100) should be used for most jobs. A different + priority (10) should be used for most jobs. A different priority should only be used for a few particularly interesting jobs (in terms of giving feedback to developers), such as stdenv. */ prio = level: job: toJob job // { schedulingPriority = level; }; toJob = x: if builtins.isAttrs x then x else - { type = "job"; systems = x; schedulingPriority = 10; }; + { type = "job"; systems = x; schedulingPriority = 5; }; /* Perform a job on the given set of platforms. The function `f' is called by Hydra for each platform, and should return some job diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index 73ba02211fe..54bc621cf2f 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -164,7 +164,7 @@ with (import ./release-lib.nix); jwhois = linux; kbd = linux; keen4 = ["i686-linux"]; - klibc = linux; +# klibc = linux; ktorrent = linux; kvm = linux; qemu = linux;