Browse Source

Merge pull request #58504 from symphorien/static-proot

Static proot, wafHook cross compilation
nim-0.20.0
Dmitry Kalinkin 3 years ago committed by GitHub
parent
commit
59c81160e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      doc/stdenv.xml
  2. 2
      pkgs/applications/audio/ardour/default.nix
  3. 2
      pkgs/applications/audio/guitarix/default.nix
  4. 2
      pkgs/applications/misc/xiphos/default.nix
  5. 2
      pkgs/development/libraries/audio/lvtk/default.nix
  6. 2
      pkgs/development/libraries/ndn-cxx/default.nix
  7. 2
      pkgs/development/libraries/science/networking/ns3/default.nix
  8. 19
      pkgs/development/libraries/talloc/default.nix
  9. 16
      pkgs/development/libraries/tdb/default.nix
  10. 19
      pkgs/development/tools/build-managers/waf/setup-hook.sh
  11. 2
      pkgs/misc/emulators/wxmupen64plus/default.nix
  12. 2
      pkgs/misc/jackaudio/default.nix
  13. 2
      pkgs/tools/graphics/glmark2/default.nix
  14. 2
      pkgs/tools/system/proot/default.nix
  15. 6
      pkgs/top-level/all-packages.nix

6
doc/stdenv.xml

@ -2754,9 +2754,9 @@ addEnvHooks "$hostOffset" myBashFunction
<listitem>
<para>
Overrides the configure, build, and install phases. This will run the
"waf" script used by many projects. If waf doesn’t exist, it will copy
the version of waf available in Nixpkgs wafFlags can be used to pass
flags to the waf script.
"waf" script used by many projects. If wafPath (default ./waf) doesn’t
exist, it will copy the version of waf available in Nixpkgs. wafFlags can
be used to pass flags to the waf script.
</para>
</listitem>
</varlistentry>

2
pkgs/applications/audio/ardour/default.nix

