about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/build-managers/scons/common.nix
blob: 64890d12cea9689ee5839b74160a8df3060ee729 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ version, sha256 }:

{ fetchurl, python, lib }:

python.pkgs.buildPythonApplication rec {
  pname = "scons";
  inherit version;

  src = fetchurl {
    url =
      if lib.versionAtLeast version "4.3.0" then
        "mirror://sourceforge/project/scons/scons/${version}/SCons-${version}.tar.gz"
      else
        "mirror://sourceforge/scons/scons-${version}.tar.gz";
    inherit sha256;
  };

  setupHook = ./setup-hook.sh;

  patches = lib.optionals (lib.versionAtLeast version "4.3.0") [
    ./env.patch
  ];

  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 = with lib.maintainers; [ AndersonTorres ];
  };
}