Skip to content

Commit

Permalink
Merge pull request #252874 from atorres1985-contrib/waf-cross
Browse files Browse the repository at this point in the history
Artturin authored Sep 7, 2023
2 parents 8fb691c + 83b98f9 commit 6946977
Showing 38 changed files with 128 additions and 112 deletions.
49 changes: 30 additions & 19 deletions doc/hooks/waf.section.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,58 @@
# waf.hook {#wafhook}
# wafHook {#wafHook}

[Waf](https://waf.io) is a Python-based software building system.

In Nixpkgs, `waf.hook` overrides the default configure, build, and install phases.
In Nixpkgs, `wafHook` overrides the default configure, build, and install phases.

## Variables controlling waf.hook {#variablesControllingWafHook}
## Variables controlling wafHook {#variablesControllingWafHook}

### `wafPath` {#wafPath}
### `wafHook` Exclusive Variables {#wafHookExclusiveVariables}

The variables below are exclusive of `wafHook`.

#### `wafPath` {#wafPath}

Location of the `waf` tool. It defaults to `./waf`, to honor software projects that include it directly inside their source trees.

If `wafPath` doesn't exist, then `waf.hook` will copy the `waf` provided from Nixpkgs to it.
If `wafPath` doesn't exist, then `wafHook` will copy the `waf` provided from Nixpkgs to it.

### `wafFlags` {#wafFlags}
#### `wafFlags` {#wafFlags}

Controls the flags passed to waf tool during build and install phases. For settings specific to build or install phases, use `buildFlags` or `installFlags` respectively.
Controls the flags passed to waf tool during build and install phases. For settings specific to build or install phases, use `wafBuildFlags` or `wafInstallFlags` respectively.

### `dontAddWafCrossFlags` {#dontAddWafCrossFlags}
#### `dontAddWafCrossFlags` {#dontAddWafCrossFlags}

When set to `true`, don't add cross compilation flags during configure phase.

### `dontUseWafConfigure` {#dontUseWafConfigure}
#### `dontUseWafConfigure` {#dontUseWafConfigure}

When set to true, don't use the predefined `wafConfigurePhase`.

### `dontUseWafBuild` {#dontUseWafBuild}
#### `dontUseWafBuild` {#dontUseWafBuild}

When set to true, don't use the predefined `wafBuildPhase`.

### `dontUseWafInstall` {#dontUseWafInstall}
#### `dontUseWafInstall` {#dontUseWafInstall}

When set to true, don't use the predefined `wafInstallPhase`.

### Variables honored by waf.hook {#variablesHonoredByWafHook}
### Similar variables {#similarVariables}

The following variables are similar to their `stdenv.mkDerivation` counterparts.

| `wafHook` Variable | `stdenv.mkDerivation` Counterpart |
|-----------------------|-----------------------------------|
| `wafConfigureFlags` | `configureFlags` |
| `wafConfigureTargets` | `configureTargets` |
| `wafBuildFlags` | `buildFlags` |
| `wafBuildTargets` | `buildTargets` |
| `wafInstallFlags` | `installFlags` |
| `wafInstallTargets` | `installTargets` |

### Honored variables {#honoredVariables}

The following variables commonly used by `stdenv.mkDerivation` are also honored by `waf.hook`.
The following variables commonly used by `stdenv.mkDerivation` are honored by `wafHook`.

- `prefixKey`
- `configureFlags`
- `configureTargets`
- `enableParallelBuilding`
- `enableParallelInstalling`
- `buildFlags`
- `buildTargets`
- `installFlags`
- `installTargets`
4 changes: 2 additions & 2 deletions pkgs/applications/audio/ams-lv2/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cairo, fftw, gtkmm2, lv2, lvtk, pkg-config
, waf, python3 }:
, wafHook, python3 }:

stdenv.mkDerivation rec {
pname = "ams-lv2";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "1lz2mvk4gqsyf92yxd3aaldx0d0qi28h4rnnvsaz4ls0ccqm80nk";
};

nativeBuildInputs = [ pkg-config waf.hook python3 ];
nativeBuildInputs = [ pkg-config wafHook python3 ];
buildInputs = [ cairo fftw gtkmm2 lv2 lvtk ];

meta = with lib; {
6 changes: 3 additions & 3 deletions pkgs/applications/audio/ardour/6.nix
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@
, suil
, taglib
, vamp-plugin-sdk
, waf
, wafHook
, xjadeo
, videoSupport ? true
}:
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
perl
pkg-config
python3
waf.hook
wafHook
];

