mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 00:53:57 +00:00
218df5159c
This allows users of scons to pick the correct version of python. Previously we had issues with some build systems not picking the right python3 version when adding additional python modules to the build environment. A famous example of this is mongodb where additional python modules are required to run the scons build. This is change doesn't introduce rebuilds (to the best of my knowledge) as it only adds a passthru argument and changes how we pass the python version around.
55 lines
1.7 KiB
Nix
55 lines
1.7 KiB
Nix
{ version, sha256 }:
|
|
|
|
{ fetchurl, python, lib }:
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
|
pname = "scons";
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/scons/${pname}-${version}.tar.gz";
|
|
inherit sha256;
|
|
};
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
postPatch = lib.optionalString (lib.versionAtLeast version "4.0.0") ''
|
|
substituteInPlace setup.cfg \
|
|
--replace "build/dist" "dist"
|
|
'' + lib.optionalString (lib.versionAtLeast version "4.1.0") ''
|
|
substituteInPlace setup.cfg \
|
|
--replace "build/doc/man/" ""
|
|
'';
|
|
|
|
# The release tarballs don't contain any tests (runtest.py and test/*):
|
|
doCheck = lib.versionOlder version "4.0.0";
|
|
|
|
postInstall = lib.optionalString (lib.versionAtLeast version "4.1.0") ''
|
|
mkdir -p "$out/share/man/man1"
|
|
mv "$out/"*.1 "$out/share/man/man1/"
|
|
'';
|
|
|
|
passthru = {
|
|
# expose the used python version so tools using this (and extensing scos with other python modules)
|
|
# can use the exact same python version.
|
|
inherit python;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "An improved, cross-platform substitute for Make";
|
|
longDescription = ''
|
|
SCons is an Open Source software construction tool. Think of
|
|
SCons as an improved, cross-platform substitute for the classic
|
|
Make utility with integrated functionality similar to
|
|
autoconf/automake and compiler caches such as ccache. In short,
|
|
SCons is an easier, more reliable and faster way to build
|
|
software.
|
|
'';
|
|
homepage = "https://scons.org/";
|
|
changelog = "https://raw.githubusercontent.com/SConsProject/scons/rel_${version}/src/CHANGES.txt";
|
|
license = licenses.mit;
|
|
platforms = platforms.all;
|
|
maintainers = [ ];
|
|
};
|
|
}
|