treewide: Remove usage of remaining redundant platform compatability stuff

Want to get this out of here for 18.09, so it can be deprecated
thereafter.
This commit is contained in:
John Ericson 2018-08-20 14:43:41 -04:00
parent 2c2f1e37d4
commit 0828e2d8c3
149 changed files with 545 additions and 603 deletions

View File

@ -93,8 +93,8 @@ Now, the file produced by the call to `carnix`, called `hello.nix`, looks like:
``` ```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone # Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped) # ... (content skipped)
in in
rec { rec {
@ -122,8 +122,8 @@ following nix file:
``` ```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone # Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped) # ... (content skipped)
in in
rec { rec {

View File

@ -1,6 +1,5 @@
{ stdenv { stdenv
, fetchurl, alsaLib , fetchurl, alsaLib
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -13,8 +12,9 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional (!stdenv.isDarwin) alsaLib; buildInputs = stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
configureFlags = configureFlags = stdenv.lib.optional
stdenv.lib.optional (hostPlatform ? mpg123) "--with-cpu=${hostPlatform.mpg123.cpu}"; (stdenv.hostPlatform ? mpg123)
"--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
meta = { meta = {
description = "Fast console MPEG Audio Player and decoder library"; description = "Fast console MPEG Audio Player and decoder library";

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, lzip { stdenv, fetchurl, lzip
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
@ -36,7 +35,7 @@ stdenv.mkDerivation (rec {
maintainers = [ ]; maintainers = [ ];
platforms = stdenv.lib.platforms.unix; platforms = stdenv.lib.platforms.unix;
}; };
} // stdenv.lib.optionalAttrs (hostPlatform != buildPlatform) { } // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
# This may be moved above during a stdenv rebuild. # This may be moved above during a stdenv rebuild.
preConfigure = '' preConfigure = ''
configureFlagsArray+=("CC=$CC") configureFlagsArray+=("CC=$CC")

View File

@ -7,7 +7,6 @@
} }
# apple frameworks # apple frameworks
, Carbon, Cocoa , Carbon, Cocoa
, buildPlatform, hostPlatform
}: }:
let let
@ -20,12 +19,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ gettext pkgconfig ]; nativeBuildInputs = [ gettext pkgconfig ];
buildInputs = [ ncurses ] buildInputs = [ ncurses ]
++ stdenv.lib.optionals hostPlatform.isDarwin [ Carbon Cocoa ]; ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
configureFlags = [ configureFlags = [
"--enable-multibyte" "--enable-multibyte"
"--enable-nls" "--enable-nls"
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"vim_cv_toupper_broken=no" "vim_cv_toupper_broken=no"
"--with-tlib=ncurses" "--with-tlib=ncurses"
"vim_cv_terminfo=yes" "vim_cv_terminfo=yes"

View File

@ -2,7 +2,6 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, libheif , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, libheif
, ApplicationServices , ApplicationServices
, hostPlatform
}: }:
let let
@ -46,7 +45,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib" "--with-gslib"
] ]
++ lib.optionals hostPlatform.isMinGW ++ lib.optionals stdenv.hostPlatform.isMinGW
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
; ;
@ -56,13 +55,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript [ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libheif libpng libtiff libxml2 libheif
] ]
++ lib.optionals (!hostPlatform.isMinGW) ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ openexr librsvg openjpeg ] [ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices; ++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs = propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 ] [ bzip2 freetype libjpeg lcms2 ]
++ lib.optionals (!hostPlatform.isMinGW) ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ] [ libX11 libXext libXt libwebp ]
; ;

View File

@ -2,7 +2,6 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, fftw, libheif, libde265 , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, fftw, libheif, libde265
, ApplicationServices , ApplicationServices
, hostPlatform
}: }:
let let
@ -20,7 +19,7 @@ let
} }
# Freeze version on mingw so we don't need to port the patch too often. # Freeze version on mingw so we don't need to port the patch too often.
# FIXME: This version has multiple security vulnerabilities # FIXME: This version has multiple security vulnerabilities
// lib.optionalAttrs (hostPlatform.isMinGW) { // lib.optionalAttrs (stdenv.hostPlatform.isMinGW) {
version = "6.9.2-0"; version = "6.9.2-0";
sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7"; sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7";
patches = [(fetchpatch { patches = [(fetchpatch {
@ -58,7 +57,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib" "--with-gslib"
] ]
++ lib.optionals (hostPlatform.isMinGW) ++ lib.optionals (stdenv.hostPlatform.isMinGW)
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
; ;
@ -68,13 +67,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript [ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libheif libde265 libpng libtiff libxml2 libheif libde265
] ]
++ lib.optionals (!hostPlatform.isMinGW) ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ openexr librsvg openjpeg ] [ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices; ++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs = propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 fftw ] [ bzip2 freetype libjpeg lcms2 fftw ]
++ lib.optionals (!hostPlatform.isMinGW) ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ] [ libX11 libXext libXt libwebp ]
; ;

View File

@ -1,5 +1,5 @@
{ stdenv, buildGoPackage, fetchFromGitHub, go-bindata, libvirt, qemu { stdenv, buildGoPackage, fetchFromGitHub, go-bindata, libvirt, qemu
, gpgme, makeWrapper, hostPlatform, vmnet, python , gpgme, makeWrapper, vmnet, python
, docker-machine-kvm, docker-machine-kvm2 , docker-machine-kvm, docker-machine-kvm2
, extraDrivers ? [] , extraDrivers ? []
}: }:
@ -25,8 +25,8 @@ in buildGoPackage rec {
sha256 = "0c36rzsdzxf9q6l4hl506bsd4qwmw033i0k1xhqszv9agg7qjlmm"; sha256 = "0c36rzsdzxf9q6l4hl506bsd4qwmw033i0k1xhqszv9agg7qjlmm";
}; };
buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional hostPlatform.isDarwin vmnet; buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin vmnet;
subPackages = [ "cmd/minikube" ] ++ stdenv.lib.optional hostPlatform.isDarwin "cmd/drivers/hyperkit"; subPackages = [ "cmd/minikube" ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "cmd/drivers/hyperkit";
preBuild = '' preBuild = ''
pushd go/src/${goPackagePath} >/dev/null pushd go/src/${goPackagePath} >/dev/null
@ -56,7 +56,7 @@ in buildGoPackage rec {
postFixup = '' postFixup = ''
wrapProgram $bin/bin/${pname} --prefix PATH : $bin/bin:${stdenv.lib.makeBinPath binPath} wrapProgram $bin/bin/${pname} --prefix PATH : $bin/bin:${stdenv.lib.makeBinPath binPath}
'' + stdenv.lib.optionalString hostPlatform.isDarwin '' '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
mv $bin/bin/hyperkit $bin/bin/docker-machine-driver-hyperkit mv $bin/bin/hyperkit $bin/bin/docker-machine-driver-hyperkit
''; '';

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool { stdenv, lib, fetchurl, autoconf, automake, pkgconfig, libtool
, gtk2, halibut, ncurses, perl , gtk2, halibut, ncurses, perl
, hostPlatform, lib }: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.70"; version = "0.70";
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
sha256 = "1gmhwwj1y7b5hgkrkxpf4jddjpk9l5832zq5ibhsiicndsfs92mv"; sha256 = "1gmhwwj1y7b5hgkrkxpf4jddjpk9l5832zq5ibhsiicndsfs92mv";
}; };
preConfigure = lib.optionalString hostPlatform.isUnix '' preConfigure = lib.optionalString stdenv.hostPlatform.isUnix ''
perl mkfiles.pl perl mkfiles.pl
( cd doc ; make ); ( cd doc ; make );
sed -e '/AM_PATH_GTK(/d' \ sed -e '/AM_PATH_GTK(/d' \
@ -22,22 +22,23 @@ stdenv.mkDerivation rec {
-e '/AC_OUTPUT/iAM_PROG_AR' -i configure.ac -e '/AC_OUTPUT/iAM_PROG_AR' -i configure.ac
./mkauto.sh ./mkauto.sh
cd unix cd unix
'' + lib.optionalString hostPlatform.isWindows '' '' + lib.optionalString stdenv.hostPlatform.isWindows ''
cd windows cd windows
''; '';
TOOLPATH = stdenv.cc.targetPrefix; TOOLPATH = stdenv.cc.targetPrefix;
makefile = if hostPlatform.isWindows then "Makefile.mgw" else null; makefile = if stdenv.hostPlatform.isWindows then "Makefile.mgw" else null;
installPhase = if hostPlatform.isWindows then '' installPhase = if stdenv.hostPlatform.isWindows then ''
for exe in *.exe; do for exe in *.exe; do
install -D $exe $out/bin/$exe install -D $exe $out/bin/$exe
done done
'' else null; '' else null;
nativeBuildInputs = [ autoconf automake halibut libtool perl pkgconfig ]; nativeBuildInputs = [ autoconf automake halibut libtool perl pkgconfig ];
buildInputs = [] buildInputs = lib.optionals stdenv.hostPlatform.isUnix [
++ lib.optionals hostPlatform.isUnix [ gtk2 ncurses ]; gtk2 ncurses
];
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with lib; { meta = with lib; {

View File

@ -1,6 +1,5 @@
{ stdenv, fetchurl { stdenv, fetchurl
, raspberrypifw, pcre, boost, freetype, zlib , raspberrypifw, pcre, boost, freetype, zlib
, hostPlatform
}: }:
let let
@ -14,7 +13,7 @@ let
configurePlatforms = []; configurePlatforms = [];
configureFlags = [ configureFlags = [
"--arch=${hostPlatform.parsed.cpu.name}" "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
] ++ stdenv.lib.optionals stdenv.hostPlatform.isAarch32 [ ] ++ stdenv.lib.optionals stdenv.hostPlatform.isAarch32 [
# TODO be better with condition # TODO be better with condition
"--cpu=arm1176jzf-s" "--cpu=arm1176jzf-s"
@ -46,8 +45,8 @@ let
"--enable-hardcoded-tables" "--enable-hardcoded-tables"
"--disable-runtime-cpudetect" "--disable-runtime-cpudetect"
"--disable-debug" "--disable-debug"
"--arch=${hostPlatform.parsed.cpu.name}" "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}" "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-prefix=${stdenv.cc.targetPrefix}" "--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile" "--enable-cross-compile"

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, glibc, buildPlatform }: { stdenv, fetchurl, glibc }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "${pname}-${version}"; name = "${pname}-${version}";
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
buildPhase = ''( buildPhase = ''(
cd src cd src
./mk.sh ${buildPlatform.platform.kernelArch} ./mk.sh ${stdenv.buildPlatform.platform.kernelArch}
)''; )'';
installPhase = '' installPhase = ''

View File

@ -1,6 +1,6 @@
# Generated by carnix 0.6.5: carnix -o way-cooler.nix Cargo.lock # Generated by carnix 0.6.5: carnix -o way-cooler.nix Cargo.lock
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.buildPlatform.parsed.kernel.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions); updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; }); mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName: mkFeatures = feat: lib.lists.foldl (features: featureName:

View File

@ -1,6 +1,6 @@
# Generated by carnix 0.6.5: carnix -o wc-bg.nix Cargo.lock # Generated by carnix 0.6.5: carnix -o wc-bg.nix Cargo.lock
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.buildPlatform.parsed.kernel.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions); updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; }); mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName: mkFeatures = feat: lib.lists.foldl (features: featureName:

View File

@ -1,6 +1,6 @@
# Generated by carnix 0.6.5: carnix -o wc-grab.nix Cargo.lock # Generated by carnix 0.6.5: carnix -o wc-grab.nix Cargo.lock
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.hostPlatform.parsed.kernel.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions); updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; }); mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName: mkFeatures = feat: lib.lists.foldl (features: featureName:

View File

@ -1,6 +1,6 @@
# Generated by carnix 0.6.5: carnix -o wc-lock.nix Cargo.lock # Generated by carnix 0.6.5: carnix -o wc-lock.nix Cargo.lock
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.hostPlatform.parsed.kernel.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions); updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; }); mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName: mkFeatures = feat: lib.lists.foldl (features: featureName:

View File

@ -13,14 +13,13 @@
# argument. # argument.
{ stdenv, perl, cpio, contents, compressor, prepend, ubootTools { stdenv, perl, cpio, contents, compressor, prepend, ubootTools
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "initrd"; name = "initrd";
builder = ./make-initrd.sh; builder = ./make-initrd.sh;
makeUInitrd = hostPlatform.platform.kernelTarget == "uImage"; makeUInitrd = stdenv.hostPlatform.platform.kernelTarget == "uImage";
nativeBuildInputs = [ perl cpio ] nativeBuildInputs = [ perl cpio ]
++ stdenv.lib.optional makeUInitrd ubootTools; ++ stdenv.lib.optional makeUInitrd ubootTools;

View File

@ -4,7 +4,7 @@
# This can be useful for deploying packages with NixOps, and to share # This can be useful for deploying packages with NixOps, and to share
# binary dependencies between projects. # binary dependencies between projects.
{ lib, buildPlatform, stdenv, defaultCrateOverrides, fetchCrate, ncurses, rustc }: { lib, stdenv, defaultCrateOverrides, fetchCrate, ncurses, rustc }:
let makeDeps = dependencies: let makeDeps = dependencies:
(lib.concatMapStringsSep " " (dep: (lib.concatMapStringsSep " " (dep:
@ -12,14 +12,14 @@ let makeDeps = dependencies:
(if dep.crateType == "lib" then (if dep.crateType == "lib" then
" --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}.rlib" " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}.rlib"
else else
" --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${buildPlatform.extensions.sharedLibrary}") " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
) dependencies); ) dependencies);
# This doesn't appear to be officially documented anywhere yet. # This doesn't appear to be officially documented anywhere yet.
# See https://github.com/rust-lang-nursery/rust-forge/issues/101. # See https://github.com/rust-lang-nursery/rust-forge/issues/101.
target_os = if buildPlatform.isDarwin target_os = if stdenv.hostPlatform.isDarwin
then "macos" then "macos"
else buildPlatform.parsed.kernel.name; else stdenv.hostPlatform.parsed.kernel.name;
echo_build_heading = colors: '' echo_build_heading = colors: ''
echo_build_heading() { echo_build_heading() {
@ -106,20 +106,20 @@ let makeDeps = dependencies:
export CARGO_PKG_VERSION=${crateVersion} export CARGO_PKG_VERSION=${crateVersion}
export CARGO_PKG_AUTHORS="${authors}" export CARGO_PKG_AUTHORS="${authors}"
export CARGO_CFG_TARGET_ARCH=${buildPlatform.parsed.cpu.name} export CARGO_CFG_TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}
export CARGO_CFG_TARGET_OS=${target_os} export CARGO_CFG_TARGET_OS=${target_os}
export CARGO_CFG_TARGET_FAMILY="unix" export CARGO_CFG_TARGET_FAMILY="unix"
export CARGO_CFG_UNIX=1 export CARGO_CFG_UNIX=1
export CARGO_CFG_TARGET_ENV="gnu" export CARGO_CFG_TARGET_ENV="gnu"
export CARGO_CFG_TARGET_ENDIAN=${if buildPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"} export CARGO_CFG_TARGET_ENDIAN=${if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"}
export CARGO_CFG_TARGET_POINTER_WIDTH=${toString buildPlatform.parsed.cpu.bits} export CARGO_CFG_TARGET_POINTER_WIDTH=${toString stdenv.hostPlatform.parsed.cpu.bits}
export CARGO_CFG_TARGET_VENDOR=${buildPlatform.parsed.vendor.name} export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name}
export CARGO_MANIFEST_DIR="." export CARGO_MANIFEST_DIR="."
export DEBUG="${toString (!release)}" export DEBUG="${toString (!release)}"
export OPT_LEVEL="${toString optLevel}" export OPT_LEVEL="${toString optLevel}"
export TARGET="${buildPlatform.config}" export TARGET="${stdenv.hostPlatform.config}"
export HOST="${buildPlatform.config}" export HOST="${stdenv.hostPlatform.config}"
export PROFILE=${if release then "release" else "debug"} export PROFILE=${if release then "release" else "debug"}
export OUT_DIR=$(pwd)/target/build/${crateName}.out export OUT_DIR=$(pwd)/target/build/${crateName}.out
export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0} export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0}
@ -218,8 +218,8 @@ let makeDeps = dependencies:
$BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors} $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}.rlib" EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}.rlib"
if [ -e target/deps/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary} ]; then if [ -e target/deps/lib$CRATE_NAME-${metadata}${stdenv.hostPlatform.extensions.sharedLibrary} ]; then
EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary}" EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${stdenv.hostPlatform.extensions.sharedLibrary}"
fi fi
} }