buildInputs = [
@@ -129,7 +129,7 @@ stdenv.mkDerivation rec {
vamp-plugin-sdk
] ++ lib.optionals videoSupport [ harvid xjadeo ];

configureFlags = [
wafConfigureFlags = [
"--cxx11"
"--docs"
"--freedesktop"
6 changes: 3 additions & 3 deletions pkgs/applications/audio/ardour/default.nix
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
, suil
, taglib
, vamp-plugin-sdk
, waf
, wafHook
, xjadeo
, videoSupport ? true
}:
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
perl
pkg-config
python3
waf.hook
wafHook
];

buildInputs = [
@@ -150,7 +150,7 @@ stdenv.mkDerivation rec {
vamp-plugin-sdk
] ++ lib.optionals videoSupport [ harvid xjadeo ];

configureFlags = [
wafConfigureFlags = [
"--cxx11"
"--docs"
"--freedesktop"
4 changes: 2 additions & 2 deletions pkgs/applications/audio/fomp/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, lv2, pkg-config, python3, waf }:
{ lib, stdenv, fetchurl, lv2, pkg-config, python3, wafHook }:

stdenv.mkDerivation rec {
pname = "fomp";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-xnGijydiO3B7BjSlryFuH1j/OPio9hCYbniq2IXp2W8=";
};

nativeBuildInputs = [ pkg-config waf.hook ];
nativeBuildInputs = [ pkg-config wafHook ];
buildInputs = [ lv2 python3 ];

meta = with lib; {
6 changes: 3 additions & 3 deletions pkgs/applications/audio/guitarix/default.nix
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
, serd
, sord
, sratom
, waf
, wafHook
, wrapGAppsHook
, zita-convolver
, zita-resampler
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
intltool
pkg-config
python3
waf.hook
wafHook
wrapGAppsHook
];

@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
zita-resampler
];

configureFlags = [
wafConfigureFlags = [
"--no-font-cache-update"
"--shared-lib"
"--no-desktop-update"
4 changes: 2 additions & 2 deletions pkgs/applications/audio/ingen/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchgit, boost, ganv, glibmm, gtkmm2, libjack2, lilv
, lv2, pkg-config, python3, raul, serd, sord, sratom
, waf
, wafHook
, suil
}:

@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
deepClone = true;
};

nativeBuildInputs = [ pkg-config waf.hook python3 python3.pkgs.wrapPython ];
nativeBuildInputs = [ pkg-config wafHook python3 python3.pkgs.wrapPython ];
buildInputs = [
boost ganv glibmm gtkmm2 libjack2 lilv lv2
python3 raul serd sord sratom suil
4 changes: 2 additions & 2 deletions pkgs/applications/audio/jalv/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, gtk2, libjack2, lilv, lv2, pkg-config, python3
, serd, sord , sratom, suil, waf }:
, serd, sord , sratom, suil, wafHook }:

stdenv.mkDerivation rec {
pname = "jalv";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ktFBeBtmQ3MgfDQ868XpuM7UYfryb9zLld8AB7BjnhY=";
};

nativeBuildInputs = [ pkg-config waf.hook ];
nativeBuildInputs = [ pkg-config wafHook ];
buildInputs = [
gtk2 libjack2 lilv lv2 python3 serd sord sratom suil
];
4 changes: 2 additions & 2 deletions pkgs/applications/audio/mda-lv2/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, fftwSinglePrec, lv2, pkg-config, waf, python3 }:
{ lib, stdenv, fetchurl, fftwSinglePrec, lv2, pkg-config, wafHook, python3 }:

stdenv.mkDerivation rec {
pname = "mda-lv2";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-zWYRcCSuBJzzrKg/npBKcCdyJOI6lp9yqcXQEKSYV9s=";
};

nativeBuildInputs = [ pkg-config waf.hook python3 ];
nativeBuildInputs = [ pkg-config wafHook python3 ];
buildInputs = [ fftwSinglePrec lv2 ];

meta = with lib; {
4 changes: 2 additions & 2 deletions pkgs/applications/audio/non/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, python3, cairo, libjpeg, ntk, libjack2
, libsndfile, ladspaH, liblo, libsigcxx, lrdf, waf
, libsndfile, ladspaH, liblo, libsigcxx, lrdf, wafHook
}:

stdenv.mkDerivation {
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
sha256 = "sha256-iMJNMDytNXpEkUhL0RILSd25ixkm8HL/edtOZta0Pf4=";
};

