-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
python3.pkgs.ninja-python: replace with a stub implementation #246963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
99524a9
python3.pkgs.ninja-python: add tjni as a maintainer of this stub
tjni d36556b
python3.pkgs.ninja-python: replace with a stub implementation
tjni a586a9e
python3.pkgs.ninja: rename from ninja-python
tjni 39dd3d1
python3.pkgs.meson-python: depend on top-level ninja
tjni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,72 +1,47 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchFromGitHub | ||
| , fetchurl | ||
| , cmake | ||
| , setuptools-scm | ||
| , scikit-build | ||
| , pytestCheckHook | ||
| , pytest-virtualenv | ||
| , flit-core | ||
| , ninja | ||
| }: | ||
| let | ||
| # these must match NinjaUrls.cmake | ||
| ninja_src_url = "https://github.com/Kitware/ninja/archive/v1.11.1.g95dee.kitware.jobserver-1.tar.gz"; | ||
| ninja_src_sha256 = "7ba84551f5b315b4270dc7c51adef5dff83a2154a3665a6c9744245c122dd0db"; | ||
| ninja_src = fetchurl { | ||
| url = ninja_src_url; | ||
| sha256 = ninja_src_sha256; | ||
| }; | ||
| in | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "ninja"; | ||
| version = "1.11.1"; | ||
| inherit (ninja) version; | ||
| format = "pyproject"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "scikit-build"; | ||
| repo = "ninja-python-distributions"; | ||
| rev = version; | ||
| hash = "sha256-scCYsSEyN+u3qZhNhWYqHpJCl+JVJJbKz+T34gOXGJM="; | ||
| }; | ||
| patches = [ | ||
| # make sure cmake doesn't try to download the ninja sources | ||
| ./no-download.patch | ||
| ]; | ||
| src = ./stub; | ||
|
|
||
| inherit ninja_src; | ||
| postUnpack = '' | ||
| # assume that if the hash matches, the source should be fine | ||
| if ! grep "${ninja_src_sha256}" $sourceRoot/NinjaUrls.cmake; then | ||
| echo "ninja_src_sha256 doesn't match the hash in NinjaUrls.cmake!" | ||
| exit 1 | ||
| fi | ||
| mkdir -p "$sourceRoot/Ninja-src" | ||
| pushd "$sourceRoot/Ninja-src" | ||
| tar -xavf ${ninja_src} --strip-components 1 | ||
| popd | ||
| ''; | ||
| substituteInPlace "$sourceRoot/pyproject.toml" \ | ||
| --subst-var version | ||
|
|
||
| postPatch = '' | ||
| sed -i '/cov/d' setup.cfg | ||
| substituteInPlace "$sourceRoot/ninja/__init__.py" \ | ||
| --subst-var-by BIN_DIR "${ninja}/bin" | ||
| ''; | ||
|
|
||
| dontUseCmakeConfigure = true; | ||
| inherit (ninja) setupHook; | ||
|
|
||
| nativeBuildInputs = [ | ||
| setuptools-scm | ||
| scikit-build | ||
| cmake | ||
| flit-core | ||
| ]; | ||
|
|
||
| nativeCheckInputs = [ | ||
| pytestCheckHook | ||
| pytest-virtualenv | ||
| preBuild = '' | ||
| cp "${ninja.src}/misc/ninja_syntax.py" ninja/ninja_syntax.py | ||
| ''; | ||
|
|
||
| pythonImportsCheck = [ | ||
| "ninja" | ||
| "ninja.ninja_syntax" | ||
| ]; | ||
|
|
||
| meta = with lib; { | ||
| description = "A small build system with a focus on speed"; | ||
| longDescription = '' | ||
| This is a stub of the ninja package on PyPI that uses the ninja program | ||
| provided by nixpkgs instead of downloading ninja from the web. | ||
| ''; | ||
| homepage = "https://github.com/scikit-build/ninja-python-distributions"; | ||
| license = licenses.asl20; | ||
| maintainers = with maintainers; [ _999eagle ]; | ||
| maintainers = with maintainers; [ _999eagle tjni ]; | ||
| }; | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import os | ||
| import subprocess | ||
| import sys | ||
|
|
||
| def _program(name, args): | ||
| return subprocess.call([os.path.join('@BIN_DIR@', name)] + args, close_fds=False) | ||
|
|
||
| def ninja(): | ||
| raise SystemExit(_program('ninja', sys.argv[1:])) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [build-system] | ||
| requires = ["flit_core"] | ||
| build-backend = "flit_core.buildapi" | ||
|
|
||
| [project] | ||
| name = "ninja" | ||
| version = "@version@" | ||
| description = "Ninja is a small build system with a focus on speed" | ||
|
|
||
| [project.scripts] | ||
| ninja = "ninja:ninja" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.