This avoids the potential conflict between autoconf flags and the waf
flags. There is some overlap between the two but waf errors when it
doesn’t recognize the flag.
waf does support --build and --host, but the only effect of these
options is an error message telling to use --cross-compile instead.
So we ignore these flags.
The waf build system is python-based and hosted locally in each package in the executable file named "waf". Unlike CMake, it cannot generate makefiles so we end up having to override the configure, build, and install phases. I've tried to keep these as close to what's in setup.sh as possible. If there is no waf file in the root directory, then we just copy the one hosted in Nixpkgs. Otherwise the only thing you have to add to a package using Waf is "wafHook" into nativeBuildInputs. wafFlags controls the flags specifically passed to waf while configureFlags, buildFlags, and installFlags are still used as in the generic builder.
This commit also swaps the build tool to use python3 internally (which waf fully
supports and prefers) and swaps the src to be downloaded from gitlab. The waf.io
site only keeps source tarballs of the latest version, so once a new waf comes
out we can no longer reproduce older versions.
We need the ensureNewerSources hook to avoid this error, in both `python2` and `python3`:
ValueError: ZIP does not support timestamps before 1980
Semi-automatic update generated by https://github.com/ryantm/nix-update tools. These checks were done:
- built on NixOS
- Warning: no binary found that responded to help or version flags. (This warning appears even if the package isn't expected to have binaries.)
- found 2.0.6 with grep in /nix/store/5rgayqfl64bn9pyrfsc9kcm2c4vdqybi-waf-2.0.6
- found 2.0.6 in filename of file in /nix/store/5rgayqfl64bn9pyrfsc9kcm2c4vdqybi-waf-2.0.6
Semi-automatic update. These checks were performed:
- built on NixOS
- found 2.0.4 with grep in /nix/store/dr6xvrw483jr5vgznwpjj0hxx3jq86ha-waf-2.0.4
- found 2.0.4 in filename of file in /nix/store/dr6xvrw483jr5vgznwpjj0hxx3jq86ha-waf-2.0.4
cc "@vrthra"