@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
patchShebangs ./tools/
'';
configureFlags = [
wafConfigureFlags = [
"--optimize"
"--docs"
"--with-backends=jack,alsa,dummy"

2
pkgs/applications/audio/guitarix/default.nix

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
zita-resampler curl
];
configureFlags = [
wafConfigureFlags = [
"--shared-lib"
"--no-desktop-update"
"--enable-nls"

2
pkgs/applications/misc/xiphos/default.nix

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
export SWORD_HOME=${sword};
'';
configureFlags= [ "--enable-webkit2" ];
wafConfigureFlags = [ "--enable-webkit2" ];
meta = with stdenv.lib; {
description = "A GTK Bible study tool";

2
pkgs/development/libraries/audio/lvtk/default.nix

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
sed -i '/target[ ]*= "ttl2c"/ ilib=["boost_system"],' tools/wscript_build
'';
configureFlags = [
wafConfigureFlags = [
"--boost-includes=${boost.dev}/include"
"--boost-libs=${boost.out}/lib"
];

2
pkgs/development/libraries/ndn-cxx/default.nix

@ -13,7 +13,7 @@ stdenv.mkDerivation {
};
nativeBuildInputs = [ pkgconfig wafHook ];
buildInputs = [ openssl doxygen boost sqlite python pythonPackages.sphinx];
configureFlags = [
wafConfigureFlags = [
"--with-openssl=${openssl.dev}"
"--boost-includes=${boost.dev}/include"
"--boost-libs=${boost.out}/lib"

2
pkgs/development/libraries/science/networking/ns3/default.nix

@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
patchShebangs doc/ns3_html_theme/get_version.sh
'';
configureFlags = with stdenv.lib; [
wafConfigureFlags = with stdenv.lib; [
"--enable-modules=${stdenv.lib.concatStringsSep "," modules}"
"--with-python=${pythonEnv.interpreter}"
]

19
pkgs/development/libraries/talloc/default.nix

@ -1,6 +1,6 @@
{ stdenv, fetchurl, python, pkgconfig, readline, libxslt
, docbook_xsl, docbook_xml_dtd_42, fixDarwinDylibNames
, buildPackages
, wafHook
}:
stdenv.mkDerivation rec {
@ -11,23 +11,22 @@ stdenv.mkDerivation rec {
sha256 = "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di";
};
nativeBuildInputs = [ pkgconfig fixDarwinDylibNames python
nativeBuildInputs = [ pkgconfig fixDarwinDylibNames python wafHook
docbook_xsl docbook_xml_dtd_42 ];
buildInputs = [ readline libxslt ];
prePatch = ''
patchShebangs buildtools/bin/waf
'';
wafPath = "buildtools/bin/waf";
configureFlags = [
wafConfigureFlags = [
"--enable-talloc-compat1"
"--bundled-libraries=NONE"
"--builtin-libraries=replace"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-compile"
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
];
configurePlatforms = [];
# this must not be exported before the ConfigurePhase otherwise waf whines
preBuild = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
export NIX_CFLAGS_LINK="-no-pie -shared";
'';
postInstall = ''
${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o

16
pkgs/development/libraries/tdb/default.nix

@ -1,5 +1,5 @@
{ stdenv, fetchurl, python2, pkgconfig, readline, libxslt
, docbook_xsl, docbook_xml_dtd_42, buildPackages
{ stdenv, fetchurl, wafHook, pkgconfig, readline, libxslt
, docbook_xsl, docbook_xml_dtd_42
}:
stdenv.mkDerivation rec {
@ -10,23 +10,17 @@ stdenv.mkDerivation rec {
sha256 = "1ibcz466xwk1x6xvzlgzd5va4lyrjzm3rnjak29kkwk7cmhw4gva";
};
nativeBuildInputs = [ pkgconfig python2 ];
nativeBuildInputs = [ pkgconfig wafHook ];
buildInputs = [
readline libxslt docbook_xsl docbook_xml_dtd_42
];
preConfigure = ''
patchShebangs buildtools/bin/waf
'';
wafPath = "buildtools/bin/waf";
configureFlags = [
wafConfigureFlags = [
"--bundled-libraries=NONE"
"--builtin-libraries=replace"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-compile"
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
];
configurePlatforms = [ ];
meta = with stdenv.lib; {
description = "The trivial database";

19
pkgs/development/tools/build-managers/waf/setup-hook.sh

@ -1,20 +1,23 @@
wafConfigurePhase() {
runHook preConfigure
if ! [ -f ./waf ]; then
cp @waf@ waf
if ! [ -f "${wafPath:=./waf}" ]; then
echo "copying waf to $wafPath..."
cp @waf@ "$wafPath"
fi
if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
wafConfigureFlags="${prefixKey:---prefix=}$prefix $wafConfigureFlags"
fi
local flagsArray=(
$configureFlags ${configureFlagsArray[@]}
@crossFlags@
"${flagsArray[@]}"
$wafConfigureFlags "${wafConfigureFlagsArray[@]}"
${configureTargets:-configure}
)
echoCmd 'configure flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postConfigure
}
@ -33,7 +36,7 @@ wafBuildPhase () {
)
echoCmd 'build flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postBuild
}
@ -52,7 +55,7 @@ wafInstallPhase() {
)
echoCmd 'install flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postInstall
}

2
pkgs/misc/emulators/wxmupen64plus/default.nix

@ -17,7 +17,7 @@ stdenv.mkDerivation {
export CXXFLAGS="-I${libX11.dev}/include/X11 -DLIBDIR=\\\"${mupen64plus}/lib/\\\""
export LDFLAGS="-lwx_gtk2u_adv-2.9"
configureFlagsArray+=("--mupenapi=$APIDIR" "--wxconfig=`type -P wx-config`")
wafConfigureFlagsArray+=("--mupenapi=$APIDIR" "--wxconfig=`type -P wx-config`")
'';
NIX_CFLAGS_COMPILE = "-fpermissive";

2
pkgs/misc/jackaudio/default.nix

@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
'';
configureFlags = [
wafConfigureFlags = [
"--classic"
"--autostart=${if (optDbus != null) then "dbus" else "classic"}"
] ++ optional (optDbus != null) "--dbus"

2
pkgs/tools/graphics/glmark2/default.nix

@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
libjpeg libpng xorg.libxcb libX11 libGL libdrm python27 wayland udev mesa_noglu
];
configureFlags = ["--with-flavors=x11-gl,x11-glesv2,drm-gl,drm-glesv2,wayland-gl,wayland-glesv2"];
wafConfigureFlags = ["--with-flavors=x11-gl,x11-glesv2,drm-gl,drm-glesv2,wayland-gl,wayland-glesv2"];
meta = with stdenv.lib; {
description = "OpenGL (ES) 2.0 benchmark";

2
pkgs/tools/system/proot/default.nix

@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace src/GNUmakefile \
--replace /bin/echo ${coreutils}/bin/echo
# our cross machinery defines $CC and co just right
sed -i /CROSS_COMPILE/d src/GNUmakefile
'';
buildInputs = [ talloc ] ++ stdenv.lib.optional enablePython python;

6
pkgs/top-level/all-packages.nix

@ -6463,7 +6463,11 @@ in
waf = callPackage ../development/tools/build-managers/waf { python = python3; };
wafHook = makeSetupHook {
deps = [ python ];
substitutions = { inherit waf; };
substitutions = {
inherit waf;
crossFlags = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform)
''--cross-compile "--cross-execute=${stdenv.targetPlatform.emulator pkgs}"'';
};
} ../development/tools/build-managers/waf/setup-hook.sh;
wakelan = callPackage ../tools/networking/wakelan { };

Loading…
Cancel
Save