Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ __pycache__/
*.c

# Distribution / packaging
/build/
.Python
env/
venv/
build/
develop-eggs/
dist/
downloads/
Expand Down
2 changes: 1 addition & 1 deletion dev/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e # exit if an error occurs

BUILD_PATH="build/`dev/abi.py`"
BUILD_PATH="build/`dev/build/abi.py`"

echo Rebuilding $BUILD_PATH...
meson compile -C $BUILD_PATH
File renamed without changes.
19 changes: 19 additions & 0 deletions dev/build/add_version_file_to_dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e # exit if an error occurs

if [[ -z "$MESON_SOURCE_ROOT" ]]; then
echo "ERROR: Must be run inside a meson build environment where the variable MESON_SOURCE_ROOT is set." 1>&2
exit 1
fi

if [[ -z "$MESON_DIST_ROOT" ]]; then
echo "ERROR: Must be run inside a meson build environment where the variable MESON_DIST_ROOT is set." 1>&2
exit 1
fi

VERSION_PATH="raysect/_version.py"
SRC_PATH="$MESON_SOURCE_ROOT/$VERSION_PATH"
DIST_PATH="$MESON_DIST_ROOT/$VERSION_PATH"

echo "Copying $VERSION_PATH to distribution path $DIST_PATH"
cp $SRC_PATH $DIST_PATH
File renamed without changes.
3 changes: 0 additions & 3 deletions dev/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/bin/bash

echo Building code...

dev/build.sh

echo Building docs...

export PYTHONPATH=../:$PYTHONPATH

cd docs

make html
2 changes: 1 addition & 1 deletion dev/clean.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e # exit if an error occurs

BUILD_PATH="build/`dev/abi.py`"
BUILD_PATH="build/`dev/build/abi.py`"

echo Cleaning $BUILD_PATH...
meson compile -C $BUILD_PATH --clean
Expand Down
5 changes: 4 additions & 1 deletion dev/root-meson.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
project('raysect', 'cython',
default_options: ['python.install-env=auto'],
version: run_command(['dev/update_version.sh'], check: true).stdout().strip()
version: run_command(['dev/build/update_version.sh'], check: true).stdout().strip()
)

# when building a distribution, copy the dynamically generated _version.py to the distribution folder
meson.add_dist_script('dev/build/add_version_file_to_dist.sh')

py = import('python').find_installation(pure: false)
numpy = dependency('numpy', method: 'config-tool')
fs = import('fs')
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

project('raysect', 'cython',
default_options: ['python.install-env=auto'],
version: run_command(['dev/update_version.sh'], check: true).stdout().strip()
version: run_command(['dev/build/update_version.sh'], check: true).stdout().strip()
)

# when building a distribution, copy the dynamically generated _version.py to the distribution folder
meson.add_dist_script('dev/build/add_version_file_to_dist.sh')

py = import('python').find_installation(pure: false)
numpy = dependency('numpy', method: 'config-tool')
fs = import('fs')
Expand Down