1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitiles,
6 six,
7 python,
8}:
9
10buildPythonPackage {
11 pname = "gyp";
12 version = "unstable-2022-04-01";
13 format = "setuptools";
14
15 src = fetchFromGitiles {
16 url = "https://chromium.googlesource.com/external/gyp";
17 rev = "9ecf45e37677743503342ee4c6a76eaee80e4a7f";
18 hash = "sha256-LUlF2VhRnuDwJLdITgmXIQV/IuKdx1KXQkiPVHKrl4Q=";
19 };
20
21 patches = lib.optionals stdenv.hostPlatform.isDarwin [
22 ./no-darwin-cflags.patch
23 ./no-xcode.patch
24 ];
25
26 propagatedBuildInputs = [ six ];
27
28 pythonImportsCheck = [
29 "gyp"
30 "gyp.generator"
31 ];
32
33 # Make mac_tool.py executable so that patchShebangs hook processes it. This
34 # file is copied and run by builds using gyp on macOS
35 preFixup = ''
36 chmod +x "$out/${python.sitePackages}/gyp/mac_tool.py"
37 '';
38
39 meta = with lib; {
40 description = "Tool to generate native build files";
41 mainProgram = "gyp";
42 homepage = "https://gyp.gsrc.io";
43 license = licenses.bsd3;
44 maintainers = with maintainers; [ codyopel ];
45 };
46}