View File

@ -1,7 +1,7 @@
# Generated by carnix 0.5.2: carnix Cargo.lock -o cargo-vendor.nix # Generated by carnix 0.5.2: carnix Cargo.lock -o cargo-vendor.nix
{ lib, buildPlatform, buildRustCrate }: { lib, stdenv, buildRustCrate }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.hostPlatform.parsed.kernel.name;
abi = buildPlatform.parsed.abi.name; abi = stdenv.hostPlatform.parsed.abi.name;
hasFeature = feature: hasFeature = feature:
lib.lists.any lib.lists.any
(originName: feature.${originName}) (originName: feature.${originName})

View File

@ -1,7 +1,7 @@
# Generated by carnix 0.7.2: carnix nix # Generated by carnix 0.7.2: carnix nix
{ lib, buildPlatform, buildRustCrate, fetchgit }: { lib, stdenv, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name; let kernel = stdenv.hostPlatform.parsed.kernel.name;
abi = buildPlatform.parsed.abi.name; abi = stdenv.hostPlatform.parsed.abi.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions); updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; }); mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName: mkFeatures = feat: lib.lists.foldl (features: featureName:

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false , langJava ? false
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
@ -20,14 +20,14 @@
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava , x11Support ? langJava
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -42,7 +42,7 @@ assert cloog != null -> isl != null;
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -54,6 +54,8 @@ let version = "4.8.5";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = [ ] patches = [ ]
++ optional enableParallelBuilding ../parallel-bconfig.patch ++ optional enableParallelBuilding ../parallel-bconfig.patch
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, noSysDirs, fetchpatch { stdenv, targetPackages, fetchurl, noSysDirs, fetchpatch
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false , langJava ? false
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
@ -20,14 +20,14 @@
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava , x11Support ? langJava
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -42,7 +42,7 @@ assert cloog != null -> isl != null;
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -54,6 +54,8 @@ let version = "4.9.4";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
[ ../use-source-date-epoch.patch ] [ ../use-source-date-epoch.patch ]
++ optionals enableParallelBuilding [ ../parallel-bconfig.patch ./parallel-strsignal.patch ] ++ optionals enableParallelBuilding [ ../parallel-bconfig.patch ./parallel-strsignal.patch ]

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false , langJava ? false
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
@ -20,15 +20,15 @@
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava , x11Support ? langJava
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -40,7 +40,7 @@ assert langJava -> zip != null && unzip != null
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -53,6 +53,8 @@ let version = "5.5.0";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
[ ../use-source-date-epoch.patch ] [ ../use-source-date-epoch.patch ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false , langJava ? false
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
@ -20,15 +20,15 @@
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava , x11Support ? langJava
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -40,7 +40,7 @@ assert langJava -> zip != null && unzip != null
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -52,6 +52,8 @@ let version = "6.4.0";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
[ ../use-source-date-epoch.patch ] [ ../use-source-date-epoch.patch ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
, staticCompiler ? false , staticCompiler ? false
@ -13,15 +13,15 @@
, isl ? null # optional, for the Graphite optimization framework. , isl ? null # optional, for the Graphite optimization framework.
, zlib ? null , zlib ? null
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -29,7 +29,7 @@
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -41,6 +41,8 @@ let version = "7.3.0";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
[ # https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html [ # https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html
./riscv-pthread-reentrant.patch ./riscv-pthread-reentrant.patch

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
, staticCompiler ? false , staticCompiler ? false
@ -13,15 +13,15 @@
, isl ? null # optional, for the Graphite optimization framework. , isl ? null # optional, for the Graphite optimization framework.
, zlib ? null , zlib ? null
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -29,7 +29,7 @@
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -41,6 +41,8 @@ let version = "8.2.0";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
optional (targetPlatform != hostPlatform) ../libstdc++-target.patch optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch ++ optional noSysDirs ../no-sys-dirs.patch

View File

@ -1,7 +1,7 @@
{ stdenv, targetPackages, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
, langGo ? false , langGo ? false
, profiledCompiler ? false , profiledCompiler ? false
, staticCompiler ? false , staticCompiler ? false
@ -13,16 +13,16 @@
, isl ? null # optional, for the Graphite optimization framework. , isl ? null # optional, for the Graphite optimization framework.
, zlib ? null , zlib ? null
, enableMultilib ? false , enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc" , name ? "gcc"
, libcCross ? null , libcCross ? null
, crossStageStatic ? false , crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross) , # Strip kills static libs of other archs (hence no cross)
stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null , gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, flex ? null , flex ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages , buildPackages
}: }:
@ -30,7 +30,7 @@
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null; assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -42,6 +42,8 @@ let version = "7-20170409";
enableParallelBuilding = true; enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = patches =
[ ] [ ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, hscolour , bootPkgs, hscolour
@ -8,7 +7,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 , useLLVM ? !stdenv.targetPlatform.isx86
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -19,7 +18,7 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
@ -27,10 +26,12 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
}: }:
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, hscolour , bootPkgs, hscolour
@ -7,7 +6,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 , useLLVM ? !stdenv.targetPlatform.isx86
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -18,7 +17,7 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
@ -26,12 +25,14 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
}: }:
assert !enableIntegerSimple -> gmp != null; assert !enableIntegerSimple -> gmp != null;
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, alex, happy, hscolour , bootPkgs, alex, happy, hscolour
@ -8,7 +7,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 || (targetPlatform.isMusl && hostPlatform != targetPlatform) , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -19,7 +18,7 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
@ -27,7 +26,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
, # Whether to backport https://phabricator.haskell.org/D4388 for , # Whether to backport https://phabricator.haskell.org/D4388 for
# deterministic profiling symbol names, at the cost of a slightly # deterministic profiling symbol names, at the cost of a slightly
# non-standard GHC API # non-standard GHC API
@ -37,6 +36,8 @@
assert !enableIntegerSimple -> gmp != null; assert !enableIntegerSimple -> gmp != null;
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, alex, happy, hscolour , bootPkgs, alex, happy, hscolour
@ -7,7 +6,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 || (targetPlatform.isMusl && hostPlatform != targetPlatform) , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -18,18 +17,18 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
enableShared ? !targetPlatform.isWindows && !targetPlatform.useiOSPrebuilt enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
, # Whetherto build terminfo. , # Whetherto build terminfo.
enableTerminfo ? !targetPlatform.isWindows enableTerminfo ? !stdenv.targetPlatform.isWindows
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
, # Whether to backport https://phabricator.haskell.org/D4388 for , # Whether to backport https://phabricator.haskell.org/D4388 for
# deterministic profiling symbol names, at the cost of a slightly # deterministic profiling symbol names, at the cost of a slightly
# non-standard GHC API # non-standard GHC API
@ -39,6 +38,8 @@
assert !enableIntegerSimple -> gmp != null; assert !enableIntegerSimple -> gmp != null;
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, alex, happy, hscolour , bootPkgs, alex, happy, hscolour
@ -7,7 +6,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 || (targetPlatform.isMusl && hostPlatform != targetPlatform) , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -18,23 +17,25 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
enableShared ? !targetPlatform.isWindows && !targetPlatform.useiOSPrebuilt enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
, # Whetherto build terminfo. , # Whetherto build terminfo.
enableTerminfo ? !targetPlatform.isWindows enableTerminfo ? !stdenv.targetPlatform.isWindows
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
}: }:
assert !enableIntegerSimple -> gmp != null; assert !enableIntegerSimple -> gmp != null;
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -1,5 +1,4 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform
# build-tools # build-tools
, bootPkgs, alex, happy, hscolour , bootPkgs, alex, happy, hscolour
@ -7,7 +6,7 @@
, libiconv ? null, ncurses , libiconv ? null, ncurses
, useLLVM ? !targetPlatform.isx86 || (targetPlatform.isMusl && hostPlatform != targetPlatform) , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
, # LLVM is conceptually a run-time-only depedendency, but for , # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a # non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too. # build-time dependency too.
@ -18,22 +17,24 @@
enableIntegerSimple ? !(gmp.meta.available or false), gmp enableIntegerSimple ? !(gmp.meta.available or false), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? targetPlatform != hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
, # Whether to build dynamic libs for the standard library (on the target , # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built. # platform). Static libs are always built.
enableShared ? !targetPlatform.isWindows && !targetPlatform.useAndroidPrebuilt enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useAndroidPrebuilt
, # Whetherto build terminfo. , # Whetherto build terminfo.
enableTerminfo ? !targetPlatform.isWindows enableTerminfo ? !stdenv.targetPlatform.isWindows
, version ? "8.5.20180118" , version ? "8.5.20180118"
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
}: }:
let let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional

View File

