-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python-bindings: Incremental building
Can now do this: $ nix develop .#python $ cd python $ make Also reuses the common.sh/init.sh testing scripts
- Loading branch information
Showing
12 changed files
with
76 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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 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 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 +1,2 @@ | ||
.cache | ||
build |
This file contains 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 @@ | ||
test: | ||
$(MAKE) -C .. python/build tests/common.sh | ||
meson test -C python/build -v | ||
|
||
build: | ||
$(MAKE) -C .. python/build | ||
meson compile -C python/build | ||
|
||
.PHONY: build test |
This file contains 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,24 @@ | ||
{ self, python, ninja, meson, pkg-config, boost, nix }: | ||
python.pkgs.buildPythonPackage { | ||
name = "nix"; | ||
format = "other"; | ||
|
||
src = self; | ||
postUnpack = "sourceRoot=$sourceRoot/python"; | ||
|
||
nativeBuildInputs = [ | ||
ninja | ||
(meson.override { python3 = python; }) | ||
pkg-config | ||
nix | ||
]; | ||
|
||
strictDeps = true; | ||
|
||
buildInputs = [ | ||
nix | ||
boost | ||
]; | ||
|
||
installCheckPhase = "meson test -v"; | ||
} |
This file contains 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,8 @@ | ||
pythonbuild=$(d)/python/build | ||
|
||
clean-files += $(pythonbuild) | ||
|
||
python/build: src/libexpr/nix-expr.pc $(libdir)/libnixexpr.so src/libmain/nix-main.pc $(libdir)/libnixmain.so | ||
rm -rf $(pythonbuild) | ||
PKG_CONFIG_PATH=$(libdir)/pkgconfig:$$PKG_CONFIG_PATH meson setup $(pythonbuild) python | ||
touch python/build |
This file contains 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 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
#include <Python.h> | ||
|
||
#include <nix/config.h> | ||
#include <config.h> | ||
|
||
#include <eval.hh> | ||
|
||
|
This file contains 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 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 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 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,7 @@ | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
cd "$SCRIPT_DIR"/../tests | ||
|
||
source init.sh | ||
|
||
python "$SCRIPT_DIR"/tests.py |