3
0
Fork 0
forked from mirrors/nixpkgs

Remove unnecessary parentheses around if conditions

Pet peeve...
This commit is contained in:
Eelco Dolstra 2012-12-28 19:54:15 +01:00
parent e2d505b24e
commit 84779a6f7d
40 changed files with 130 additions and 130 deletions

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
''; '';
buildInputs = [saneBackends libX11 gtk pkgconfig] ++ buildInputs = [saneBackends libX11 gtk pkgconfig] ++
(if (libusb != null) then [libusb] else []); (if libusb != null then [libusb] else []);
meta = { meta = {
homepage = "http://www.sane-project.org/"; homepage = "http://www.sane-project.org/";

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
''; '';
buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ] ++ buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ] ++
(if (libusb != null) then [libusb] else []); (if libusb != null then [libusb] else []);
meta = { meta = {
homepage = http://www.sane-project.org/; homepage = http://www.sane-project.org/;

View file

@ -69,7 +69,7 @@ stdenv.mkDerivation {
}; };
buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ]; buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ];
makeFlags = if (wxGUI) then "" else "NOGUI=1"; makeFlags = if wxGUI then "" else "NOGUI=1";
meta = { meta = {
description = "Free Open-Source filesystem on-the-fly encryption"; description = "Free Open-Source filesystem on-the-fly encryption";

View file

@ -20,21 +20,21 @@ let inherit (builtins) head tail trace; in
else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz"
else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) ||
(hasSuffixHack ".tbz" s) then "tbz2" (hasSuffixHack ".tbz" s) then "tbz2"
else if (hasSuffixHack ".tar.Z" s) then "tZ" else if hasSuffixHack ".tar.Z" s then "tZ"
else if (hasSuffixHack ".tar.lzma" s) then "tar.lzma" else if hasSuffixHack ".tar.lzma" s then "tar.lzma"
else if (hasSuffixHack ".tar.xz" s) then "tar.xz" else if hasSuffixHack ".tar.xz" s then "tar.xz"
else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip" else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip"
else if (hasSuffixHack "-cvs-export" s) then "cvs-dir" else if hasSuffixHack "-cvs-export" s then "cvs-dir"
else if (hasSuffixHack "-git-export" s) then "git-dir" else if hasSuffixHack "-git-export" s then "git-dir"
else if (hasSuffixHack ".nar.bz2" s) then "narbz2" else if hasSuffixHack ".nar.bz2" s then "narbz2"
else if (hasSuffixHack ".rpm" s) then "rpm" else if hasSuffixHack ".rpm" s then "rpm"
# Mostly for manually specified directories.. # Mostly for manually specified directories..
else if (hasSuffixHack "/" s) then "dir" else if hasSuffixHack "/" s then "dir"
# Last block - for single files!! It should be always after .tar.* # Last block - for single files!! It should be always after .tar.*
else if (hasSuffixHack ".bz2" s) then "plain-bz2" else if hasSuffixHack ".bz2" s then "plain-bz2"
else if (hasSuffixHack ".gz" s) then "plain-gz" else if hasSuffixHack ".gz" s then "plain-gz"
# For bootstrap calls # For bootstrap calls
else if (s ==("" + (substring 0 0 s))) then "empty" else if (s ==("" + (substring 0 0 s))) then "empty"
@ -391,7 +391,7 @@ let inherit (builtins) head tail trace; in
cmakeFlags = attrByPath ["cmakeFlags"] [] args; cmakeFlags = attrByPath ["cmakeFlags"] [] args;
cmakeRPathFlag = if (attrByPath ["cmakeSkipRpath "] true args) then " -DCMAKE_SKIP_BUILD_RPATH=ON " else ""; cmakeRPathFlag = if attrByPath ["cmakeSkipRpath "] true args then " -DCMAKE_SKIP_BUILD_RPATH=ON " else "";
cmakeBuildDir = attrByPath ["cmakeBuildDir"] "build" args; cmakeBuildDir = attrByPath ["cmakeBuildDir"] "build" args;
@ -508,7 +508,7 @@ let inherit (builtins) head tail trace; in
); );
builderDefsPackage = bd: func: builderDefsPackage = bd: func:
if (builtins.isFunction func) then if builtins.isFunction func then
(foldArgs (foldArgs
(x: y: ((func (bd // x // y)) // y)) (x: y: ((func (bd // x // y)) // y))
(innerBuilderDefsPackage bd) (innerBuilderDefsPackage bd)
@ -588,7 +588,7 @@ let inherit (builtins) head tail trace; in
url = srcInfo.url; url = srcInfo.url;
sha256 = srcInfo.hash; sha256 = srcInfo.hash;
} // } //
(if (srcInfo ? downloadName) then {name = srcInfo.downloadName;} else {})); (if srcInfo ? downloadName then {name = srcInfo.downloadName;} else {}));
fetchGitFromSrcInfo = srcInfo: fetchgit { fetchGitFromSrcInfo = srcInfo: fetchgit {
url = srcInfo.url; url = srcInfo.url;

View file

@ -8,14 +8,14 @@ with lib;
let let
findInList = p: list: default: findInList = p: list: default:
if (list == []) then default else if list == [] then default else
if (p (head list)) then (head list) else if (p (head list)) then (head list) else
findInList p (tail list) default; findInList p (tail list) default;
checkAttrInclusion = s: a: b: checkAttrInclusion = s: a: b:
( (
if (! isAttrs b) then s else if ! isAttrs b then s else
if (lib.attrByPath ["_type"] "" b) == "option" then "" else if (lib.attrByPath ["_type"] "" b) == "option" then "" else
findInList (x : x != "") findInList (x : x != "")
( map (x: if (x == "servicesProposal") # this attr will be checked at another place ( -> upstart-jobs/default.nix ) ( map (x: if (x == "servicesProposal") # this attr will be checked at another place ( -> upstart-jobs/default.nix )

View file

@ -2,16 +2,16 @@
# TODO: statically check if mercurial as the https support if the url starts woth https. # TODO: statically check if mercurial as the https support if the url starts woth https.
stdenv.mkDerivation { stdenv.mkDerivation {
name = "hg-archive" + (if (name != null) then "-${name}" else ""); name = "hg-archive" + (if name != null then "-${name}" else "");
builder = ./builder.sh; builder = ./builder.sh;
buildInputs = [mercurial]; buildInputs = [mercurial];
# Nix <= 0.7 compatibility. # Nix <= 0.7 compatibility.
id = md5; id = md5;
outputHashAlgo = if (md5 != null) then "md5" else "sha256"; outputHashAlgo = if md5 != null then "md5" else "sha256";
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = if (md5 != null) then md5 else sha256; outputHash = if md5 != null then md5 else sha256;
inherit url tag; inherit url tag;
preferLocalBuild = true; preferLocalBuild = true;

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation {
utils = ./utils.sh; utils = ./utils.sh;
addFlags = ./add-flags; addFlags = ./add-flags;
inherit nativeTools nativeLibc nativePrefix gcc libc binutils; inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
crossConfig = if (cross != null) then cross.config else null; crossConfig = if cross != null then cross.config else null;
gccLibs = if gcc != null then gccLibs else null; gccLibs = if gcc != null then gccLibs else null;
name = chosenName; name = chosenName;
langC = if nativeTools then true else gcc.langC; langC = if nativeTools then true else gcc.langC;

View file

@ -50,7 +50,7 @@ stdenv.mkDerivation ({
langFortran = if nativeTools then false else gcc ? langFortran; langFortran = if nativeTools then false else gcc ? langFortran;
langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
zlib = if (gcc != null && gcc ? langVhdl) then zlib else null; zlib = if gcc != null && gcc ? langVhdl then zlib else null;
shell = if shell == "" then stdenv.shell else shell = if shell == "" then stdenv.shell else
if builtins.isAttrs shell then (shell + shell.shellPath) if builtins.isAttrs shell then (shell + shell.shellPath)
else shell; else shell;

View file

@ -6,7 +6,7 @@
assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null; assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null;
let let
platformName = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then "linux" platformName = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then "linux"
else if stdenv.system == "x86_64-darwin" then "macosx" else if stdenv.system == "x86_64-darwin" then "macosx"
else throw "Platform: ${stdenv.system} is not supported!"; else throw "Platform: ${stdenv.system} is not supported!";

View file

@ -47,9 +47,9 @@ let
" --enable-threads=posix" + " --enable-threads=posix" +
" --enable-nls" " --enable-nls"
); );
stageNameAddon = if (crossStageStatic) then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
in in
stdenv.mkDerivation ({ stdenv.mkDerivation ({
@ -85,7 +85,7 @@ stdenv.mkDerivation ({
inherit noSysDirs profiledCompiler staticCompiler crossStageStatic inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
binutilsCross libcCross; binutilsCross libcCross;
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
buildInputs = [texinfo gmp mpfr] buildInputs = [texinfo gmp mpfr]
++ (optionals langTreelang [bison flex]) ++ (optionals langTreelang [bison flex])

View file

@ -84,9 +84,9 @@ let version = "4.4.6";
" --enable-nls" + " --enable-nls" +
" --disable-decimal-float" # No final libdecnumber (it may work only in 386) " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
); );
stageNameAddon = if (crossStageStatic) then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
in in
@ -163,11 +163,11 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
"; ";
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
# Needed for the cross compilation to work # Needed for the cross compilation to work
AR = "ar"; AR = "ar";
@ -211,7 +211,7 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
--target=${stdenv.cross.config} --target=${stdenv.cross.config}
"; ";

View file

@ -78,7 +78,7 @@ let version = "4.5.4";
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
(if (crossMingw && crossStageStatic) then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
" --with-gnu-as" + " --with-gnu-as" +
@ -115,9 +115,9 @@ let version = "4.5.4";
" --enable-nls" + " --enable-nls" +
" --disable-decimal-float") # No final libdecnumber (it may work only in 386) " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
); );
stageNameAddon = if (crossStageStatic) then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
in in
@ -189,7 +189,7 @@ stdenv.mkDerivation ({
# On NixOS, use the right path to the dynamic linker instead of # On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'. # `/lib/ld*.so'.
let let
libc = if (libcCross != null) then libcCross else stdenv.gcc.libc; libc = if libcCross != null then libcCross else stdenv.gcc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@ -237,7 +237,7 @@ stdenv.mkDerivation ({
--with-gmp=${gmp} --with-gmp=${gmp}
--with-mpfr=${mpfr} --with-mpfr=${mpfr}
--with-mpc=${mpc} --with-mpc=${mpc}
${if (libelf != null) then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
--without-included-gettext --without-included-gettext
--with-system-zlib --with-system-zlib
@ -255,11 +255,11 @@ stdenv.mkDerivation ({
${ # Trick that should be taken out once we have a mips64el-linux not loongson2f ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
"; ";
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
crossAttrs = { crossAttrs = {
AR = "${stdenv.cross.config}-ar"; AR = "${stdenv.cross.config}-ar";
@ -299,7 +299,7 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
--target=${stdenv.cross.config} --target=${stdenv.cross.config}
''; '';

View file

@ -101,7 +101,7 @@ let version = "4.6.3";
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
(if (crossMingw && crossStageStatic) then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
" --with-gnu-as" + " --with-gnu-as" +
@ -149,9 +149,9 @@ let version = "4.6.3";
" --enable-nls" + " --enable-nls" +
" --disable-decimal-float") # No final libdecnumber (it may work only in 386) " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
); );
stageNameAddon = if (crossStageStatic) then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
@ -216,7 +216,7 @@ stdenv.mkDerivation ({
# On NixOS, use the right path to the dynamic linker instead of # On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'. # `/lib/ld*.so'.
let let
libc = if (libcCross != null) then libcCross else stdenv.gcc.libc; libc = if libcCross != null then libcCross else stdenv.gcc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@ -275,7 +275,7 @@ stdenv.mkDerivation ({
--with-gmp=${gmp} --with-gmp=${gmp}
--with-mpfr=${mpfr} --with-mpfr=${mpfr}
--with-mpc=${mpc} --with-mpc=${mpc}
${if (libelf != null) then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
--without-included-gettext --without-included-gettext
--with-system-zlib --with-system-zlib
@ -294,12 +294,12 @@ stdenv.mkDerivation ({
${ # Trick that should be taken out once we have a mips64el-linux not loongson2f ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
${if !bootstrap then "--disable-bootstrap" else ""} ${if !bootstrap then "--disable-bootstrap" else ""}
"; ";
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
buildFlags = if bootstrap then buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap") (if profiledCompiler then "profiledbootstrap" else "bootstrap")
@ -350,7 +350,7 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
--target=${stdenv.cross.config} --target=${stdenv.cross.config}
''; '';

View file

@ -99,7 +99,7 @@ let version = "4.7.2";
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
(if (crossMingw && crossStageStatic) then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
" --with-gnu-as" + " --with-gnu-as" +
@ -147,9 +147,9 @@ let version = "4.7.2";
" --enable-nls" + " --enable-nls" +
" --disable-decimal-float") # No final libdecnumber (it may work only in 386) " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
); );
stageNameAddon = if (crossStageStatic) then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
@ -211,7 +211,7 @@ stdenv.mkDerivation ({
# On NixOS, use the right path to the dynamic linker instead of # On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'. # `/lib/ld*.so'.
let let
libc = if (libcCross != null) then libcCross else stdenv.gcc.libc; libc = if libcCross != null then libcCross else stdenv.gcc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@ -274,7 +274,7 @@ stdenv.mkDerivation ({
--with-gmp=${gmp} --with-gmp=${gmp}
--with-mpfr=${mpfr} --with-mpfr=${mpfr}
--with-mpc=${mpc} --with-mpc=${mpc}
${if (libelf != null) then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
--without-included-gettext --without-included-gettext
--with-system-zlib --with-system-zlib
@ -296,12 +296,12 @@ stdenv.mkDerivation ({
${ # Trick that should be taken out once we have a mips64el-linux not loongson2f ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
${if !bootstrap then "--disable-bootstrap" else ""} ${if !bootstrap then "--disable-bootstrap" else ""}
"; ";
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
buildFlags = if bootstrap then buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap") (if profiledCompiler then "profiledbootstrap" else "bootstrap")
@ -351,7 +351,7 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""} ${if cross != null then crossConfigureFlags else ""}
--target=${stdenv.cross.config} --target=${stdenv.cross.config}
''; '';

View file

@ -3,12 +3,12 @@
stdenv.mkDerivation { stdenv.mkDerivation {
name = "gentoo-gnatboot-4.1"; name = "gentoo-gnatboot-4.1";
src = if (stdenv.system == "i686-linux") then src = if stdenv.system == "i686-linux" then
fetchurl { fetchurl {
url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2"; url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2";
sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr"; sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr";
} }
else if (stdenv.system == "x86_64-linux") then else if stdenv.system == "x86_64-linux" then
fetchurl { fetchurl {
url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2"; url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2";
sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4"; sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4";

View file

@ -54,9 +54,9 @@ stdenv.mkDerivation {
patches = [ ./cacert.patch ]; patches = [ ./cacert.patch ];
GOOS = "linux"; GOOS = "linux";
GOARCH = if (stdenv.system == "i686-linux") then "386" GOARCH = if stdenv.system == "i686-linux" then "386"
else if (stdenv.system == "x86_64-linux") then "amd64" else if stdenv.system == "x86_64-linux" then "amd64"
else if (stdenv.system == "armv5tel-linux") then "arm" else if stdenv.system == "armv5tel-linux" then "arm"
else throw "Unsupported system"; else throw "Unsupported system";
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5"; GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
@ -74,7 +74,7 @@ stdenv.mkDerivation {
for a in go gofmt godoc; do for a in go gofmt godoc; do
wrapProgram "$out/bin/$a" \ wrapProgram "$out/bin/$a" \
--set "GOROOT" $out/share/go \ --set "GOROOT" $out/share/go \
${if (stdenv.system == "armv5tel-linux") then "--set GOARM $GOARM" else ""} ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
done done
# Copy the emacs configuration for Go files. # Copy the emacs configuration for Go files.

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation ({
license = "GPL-3"; license = "GPL-3";
}; };
} // ( } // (
if (config.octave.devVersion or false) then { if config.octave.devVersion or false then {
name = "octave-hg"; # developement version mercurial repo name = "octave-hg"; # developement version mercurial repo
# REGION AUTO UPDATE: { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; } # REGION AUTO UPDATE: { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; }
src = sourceFromHead "octave-03b414516dd8.tar.gz" src = sourceFromHead "octave-03b414516dd8.tar.gz"

View file

@ -29,7 +29,7 @@ let
(enableShared && enableStatic)) then (enableShared && enableStatic)) then
"tagged" else "system"; "tagged" else "system";
cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else ""; cflags = if enablePIC then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
in in

View file

@ -28,7 +28,7 @@ let
(enableShared && enableStatic)) then (enableShared && enableStatic)) then
"tagged" else "system"; "tagged" else "system";
cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else ""; cflags = if enablePIC then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
in in

View file

@ -29,11 +29,11 @@ let
(enableShared && enableStatic)) then (enableShared && enableStatic)) then
"tagged" else "system"; "tagged" else "system";
cflags = if (enablePIC && enableExceptions) then cflags = if enablePIC && enableExceptions then
"cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
else if (enablePIC) then else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if (enableExceptions) then else if enableExceptions then
"cflags=-fexceptions" "cflags=-fexceptions"
else else
""; "";

View file

@ -29,11 +29,11 @@ let
(enableShared && enableStatic)) then (enableShared && enableStatic)) then
"tagged" else "system"; "tagged" else "system";
cflags = if (enablePIC && enableExceptions) then cflags = if enablePIC && enableExceptions then
"cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
else if (enablePIC) then else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if (enableExceptions) then else if enableExceptions then
"cflags=-fexceptions" "cflags=-fexceptions"
else else
""; "";

View file

@ -27,11 +27,11 @@ let
# To avoid library name collisions # To avoid library name collisions
layout = if taggedLayout then "tagged" else "system"; layout = if taggedLayout then "tagged" else "system";
cflags = if (enablePIC && enableExceptions) then cflags = if enablePIC && enableExceptions then
"cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
else if (enablePIC) then else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if (enableExceptions) then else if enableExceptions then
"cflags=-fexceptions" "cflags=-fexceptions"
else else
""; "";

View file

@ -27,11 +27,11 @@ let
# To avoid library name collisions # To avoid library name collisions
layout = if taggedLayout then "tagged" else "system"; layout = if taggedLayout then "tagged" else "system";
cflags = if (enablePIC && enableExceptions) then cflags = if enablePIC && enableExceptions then
"cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
else if (enablePIC) then else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if (enableExceptions) then else if enableExceptions then
"cflags=-fexceptions" "cflags=-fexceptions"
else else
""; "";

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation { stdenv.mkDerivation {
name = "fmod-42204"; name = "fmod-42204";
src = if (stdenv.system == "i686-linux") then src = if stdenv.system == "i686-linux" then
fetchurl { fetchurl {
url = http://www.fmod.org/index.php/release/version/fmodapi42204linux.tar.gz; url = http://www.fmod.org/index.php/release/version/fmodapi42204linux.tar.gz;
sha256 = "64eedc5b37c597eb925de446106d75cab0b5a79697d5ec048d34702812c08563"; sha256 = "64eedc5b37c597eb925de446106d75cab0b5a79697d5ec048d34702812c08563";
} else if (stdenv.system == "x86_64-linux") then } else if stdenv.system == "x86_64-linux" then
fetchurl { fetchurl {
url = http://www.fmod.org/index.php/release/version/fmodapi42204linux64.tar.gz; url = http://www.fmod.org/index.php/release/version/fmodapi42204linux64.tar.gz;
sha256 = "3f2eec8265838a1005febe07c4971660e85010e4622911890642dc438746edf3"; sha256 = "3f2eec8265838a1005febe07c4971660e85010e4622911890642dc438746edf3";

View file

@ -39,7 +39,7 @@ stdenv.mkDerivation ({
inherit kernelHeaders installLocales; inherit kernelHeaders installLocales;
# The host/target system. # The host/target system.
crossConfig = if (cross != null) then cross.config else null; crossConfig = if cross != null then cross.config else null;
inherit (stdenv) is64bit; inherit (stdenv) is64bit;

View file

@ -7,11 +7,11 @@ assert opensc.name == "opensc-0.11.7";
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libopensc-dnie-1.4.6-2"; name = "libopensc-dnie-1.4.6-2";
src = if (stdenv.system == "i686-linux") then (fetchurl { src = if stdenv.system == "i686-linux" then (fetchurl {
url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar; url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar;
sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i"; sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i";
}) })
else if (stdenv.system == "x86_64-linux") then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar; else if stdenv.system == "x86_64-linux" then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9"; sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9";
}) })
else throw "Architecture not supported"; else throw "Architecture not supported";

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"; sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
}; };
NIX_CFLAGS_COMPILE = if (enablePIC) then "-fPIC" else ""; NIX_CFLAGS_COMPILE = if enablePIC then "-fPIC" else "";
propagatedBuildInputs = [ propagatedBuildInputs = [
mesa freeglut SDL mesa freeglut SDL

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation {
# BUILD_OUL wants old linux headers for videodev.h, not available # BUILD_OUL wants old linux headers for videodev.h, not available
# in stdenv linux headers # in stdenv linux headers
cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF " cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF "
+ (if (stdenv.system == "x86_64-linux") then + (if stdenv.system == "x86_64-linux" then
"-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
else else
""); "");

View file

@ -47,6 +47,6 @@ stdenv.mkDerivation {
''; '';
maintainers = [stdenv.lib.maintainers.simons]; maintainers = [stdenv.lib.maintainers.simons];
platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix; platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
}; };
} }

View file

@ -47,6 +47,6 @@ stdenv.mkDerivation {
''; '';
maintainers = [stdenv.lib.maintainers.simons]; maintainers = [stdenv.lib.maintainers.simons];
platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix; platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
}; };
} }

View file

@ -95,7 +95,7 @@ rec {
else if isInt x then true else if isInt x then true
else if x == null then true else if x == null then true
else true; # a (store) path? else true; # a (store) path?
in if (traverse x) then x else throw "else never reached"; in if traverse x then x else throw "else never reached";
# example: (traceCallXml "myfun" id 3) will output something like # example: (traceCallXml "myfun" id 3) will output something like
# calling myfun arg 1: 3 result: 3 # calling myfun arg 1: 3 result: 3

View file

@ -53,7 +53,7 @@ rec {
f : # the function applied to the arguments f : # the function applied to the arguments
initial : # you pass attrs, the functions below are passing a function taking the fix argument initial : # you pass attrs, the functions below are passing a function taking the fix argument
let let
takeFixed = if (isFunction initial) then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
tidy = args : tidy = args :
let # apply all functions given in "applyPreTidy" in sequence let # apply all functions given in "applyPreTidy" in sequence
applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args); applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
@ -106,11 +106,11 @@ rec {
# shortcut for attrByPath ["name"] default attrs # shortcut for attrByPath ["name"] default attrs
maybeAttrNullable = name: default: attrs: maybeAttrNullable = name: default: attrs:
if attrs == null then default else if attrs == null then default else
if (__hasAttr name attrs) then (__getAttr name attrs) else default; if __hasAttr name attrs then (__getAttr name attrs) else default;
# shortcut for attrByPath ["name"] default attrs # shortcut for attrByPath ["name"] default attrs
maybeAttr = name: default: attrs: maybeAttr = name: default: attrs:
if (__hasAttr name attrs) then (__getAttr name attrs) else default; if __hasAttr name attrs then (__getAttr name attrs) else default;
# Return the second argument if the first one is true or the empty version # Return the second argument if the first one is true or the empty version
@ -120,14 +120,14 @@ rec {
else if builtins.isList val then [] else if builtins.isList val then []
else if builtins.isAttrs val then {} else if builtins.isAttrs val then {}
# else if builtins.isString val then "" # else if builtins.isString val then ""
else if (val == true || val == false) then false else if val == true || val == false then false
else null; else null;
# Return true only if there is an attribute and it is true. # Return true only if there is an attribute and it is true.
checkFlag = attrSet: name: checkFlag = attrSet: name:
if (name == "true") then true else if name == "true" then true else
if (name == "false") then false else if name == "false" then false else
if (elem name (attrByPath ["flags"] [] attrSet)) then true else if (elem name (attrByPath ["flags"] [] attrSet)) then true else
attrByPath [name] false attrSet ; attrByPath [name] false attrSet ;
@ -170,7 +170,7 @@ rec {
uniqListExt = {inputList, outputList ? [], uniqListExt = {inputList, outputList ? [],
getter ? (x : x), compare ? (x: y: x==y)}: getter ? (x : x), compare ? (x: y: x==y)}:
if (inputList == []) then outputList else if inputList == [] then outputList else
let x=head inputList; let x=head inputList;
isX = y: (compare (getter y) (getter x)); isX = y: (compare (getter y) (getter x));
newOutputList = outputList ++ newOutputList = outputList ++
@ -362,7 +362,7 @@ rec {
cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags))) cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
// args2.cfg; // args2.cfg;
opts = attrValues (mapAttrs (a : v : opts = attrValues (mapAttrs (a : v :
let v2 = if (v ? set || v ? unset) then v else { set = v; }; let v2 = if v ? set || v ? unset then v else { set = v; };
n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset"; n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
attr = maybeAttr n {} v2; in attr = maybeAttr n {} v2; in
if (maybeAttr "assertion" true attr) if (maybeAttr "assertion" true attr)

View file

@ -4,8 +4,8 @@ args: with args; {
|| x ? meta && x.meta ? sourceWithTags ); || x ? meta && x.meta ? sourceWithTags );
# hack because passthru doesn't work the way I'd expect. Don't have time to spend on this right now # hack because passthru doesn't work the way I'd expect. Don't have time to spend on this right now
# that's why I'm abusing meta for the same purpose in ghcsAndLibs # that's why I'm abusing meta for the same purpose in ghcsAndLibs
sourceWithTagsFromDerivation = x : if (x ? passthru && x.passthru ? sourceWithTags ) then x.passthru.sourceWithTags sourceWithTagsFromDerivation = x : if x ? passthru && x.passthru ? sourceWithTags then x.passthru.sourceWithTags
else if (x ? meta && x.meta ? sourceWithTags ) then x.meta.sourceWithTags else if x ? meta && x.meta ? sourceWithTags then x.meta.sourceWithTags
else null; else null;
# createTagFiles = [ { name = "my_tag_name_without_suffix", tagCmd = "ctags -R . -o \$TAG_FILE"; } ] # createTagFiles = [ { name = "my_tag_name_without_suffix", tagCmd = "ctags -R . -o \$TAG_FILE"; } ]

View file

@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
extraCrossConfig = '' extraCrossConfig = ''
CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-" CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-"
'' + '' +
(if (stdenv.cross.platform.kernelMajor == "2.4") then '' (if stdenv.cross.platform.kernelMajor == "2.4" then ''
CONFIG_IONICE n CONFIG_IONICE n
'' else ""); '' else "");
}; };

View file

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "13hybl5p0ck0vgi2gxmiwa2810gcfk78kdy17ai8nczj8il15mn0"; sha256 = "13hybl5p0ck0vgi2gxmiwa2810gcfk78kdy17ai8nczj8il15mn0";
}; };
buildPhase = if (!onlyHeaders) then '' buildPhase = if !onlyHeaders then ''
make -C ${kernel}/lib/modules/${kernel.modDirVersion}/build \ make -C ${kernel}/lib/modules/${kernel.modDirVersion}/build \
SUBDIRS=`pwd` INSTALL_PATH=$out SUBDIRS=`pwd` INSTALL_PATH=$out
'' else ":"; '' else ":";

View file

@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
let let
version = "2.4.37.9"; version = "2.4.37.9";
kernelHeadersBaseConfig = if (cross == null) then kernelHeadersBaseConfig = if cross == null then
stdenv.platform.kernelHeadersBaseConfig stdenv.platform.kernelHeadersBaseConfig
else else
cross.platform.kernelHeadersBaseConfig; cross.platform.kernelHeadersBaseConfig;
@ -18,7 +18,7 @@ stdenv.mkDerivation {
sha256 = "08rca9lcb5l5w483hgaqk8pi2njd7cmwpkifjqxwlb3g8liz4r5g"; sha256 = "08rca9lcb5l5w483hgaqk8pi2njd7cmwpkifjqxwlb3g8liz4r5g";
}; };
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
platform = platform =
if cross != null then cross.platform.kernelArch else if cross != null then cross.platform.kernelArch else

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation {
sha256 = "0hifjh75sinifr5138v22zwbpqln6lhn65k8b57a1dyzlqca7cl9"; sha256 = "0hifjh75sinifr5138v22zwbpqln6lhn65k8b57a1dyzlqca7cl9";
}; };
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
platform = platform =
if cross != null then cross.arch else if cross != null then cross.arch else

View file

@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
let let
version = "2.6.32.16"; version = "2.6.32.16";
kernelHeadersBaseConfig = if (cross == null) then kernelHeadersBaseConfig = if cross == null then
stdenv.platform.kernelHeadersBaseConfig stdenv.platform.kernelHeadersBaseConfig
else else
cross.platform.kernelHeadersBaseConfig; cross.platform.kernelHeadersBaseConfig;
@ -18,7 +18,7 @@ stdenv.mkDerivation {
sha256 = "1ndvqvfaxachsklzzr5db1bzvfhnzz8diddrm1zlv7171fzmn13j"; sha256 = "1ndvqvfaxachsklzzr5db1bzvfhnzz8diddrm1zlv7171fzmn13j";
}; };
targetConfig = if (cross != null) then cross.config else null; targetConfig = if cross != null then cross.config else null;
platform = platform =
if cross != null then cross.platform.kernelArch else if cross != null then cross.platform.kernelArch else

View file

@ -33,8 +33,8 @@ let
} }
''; '';
archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else ""; archMakeFlag = if cross != null then "ARCH=${cross.arch}" else "";
crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else ""; crossMakeFlag = if cross != null then "CROSS=${cross.config}-" else "";
# UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds. # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds.
nixConfig = '' nixConfig = ''
@ -74,7 +74,7 @@ stdenv.mkDerivation {
''; '';
# Cross stripping hurts. # Cross stripping hurts.
dontStrip = if (cross != null) then true else false; dontStrip = if cross != null then true else false;
makeFlags = [ crossMakeFlag "VERBOSE=1" ]; makeFlags = [ crossMakeFlag "VERBOSE=1" ];

View file

@ -222,7 +222,7 @@ let
else else
defaultStdenv; defaultStdenv;
forceNativeDrv = drv : if (crossSystem == null) then drv else forceNativeDrv = drv : if crossSystem == null then drv else
(drv // { crossDrv = drv.nativeDrv; }); (drv // { crossDrv = drv.nativeDrv; });
# A stdenv capable of building 32-bit binaries. On x86_64-linux, # A stdenv capable of building 32-bit binaries. On x86_64-linux,
@ -2422,10 +2422,10 @@ let
jreOnly = true; jreOnly = true;
}; };
jdk = if (stdenv.isDarwin || stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") jdk = if stdenv.isDarwin || stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
then pkgs.openjdk then pkgs.openjdk
else pkgs.oraclejdk; else pkgs.oraclejdk;
jre = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") jre = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
then pkgs.openjre then pkgs.openjre
else pkgs.oraclejre; else pkgs.oraclejre;
@ -3658,11 +3658,11 @@ let
}; };
# We can choose: # We can choose:
libcCrossChooser = name : if (name == "glibc") then glibcCross libcCrossChooser = name : if name == "glibc" then glibcCross
else if (name == "uclibc") then uclibcCross else if name == "uclibc" then uclibcCross
else if (name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32") then else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
windows.mingw_w64 windows.mingw_w64
else if (name == "msvcrt") then windows.mingw_headers3 else if name == "msvcrt" then windows.mingw_headers3
else throw "Unknown libc"; else throw "Unknown libc";
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc; libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
@ -4184,14 +4184,14 @@ let
libiconv = callPackage ../development/libraries/libiconv { }; libiconv = callPackage ../development/libraries/libiconv { };
libiconvOrEmpty = if (libiconvOrNull == null) then [] else [libiconv]; libiconvOrEmpty = if libiconvOrNull == null then [] else [libiconv];
libiconvOrNull = libiconvOrNull =
if ((gcc ? libc && (gcc.libc != null)) || stdenv.isGlibc) if gcc.libc or null != null || stdenv.isGlibc
then null then null
else libiconv; else libiconv;
libiconvOrLibc = if (libiconvOrNull == null) then gcc.libc else libiconv; libiconvOrLibc = if libiconvOrNull == null then gcc.libc else libiconv;
libid3tag = callPackage ../development/libraries/libid3tag { }; libid3tag = callPackage ../development/libraries/libid3tag { };
@ -5699,8 +5699,8 @@ let
}); });
# We can choose: # We can choose:
linuxHeadersCrossChooser = ver : if (ver == "2.4") then linuxHeaders24Cross linuxHeadersCrossChooser = ver : if ver == "2.4" then linuxHeaders24Cross
else if (ver == "2.6") then linuxHeaders26Cross else if ver == "2.6" then linuxHeaders26Cross
else throw "Unknown linux kernel version"; else throw "Unknown linux kernel version";
linuxHeadersCross = assert crossSystem != null; linuxHeadersCross = assert crossSystem != null;
@ -5905,10 +5905,10 @@ let
iwlwifi = callPackage ../os-specific/linux/iwlwifi { }; iwlwifi = callPackage ../os-specific/linux/iwlwifi { };
iwlwifi4965ucode = iwlwifi4965ucode =
(if (builtins.compareVersions kernel.version "2.6.27" == 0) if (builtins.compareVersions kernel.version "2.6.27" == 0)
|| (builtins.compareVersions kernel.version "2.6.27" == 1) || (builtins.compareVersions kernel.version "2.6.27" == 1)
then iwlwifi4965ucodeV2 then iwlwifi4965ucodeV2
else iwlwifi4965ucodeV1); else iwlwifi4965ucodeV1;
atheros = callPackage ../os-specific/linux/atheros/0.9.4.nix { }; atheros = callPackage ../os-specific/linux/atheros/0.9.4.nix { };
@ -6188,10 +6188,10 @@ let
tunctl = callPackage ../os-specific/linux/tunctl { }; tunctl = callPackage ../os-specific/linux/tunctl { };
ubootChooser = name : if (name == "upstream") then ubootUpstream ubootChooser = name : if name == "upstream" then ubootUpstream
else if (name == "sheevaplug") then ubootSheevaplug else if name == "sheevaplug" then ubootSheevaplug
else if (name == "guruplug") then ubootGuruplug else if name == "guruplug" then ubootGuruplug
else if (name == "nanonote") then ubootNanonote else if name == "nanonote" then ubootNanonote
else throw "Unknown uboot"; else throw "Unknown uboot";
ubootUpstream = callPackage ../misc/uboot { }; ubootUpstream = callPackage ../misc/uboot { };
@ -7515,9 +7515,9 @@ let
picocom = callPackage ../tools/misc/picocom { }; picocom = callPackage ../tools/misc/picocom { };
pidgin = callPackage ../applications/networking/instant-messengers/pidgin { pidgin = callPackage ../applications/networking/instant-messengers/pidgin {
openssl = if (config.pidgin.openssl or true) then openssl else null; openssl = if config.pidgin.openssl or true then openssl else null;
gnutls = if (config.pidgin.gnutls or false) then gnutls else null; gnutls = if config.pidgin.gnutls or false then gnutls else null;
libgcrypt = if (config.pidgin.gnutls or false) then libgcrypt else null; libgcrypt = if config.pidgin.gnutls or false then libgcrypt else null;
inherit (gnome) startupnotification; inherit (gnome) startupnotification;
}; };