@ -13,13 +13,11 @@
, zlib , zlib
, compiler-rt_src , compiler-rt_src
, debugVersion ? false , debugVersion ? false
, enableSharedLibraries ? (buildPlatform == hostPlatform) , enableSharedLibraries ? (stdenv.buildPlatform == stdenv.hostPlatform)
, buildPackages , buildPackages
, buildPlatform
, hostPlatform
}: }:
assert (hostPlatform != buildPlatform) -> !enableSharedLibraries; assert (stdenv.hostPlatform != stdenv.buildPlatform) -> !enableSharedLibraries;
let let
src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"; src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
@ -131,7 +129,7 @@ in stdenv.mkDerivation rec {
++ stdenv.lib.optionals (isDarwin) [ ++ stdenv.lib.optionals (isDarwin) [
"-DLLVM_ENABLE_LIBCXX=ON" "-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false" "-DCAN_TARGET_i386=false"
] ++ stdenv.lib.optionals (buildPlatform != hostPlatform) [ ] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-DCMAKE_CROSSCOMPILING=True" "-DCMAKE_CROSSCOMPILING=True"
"-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen" "-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen"
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [

View File

@ -12,7 +12,6 @@
, targetToolchains , targetToolchains
, doCheck ? true , doCheck ? true
, broken ? false , broken ? false
, buildPlatform, hostPlatform
}: }:
let let

View File

@ -1,10 +1,9 @@
{ stdenv, buildPackages, buildHaskellPackages, ghc { stdenv, buildPackages, buildHaskellPackages, ghc
, jailbreak-cabal, hscolour, cpphs, nodejs , jailbreak-cabal, hscolour, cpphs, nodejs
, buildPlatform, hostPlatform
}: }:
let let
isCross = buildPlatform != hostPlatform; isCross = stdenv.buildPlatform != stdenv.hostPlatform;
inherit (buildPackages) inherit (buildPackages)
fetchurl removeReferencesTo fetchurl removeReferencesTo
pkgconfig coreutils gnugrep gnused glibcLocales; pkgconfig coreutils gnugrep gnused glibcLocales;
@ -32,8 +31,8 @@ in
, enableSharedExecutables ? false , enableSharedExecutables ? false
, enableSharedLibraries ? (ghc.enableShared or false) , enableSharedLibraries ? (ghc.enableShared or false)
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
, enableStaticLibraries ? !hostPlatform.isWindows , enableStaticLibraries ? !stdenv.hostPlatform.isWindows
, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" , enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
, extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? []
# On macOS, statically linking against system frameworks is not supported; # On macOS, statically linking against system frameworks is not supported;
# see https://developer.apple.com/library/content/qa/qa1118/_index.html # see https://developer.apple.com/library/content/qa/qa1118/_index.html
@ -79,7 +78,7 @@ assert editedCabalFile != null -> revision != null;
# --enable-static does not work on windows. This is a bug in GHC. # --enable-static does not work on windows. This is a bug in GHC.
# --enable-static will pass -staticlib to ghc, which only works for mach-o and elf. # --enable-static will pass -staticlib to ghc, which only works for mach-o and elf.
assert hostPlatform.isWindows -> enableStaticLibraries == false; assert stdenv.hostPlatform.isWindows -> enableStaticLibraries == false;
let let
@ -144,7 +143,7 @@ let
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES") (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
(enableFeature (enableDeadCodeElimination && !hostPlatform.isAarch32 && !hostPlatform.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs") (enableFeature (enableDeadCodeElimination && !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs")
(enableFeature enableLibraryProfiling "library-profiling") (enableFeature enableLibraryProfiling "library-profiling")
(optionalString ((enableExecutableProfiling || enableLibraryProfiling) && versionOlder "8" ghc.version) "--profiling-detail=${profilingDetail}") (optionalString ((enableExecutableProfiling || enableLibraryProfiling) && versionOlder "8" ghc.version) "--profiling-detail=${profilingDetail}")
(enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling")) (enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling"))
@ -163,7 +162,7 @@ let
] ++ optionals isGhcjs [ ] ++ optionals isGhcjs [
"--ghcjs" "--ghcjs"
] ++ optionals isCross ([ ] ++ optionals isCross ([
"--configure-option=--host=${hostPlatform.config}" "--configure-option=--host=${stdenv.hostPlatform.config}"
] ++ crossCabalFlags); ] ++ crossCabalFlags);
setupCompileFlags = [ setupCompileFlags = [
@ -285,7 +284,7 @@ stdenv.mkDerivation ({
fi fi
'' ''
# It is not clear why --extra-framework-dirs does work fine on Linux # It is not clear why --extra-framework-dirs does work fine on Linux
+ optionalString (!buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' + optionalString (!stdenv.buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") ''
if [[ -d "$p/Library/Frameworks" ]]; then if [[ -d "$p/Library/Frameworks" ]]; then
configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks"
fi fi
@ -486,5 +485,5 @@ stdenv.mkDerivation ({
// optionalAttrs (postFixup != "") { inherit postFixup; } // optionalAttrs (postFixup != "") { inherit postFixup; }
// optionalAttrs (dontStrip) { inherit dontStrip; } // optionalAttrs (dontStrip) { inherit dontStrip; }
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; } // optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
// optionalAttrs (buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } // optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
) )

View File

@ -1,4 +1,4 @@
{ lib, targetPlatform, ghc, llvmPackages, packages, symlinkJoin, makeWrapper { lib, stdenv, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
, withLLVM ? false , withLLVM ? false
, postBuild ? "" , postBuild ? ""
, ghcLibdir ? null # only used by ghcjs, when resolving plugins , ghcLibdir ? null # only used by ghcjs, when resolving plugins
@ -48,7 +48,7 @@ let
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
llvm = lib.makeBinPath llvm = lib.makeBinPath
([ llvmPackages.llvm ] ([ llvmPackages.llvm ]
++ lib.optional targetPlatform.isDarwin llvmPackages.clang); ++ lib.optional stdenv.targetPlatform.isDarwin llvmPackages.clang);
in in
if paths == [] && !withLLVM then ghc else if paths == [] && !withLLVM then ghc else
symlinkJoin { symlinkJoin {
@ -105,7 +105,7 @@ symlinkJoin {
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
fi fi
'' + (lib.optionalString (targetPlatform.isDarwin && !isGhcjs && !targetPlatform.isiOS) '' '' + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS) ''
# Work around a linker limit in macOS Sierra (see generic-builder.nix): # Work around a linker limit in macOS Sierra (see generic-builder.nix):
local packageConfDir="$out/lib/${ghc.name}/package.conf.d"; local packageConfDir="$out/lib/${ghc.name}/package.conf.d";
local dynamicLinksDir="$out/lib/links" local dynamicLinksDir="$out/lib/links"

View File

@ -1,5 +1,4 @@
{ stdenv, buildPackages { stdenv, buildPackages
, buildPlatform, hostPlatform
, fetchurl, makeWrapper, gawk, pkgconfig , fetchurl, makeWrapper, gawk, pkgconfig
, libtool, readline, gmp , libtool, readline, gmp
}: }:
@ -23,7 +22,7 @@ stdenv.mkDerivation rec {
"--with-threads=no"; "--with-threads=no";
depsBuildBuild = [ buildPackages.stdenv.cc ] depsBuildBuild = [ buildPackages.stdenv.cc ]
++ stdenv.lib.optional (hostPlatform != buildPlatform) ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
buildPackages.buildPackages.guile_1_8; buildPackages.buildPackages.guile_1_8;
nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
buildInputs = [ readline libtool ]; buildInputs = [ readline libtool ];

View File

@ -1,5 +1,4 @@
{ stdenv, buildPackages { stdenv, buildPackages
, buildPlatform, hostPlatform
, fetchpatch, fetchurl, makeWrapper, gawk, pkgconfig , fetchpatch, fetchurl, makeWrapper, gawk, pkgconfig
, libffi, libtool, readline, gmp, boehmgc, libunistring , libffi, libtool, readline, gmp, boehmgc, libunistring
, coverageAnalysis ? null , coverageAnalysis ? null
@ -22,7 +21,7 @@
setOutputFlags = false; # $dev gets into the library otherwise setOutputFlags = false; # $dev gets into the library otherwise
depsBuildBuild = [ buildPackages.stdenv.cc ] depsBuildBuild = [ buildPackages.stdenv.cc ]
++ stdenv.lib.optional (hostPlatform != buildPlatform) ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
buildPackages.buildPackages.guile_2_0; buildPackages.buildPackages.guile_2_0;
nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
buildInputs = [ readline libtool libunistring libffi ]; buildInputs = [ readline libtool libunistring libffi ];

View File

@ -1,5 +1,4 @@
{ stdenv, buildPackages { stdenv, buildPackages
, buildPlatform, hostPlatform
, fetchurl, makeWrapper, gawk, pkgconfig , fetchurl, makeWrapper, gawk, pkgconfig
, libffi, libtool, readline, gmp, boehmgc, libunistring , libffi, libtool, readline, gmp, boehmgc, libunistring
, coverageAnalysis ? null , coverageAnalysis ? null
@ -23,7 +22,7 @@
setOutputFlags = false; # $dev gets into the library otherwise setOutputFlags = false; # $dev gets into the library otherwise
depsBuildBuild = [ buildPackages.stdenv.cc ] depsBuildBuild = [ buildPackages.stdenv.cc ]
++ stdenv.lib.optional (hostPlatform != buildPlatform) ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
buildPackages.buildPackages.guile; buildPackages.buildPackages.guile;
nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
buildInputs = [ readline libtool libunistring libffi ]; buildInputs = [ readline libtool libunistring libffi ];

View File

@ -1,4 +1,4 @@
{ stdenv, hostPlatform, buildPlatform, buildPackages, fetchurl { stdenv, buildPackages, fetchurl
, bzip2 , bzip2
, gdbm , gdbm
, fetchpatch , fetchpatch
@ -85,7 +85,7 @@ let
# libuuid, slowing down program startup a lot). # libuuid, slowing down program startup a lot).
./no-ldconfig.patch ./no-ldconfig.patch
] ++ optionals hostPlatform.isCygwin [ ] ++ optionals stdenv.hostPlatform.isCygwin [
./2.5.2-ctypes-util-find_library.patch ./2.5.2-ctypes-util-find_library.patch
./2.5.2-tkinter-x11.patch ./2.5.2-tkinter-x11.patch
./2.6.2-ssl-threads.patch ./2.6.2-ssl-threads.patch
@ -125,14 +125,14 @@ let
"--enable-shared" "--enable-shared"
"--with-threads" "--with-threads"
"--enable-unicode=ucs${toString ucsEncoding}" "--enable-unicode=ucs${toString ucsEncoding}"
] ++ optionals (hostPlatform.isCygwin || hostPlatform.isAarch64) [ ] ++ optionals (stdenv.hostPlatform.isCygwin || stdenv.hostPlatform.isAarch64) [
"--with-system-ffi" "--with-system-ffi"
] ++ optionals hostPlatform.isCygwin [ ] ++ optionals stdenv.hostPlatform.isCygwin [
"--with-system-expat" "--with-system-expat"
"ac_cv_func_bind_textdomain_codeset=yes" "ac_cv_func_bind_textdomain_codeset=yes"
] ++ optionals stdenv.isDarwin [ ] ++ optionals stdenv.isDarwin [
"--disable-toolbox-glue" "--disable-toolbox-glue"
] ++ optionals (hostPlatform != buildPlatform) [ ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"PYTHON_FOR_BUILD=${getBin buildPackages.python}/bin/python" "PYTHON_FOR_BUILD=${getBin buildPackages.python}/bin/python"
"ac_cv_buggy_getaddrinfo=no" "ac_cv_buggy_getaddrinfo=no"
# Assume little-endian IEEE 754 floating point when cross compiling # Assume little-endian IEEE 754 floating point when cross compiling
@ -157,18 +157,18 @@ let
] ]
# Never even try to use lchmod on linux, # Never even try to use lchmod on linux,
# don't rely on detecting glibc-isms. # don't rely on detecting glibc-isms.
++ optional hostPlatform.isLinux "ac_cv_func_lchmod=no"; ++ optional stdenv.hostPlatform.isLinux "ac_cv_func_lchmod=no";
buildInputs = buildInputs =
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++ optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
[ bzip2 openssl zlib ] [ bzip2 openssl zlib ]
++ optional (hostPlatform.isCygwin || hostPlatform.isAarch64) libffi ++ optional (stdenv.hostPlatform.isCygwin || stdenv.hostPlatform.isAarch64) libffi
++ optional hostPlatform.isCygwin expat ++ optional stdenv.hostPlatform.isCygwin expat
++ [ db gdbm ncurses sqlite readline ] ++ [ db gdbm ncurses sqlite readline ]
++ optionals x11Support [ tcl tk xlibsWrapper libX11 ] ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
++ optionals stdenv.isDarwin ([ CF ] ++ optional (configd != null) configd); ++ optionals stdenv.isDarwin ([ CF ] ++ optional (configd != null) configd);
nativeBuildInputs = nativeBuildInputs =
optionals (hostPlatform != buildPlatform) optionals (stdenv.hostPlatform != stdenv.buildPlatform)
[ buildPackages.stdenv.cc buildPackages.python ]; [ buildPackages.stdenv.cc buildPackages.python ];
mkPaths = paths: { mkPaths = paths: {
@ -190,7 +190,7 @@ in stdenv.mkDerivation {
inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2" NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"
+ optionalString hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000"; + optionalString stdenv.hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000";
DETERMINISTIC_BUILD = 1; DETERMINISTIC_BUILD = 1;
setupHook = python-setup-hook sitePackages; setupHook = python-setup-hook sitePackages;
@ -235,7 +235,7 @@ in stdenv.mkDerivation {
find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
'' + optionalString hostPlatform.isCygwin '' '' + optionalString stdenv.hostPlatform.isCygwin ''
cp libpython2.7.dll.a $out/lib cp libpython2.7.dll.a $out/lib
''; '';

View File

@ -1,10 +1,9 @@
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv { stdenv, lib, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
, openglSupport ? false, libGL, libGLU , openglSupport ? false, libGL, libGLU
, alsaSupport ? true, alsaLib , alsaSupport ? true, alsaLib
, x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr , x11Support ? stdenv.hostPlatform == stdenv.buildPlatform, libXext, libICE, libXrandr
, pulseaudioSupport ? true, libpulseaudio , pulseaudioSupport ? true, libpulseaudio
, OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
, hostPlatform, buildPlatform
}: }:
# NOTE: When editing this expression see if the same change applies to # NOTE: When editing this expression see if the same change applies to
@ -41,7 +40,7 @@ stdenv.mkDerivation rec {
++ optional stdenv.isDarwin Cocoa; ++ optional stdenv.isDarwin Cocoa;
buildInputs = [ ] buildInputs = [ ]
++ optional (!hostPlatform.isMinGW) audiofile ++ optional (!stdenv.hostPlatform.isMinGW) audiofile
++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ]; ++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
configureFlags = [ configureFlags = [

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gettext, hostPlatform }: { stdenv, fetchurl, gettext }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "attr-2.4.47"; name = "attr-2.4.47";
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
installTargets = [ "install" "install-lib" "install-dev" ]; installTargets = [ "install" "install-lib" "install-dev" ];
patches = if (hostPlatform.libc == "musl") then [ ./fix-headers-musl.patch ] else null; patches = if (stdenv.hostPlatform.libc == "musl") then [ ./fix-headers-musl.patch ] else null;
postPatch = '' postPatch = ''
for script in install-sh include/install-sh; do for script in install-sh include/install-sh; do

View File

@ -1,6 +1,5 @@
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops { lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops
, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179 , enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -30,7 +29,7 @@ stdenv.mkDerivation rec {
sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3"; sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3";
}) ] ++ }) ] ++
# https://github.com/ivmai/bdwgc/pull/208 # https://github.com/ivmai/bdwgc/pull/208
lib.optional hostPlatform.isRiscV ./riscv.patch; lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch;
configureFlags = configureFlags =
[ "--enable-cplusplus" ] [ "--enable-cplusplus" ]
@ -40,7 +39,7 @@ stdenv.mkDerivation rec {
doCheck = true; # not cross; doCheck = true; # not cross;
# Don't run the native `strip' when cross-compiling. # Don't run the native `strip' when cross-compiling.
dontStrip = hostPlatform != buildPlatform; dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,4 +1,4 @@
{ stdenv, callPackage, fetchurl, hostPlatform, buildPlatform, ... } @ args: { stdenv, callPackage, fetchurl, ... } @ args:
callPackage ./generic.nix (args // rec { callPackage ./generic.nix (args // rec {
version = "1.66_0"; version = "1.66_0";

View File

@ -1,4 +1,4 @@
{ stdenv, callPackage, fetchurl, fetchpatch, hostPlatform, buildPlatform, ... } @ args: { stdenv, callPackage, fetchurl, fetchpatch, ... } @ args:
callPackage ./generic.nix (args // rec { callPackage ./generic.nix (args // rec {
version = "1.67_0"; version = "1.67_0";

View File

@ -1,4 +1,4 @@
{ stdenv, callPackage, fetchurl, fetchpatch, hostPlatform, buildPlatform, ... } @ args: { stdenv, callPackage, fetchurl, fetchpatch, ... } @ args:
callPackage ./generic.nix (args // rec { callPackage ./generic.nix (args // rec {
version = "1.68_0"; version = "1.68_0";

View File

@ -1,13 +1,13 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
, which , which
, buildPackages, buildPlatform, hostPlatform , buildPackages
, toolset ? /**/ if stdenv.cc.isClang then "clang" , toolset ? /**/ if stdenv.cc.isClang then "clang"
else null else null
, enableRelease ? true , enableRelease ? true
, enableDebug ? false , enableDebug ? false
, enableSingleThreaded ? false , enableSingleThreaded ? false
, enableMultiThreaded ? true , enableMultiThreaded ? true
, enableShared ? !(hostPlatform.libc == "msvcrt") # problems for now , enableShared ? !(stdenv.hostPlatform.libc == "msvcrt") # problems for now
, enableStatic ? !enableShared , enableStatic ? !enableShared
, enablePython ? false , enablePython ? false
, enableNumpy ? false , enableNumpy ? false
@ -24,7 +24,7 @@
assert enableShared || enableStatic; assert enableShared || enableStatic;
# Python isn't supported when cross-compiling # Python isn't supported when cross-compiling
assert enablePython -> hostPlatform == buildPlatform; assert enablePython -> stdenv.hostPlatform == stdenv.buildPlatform;
assert enableNumpy -> enablePython; assert enableNumpy -> enablePython;
with stdenv.lib; with stdenv.lib;
@ -59,23 +59,23 @@ let
"-sEXPAT_LIBPATH=${expat.out}/lib" "-sEXPAT_LIBPATH=${expat.out}/lib"
# TODO: make this unconditional # TODO: make this unconditional
] ++ optionals (hostPlatform != buildPlatform) [ ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"address-model=${toString hostPlatform.parsed.cpu.bits}" "address-model=${toString stdenv.hostPlatform.parsed.cpu.bits}"
"architecture=${toString hostPlatform.parsed.cpu.family}" "architecture=${toString stdenv.hostPlatform.parsed.cpu.family}"
"binary-format=${toString hostPlatform.parsed.kernel.execFormat.name}" "binary-format=${toString stdenv.hostPlatform.parsed.kernel.execFormat.name}"
"target-os=${toString hostPlatform.parsed.kernel.name}" "target-os=${toString stdenv.hostPlatform.parsed.kernel.name}"
# adapted from table in boost manual # adapted from table in boost manual
# https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html # https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html
"abi=${if hostPlatform.parsed.cpu.family == "arm" then "aapcs" "abi=${if stdenv.hostPlatform.parsed.cpu.family == "arm" then "aapcs"
else if hostPlatform.isWindows then "ms" else if stdenv.hostPlatform.isWindows then "ms"
else if hostPlatform.isMips then "o32" else if stdenv.hostPlatform.isMips then "o32"
else "sysv"}" else "sysv"}"
] ++ optional (link != "static") "runtime-link=${runtime-link}" ] ++ optional (link != "static") "runtime-link=${runtime-link}"
++ optional (variant == "release") "debug-symbols=off" ++ optional (variant == "release") "debug-symbols=off"
++ optional (toolset != null) "toolset=${toolset}" ++ optional (toolset != null) "toolset=${toolset}"
++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam" ++ optional (mpi != null || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
++ optionals (hostPlatform.libc == "msvcrt") [ ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [
"threadapi=win32" "threadapi=win32"
]); ]);
@ -86,10 +86,10 @@ stdenv.mkDerivation {
inherit src; inherit src;
patchFlags = optionalString (hostPlatform.libc == "msvcrt") "-p0"; patchFlags = optionalString (stdenv.hostPlatform.libc == "msvcrt") "-p0";
patches = patches patches = patches
++ optional stdenv.isDarwin ./darwin-no-system-python.patch ++ optional stdenv.isDarwin ./darwin-no-system-python.patch
++ optional (hostPlatform.libc == "msvcrt") (fetchurl { ++ optional (stdenv.hostPlatform.libc == "msvcrt") (fetchurl {
url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/" url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/"
+ "boost-mingw.patch"; + "boost-mingw.patch";
sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj"; sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
@ -113,7 +113,7 @@ stdenv.mkDerivation {
cat << EOF >> user-config.jam cat << EOF >> user-config.jam
using mpi : ${mpi}/bin/mpiCC ; using mpi : ${mpi}/bin/mpiCC ;
EOF EOF
'' + optionalString (hostPlatform != buildPlatform) '' '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
cat << EOF >> user-config.jam cat << EOF >> user-config.jam
using gcc : cross : ${stdenv.cc.targetPrefix}c++ ; using gcc : cross : ${stdenv.cc.targetPrefix}c++ ;
EOF EOF
@ -126,7 +126,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ which buildPackages.stdenv.cc ]; nativeBuildInputs = [ which buildPackages.stdenv.cc ];
buildInputs = [ expat zlib bzip2 libiconv ] buildInputs = [ expat zlib bzip2 libiconv ]
++ optional (hostPlatform == buildPlatform) icu ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu
++ optional stdenv.isDarwin fixDarwinDylibNames ++ optional stdenv.isDarwin fixDarwinDylibNames
++ optional enablePython python ++ optional enablePython python
++ optional enableNumpy python.pkgs.numpy; ++ optional enableNumpy python.pkgs.numpy;
@ -137,7 +137,7 @@ stdenv.mkDerivation {
"--includedir=$(dev)/include" "--includedir=$(dev)/include"
"--libdir=$(out)/lib" "--libdir=$(out)/lib"
] ++ optional enablePython "--with-python=${python.interpreter}" ] ++ optional enablePython "--with-python=${python.interpreter}"
++ [ (if hostPlatform == buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ] ++ [ (if stdenv.hostPlatform == stdenv.buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ]
++ optional (toolset != null) "--with-toolset=${toolset}"; ++ optional (toolset != null) "--with-toolset=${toolset}";
buildPhase = '' buildPhase = ''
@ -157,7 +157,7 @@ stdenv.mkDerivation {
# Make boost header paths relative so that they are not runtime dependencies # Make boost header paths relative so that they are not runtime dependencies
cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \ cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-exec sed '1i#line 1 "{}"' -i '{}' \; -exec sed '1i#line 1 "{}"' -i '{}' \;
'' + optionalString (hostPlatform.libc == "msvcrt") '' '' + optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
$RANLIB "$out/lib/"*.a $RANLIB "$out/lib/"*.a
''; '';

View File

@ -1,4 +1,4 @@
{ targetPlatform, stdenv, fetchurl, writeTextDir }: { stdenv, fetchurl, writeTextDir }:
let self = let self =
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -40,8 +40,8 @@ stdenv.mkDerivation rec {
) )
set_property(TARGET c-ares::cares APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_property(TARGET c-ares::cares APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(c-ares::cares PROPERTIES set_target_properties(c-ares::cares PROPERTIES
IMPORTED_LOCATION_RELEASE "${self}/lib/libcares${targetPlatform.extensions.sharedLibrary}" IMPORTED_LOCATION_RELEASE "${self}/lib/libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
IMPORTED_SONAME_RELEASE "libcares${targetPlatform.extensions.sharedLibrary}" IMPORTED_SONAME_RELEASE "libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
) )
add_library(c-ares::cares_shared INTERFACE IMPORTED) add_library(c-ares::cares_shared INTERFACE IMPORTED)
set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares") set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm { stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
, hostPlatform
/* /*
* Licensing options (yes some are listed twice, filters and such are not listed) * Licensing options (yes some are listed twice, filters and such are not listed)
*/ */
@ -253,8 +252,8 @@ stdenv.mkDerivation rec {
configurePlatforms = []; configurePlatforms = [];
configureFlags = [ configureFlags = [
"--target_os=${hostPlatform.parsed.kernel.name}" "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.parsed.cpu.name}" "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
/* /*
* Licensing flags * Licensing flags
*/ */

View File

@ -2,7 +2,6 @@
, alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
, libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr , libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr
, x264, x265, xvidcore, zlib, libopus , x264, x265, xvidcore, zlib, libopus
, hostPlatform
, openglSupport ? false, libGLU_combined ? null , openglSupport ? false, libGLU_combined ? null
# Build options # Build options
, runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime , runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime
@ -83,8 +82,8 @@ stdenv.mkDerivation rec {
configurePlatforms = []; configurePlatforms = [];
configureFlags = [ configureFlags = [
"--arch=${hostPlatform.parsed.cpu.name}" "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}" "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
# License # License
"--enable-gpl" "--enable-gpl"
"--enable-version3" "--enable-version3"

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, pkgconfig, freetype, expat { stdenv, fetchurl, pkgconfig, freetype, expat
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -17,13 +16,13 @@ stdenv.mkDerivation rec {
buildInputs = [ expat ]; buildInputs = [ expat ];
configureFlags = [ configureFlags = [
"--with-arch=${hostPlatform.parsed.cpu.name}" "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--with-cache-dir=/var/cache/fontconfig" "--with-cache-dir=/var/cache/fontconfig"
"--disable-docs" "--disable-docs"
"--with-default-fonts=" "--with-default-fonts="
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--with-arch=${hostPlatform.parsed.cpu.name}" "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,6 +1,5 @@
{ stdenv, substituteAll, fetchurl { stdenv, substituteAll, fetchurl
, pkgconfig, freetype, expat, libxslt, gperf, dejavu_fonts , pkgconfig, freetype, expat, libxslt, gperf, dejavu_fonts
, hostPlatform
}: }:
/** Font configuration scheme /** Font configuration scheme
@ -40,13 +39,13 @@ stdenv.mkDerivation rec {
buildInputs = [ expat ]; buildInputs = [ expat ];
configureFlags = [ configureFlags = [
"--with-arch=${hostPlatform.parsed.cpu.name}" "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/ "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
"--disable-docs" "--disable-docs"
# just <1MB; this is what you get when loading config fails for some reason # just <1MB; this is what you get when loading config fails for some reason
"--with-default-fonts=${dejavu_fonts.minimal}" "--with-default-fonts=${dejavu_fonts.minimal}"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--with-arch=${hostPlatform.parsed.cpu.name}" "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,4 +1,4 @@
{ stdenvNoLibs, buildPackages, buildPlatform, hostPlatform { stdenvNoLibs, buildPackages
, gcc, glibc , gcc, glibc
, libiberty , libiberty
}: }:
@ -29,8 +29,8 @@ stdenvNoLibs.mkDerivation rec {
# Drop in libiberty, as external builds are not expected # Drop in libiberty, as external builds are not expected
+ '' + ''
( (
mkdir -p build-${buildPlatform.config}/libiberty/ mkdir -p build-${stdenvNoLibs.buildPlatform.config}/libiberty/
cd build-${buildPlatform.config}/libiberty/ cd build-${stdenvNoLibs.buildPlatform.config}/libiberty/
ln -s ${buildPackages.libiberty}/lib/libiberty.a ./ ln -s ${buildPackages.libiberty}/lib/libiberty.a ./
) )
'' ''
@ -83,8 +83,8 @@ stdenvNoLibs.mkDerivation rec {
'' ''
# Preparing to configure + build libgcc itself # Preparing to configure + build libgcc itself
+ '' + ''
mkdir -p "$buildRoot/gcc/${hostPlatform.config}/libgcc" mkdir -p "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
cd "$buildRoot/gcc/${hostPlatform.config}/libgcc" cd "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
configureScript=$sourceRoot/configure configureScript=$sourceRoot/configure
chmod +x "$configureScript" chmod +x "$configureScript"
@ -107,9 +107,9 @@ stdenvNoLibs.mkDerivation rec {
''; '';
gccConfigureFlags = [ gccConfigureFlags = [
"--build=${buildPlatform.config}" "--build=${stdenvNoLibs.buildPlatform.config}"
"--host=${buildPlatform.config}" "--host=${stdenvNoLibs.buildPlatform.config}"
"--target=${hostPlatform.config}" "--target=${stdenvNoLibs.hostPlatform.config}"
"--disable-bootstrap" "--disable-bootstrap"
"--disable-multilib" "--with-multilib-list=" "--disable-multilib" "--with-multilib-list="
@ -128,7 +128,7 @@ stdenvNoLibs.mkDerivation rec {
"--disable-vtable-verify" "--disable-vtable-verify"
"--with-system-zlib" "--with-system-zlib"
] ++ stdenvNoLibs.lib.optional (hostPlatform.libc == "glibc") ] ++ stdenvNoLibs.lib.optional (stdenvNoLibs.hostPlatform.libc == "glibc")
"--with-glibc-version=${glibc.version}"; "--with-glibc-version=${glibc.version}";
configurePlatforms = [ "build" "host" ]; configurePlatforms = [ "build" "host" ];
@ -144,9 +144,9 @@ stdenvNoLibs.mkDerivation rec {
makeFlags = [ "MULTIBUILDTOP:=../" ]; makeFlags = [ "MULTIBUILDTOP:=../" ];
postInstall = '' postInstall = ''
moveToOutput "lib/gcc/${hostPlatform.config}/${version}/include" "$dev" moveToOutput "lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}/include" "$dev"
mkdir -p "$out/lib" "$dev/include" mkdir -p "$out/lib" "$dev/include"
ln -s "$out/lib/gcc/${hostPlatform.config}/${version}"/* "$out/lib" ln -s "$out/lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}"/* "$out/lib"
ln -s "$dev/lib/gcc/${hostPlatform.config}/${version}/include"/* "$dev/include/" ln -s "$dev/lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}/include"/* "$dev/include/"
''; '';
} }

View File

@ -1,4 +1,4 @@
{ stdenv, lib, buildPlatform, fetchurl }: { stdenv, lib, fetchurl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gdbm-1.17"; name = "gdbm-1.17";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
# Disable dbmfetch03.at test because it depends on unlink() # Disable dbmfetch03.at test because it depends on unlink()
# failing on a link in a chmod -w directory, which cygwin # failing on a link in a chmod -w directory, which cygwin
# apparently allows. # apparently allows.
postPatch = lib.optionalString buildPlatform.isCygwin '' postPatch = lib.optionalString stdenv.buildPlatform.isCygwin ''
substituteInPlace tests/Makefile.in --replace \ substituteInPlace tests/Makefile.in --replace \
'_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \ '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
'_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la' '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'

View File

@ -1,4 +1,4 @@
{ stdenv, lib, hostPlatform, fetchurl, libiconv, xz }: { stdenv, lib, fetchurl, libiconv, xz }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gettext-${version}"; name = "gettext-${version}";
@ -35,20 +35,20 @@ stdenv.mkDerivation rec {
substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
'' + lib.optionalString hostPlatform.isCygwin '' '' + lib.optionalString stdenv.hostPlatform.isCygwin ''
sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
''; '';
nativeBuildInputs = [ xz xz.bin ]; nativeBuildInputs = [ xz xz.bin ];
# HACK, see #10874 (and 14664) # HACK, see #10874 (and 14664)
buildInputs = stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv; buildInputs = stdenv.lib.optional (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) libiconv;
setupHooks = [ setupHooks = [
../../../build-support/setup-hooks/role.bash ../../../build-support/setup-hooks/role.bash
./gettext-setup-hook.sh ./gettext-setup-hook.sh
]; ];
gettextNeedsLdflags = hostPlatform.libc != "glibc" && !hostPlatform.isMusl; gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl;
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi { stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
, buildPlatform, hostPlatform
, AGL ? null , AGL ? null
}: }:
@ -19,7 +18,7 @@ stdenv.mkDerivation rec {
patchPhase = '' patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux sed -i 's|lib64|lib|' config/Makefile.linux
${optionalString (hostPlatform != buildPlatform) '' ${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
''} ''}
''; '';
@ -39,7 +38,7 @@ stdenv.mkDerivation rec {
''; '';
makeFlags = [ makeFlags = [
"SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}" "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
]; ];
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi { stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
, buildPlatform, hostPlatform
}: }:
with stdenv.lib; with stdenv.lib;
@ -20,7 +19,7 @@ stdenv.mkDerivation rec {
patchPhase = '' patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux sed -i 's|lib64|lib|' config/Makefile.linux
substituteInPlace config/Makefile.darwin --replace /usr/local "$out" substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
${optionalString (hostPlatform != buildPlatform) '' ${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
''} ''}
''; '';
@ -41,7 +40,7 @@ stdenv.mkDerivation rec {
''; '';
makeFlags = [ makeFlags = [
"SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}" "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -18,7 +18,6 @@
*/ */
{ stdenv, lib { stdenv, lib
, buildPlatform, hostPlatform
, buildPackages , buildPackages
, fetchurl ? null , fetchurl ? null
, linuxHeaders ? null , linuxHeaders ? null
@ -119,12 +118,12 @@ stdenv.mkDerivation ({
else "--disable-profile") else "--disable-profile")
] ++ lib.optionals withLinuxHeaders [ ] ++ lib.optionals withLinuxHeaders [
"--enable-kernel=3.2.0" # can't get below with glibc >= 2.26 "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
] ++ lib.optionals (hostPlatform != buildPlatform) [ ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
(if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft" (if stdenv.hostPlatform.platform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"
then "--without-fp" then "--without-fp"
else "--with-fp") else "--with-fp")
"--with-__thread" "--with-__thread"
] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [ ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
"--host=arm-linux-gnueabi" "--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi" "--build=arm-linux-gnueabi"
@ -176,7 +175,7 @@ stdenv.mkDerivation ({
} }
'' + lib.optionalString (hostPlatform != buildPlatform) '' '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig" sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
cat > config.cache << "EOF" cat > config.cache << "EOF"
@ -210,7 +209,7 @@ stdenv.mkDerivation ({
} // meta; } // meta;
} }
// lib.optionalAttrs (hostPlatform != buildPlatform) { // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
preInstall = null; # clobber the native hook preInstall = null; # clobber the native hook
dontStrip = true; dontStrip = true;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, m4, cxx ? !hostPlatform.useAndroidPrebuilt { stdenv, fetchurl, m4, cxx ? !stdenv.hostPlatform.useAndroidPrebuilt
, buildPackages, hostPlatform , buildPackages
, withStatic ? false }: , withStatic ? false }:
let inherit (stdenv.lib) optional optionalString; in let inherit (stdenv.lib) optional optionalString; in

View File

@ -1,7 +1,7 @@
{ version, sha256, patches ? [], patchFlags ? "" }: { version, sha256, patches ? [], patchFlags ? "" }:
{ stdenv, fetchurl, fixDarwinDylibNames { stdenv, fetchurl, fixDarwinDylibNames
# Cross-compiled icu4c requires a build-root of a native compile # Cross-compiled icu4c requires a build-root of a native compile
, buildRootOnly ? false, nativeBuildRoot, buildPlatform, hostPlatform , buildRootOnly ? false, nativeBuildRoot
}: }:
let let
@ -38,7 +38,7 @@ let
configureFlags = [ "--disable-debug" ] configureFlags = [ "--disable-debug" ]
++ stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath" ++ stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"
++ stdenv.lib.optional (buildPlatform != hostPlatform) "--with-cross-build=${nativeBuildRoot}"; ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}";
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -13,7 +13,6 @@
, SDL # only for avplay in $bin, adds nontrivial closure to it , SDL # only for avplay in $bin, adds nontrivial closure to it
, enableGPL ? true # ToDo: some additional default stuff may need GPL , enableGPL ? true # ToDo: some additional default stuff may need GPL
, enableUnfree ? faacSupport , enableUnfree ? faacSupport
, hostPlatform
}: }:
assert faacSupport -> enableUnfree; assert faacSupport -> enableUnfree;
@ -53,8 +52,8 @@ let
configurePlatforms = []; configurePlatforms = [];
configureFlags = assert stdenv.lib.all (x: x!=null) buildInputs; [ configureFlags = assert stdenv.lib.all (x: x!=null) buildInputs; [
"--arch=${hostPlatform.parsed.cpu.name}" "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}" "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
#"--enable-postproc" # it's now a separate package in upstream #"--enable-postproc" # it's now a separate package in upstream
"--disable-avserver" # upstream says it's in a bad state "--disable-avserver" # upstream says it's in a bad state
"--enable-avplay" "--enable-avplay"

View File

@ -1,4 +1,4 @@
{ stdenv, hostPlatform, fetchurl, autoconf, automake, libtool }: { stdenv, fetchurl, autoconf, automake, libtool }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libb2-${version}"; name = "libb2-${version}";
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
./autogen.sh ./autogen.sh
''; '';
configureFlags = stdenv.lib.optional hostPlatform.isx86 "--enable-fat=yes"; configureFlags = stdenv.lib.optional stdenv.hostPlatform.isx86 "--enable-fat=yes";
nativeBuildInputs = [ autoconf automake libtool ]; nativeBuildInputs = [ autoconf automake libtool ];

View File

@ -1,6 +1,5 @@
{ stdenv { stdenv
, fetchurl, autoreconfHook, gettext , fetchurl, autoreconfHook, gettext
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -20,17 +19,17 @@ stdenv.mkDerivation rec {
configureFlags = [] configureFlags = []
# Configure check for dynamic lib support is broken, see # Configure check for dynamic lib support is broken, see
# http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
++ stdenv.lib.optional (hostPlatform != buildPlatform) "mr_cv_target_elf=yes" ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
# Libelf's custom NLS macros fail to determine the catalog file extension # Libelf's custom NLS macros fail to determine the catalog file extension
# on Darwin, so disable NLS for now. # on Darwin, so disable NLS for now.
++ stdenv.lib.optional hostPlatform.isDarwin "--disable-nls"; ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
nativeBuildInputs = [ gettext ] nativeBuildInputs = [ gettext ]
# Need to regenerate configure script with newer version in order to pass # Need to regenerate configure script with newer version in order to pass
# "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper` # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
# which doesn't work with the bootstrapTools bash, so can only do this # which doesn't work with the bootstrapTools bash, so can only do this
# for cross builds when `stdenv.shell` is a newer bash. # for cross builds when `stdenv.shell` is a newer bash.
++ stdenv.lib.optional (hostPlatform != buildPlatform) autoreconfHook; ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
meta = { meta = {
description = "ELF object file access library"; description = "ELF object file access library";

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch { stdenv, fetchurl, fetchpatch
, buildPlatform, hostPlatform, autoreconfHook , autoreconfHook
# libffi is used in darwin stdenv # libffi is used in darwin stdenv
# we cannot run checks within it # we cannot run checks within it
@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch; url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch;
sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc"; sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc";
}) })
++ stdenv.lib.optional hostPlatform.isMusl (fetchpatch { ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
name = "gnu-linux-define.patch"; name = "gnu-linux-define.patch";
url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580"; url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580";
sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2"; sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2";
}) })
++ stdenv.lib.optional hostPlatform.isRiscV (fetchpatch { ++ stdenv.lib.optional stdenv.hostPlatform.isRiscV (fetchpatch {
name = "riscv-support.patch"; name = "riscv-support.patch";
url = https://github.com/sorear/libffi-riscv/commit/e46492e8bb1695a19bc1053ed869e6c2bab02ff2.patch; url = https://github.com/sorear/libffi-riscv/commit/e46492e8bb1695a19bc1053ed869e6c2bab02ff2.patch;
sha256 = "1vl1vbvdkigs617kckxvj8j4m2cwg62kxm1clav1w5rnw9afxg0y"; sha256 = "1vl1vbvdkigs617kckxvj8j4m2cwg62kxm1clav1w5rnw9afxg0y";
@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "man" "info" ]; outputs = [ "out" "dev" "man" "info" ];
nativeBuildInputs = stdenv.lib.optional hostPlatform.isRiscV autoreconfHook; nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isRiscV autoreconfHook;
configureFlags = [ configureFlags = [
"--with-gcc-arch=generic" # no detection of -march= or -mtune= "--with-gcc-arch=generic" # no detection of -march= or -mtune=
@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
inherit doCheck; inherit doCheck;
dontStrip = hostPlatform != buildPlatform; # Don't run the native `strip' when cross-compiling. dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
# Install headers and libs in the right places. # Install headers and libs in the right places.
postFixup = '' postFixup = ''

View File

@ -1,10 +1,9 @@
{ fetchurl, stdenv, lib { fetchurl, stdenv, lib
, buildPlatform, hostPlatform
, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt , enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt
, enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt , enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt
}: }:
# assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross # assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libiconv-${version}"; name = "libiconv-${version}";
@ -21,7 +20,7 @@ stdenv.mkDerivation rec {
]; ];
postPatch = postPatch =
lib.optionalString ((hostPlatform != buildPlatform && hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc) lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
'' ''
sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
'' ''

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, nasm { stdenv, fetchurl, nasm
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -12,7 +11,7 @@ stdenv.mkDerivation rec {
}; # github releases still need autotools, surprisingly }; # github releases still need autotools, surprisingly
patches = patches =
stdenv.lib.optional (hostPlatform.libc or null == "msvcrt") stdenv.lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
./mingw-boolean.patch; ./mingw-boolean.patch;
outputs = [ "bin" "dev" "out" "man" "doc" ]; outputs = [ "bin" "dev" "out" "man" "doc" ];

View File

@ -1,8 +1,6 @@
{ stdenv, fetchurl, zlib { stdenv, fetchurl, zlib }:
, buildPlatform, hostPlatform
}:
assert hostPlatform == buildPlatform -> zlib != null; assert stdenv.hostPlatform == stdenv.buildPlatform -> zlib != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libpng-1.2.57"; name = "libpng-1.2.57";

View File

@ -1,6 +1,4 @@
{ stdenv, fetchurlBoot, openssl, zlib, windows { stdenv, fetchurlBoot, openssl, zlib, windows }:
, hostPlatform
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libssh2-1.8.0"; name = "libssh2-1.8.0";
@ -13,7 +11,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
buildInputs = [ openssl zlib ] buildInputs = [ openssl zlib ]
++ stdenv.lib.optional hostPlatform.isMinGW windows.mingw_w64; ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
meta = { meta = {
description = "A client-side C library implementing the SSH2 protocol"; description = "A client-side C library implementing the SSH2 protocol";

View File

@ -1,5 +1,4 @@
{ stdenv, fetchFromGitHub, perl, yasm { stdenv, fetchFromGitHub, perl, yasm
, hostPlatform
, vp8DecoderSupport ? true # VP8 decoder , vp8DecoderSupport ? true # VP8 decoder
, vp8EncoderSupport ? true # VP8 encoder , vp8EncoderSupport ? true # VP8 encoder
, vp9DecoderSupport ? true # VP9 decoder , vp9DecoderSupport ? true # VP9 decoder
@ -141,17 +140,17 @@ stdenv.mkDerivation rec {
# libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
# See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
# Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
"--force-target=${hostPlatform.config}${ "--force-target=${stdenv.hostPlatform.config}${
if hostPlatform.isDarwin then if stdenv.hostPlatform.isDarwin then
if hostPlatform.osxMinVersion == "10.10" then "14" if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
else if hostPlatform.osxMinVersion == "10.9" then "13" else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"
else if hostPlatform.osxMinVersion == "10.8" then "12" else if stdenv.hostPlatform.osxMinVersion == "10.8" then "12"
else if hostPlatform.osxMinVersion == "10.7" then "11" else if stdenv.hostPlatform.osxMinVersion == "10.7" then "11"
else if hostPlatform.osxMinVersion == "10.6" then "10" else if stdenv.hostPlatform.osxMinVersion == "10.6" then "10"
else if hostPlatform.osxMinVersion == "10.5" then "9" else if stdenv.hostPlatform.osxMinVersion == "10.5" then "9"
else "8" else "8"
else ""}-gcc" else ""}-gcc"
(if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") (if stdenv.hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
] # Experimental features ] # Experimental features
++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc"
++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats"

View File

@ -1,5 +1,4 @@
{ stdenv, fetchgit, perl, yasm { stdenv, fetchgit, perl, yasm
, hostPlatform
, vp8DecoderSupport ? true # VP8 decoder , vp8DecoderSupport ? true # VP8 decoder
, vp8EncoderSupport ? true # VP8 encoder , vp8EncoderSupport ? true # VP8 encoder
, vp9DecoderSupport ? true # VP9 decoder , vp9DecoderSupport ? true # VP9 decoder
@ -148,17 +147,17 @@ stdenv.mkDerivation rec {
# libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
# See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
# Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
"--force-target=${hostPlatform.config}${ "--force-target=${stdenv.hostPlatform.config}${
if hostPlatform.isDarwin then if stdenv.hostPlatform.isDarwin then
if hostPlatform.osxMinVersion == "10.10" then "14" if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
else if hostPlatform.osxMinVersion == "10.9" then "13" else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"
else if hostPlatform.osxMinVersion == "10.8" then "12" else if stdenv.hostPlatform.osxMinVersion == "10.8" then "12"
else if hostPlatform.osxMinVersion == "10.7" then "11" else if stdenv.hostPlatform.osxMinVersion == "10.7" then "11"
else if hostPlatform.osxMinVersion == "10.6" then "10" else if stdenv.hostPlatform.osxMinVersion == "10.6" then "10"
else if hostPlatform.osxMinVersion == "10.5" then "9" else if stdenv.hostPlatform.osxMinVersion == "10.5" then "9"
else "8" else "8"
else ""}-gcc" else ""}-gcc"
(if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") (if stdenv.hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
] # Experimental features ] # Experimental features
++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc"
++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats"

View File

@ -1,9 +1,8 @@
{ stdenv, lib, fetchurl, fetchpatch { stdenv, lib, fetchurl, fetchpatch
, zlib, xz, python2, findXMLCatalogs , zlib, xz, python2, findXMLCatalogs
, buildPlatform, hostPlatform , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
, pythonSupport ? buildPlatform == hostPlatform
, icuSupport ? false, icu ? null , icuSupport ? false, icu ? null
, enableShared ? hostPlatform.libc != "msvcrt" , enableShared ? stdenv.hostPlatform.libc != "msvcrt"
, enableStatic ? !enableShared, , enableStatic ? !enableShared,
}: }:
@ -56,7 +55,7 @@ in stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin && doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin &&
hostPlatform.libc != "musl"; stdenv.hostPlatform.libc != "musl";
preInstall = lib.optionalString pythonSupport preInstall = lib.optionalString pythonSupport
''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"''; ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';

View File

@ -1,7 +1,6 @@
{ stdenv, fetchurl, libxml2, findXMLCatalogs, python2 { stdenv, fetchurl, libxml2, findXMLCatalogs, python2
, buildPlatform, hostPlatform
, cryptoSupport ? false , cryptoSupport ? false
, pythonSupport ? buildPlatform == hostPlatform , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
}: }:
assert pythonSupport -> python2 != null; assert pythonSupport -> python2 != null;
@ -22,7 +21,7 @@ stdenv.mkDerivation rec {
patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch; patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch;
# fixes: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified # fixes: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
postPatch = optionalString hostPlatform.isCygwin '' postPatch = optionalString stdenv.hostPlatform.isCygwin ''
substituteInPlace tests/plugins/Makefile.in \ substituteInPlace tests/plugins/Makefile.in \
--replace 'la_LDFLAGS =' 'la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS)' --replace 'la_LDFLAGS =' 'la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS)'
''; '';

View File

@ -1,9 +1,8 @@
{ stdenv, fetchgit, cmake { stdenv, fetchgit, cmake
, hostPlatform, buildPlatform
}: }:
let let
nativeBuild = hostPlatform == buildPlatform; nativeBuild = stdenv.hostPlatform == stdenv.buildPlatform;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "microsoft_gsl-${version}"; name = "microsoft_gsl-${version}";

View File

@ -1,6 +1,4 @@
{ stdenv, fetchurl, gmp { stdenv, fetchurl, gmp }:
, hostPlatform
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "4.0.1"; version = "4.0.1";
@ -17,8 +15,8 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ gmp ]; propagatedBuildInputs = [ gmp ];
configureFlags = configureFlags =
stdenv.lib.optional hostPlatform.isSunOS "--disable-thread-safe" ++ stdenv.lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" ++
stdenv.lib.optional hostPlatform.is64bit "--with-pic"; stdenv.lib.optional stdenv.hostPlatform.is64bit "--with-pic";
doCheck = true; # not cross; doCheck = true; # not cross;

View File

@ -1,6 +1,5 @@
{ stdenv, cmake { stdenv, cmake
, version, src, patches ? [ ] , version, src, patches ? [ ]
, hostPlatform
, ... , ...
}: }:
@ -16,7 +15,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [] cmakeFlags = []
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"-DMSGPACK_BUILD_EXAMPLES=OFF" "-DMSGPACK_BUILD_EXAMPLES=OFF"
++ stdenv.lib.optional (hostPlatform.libc == "msvcrt") ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "msvcrt")
"-DCMAKE_SYSTEM_NAME=Windows" "-DCMAKE_SYSTEM_NAME=Windows"
; ;

View File

@ -8,7 +8,6 @@
, gpm , gpm
, buildPlatform, hostPlatform
, buildPackages , buildPackages
}: }:
@ -36,7 +35,7 @@ stdenv.mkDerivation rec {
] ++ lib.optional unicode "--enable-widec" ] ++ lib.optional unicode "--enable-widec"
++ lib.optional (!withCxx) "--without-cxx" ++ lib.optional (!withCxx) "--without-cxx"
++ lib.optional (abiVersion == "5") "--with-abi-version=5" ++ lib.optional (abiVersion == "5") "--with-abi-version=5"
++ lib.optionals hostPlatform.isWindows [ ++ lib.optionals stdenv.hostPlatform.isWindows [
"--enable-sp-funcs" "--enable-sp-funcs"
"--enable-term-driver" "--enable-term-driver"
]; ];
@ -47,7 +46,7 @@ stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig pkgconfig
] ++ lib.optionals (buildPlatform != hostPlatform) [ ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.ncurses buildPackages.ncurses
]; ];
buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm; buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
@ -137,7 +136,7 @@ stdenv.mkDerivation rec {
moveToOutput "bin/infotocap" "$out" moveToOutput "bin/infotocap" "$out"
''; '';
preFixup = lib.optionalString (!hostPlatform.isCygwin && !enableStatic) '' preFixup = lib.optionalString (!stdenv.hostPlatform.isCygwin && !enableStatic) ''
rm "$out"/lib/*.a rm "$out"/lib/*.a
''; '';

View File

@ -1,5 +1,4 @@
{ stdenv, fetchFromGitHub, cmake { stdenv, fetchFromGitHub, cmake
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -19,7 +18,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [ cmakeFlags = [
"-DBuildTests=${if doCheck then "ON" else "OFF"}" "-DBuildTests=${if doCheck then "ON" else "OFF"}"
] ++ stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
"-DCMAKE_SYSTEM_NAME=Windows" "-DCMAKE_SYSTEM_NAME=Windows"
]; ];

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, buildPackages, perl { stdenv, fetchurl, buildPackages, perl
, buildPlatform, hostPlatform
, withCryptodev ? false, cryptodevHeaders , withCryptodev ? false, cryptodevHeaders
, enableSSL2 ? false , enableSSL2 ? false
, static ? false , static ? false
@ -20,8 +19,8 @@ let
(args.patches or []) (args.patches or [])
++ [ ./nix-ssl-cert-file.patch ] ++ [ ./nix-ssl-cert-file.patch ]
++ optional (versionOlder version "1.1.0") ++ optional (versionOlder version "1.1.0")
(if hostPlatform.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch) (if stdenv.hostPlatform.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin) ++ optional (versionOlder version "1.0.2" && stdenv.hostPlatform.isDarwin)
./darwin-arch.patch; ./darwin-arch.patch;
postPatch = '' postPatch = ''
@ -40,7 +39,7 @@ let
outputs = [ "bin" "dev" "out" "man" ]; outputs = [ "bin" "dev" "out" "man" ];
setOutputFlags = false; setOutputFlags = false;
separateDebugInfo = hostPlatform.isLinux; separateDebugInfo = stdenv.hostPlatform.isLinux;
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];
buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders; buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders;
@ -50,19 +49,19 @@ let
configureScript = { configureScript = {
"x86_64-darwin" = "./Configure darwin64-x86_64-cc"; "x86_64-darwin" = "./Configure darwin64-x86_64-cc";
"x86_64-solaris" = "./Configure solaris64-x86_64-gcc"; "x86_64-solaris" = "./Configure solaris64-x86_64-gcc";
}.${hostPlatform.system} or ( }.${stdenv.hostPlatform.system} or (
if hostPlatform == buildPlatform if stdenv.hostPlatform == stdenv.buildPlatform
then "./config" then "./config"
else if hostPlatform.isMinGW else if stdenv.hostPlatform.isMinGW
then "./Configure mingw${optionalString then "./Configure mingw${optionalString
(hostPlatform.parsed.cpu.bits != 32) (stdenv.hostPlatform.parsed.cpu.bits != 32)
(toString hostPlatform.parsed.cpu.bits)}" (toString stdenv.hostPlatform.parsed.cpu.bits)}"
else if hostPlatform.isLinux else if stdenv.hostPlatform.isLinux
then "./Configure linux-generic${toString hostPlatform.parsed.cpu.bits}" then "./Configure linux-generic${toString stdenv.hostPlatform.parsed.cpu.bits}"
else if hostPlatform.isiOS else if stdenv.hostPlatform.isiOS
then "./Configure ios${toString hostPlatform.parsed.cpu.bits}-cross" then "./Configure ios${toString stdenv.hostPlatform.parsed.cpu.bits}-cross"
else else
throw "Not sure what configuration to use for ${hostPlatform.config}" throw "Not sure what configuration to use for ${stdenv.hostPlatform.config}"
); );
configureFlags = [ configureFlags = [
@ -73,7 +72,7 @@ let
"-DHAVE_CRYPTODEV" "-DHAVE_CRYPTODEV"
"-DUSE_CRYPTODEV_DIGESTS" "-DUSE_CRYPTODEV_DIGESTS"
] ++ stdenv.lib.optional enableSSL2 "enable-ssl2" ] ++ stdenv.lib.optional enableSSL2 "enable-ssl2"
++ stdenv.lib.optional (versionAtLeast version "1.1.0" && hostPlatform.isAarch64) "no-afalgeng"; ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng";
makeFlags = [ "MANDIR=$(man)/share/man" ]; makeFlags = [ "MANDIR=$(man)/share/man" ];

View File

@ -1,6 +1,5 @@
{ stdenv, fetchurl { stdenv, fetchurl
, pcre, windows ? null , pcre, windows ? null
, buildPlatform, hostPlatform
, variant ? null , variant ? null
}: }:
@ -24,13 +23,13 @@ in stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" "doc" "man" ]; outputs = [ "bin" "dev" "out" "doc" "man" ];
configureFlags = optional (!hostPlatform.isRiscV) "--enable-jit" ++ [ configureFlags = optional (!stdenv.hostPlatform.isRiscV) "--enable-jit" ++ [
"--enable-unicode-properties" "--enable-unicode-properties"
"--disable-cpp" "--disable-cpp"
] ]
++ optional (variant != null) "--enable-${variant}"; ++ optional (variant != null) "--enable-${variant}";
buildInputs = optional (hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads; buildInputs = optional (stdenv.hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads;
# https://bugs.exim.org/show_bug.cgi?id=2173 # https://bugs.exim.org/show_bug.cgi?id=2173
patches = [ ./stacksize-detection.patch ]; patches = [ ./stacksize-detection.patch ];
@ -39,7 +38,7 @@ in stdenv.mkDerivation rec {
patchShebangs RunGrepTest patchShebangs RunGrepTest
''; '';
doCheck = !(with hostPlatform; isCygwin || isFreeBSD) && hostPlatform == buildPlatform; doCheck = !(with stdenv.hostPlatform; isCygwin || isFreeBSD) && stdenv.hostPlatform == stdenv.buildPlatform;
# XXX: test failure on Cygwin # XXX: test failure on Cygwin
# we are running out of stack on both freeBSDs on Hydra # we are running out of stack on both freeBSDs on Hydra

View File

@ -1,5 +1,4 @@
{ fetchurl, stdenv, ncurses { fetchurl, stdenv, ncurses
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
@ -59,6 +58,6 @@ stdenv.mkDerivation (rec {
// //
# Don't run the native `strip' when cross-compiling. # Don't run the native `strip' when cross-compiling.
(if hostPlatform != buildPlatform (if stdenv.hostPlatform != stdenv.buildPlatform
then { dontStrip = true; } then { dontStrip = true; }
else { })) else { }))

View File

@ -1,6 +1,4 @@
{ fetchurl, stdenv, ncurses { fetchurl, stdenv, ncurses }:
, buildPlatform, hostPlatform
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "readline-6.3p08"; name = "readline-6.3p08";
@ -37,7 +35,7 @@ stdenv.mkDerivation rec {
import ./readline-6.3-patches.nix patch); import ./readline-6.3-patches.nix patch);
# Don't run the native `strip' when cross-compiling. # Don't run the native `strip' when cross-compiling.
dontStrip = hostPlatform != buildPlatform; dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null; bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null;
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -1,5 +1,4 @@
{ fetchurl, stdenv, ncurses { fetchurl, stdenv, ncurses
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -34,7 +33,7 @@ stdenv.mkDerivation rec {
++ upstreamPatches; ++ upstreamPatches;
# Don't run the native `strip' when cross-compiling. # Don't run the native `strip' when cross-compiling.
dontStrip = hostPlatform != buildPlatform; dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null; bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null;
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -1,6 +1,5 @@
{ stdenv { stdenv
, fetchurl , fetchurl
, buildPlatform, hostPlatform
, static ? false , static ? false
}: }:
@ -16,9 +15,9 @@ stdenv.mkDerivation rec {
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1"; sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
}; };
patches = stdenv.lib.optional hostPlatform.isCygwin ./disable-cygwin-widechar.patch; patches = stdenv.lib.optional stdenv.hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
postPatch = stdenv.lib.optionalString hostPlatform.isDarwin '' postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure \ substituteInPlace configure \
--replace '/usr/bin/libtool' 'ar' \ --replace '/usr/bin/libtool' 'ar' \
--replace 'AR="libtool"' 'AR="ar"' \ --replace 'AR="libtool"' 'AR="ar"' \
@ -37,25 +36,25 @@ stdenv.mkDerivation rec {
# jww (2015-01-06): Sometimes this library install as a .so, even on # jww (2015-01-06): Sometimes this library install as a .so, even on
# Darwin; others time it installs as a .dylib. I haven't yet figured out # Darwin; others time it installs as a .dylib. I haven't yet figured out
# what causes this difference. # what causes this difference.
+ stdenv.lib.optionalString hostPlatform.isDarwin '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
for file in $out/lib/*.so* $out/lib/*.dylib* ; do for file in $out/lib/*.so* $out/lib/*.dylib* ; do
install_name_tool -id "$file" $file install_name_tool -id "$file" $file
done done
'' ''
# Non-typical naming confuses libtool which then refuses to use zlib's DLL # Non-typical naming confuses libtool which then refuses to use zlib's DLL
# in some cases, e.g. when compiling libpng. # in some cases, e.g. when compiling libpng.
+ stdenv.lib.optionalString (hostPlatform.libc == "msvcrt") '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
ln -s zlib1.dll $out/bin/libz.dll ln -s zlib1.dll $out/bin/libz.dll
''; '';
# As zlib takes part in the stdenv building, we don't want references # As zlib takes part in the stdenv building, we don't want references
# to the bootstrap-tools libgcc (as uses to happen on arm/mips) # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!hostPlatform.isDarwin) "-static-libgcc"; NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
dontStrip = hostPlatform != buildPlatform && static; dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
configurePlatforms = []; configurePlatforms = [];
installFlags = stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [ installFlags = stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
"BINARY_PATH=$(out)/bin" "BINARY_PATH=$(out)/bin"
"INCLUDE_PATH=$(dev)/include" "INCLUDE_PATH=$(dev)/include"
"LIBRARY_PATH=$(out)/lib" "LIBRARY_PATH=$(out)/lib"
@ -63,7 +62,7 @@ stdenv.mkDerivation rec {
makeFlags = [ makeFlags = [
"PREFIX=${stdenv.cc.targetPrefix}" "PREFIX=${stdenv.cc.targetPrefix}"
] ++ stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [ ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
"-f" "win32/Makefile.gcc" "-f" "win32/Makefile.gcc"
] ++ stdenv.lib.optionals (!static) [ ] ++ stdenv.lib.optionals (!static) [
"SHARED_MODE=1" "SHARED_MODE=1"

View File

@ -1,4 +1,4 @@
{ lib, hostPlatform, targetPlatform { lib
, makeWrapper , makeWrapper
, runCommand, wrapBintoolsWith, wrapCCWith , runCommand, wrapBintoolsWith, wrapCCWith
, buildAndroidndk, androidndk, targetAndroidndkPkgs , buildAndroidndk, androidndk, targetAndroidndkPkgs
@ -33,8 +33,8 @@ let
}.${config} or }.${config} or
(throw "Android NDK doesn't support ${config}, as far as we know"); (throw "Android NDK doesn't support ${config}, as far as we know");
hostInfo = ndkInfoFun hostPlatform; hostInfo = ndkInfoFun stdenv.hostPlatform;
targetInfo = ndkInfoFun targetPlatform; targetInfo = ndkInfoFun stdenv.targetPlatform;
in in
@ -51,7 +51,7 @@ rec {
mkdir -p $out/bin mkdir -p $out/bin
for prog in ${ndkBinDir}/${targetInfo.triple}-*; do for prog in ${ndkBinDir}/${targetInfo.triple}-*; do
prog_suffix=$(basename $prog | sed 's/${targetInfo.triple}-//') prog_suffix=$(basename $prog | sed 's/${targetInfo.triple}-//')
ln -s $prog $out/bin/${targetPlatform.config}-$prog_suffix ln -s $prog $out/bin/${stdenv.targetPlatform.config}-$prog_suffix
done done
''; '';
@ -68,11 +68,11 @@ rec {
bintools = binutils; bintools = binutils;
libc = targetAndroidndkPkgs.libraries; libc = targetAndroidndkPkgs.libraries;
extraBuildCommands = '' extraBuildCommands = ''
echo "-D__ANDROID_API__=${targetPlatform.sdkVer}" >> $out/nix-support/cc-cflags echo "-D__ANDROID_API__=${stdenv.targetPlatform.sdkVer}" >> $out/nix-support/cc-cflags
'' ''
+ lib.optionalString targetPlatform.isAarch32 (let + lib.optionalString stdenv.targetPlatform.isAarch32 (let
p = targetPlatform.platform.gcc or {} p = stdenv.targetPlatform.platform.gcc or {}
// targetPlatform.parsed.abi; // stdenv.targetPlatform.parsed.abi;
flags = lib.concatLists [ flags = lib.concatLists [
(lib.optional (p ? arch) "-march=${p.arch}") (lib.optional (p ? arch) "-march=${p.arch}")
(lib.optional (p ? cpu) "-mcpu=${p.cpu}") (lib.optional (p ? cpu) "-mcpu=${p.cpu}")
@ -84,10 +84,10 @@ rec {
]; ];
in '' in ''
sed -E -i \ sed -E -i \
$out/bin/${targetPlatform.config}-cc \ $out/bin/${stdenv.targetPlatform.config}-cc \
$out/bin/${targetPlatform.config}-c++ \ $out/bin/${stdenv.targetPlatform.config}-c++ \
$out/bin/${targetPlatform.config}-gcc \ $out/bin/${stdenv.targetPlatform.config}-gcc \
$out/bin/${targetPlatform.config}-g++ \ $out/bin/${stdenv.targetPlatform.config}-g++ \
-e '130i extraBefore+=(-Wl,--fix-cortex-a8)' \ -e '130i extraBefore+=(-Wl,--fix-cortex-a8)' \
-e 's|^(extraBefore=)\(\)$|\1(${builtins.toString flags})|' -e 's|^(extraBefore=)\(\)$|\1(${builtins.toString flags})|'
'') '')
@ -107,10 +107,10 @@ rec {
libraries = libraries =
let let
includePath = if buildAndroidndk.version == "10e" then includePath = if buildAndroidndk.version == "10e" then
"${buildAndroidndk}/libexec/${buildAndroidndk.name}/platforms/android-${hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/include/" "${buildAndroidndk}/libexec/${buildAndroidndk.name}/platforms/android-${stdenv.hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/include/"
else else
"${buildAndroidndk}/libexec/${buildAndroidndk.name}/sysroot/usr/include"; "${buildAndroidndk}/libexec/${buildAndroidndk.name}/sysroot/usr/include";
libPath = "${buildAndroidndk}/libexec/${buildAndroidndk.name}/platforms/android-${hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/lib/"; libPath = "${buildAndroidndk}/libexec/${buildAndroidndk.name}/platforms/android-${stdenv.hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/lib/";
in in
runCommand "bionic-prebuilt" {} '' runCommand "bionic-prebuilt" {} ''
mkdir -p $out mkdir -p $out

View File

@ -1,4 +1,4 @@
{lib, fetchPypi, python, buildPythonPackage, isPyPy, gfortran, nose, blas, hostPlatform }: { stdenv, lib, fetchPypi, python, buildPythonPackage, isPyPy, gfortran, nose, blas }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "numpy"; pname = "numpy";
@ -20,7 +20,7 @@ buildPythonPackage rec {
./numpy-distutils-C++.patch ./numpy-distutils-C++.patch
]; ];
postPatch = lib.optionalString hostPlatform.isMusl '' postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
# Use fenv.h # Use fenv.h
sed -i \ sed -i \
numpy/core/src/npymath/ieee754.c.src \ numpy/core/src/npymath/ieee754.c.src \

View File

@ -1,4 +1,4 @@
{ lib, fetchPypi, buildPythonPackage, hostPlatform }: { stdenv, lib, fetchPypi, buildPythonPackage }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pyserial"; pname = "pyserial";
@ -10,7 +10,7 @@ buildPythonPackage rec {
}; };
checkPhase = "python -m unittest discover -s test"; checkPhase = "python -m unittest discover -s test";
doCheck = !hostPlatform.isDarwin; # broken on darwin doCheck = !stdenv.hostPlatform.isDarwin; # broken on darwin
meta = with lib; { meta = with lib; {
homepage = "https://github.com/pyserial/pyserial"; homepage = "https://github.com/pyserial/pyserial";

View File

@ -1,6 +1,5 @@
{ stdenv, fetchurl, fetchpatch, curl, expat, zlib, bzip2 { stdenv, fetchurl, fetchpatch, curl, expat, zlib, bzip2
, useNcurses ? false, ncurses, useQt4 ? false, qt4, ps , useNcurses ? false, ncurses, useQt4 ? false, qt4, ps
, buildPlatform, hostPlatform
}: }:
with stdenv.lib; with stdenv.lib;
@ -35,7 +34,7 @@ stdenv.mkDerivation rec {
})] ++ })] ++
# Don't search in non-Nix locations such as /usr, but do search in our libc. # Don't search in non-Nix locations such as /usr, but do search in our libc.
[ ./search-path.patch ] ++ [ ./search-path.patch ] ++
optional (hostPlatform != buildPlatform) (fetchurl { optional (stdenv.hostPlatform != stdenv.buildPlatform) (fetchurl {
name = "fix-darwin-cross-compile.patch"; name = "fix-darwin-cross-compile.patch";
url = "https://public.kitware.com/Bug/file_download.php?" url = "https://public.kitware.com/Bug/file_download.php?"
+ "file_id=4981&type=bug"; + "file_id=4981&type=bug";

View File

@ -1,4 +1,4 @@
{ lib, python3Packages, stdenv, targetPlatform, writeTextDir, substituteAll }: { lib, python3Packages, stdenv, writeTextDir, substituteAll }:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
version = "0.46.1"; version = "0.46.1";
@ -57,10 +57,10 @@ python3Packages.buildPythonApplication rec {
needs_exe_wrapper = true needs_exe_wrapper = true
[host_machine] [host_machine]
system = '${targetPlatform.parsed.kernel.name}' system = '${stdenv.targetPlatform.parsed.kernel.name}'
cpu_family = '${targetPlatform.parsed.cpu.family}' cpu_family = '${stdenv.targetPlatform.parsed.cpu.family}'
cpu = '${targetPlatform.parsed.cpu.name}' cpu = '${stdenv.targetPlatform.parsed.cpu.name}'
endian = ${if targetPlatform.isLittleEndian then "'little'" else "'big'"} endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"}
''; '';
# 0.45 update enabled tests but they are failing # 0.45 update enabled tests but they are failing

View File

@ -1,6 +1,5 @@
{ stdenv, buildPackages { stdenv, buildPackages
, fetchurl, zlib, autoreconfHook264 , fetchurl, zlib, autoreconfHook264
, hostPlatform, buildPlatform, targetPlatform
, noSysDirs, gold ? true, bison ? null , noSysDirs, gold ? true, bison ? null
}: }:
@ -13,7 +12,7 @@ let
inherit (stdenv.lib) optionals optionalString; inherit (stdenv.lib) optionals optionalString;
# The targetPrefix prepended to binary names to allow multiple binuntils on the # The targetPrefix prepended to binary names to allow multiple binuntils on the
# PATH to both be usable. # PATH to both be usable.
targetPrefix = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; targetPrefix = optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "${stdenv.targetPlatform.config}-";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -65,14 +64,14 @@ stdenv.mkDerivation rec {
# be satisfied on aarch64 platform. Add backported fix from bugzilla. # be satisfied on aarch64 platform. Add backported fix from bugzilla.
# https://sourceware.org/bugzilla/show_bug.cgi?id=22764 # https://sourceware.org/bugzilla/show_bug.cgi?id=22764
./relax-R_AARCH64_ABS32-R_AARCH64_ABS16-absolute.patch ./relax-R_AARCH64_ABS32-R_AARCH64_ABS16-absolute.patch
] ++ stdenv.lib.optional targetPlatform.isiOS ./support-ios.patch; ] ++ stdenv.lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch;
outputs = [ "out" "info" "man" ]; outputs = [ "out" "info" "man" ];
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ nativeBuildInputs = [
bison bison
] ++ stdenv.lib.optionals targetPlatform.isiOS [ ] ++ stdenv.lib.optionals stdenv.targetPlatform.isiOS [
autoreconfHook264 autoreconfHook264
]; ];
buildInputs = [ zlib ]; buildInputs = [ zlib ];
@ -94,14 +93,14 @@ stdenv.mkDerivation rec {
# As binutils takes part in the stdenv building, we don't want references # As binutils takes part in the stdenv building, we don't want references
# to the bootstrap-tools libgcc (as uses to happen on arm/mips) # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
NIX_CFLAGS_COMPILE = if hostPlatform.isDarwin NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.isDarwin
then "-Wno-string-plus-int -Wno-deprecated-declarations" then "-Wno-string-plus-int -Wno-deprecated-declarations"
else "-static-libgcc"; else "-static-libgcc";
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
# TODO(@Ericson2314): Always pass "--target" and always targetPrefix. # TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
configureFlags = [ configureFlags = [
"--enable-targets=all" "--enable-64-bit-bfd" "--enable-targets=all" "--enable-64-bit-bfd"
@ -122,7 +121,7 @@ stdenv.mkDerivation rec {
doCheck = false; # fails doCheck = false; # fails
# else fails with "./sanity.sh: line 36: $out/bin/size: not found" # else fails with "./sanity.sh: line 36: $out/bin/size: not found"
doInstallCheck = buildPlatform == hostPlatform && hostPlatform == targetPlatform; doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform == stdenv.targetPlatform;
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -6,9 +6,7 @@
# Run time # Run time
, ncurses, readline, gmp, mpfr, expat, zlib, dejagnu , ncurses, readline, gmp, mpfr, expat, zlib, dejagnu
, buildPlatform, hostPlatform, targetPlatform , pythonSupport ? stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isCygwin, python ? null
, pythonSupport ? hostPlatform == buildPlatform && !hostPlatform.isCygwin, python ? null
, guile ? null , guile ? null
}: }:
@ -22,8 +20,8 @@ assert pythonSupport -> python != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = name =
stdenv.lib.optionalString (targetPlatform != hostPlatform) stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(targetPlatform.config + "-") (stdenv.targetPlatform.config + "-")
+ basename; + basename;
src = fetchurl { src = fetchurl {
@ -50,7 +48,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
configureFlags = with stdenv.lib; [ configureFlags = with stdenv.lib; [
"--enable-targets=all" "--enable-64-bit-bfd" "--enable-targets=all" "--enable-64-bit-bfd"

View File

@ -1,4 +1,4 @@
{ stdenv, hostPlatform, fetchurl }: { stdenv, fetchurl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gnum4-1.4.18"; name = "gnum4-1.4.18";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
configureFlags = [ "--with-syscmd-shell=${stdenv.shell}" ]; configureFlags = [ "--with-syscmd-shell=${stdenv.shell}" ];
# Upstream is aware of it; it may be in the next release. # Upstream is aware of it; it may be in the next release.
patches = [ ./s_isdir.patch ] ++ stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch; patches = [ ./s_isdir.patch ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin stdenv.secure-format-patch;
meta = { meta = {
homepage = http://www.gnu.org/software/m4/; homepage = http://www.gnu.org/software/m4/;

View File

@ -1,4 +1,4 @@
{ stdenv, hostPlatform, fetchurl, perl, gettext, LocaleGettext }: { stdenv, fetchurl, perl, gettext, LocaleGettext }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "help2man-1.47.6"; name = "help2man-1.47.6";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
doCheck = false; # target `check' is missing doCheck = false; # target `check' is missing
patches = if hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null; patches = if stdenv.hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
# We don't use makeWrapper here because it uses substitutions our # We don't use makeWrapper here because it uses substitutions our
# bootstrap shell can't handle. # bootstrap shell can't handle.
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
cat > $out/bin/help2man <<EOF cat > $out/bin/help2man <<EOF
#! $SHELL -e #! $SHELL -e
export PERL5LIB=\''${PERL5LIB:+:}$gettext_perl export PERL5LIB=\''${PERL5LIB:+:}$gettext_perl
${stdenv.lib.optionalString hostPlatform.isCygwin ${stdenv.lib.optionalString stdenv.hostPlatform.isCygwin
"export PATH=\''${PATH:+:}${gettext}/bin"} "export PATH=\''${PATH:+:}${gettext}/bin"}
exec -a \$0 $out/bin/.help2man-wrapped "\$@" exec -a \$0 $out/bin/.help2man-wrapped "\$@"
EOF EOF

View File

@ -1,5 +1,4 @@
{ stdenv, fetchurl, m4, perl, help2man { stdenv, fetchurl, m4, perl, help2man
, buildPlatform, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -26,7 +25,7 @@ stdenv.mkDerivation rec {
# Don't run the native `strip' when cross-compiling. This breaks at least # Don't run the native `strip' when cross-compiling. This breaks at least
# with `.a' files for MinGW. # with `.a' files for MinGW.
dontStrip = hostPlatform != buildPlatform; dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
meta = { meta = {
description = "GNU Libtool, a generic library support script"; description = "GNU Libtool, a generic library support script";

View File

@ -1,9 +1,8 @@
{ stdenv, lib, buildPackages, makeWrapper, writeText, runCommand { stdenv, lib, buildPackages, makeWrapper, writeText, runCommand
, CoreServices, ImageIO, CoreGraphics , CoreServices, ImageIO, CoreGraphics
, targetPlatform , xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX"
, xcodePlatform ? targetPlatform.xcodePlatform or "MacOSX" , xcodeVer ? stdenv.targetPlatform.xcodeVer or "9.4.1"
, xcodeVer ? targetPlatform.xcodeVer or "9.4.1" , sdkVer ? stdenv.targetPlatform.sdkVer or "10.10" }:
, sdkVer ? targetPlatform.sdkVer or "10.10" }:
let let

View File

@ -1,6 +1,5 @@
{ stdenv, fetchurl, nasm { stdenv, fetchurl, nasm
, alsaLib, flac, fluidsynth, freetype, libjpeg, libmad, libmpeg2, libogg, libvorbis, libGLU_combined, SDL2, zlib , alsaLib, flac, fluidsynth, freetype, libjpeg, libmad, libmpeg2, libogg, libvorbis, libGLU_combined, SDL2, zlib
, hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {

View File

@ -1,4 +1,4 @@
{ stdenv, buildPlatform, fetchFromGitHub, autoconf, automake, libX11, libXt, libXpm, libXaw, localStateDir?null }: { stdenv, fetchFromGitHub, autoconf, automake, libX11, libXt, libXpm, libXaw, localStateDir?null }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "xjump-${version}"; name = "xjump-${version}";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoconf automake ]; nativeBuildInputs = [ autoconf automake ];
buildInputs = [ libX11 libXt libXpm libXaw ]; buildInputs = [ libX11 libXt libXpm libXaw ];
preConfigure = "autoreconf --install"; preConfigure = "autoreconf --install";
patches = if buildPlatform.isDarwin then [ ./darwin.patch ] else []; patches = if stdenv.buildPlatform.isDarwin then [ ./darwin.patch ] else [];
configureFlags = configureFlags =
if localStateDir != null then if localStateDir != null then
["--localstatedir=${localStateDir}"] ["--localstatedir=${localStateDir}"]

View File

@ -12,7 +12,7 @@
, udev ? null , udev ? null
, enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null , enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
, withVulkan ? stdenv.isLinux, vulkan-loader ? null , withVulkan ? stdenv.isLinux, vulkan-loader ? null
, targetPlatform, fetchurl , fetchurl
}: }:
with stdenv.lib; with stdenv.lib;
@ -50,7 +50,7 @@ in stdenv.mkDerivation rec {
postInstall = optionalString withVulkan '' postInstall = optionalString withVulkan ''
wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
'' + optionalString targetPlatform.isDarwin '' '' + optionalString stdenv.targetPlatform.isDarwin ''
EXECUTABLE_NAME=RetroArch EXECUTABLE_NAME=RetroArch
PRODUCT_NAME=RetroArch PRODUCT_NAME=RetroArch
MACOSX_DEPLOYMENT_TARGET=10.5 MACOSX_DEPLOYMENT_TARGET=10.5

View File

@ -1,4 +1,4 @@
{ stdenv, hostPlatform, fetchcvs, lib, groff, mandoc, zlib, buildPackages { stdenv, fetchcvs, lib, groff, mandoc, zlib, buildPackages
, yacc, flex, libressl, bash, less, writeText }: , yacc, flex, libressl, bash, less, writeText }:
let let
@ -32,8 +32,8 @@ let
MKUNPRIVED = "yes"; MKUNPRIVED = "yes";
HOST_SH = "${bash}/bin/sh"; HOST_SH = "${bash}/bin/sh";
OBJCOPY = if stdenv.isDarwin then "true" else "objcopy"; OBJCOPY = if stdenv.isDarwin then "true" else "objcopy";
MACHINE_ARCH = hostPlatform.parsed.cpu.name; MACHINE_ARCH = stdenv.hostPlatform.parsed.cpu.name;
MACHINE_CPU = hostPlatform.parsed.cpu.name; MACHINE_CPU = stdenv.hostPlatform.parsed.cpu.name;
INSTALL_FILE = "install -U -c"; INSTALL_FILE = "install -U -c";
INSTALL_DIR = "xinstall -U -d"; INSTALL_DIR = "xinstall -U -d";
@ -478,7 +478,7 @@ in rec {
"-DOXTABS=XTABS" "-DOXTABS=XTABS"
"-DRANDOM_MAX=RAND_MAX" "-DRANDOM_MAX=RAND_MAX"
"-DINFTIM=-1" "-DINFTIM=-1"
(lib.optionalString hostPlatform.isMusl "-include sys/ttydefaults.h -include sys/file.h") (lib.optionalString stdenv.hostPlatform.isMusl "-include sys/ttydefaults.h -include sys/file.h")
"-DBE32TOH(x)=((void)0)" "-DBE32TOH(x)=((void)0)"
"-DBE64TOH(x)=((void)0)" "-DBE64TOH(x)=((void)0)"
"-D__c99inline=__inline" "-D__c99inline=__inline"

View File

@ -1,6 +1,6 @@
{ stdenv, appleDerivation, lib, targetPlatform { stdenv, appleDerivation, lib
, enableStatic ? targetPlatform.isiOS , enableStatic ? stdenv.targetPlatform.isiOS
, enableShared ? !targetPlatform.isiOS , enableShared ? !stdenv.targetPlatform.isiOS
}: }:
appleDerivation { appleDerivation {

View File

@ -1,7 +1,6 @@
{ stdenv, fetchFromGitHub, autoconf, automake, libtool_2, autoreconfHook { stdenv, fetchFromGitHub, autoconf, automake, libtool_2, autoreconfHook
, libcxxabi, libuuid , libcxxabi, libuuid
, libobjc ? null, maloader ? null , libobjc ? null, maloader ? null
, hostPlatform, targetPlatform
, enableDumpNormalizedLibArgs ? false , enableDumpNormalizedLibArgs ? false
}: }:
@ -12,17 +11,17 @@ let
# 10.x. For 11.0 and higher we will need to upgrade to a newer cctools than the # 10.x. For 11.0 and higher we will need to upgrade to a newer cctools than the
# default version here, which can support the new TBD format via Apple's # default version here, which can support the new TBD format via Apple's
# libtapi. # libtapi.
useOld = targetPlatform.isiOS; useOld = stdenv.targetPlatform.isiOS;
# The targetPrefix prepended to binary names to allow multiple binuntils on the # The targetPrefix prepended to binary names to allow multiple binuntils on the
# PATH to both be usable. # PATH to both be usable.
targetPrefix = stdenv.lib.optionalString targetPrefix = stdenv.lib.optionalString
(targetPlatform != hostPlatform) (stdenv.targetPlatform != stdenv.hostPlatform)
"${targetPlatform.config}-"; "${stdenv.targetPlatform.config}-";
in in
# Non-Darwin alternatives # Non-Darwin alternatives
assert (!hostPlatform.isDarwin) -> maloader != null; assert (!stdenv.hostPlatform.isDarwin) -> maloader != null;
assert enableDumpNormalizedLibArgs -> (!useOld); assert enableDumpNormalizedLibArgs -> (!useOld);
@ -77,7 +76,7 @@ let
enableParallelBuilding = true; enableParallelBuilding = true;
# TODO(@Ericson2314): Always pass "--target" and always targetPrefix. # TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
postPatch = '' postPatch = ''
sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp
@ -131,7 +130,7 @@ let
}; };
meta = { meta = {
broken = !targetPlatform.isDarwin; # Only supports darwin targets broken = !stdenv.targetPlatform.isDarwin; # Only supports darwin targets
homepage = http://www.opensource.apple.com/source/cctools/; homepage = http://www.opensource.apple.com/source/cctools/;
description = "MacOS Compiler Tools (cross-platform port)"; description = "MacOS Compiler Tools (cross-platform port)";
license = stdenv.lib.licenses.apsl20; license = stdenv.lib.licenses.apsl20;

View File

@ -1,4 +1,4 @@
{ stdenv, requireFile, targetPlatform, lib }: { stdenv, requireFile, lib }:
let requireXcode = version: sha256: let requireXcode = version: sha256:
let let
@ -46,5 +46,5 @@ in lib.makeExtensible (self: {
xcode_9_1 = requireXcode "9.1" "0ab1403wy84ys3yn26fj78cazhpnslmh3nzzp1wxib3mr1afjvic"; xcode_9_1 = requireXcode "9.1" "0ab1403wy84ys3yn26fj78cazhpnslmh3nzzp1wxib3mr1afjvic";
xcode_9_2 = requireXcode "9.2" "1bgfgdp266cbbqf2axcflz92frzvhi0qw0jdkcw6r85kdpc8dj4c"; xcode_9_2 = requireXcode "9.2" "1bgfgdp266cbbqf2axcflz92frzvhi0qw0jdkcw6r85kdpc8dj4c";
xcode_9_4 = requireXcode "9.4" "6731381785075602a52489f7ea47ece8f6daf225007ba3ffae1fd59b1c0b5f01"; xcode_9_4 = requireXcode "9.4" "6731381785075602a52489f7ea47ece8f6daf225007ba3ffae1fd59b1c0b5f01";
xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if targetPlatform.useiOSPrebuilt then targetPlatform.xcodeVer else "8.2")}"; xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if stdenv.targetPlatform.useiOSPrebuilt then stdenv.targetPlatform.xcodeVer else "8.2")}";
}) })

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