* Merged the stdenv-updated branch. Woohoo!

svn path=/nixpkgs/trunk/; revision=25315
This commit is contained in:
Eelco Dolstra 2010-12-28 21:19:57 +00:00
commit 762ed9079f
260 changed files with 6784 additions and 1956 deletions

View File

@ -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

View File

@ -0,0 +1,712 @@
;;; GNUpdate -- Update GNU packages in Nixpkgs. -*- coding: utf-8; -*-
;;; Copyright (C) 2010 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.
(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 <location>
(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 <ftp-connection>
(%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 <ludo@gnu.org>~%")
(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))

View File

@ -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;
};
}

View File

@ -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";
};
}

View File

@ -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";

View File

@ -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 ];

View File

@ -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

View File

@ -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";

View File

@ -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 ];

View File

@ -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
};
}

View File

@ -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
'';

View File

@ -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

View File

@ -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 = {

View File

@ -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

View File

@ -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
};
}

View File

@ -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;

View File

@ -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"

View File

@ -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<CharacterPosition,80> mPositions;
+ nsSVGGlyphFrame *mSource;
gfxMatrix mInitialMatrix;
// Textrun advance width from start to mCurrentChar, in appunits
gfxFloat mCurrentAdvance;

View File

@ -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 <r0bertz@gentoo.org>
+// 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

View File

@ -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 <r0bertz@gentoo.org>
Date: Thu, 12 Mar 2009 02:24:34 +0800
Subject: [PATCH 2/2] xulrunner mips n32 ABI patch
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
---
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 <r0bertz@gentoo.org>
+ *
+ * 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 <sys/regdef.h>
+#include <sys/asm.h>
+
+.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 <r0bertz@gentoo.org>
+ *
+ * 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*)&regs[i] = s->val.f;
+ else
+ *(float*)d++ = s->val.f;
+ break;
+ case nsXPTType::T_DOUBLE:
+ if (i < N_ARG_REGS)
+ *(double*)&regs[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 <r0bertz@gentoo.org>
+ *
+ * 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 <sys/regdef.h>
+#include <sys/asm.h>
+
+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 <r0bertz@gentoo.org>
+ *
+ * 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

View File

@ -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
];
};
}

View File

@ -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/;

View File

@ -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";
};
};
}
]

View File

@ -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];

View File

@ -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 */

View File

@ -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

View File

@ -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 <class T> 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 <typename T>
+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 <typename T>
+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));

View File

@ -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];

View File

@ -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 = ''

View File

@ -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

View File

@ -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 <fabric...@ubuntu.com>
##
## Description: fix FTBFS with gcc 4.5 with undefined reference to
## `drgeoDialogData'
## Author: Petr Gajdos <pgaj...@suse.cz>
## 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
{

View File

@ -0,0 +1,84 @@
From: glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7>
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

View File

@ -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)

View File

@ -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/;

View File

@ -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;

View File

@ -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 = ''

View File

@ -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";

View File

@ -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 =

View File

@ -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

View File

@ -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/;

View File

@ -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 .

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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=""

View File

@ -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 "";
}

View File

@ -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 "";
}

View File

@ -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

View File

@ -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[@]}

View File

@ -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

View File

@ -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";
}

View File

@ -0,0 +1,263 @@
From 1e3a6c25bc258021899c0a31ea9b68ea656d8f6b Mon Sep 17 00:00:00 2001
From: Yury G. Kudryashov <urkud.urkud@gmail.com>
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 <urkud@ya.ru>
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

View File

@ -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/;

View File

@ -1,22 +0,0 @@
Submitted By: Andrew "Weibullguy" Rowland <darowland_at_ieee_dot_org>
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

View File

@ -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"];

View File

@ -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/";

View File

@ -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

View File

@ -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/;

View File

@ -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

View File

@ -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 {}))
})

View File

@ -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);

View File

@ -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

View File

@ -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 <http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00602.html>, 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

View File

@ -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";
}) ++
[]

View File

@ -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 = {

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,24 @@
Fix doc snarfing with GCC 4.5.
From <http://git.savannah.gnu.org/cgit/guile.git/commit/?h=branch_release-1-8&id=aac41d28358cea594bb30f6e547afb82bb6004a6>.
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)))

View File

@ -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:
# <http://git.savannah.gnu.org/cgit/guile.git/commit/?h=branch_release-1-8&id=a0aa1e5b69d6ef0311aeea8e4b9a94eae18a1aaf>.
doCheck = false;
setupHook = ./setup-hook.sh;

View File

@ -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";
}

View File

@ -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;};

View File

@ -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;
}

View File

@ -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";
};
}

View File

@ -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";
};
}

View File

@ -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;

View File

@ -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 ];

View File

@ -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;

View File

@ -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 <sys/stat.h>' >> inc/cc++/config.h
'';
meta = {
description = "GNU Common C++, a portable, highly optimized C++ class framework";

View File

@ -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 ];

View File

@ -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"
];
}

View File

@ -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];

View File

@ -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/;

View File

@ -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/;

View File

@ -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;
};
}

View File

@ -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;
};
}

View File

@ -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 ];

View File

@ -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 <schwab@redhat.com>
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

View File

@ -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

View File

@ -1,85 +0,0 @@
Fix for CVE-2010-3847.
2010-10-18 Andreas Schwab <schwab@redhat.com>
* 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

View File

@ -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" \

View File

@ -1,31 +0,0 @@
commit 89b432d7a5befb85048c97e881b2106e8df58e43
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sun Nov 22 10:23:12 2009 -0800
Fix up <sys/timex.h> 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 */

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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 <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
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}
'';

View File

@ -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 {}))

View File

@ -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 =

View File

@ -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. */

Some files were not shown because too many files have changed in this diff Show More