nativeBuildInputs = [ pkg-config waf.hook ];
nativeBuildInputs = [ pkg-config wafHook ];
buildInputs = [ python3 cairo libjpeg ntk libjack2 libsndfile
ladspaH liblo libsigcxx lrdf
];
4 changes: 2 additions & 2 deletions pkgs/applications/audio/patchage/default.nix
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
, libjack2
, pkg-config
, python3
, waf
, wafHook
}:

stdenv.mkDerivation rec {
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
gtkmm2
libjack2
python3
waf.hook
wafHook
];

meta = {
4 changes: 2 additions & 2 deletions pkgs/applications/misc/hamster/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, fetchFromGitHub, python3Packages, intltool, glib, itstool, gtk3
, wrapGAppsHook, gobject-introspection, pango, gdk-pixbuf, atk, waf }:
, wrapGAppsHook, gobject-introspection, pango, gdk-pixbuf, atk, wafHook }:

python3Packages.buildPythonApplication rec {
pname = "hamster";
@@ -19,7 +19,7 @@ python3Packages.buildPythonApplication rec {
wrapGAppsHook
intltool
itstool
waf.hook
wafHook
glib
gobject-introspection
];
4 changes: 2 additions & 2 deletions pkgs/applications/misc/kupfer/default.nix
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
, desktop-file-utils
, shared-mime-info
, wrapGAppsHook
, waf
, wafHook
, bash
, dbus
}:
@@ -31,7 +31,7 @@ buildPythonApplication rec {
nativeBuildInputs = [
wrapGAppsHook intltool
# For setup hook
gobject-introspection waf.hook
gobject-introspection wafHook
itstool # for help pages
desktop-file-utils # for update-desktop-database
shared-mime-info # for update-mime-info
6 changes: 3 additions & 3 deletions pkgs/applications/office/semantik/default.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
, mkDerivation
, fetchFromGitLab
, fetchpatch
, waf
, wafHook
, pkg-config
, cmake
, qtbase
@@ -65,7 +65,7 @@ mkDerivation rec {
--replace /usr/include/KF5/KDELibs4Support "${lib.getDev kdelibs4support}/include/KF5/KDELibs4Support"
'';

nativeBuildInputs = [ (lib.getDev qtsvg) (lib.getLib qtsvg) python3 pkg-config waf.hook cmake ];
nativeBuildInputs = [ (lib.getDev qtsvg) (lib.getLib qtsvg) python3 pkg-config wafHook cmake ];

buildInputs = [
qtbase
@@ -85,7 +85,7 @@ mkDerivation rec {
kdelibs4support
];

configureFlags = [
wafConfigureFlags = [
"--qtlibs=${lib.getLib qtbase}/lib"
];

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, pkg-config, fetchFromGitHub, python3, vala
, gtk3, libwnck, libxfce4util, xfce4-panel, waf, xfce
, gtk3, libwnck, libxfce4util, xfce4-panel, wafHook, xfce
, gitUpdater
}:

@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-aKrJzf9rwCyXAJsRIXdBzmJBASuXD5I5kZrp+atx4FA=";
};

nativeBuildInputs = [ pkg-config vala waf.hook python3 ];
nativeBuildInputs = [ pkg-config vala wafHook python3 ];
buildInputs = [ gtk3 libwnck libxfce4util xfce4-panel ];

postPatch = ''
4 changes: 2 additions & 2 deletions pkgs/development/libraries/aubio/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, alsa-lib, fftw, libjack2, libsamplerate
, libsndfile, pkg-config, python3, waf
, libsndfile, pkg-config, python3, wafHook
}:

stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "1npks71ljc48w6858l9bq30kaf5nph8z0v61jkfb70xb9np850nl";
};

nativeBuildInputs = [ pkg-config python3 waf.hook ];
nativeBuildInputs = [ pkg-config python3 wafHook ];
buildInputs = [ alsa-lib fftw libjack2 libsamplerate libsndfile ];

strictDeps = true;
4 changes: 2 additions & 2 deletions pkgs/development/libraries/audio/lilv/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, sratom, waf
{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, sratom, wafHook

# test derivations
, pipewire
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {

patches = [ ./lilv-pkgconfig.patch ];

nativeBuildInputs = [ pkg-config python3 waf.hook ];
nativeBuildInputs = [ pkg-config python3 wafHook ];
buildInputs = [ serd sord sratom ];
propagatedBuildInputs = [ lv2 ];
dontAddWafCrossFlags = true;
Loading

0 comments on commit 6946977

Please sign in to comment.