2021-09-03 14:11:15 +10:00
|
|
|
# BlenderBIM Add-on - OpenBIM Blender Add-on
|
2023-03-04 23:04:05 +11:00
|
|
|
# Copyright (C) 2020-2023 Dion Moult <dion@thinkmoult.com>
|
2021-09-03 14:11:15 +10:00
|
|
|
#
|
|
|
|
|
# This file is part of BlenderBIM Add-on.
|
|
|
|
|
#
|
|
|
|
|
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# BlenderBIM Add-on is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2024-06-11 14:11:40 +10:00
|
|
|
PYTHON:=python3.11
|
|
|
|
|
PIP:=pip3.11
|
2022-09-07 20:26:44 +10:00
|
|
|
PATCH:=patch
|
|
|
|
|
SED:=sed -i
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
|
HOSTOS:=win
|
|
|
|
|
else
|
|
|
|
|
UNAME_S:=$(shell uname -s)
|
|
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
|
HOSTOS:=linux
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
|
HOSTOS:=macos
|
|
|
|
|
PYTHON:=python3
|
|
|
|
|
PATCH:=patch -d
|
|
|
|
|
SED:=sed -i '' -e
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2024-06-11 15:41:18 +10:00
|
|
|
IS_STABLE:=FALSE
|
2024-06-11 13:11:14 +10:00
|
|
|
VERSION:=$(shell cat ../../VERSION)
|
|
|
|
|
VERSION_MAJOR:=$(shell cat '../../VERSION' | cut -d '.' -f 1)
|
|
|
|
|
VERSION_MINOR:=$(shell cat '../../VERSION' | cut -d '.' -f 2)
|
|
|
|
|
VERSION_PATCH:=$(shell cat '../../VERSION' | cut -d '.' -f 3)
|
|
|
|
|
VERSION_DATE:=$(shell date '+%y%m%d')
|
2023-07-12 18:15:31 +05:00
|
|
|
LAST_COMMIT_HASH:=$(shell git rev-parse HEAD)
|
2023-07-01 15:36:45 +10:00
|
|
|
PYVERSION:=py310
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_IMP:=cp
|
2021-03-06 09:36:31 +11:00
|
|
|
|
2021-08-03 13:29:13 +10:00
|
|
|
ifeq ($(PYVERSION), py39)
|
|
|
|
|
PYLIBDIR:=python3.9
|
2021-08-08 12:06:01 +10:00
|
|
|
PYNUMBER:=39
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_VERSION:=3.9
|
2021-08-03 13:29:13 +10:00
|
|
|
endif
|
2022-03-14 16:43:10 +11:00
|
|
|
ifeq ($(PYVERSION), py310)
|
|
|
|
|
PYLIBDIR:=python3.10
|
2023-01-06 11:16:10 +11:00
|
|
|
PYNUMBER:=310
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_VERSION:=3.10
|
2022-03-14 16:43:10 +11:00
|
|
|
endif
|
2024-01-03 00:22:50 +01:00
|
|
|
ifeq ($(PYVERSION), py311)
|
|
|
|
|
PYLIBDIR:=python3.11
|
|
|
|
|
PYNUMBER:=311
|
|
|
|
|
PYPI_VERSION:=3.11
|
|
|
|
|
endif
|
2024-05-31 23:06:12 +10:00
|
|
|
ifeq ($(PYVERSION), py312)
|
|
|
|
|
PYLIBDIR:=python3.12
|
|
|
|
|
PYNUMBER:=312
|
|
|
|
|
PYPI_VERSION:=3.12
|
|
|
|
|
endif
|
2021-08-03 13:29:13 +10:00
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM), linux)
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_PLATFORM:=--platform manylinux_2_17_x86_64
|
2021-08-03 13:29:13 +10:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM), macos)
|
2024-06-01 10:48:36 +10:00
|
|
|
PYPI_PLATFORM:=--platform macosx_10_10_x86_64
|
2021-08-03 13:29:13 +10:00
|
|
|
endif
|
|
|
|
|
|
2022-09-16 20:30:33 +10:00
|
|
|
ifeq ($(PLATFORM), macosm1)
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_PLATFORM:=--platform macosx_11_0_arm64
|
2022-09-16 20:30:33 +10:00
|
|
|
endif
|
|
|
|
|
|
2021-08-03 13:29:13 +10:00
|
|
|
ifeq ($(PLATFORM), win)
|
2023-08-20 15:28:09 +10:00
|
|
|
PYPI_PLATFORM:=--platform win_amd64
|
2021-08-03 13:29:13 +10:00
|
|
|
endif
|
|
|
|
|
|
2024-07-05 11:57:57 +05:00
|
|
|
# Current build commit hash.
|
2024-07-09 08:22:57 +10:00
|
|
|
OLD:=c18e4ea
|
2023-01-05 18:38:32 +11:00
|
|
|
.PHONY: bump
|
|
|
|
|
bump:
|
2024-07-05 11:57:57 +05:00
|
|
|
cd . && $(SED) -b "s/$(OLD)/$(NEW)/" Makefile
|
|
|
|
|
cd ../ifcopenshell-python/ && $(SED) -b "s/$(OLD)/$(NEW)/" Makefile
|
|
|
|
|
cd ../ifcopenshell-python/docs/ifcconvert/ && $(SED) -b "s/$(OLD)/$(NEW)/" installation.rst
|
2023-01-05 18:38:32 +11:00
|
|
|
|
2019-10-06 19:59:41 +11:00
|
|
|
.PHONY: dist
|
|
|
|
|
dist:
|
|
|
|
|
ifndef PLATFORM
|
|
|
|
|
$(error PLATFORM is not set)
|
|
|
|
|
endif
|
|
|
|
|
rm -rf dist
|
2019-12-16 05:44:52 +01:00
|
|
|
mkdir -p dist/working
|
|
|
|
|
mkdir -p dist/blenderbim
|
|
|
|
|
cp -r blenderbim/* dist/blenderbim/
|
|
|
|
|
|
2020-07-27 21:01:16 +10:00
|
|
|
# Provides IfcOpenShell Python functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcopenshell-python && make dist PLATFORM=$(PLATFORM)64 PYVERSION=$(PYVERSION) && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.9-${OLD}-$(PLATFORM)64.zip
|
|
|
|
|
# cd dist/working && unzip ifcopenshell-python*
|
|
|
|
|
# cp -r dist/working/ifcopenshell dist/blenderbim/libs/site/packages/
|
2024-07-16 11:17:33 +05:00
|
|
|
rm -rf dist/working
|
2021-03-06 09:36:31 +11:00
|
|
|
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides dependencies that are part of IfcOpenShell
|
|
|
|
|
mkdir dist/working
|
2024-07-17 21:29:58 +10:00
|
|
|
# cd dist/working && wget https://github.com/IfcOpenShell/IfcOpenShell/archive/refs/heads/v0.8.0.zip
|
|
|
|
|
# cd dist/working && unzip v0.8.0.zip
|
2024-06-26 10:24:32 +10:00
|
|
|
# IfcOpenBot sometimes lags behind, so we only use its binaries
|
2024-07-17 21:29:58 +10:00
|
|
|
# mv dist/blenderbim/libs/site/packages/ifcopenshell/*ifcopenshell_wrapper* dist/working/
|
|
|
|
|
# rm -rf dist/blenderbim/libs/site/packages/ifcopenshell
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifcopenshell-python/ifcopenshell dist/blenderbim/libs/site/packages/
|
|
|
|
|
# mv dist/working/*ifcopenshell_wrapper* dist/blenderbim/libs/site/packages/ifcopenshell/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides bcf functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../bcf && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/bcf/src/bcf dist/blenderbim/libs/site/packages/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides IFCClash functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcclash && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifcclash/ifcclash dist/blenderbim/libs/site/packages/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides BIMTester functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcbimtester && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
2022-08-16 11:51:16 +10:00
|
|
|
# Provides IFCTester functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifctester && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifctester/ifctester dist/blenderbim/libs/site/packages/
|
2023-09-13 17:06:42 +10:00
|
|
|
# Provides IFCFM functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcfm && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifcfm/ifcfm dist/blenderbim/libs/site/packages/
|
2023-09-19 18:13:38 +10:00
|
|
|
# Provides bSDD functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../bsdd && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/bsdd/* dist/blenderbim/libs/site/packages/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides IFCDiff functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcdiff && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifcdiff/* dist/blenderbim/libs/site/packages/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides IFCCSV functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifccsv && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifccsv/* dist/blenderbim/libs/site/packages/
|
2021-01-26 12:54:27 +11:00
|
|
|
# Provides IFCPatch functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifcpatch && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifcpatch/ifcpatch dist/blenderbim/libs/site/packages/
|
2021-08-05 13:21:55 +10:00
|
|
|
# Provides IFC4D functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifc4d && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifc4d/ifc4d dist/blenderbim/libs/site/packages/
|
2021-08-09 17:12:23 +10:00
|
|
|
# Provides IFC5D functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifc5d && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifc5d/ifc5d dist/blenderbim/libs/site/packages/
|
2021-11-08 22:51:30 +01:00
|
|
|
# Provides IFCCityJSON functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd ../ifccityjson && make dist && cp dist/*.whl ../blenderbim/dist/blenderbim/wheels/
|
|
|
|
|
# cp -r dist/working/IfcOpenShell-0.8.0/src/ifccityjson dist/blenderbim/libs/site/packages/
|
2023-04-23 08:03:19 +01:00
|
|
|
# Provides IfcGit functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download GitPython --dest=../blenderbim/wheels
|
|
|
|
|
# cp -r dist/working/site-packages/smmap dist/blenderbim/libs/site/packages/
|
|
|
|
|
# cp -r dist/working/site-packages/gitdb dist/blenderbim/libs/site/packages/
|
|
|
|
|
# cp -r dist/working/site-packages/git dist/blenderbim/libs/site/packages/
|
2023-04-23 08:12:49 +01:00
|
|
|
rm -rf dist/working
|
2021-01-26 12:54:27 +11:00
|
|
|
|
2023-02-11 10:05:54 +01:00
|
|
|
# Provides audio playback for costing
|
2024-07-17 21:29:58 +10:00
|
|
|
# mkdir -p dist/working
|
|
|
|
|
# git clone https://github.com/Andrej730/aud.git --branch master-reduced-size --depth 1 dist/working/aud
|
|
|
|
|
# cd dist/working/aud && git checkout 529af208fbcb707c387bfb681d2605c0b6112de7
|
|
|
|
|
# cp -r dist/working/aud/aud dist/blenderbim/libs/site/packages/
|
|
|
|
|
# rm -rf dist/working
|
2023-02-11 10:05:54 +01:00
|
|
|
|
2021-04-21 12:57:31 +10:00
|
|
|
# Provides jsgantt-improved supports for web-based construction sequencing gantt charts
|
|
|
|
|
mkdir dist/working
|
|
|
|
|
cd dist/working && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
|
|
|
|
|
cd dist/working && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css
|
2021-04-21 16:45:11 +10:00
|
|
|
cp dist/working/jsgantt* dist/blenderbim/bim/data/gantt/
|
2021-04-21 12:57:31 +10:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2021-11-08 22:51:30 +01:00
|
|
|
mkdir dist/working
|
2022-09-07 20:26:44 +10:00
|
|
|
cd dist/working && $(PYTHON) -m venv env
|
2021-11-09 09:45:36 +11:00
|
|
|
cd dist/working && mkdir site-packages
|
2024-07-10 21:37:31 +05:00
|
|
|
# IfcOpenShell dependency - support for new typing features
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download typing_extensions --dest=../blenderbim/wheels
|
2023-08-20 15:28:09 +10:00
|
|
|
# Required by IfcCSV
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pandas $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-03-06 17:11:21 +11:00
|
|
|
# Pandas ships with very heavy tests
|
2024-07-17 21:29:58 +10:00
|
|
|
# cd dist/working/site-packages/pandas && rm -rf tests
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download openpyxl --dest=../blenderbim/wheels
|
|
|
|
|
# odfpy doesn't come with its own wheel, so whee'l (get it?) create it ourselves!
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) wheel odfpy --wheel-dir=./
|
|
|
|
|
cd dist/working && tar -xzvf odfpy* && cd odfpy* && python -m build && cp dist/*.whl ../blenderbim/wheels
|
|
|
|
|
# pip wheel odfpy --wheel-dir=.
|
2023-03-01 21:39:15 +11:00
|
|
|
# Required by IFCCityJSON
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download cjio --dest=../blenderbim/wheels
|
2023-03-01 21:39:15 +11:00
|
|
|
# Provides express rule validation for ifcopenshell.validate
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pytest --dest=../blenderbim/wheels
|
2023-06-01 21:08:27 -07:00
|
|
|
# Provides Brickschema functionality
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download "brickschema[persistence]==0.7.6a2" --dest=../blenderbim/wheels
|
2024-04-01 14:03:22 +05:00
|
|
|
# Required for SVG to DXF conversion
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download ezdxf --dest=../blenderbim/wheels
|
2024-05-19 23:50:57 +10:00
|
|
|
# Required by bcf
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download xsdata --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download xmlschema --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download elementpath --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download six --dest=../blenderbim/wheels
|
2024-05-31 23:06:12 +10:00
|
|
|
# Required by drawing module
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download lxml $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-06-01 10:21:33 +10:00
|
|
|
# Required by qto and drawing module
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download shapely $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Required by the BIM type manager thumbnail generator
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pillow $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Provides mustache templating in construction docs and web UI data
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pystache --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Provides SVG export in construction documentation
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download svgwrite --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Provides fuzzy date parsing for construction sequencing
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download python-dateutil --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Provides duration parsing for construction sequencing
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download isodate --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Provides networkx graph analysis for project dependency calculations
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download networkx --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Required by IFCDiff
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download deepdiff --dest=../blenderbim/wheels
|
2024-06-01 10:38:04 +10:00
|
|
|
# Required by IFCCSV and ifcopenshell.util.selector
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download lark --dest=../blenderbim/wheels
|
2024-06-01 12:03:41 +10:00
|
|
|
# Required by IFC4D
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download PyP6Xer --dest=../blenderbim/wheels
|
2024-07-09 22:03:04 +10:00
|
|
|
# Required by web module
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download python-socketio[asyncio_client] --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download aiohttp --dest=../blenderbim/wheels
|
2024-07-09 22:03:04 +10:00
|
|
|
# Required by light module
|
2024-07-17 21:29:58 +10:00
|
|
|
# cd dist/working && . env/bin/activate && $(PIP) download pytz --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pytz --dest ../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download tzfpy $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-07-16 22:55:49 +10:00
|
|
|
# pyradiance is using different platform versions than defaults in our makefile.
|
2024-07-14 23:03:45 +10:00
|
|
|
ifeq ($(PLATFORM), linux)
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pyradiance --platform manylinux_2_35_x86_64 --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-07-16 12:04:28 +05:00
|
|
|
else ifeq ($(PLATFORM), macos)
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pyradiance --platform macosx_10_13_x86_64 --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-07-16 12:04:28 +05:00
|
|
|
else
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download pyradiance $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=../blenderbim/wheels
|
2024-07-14 23:03:45 +10:00
|
|
|
endif
|
2024-06-19 10:52:48 +05:00
|
|
|
|
2024-07-17 21:29:58 +10:00
|
|
|
# cp -r dist/working/site-packages/* dist/blenderbim/libs/site/packages/
|
2021-11-08 22:51:30 +01:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2020-07-20 22:08:39 +10:00
|
|
|
# Required by BIMTester
|
|
|
|
|
mkdir dist/working
|
|
|
|
|
cd dist/working && wget https://files.pythonhosted.org/packages/c8/4b/d0a8c23b6c8985e5544ea96d27105a273ea22051317f850c2cdbf2029fe4/behave-1.2.6.tar.gz
|
|
|
|
|
cd dist/working && tar -xzvf behave*
|
|
|
|
|
cd dist/working/behave-1.2.6/ && cp -r behave ../../blenderbim/libs/site/packages/
|
2021-03-21 12:07:11 +11:00
|
|
|
# See bug #1294
|
2024-06-08 00:18:23 +05:00
|
|
|
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/src/ifcbimtester/patch/model_core.patch
|
|
|
|
|
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/src/ifcbimtester/patch/runner_util.patch
|
2022-09-07 20:26:44 +10:00
|
|
|
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/model_core.py < model_core.patch
|
|
|
|
|
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/runner_util.py < runner_util.patch
|
2022-08-26 13:40:20 +10:00
|
|
|
# See bug #2159
|
2024-06-08 00:18:23 +05:00
|
|
|
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/src/ifcbimtester/patch/junit.patch
|
2022-09-07 20:26:44 +10:00
|
|
|
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/reporter/junit.py < junit.patch
|
2020-07-20 22:08:39 +10:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
|
|
|
|
# Required by behave
|
|
|
|
|
mkdir dist/working
|
2024-07-17 21:29:58 +10:00
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download parse --dest=../blenderbim/wheels
|
|
|
|
|
cd dist/working && . env/bin/activate && $(PIP) download parse-type --dest=../blenderbim/wheels
|
2021-03-01 10:57:48 +11:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2020-08-09 18:10:30 +10:00
|
|
|
# Provides IFCJSON functionality
|
|
|
|
|
mkdir dist/working
|
|
|
|
|
cd dist/working && wget https://github.com/IFCJSON-Team/IFC2JSON_python/archive/master.zip
|
|
|
|
|
cd dist/working && unzip master.zip
|
2020-11-15 22:15:53 +11:00
|
|
|
cp -r dist/working/IFC2JSON_python-master/file_converters/ifcjson dist/blenderbim/libs/site/packages/
|
2020-08-09 18:10:30 +10:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2022-08-27 10:36:54 -04:00
|
|
|
# Provides Brickschema functionality
|
2021-11-04 18:02:50 +11:00
|
|
|
mkdir dist/working
|
|
|
|
|
# For now lets bundle the latest nightly schema
|
|
|
|
|
cd dist/working && wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
|
2023-03-10 17:49:11 +11:00
|
|
|
cd dist/working && cp Brick.ttl ../blenderbim/bim/schema/Brick.ttl
|
2021-11-04 18:02:50 +11:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
|
|
|
|
# Required by brickschema
|
2022-03-14 16:43:27 +11:00
|
|
|
# This is a bit of a dodgy one, it should be provided by setuptools which Blender doesn't ship.
|
|
|
|
|
mkdir dist/working
|
2024-06-08 00:18:23 +05:00
|
|
|
cd dist/working && wget https://github.com/IfcOpenShell/IfcOpenShell/raw/v0.8.0/src/blenderbim/scripts/pkg_resources.tar.gz
|
2022-03-14 16:43:27 +11:00
|
|
|
cd dist/working && tar -xzvf pkg_resources*
|
|
|
|
|
cd dist/working/ && cp -r pkg_resources ../blenderbim/libs/site/packages/
|
2021-08-23 16:34:19 +10:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2023-02-27 21:49:04 +11:00
|
|
|
# Required for hipped roof generation
|
|
|
|
|
mkdir dist/working
|
|
|
|
|
cd dist/working && wget https://github.com/prochitecture/bpypolyskel/archive/refs/heads/master.zip
|
|
|
|
|
cd dist/working && unzip master.zip
|
|
|
|
|
cp -r dist/working/bpypolyskel-master/bpypolyskel dist/blenderbim/libs/site/packages/
|
|
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2023-05-07 13:08:28 +01:00
|
|
|
# Required for Desktop icon and file association
|
|
|
|
|
cp -r blenderbim/libs/desktop dist/blenderbim/libs/
|
|
|
|
|
|
2024-03-02 22:58:58 +11:00
|
|
|
# Generate translations module for BBIM build
|
2024-01-17 17:10:07 +05:00
|
|
|
git clone https://github.com/IfcOpenShell/blenderbim-translations.git dist/working
|
2024-03-03 16:50:00 +05:30
|
|
|
$(PYTHON) scripts/bbim_translations.py -i "dist/working" -o "dist/blenderbim"
|
2024-01-17 17:10:07 +05:00
|
|
|
rm -rf dist/working
|
|
|
|
|
|
2023-05-04 19:44:52 +10:00
|
|
|
# Remove dependencies also bundled with Blender
|
2024-07-17 21:29:58 +10:00
|
|
|
rm -rf dist/blenderbim/wheels/numpy*
|
|
|
|
|
# rm -rf dist/blenderbim/libs/site/packages/numpy
|
|
|
|
|
# rm -rf dist/blenderbim/libs/site/packages/numpy.libs
|
2023-05-04 19:44:52 +10:00
|
|
|
|
2024-06-11 15:41:18 +10:00
|
|
|
ifeq ($(IS_STABLE), TRUE)
|
|
|
|
|
cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH)/" __init__.py
|
|
|
|
|
cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION)/" blender_manifest.toml
|
|
|
|
|
cd dist && zip -r blenderbim-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ./*
|
|
|
|
|
else
|
2024-06-11 13:11:14 +10:00
|
|
|
cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH), $(VERSION_DATE)/" __init__.py
|
2024-07-17 12:25:32 +05:00
|
|
|
# Blender manifest version must be semver compatible.
|
|
|
|
|
cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION)-$(VERSION_DATE)/" blender_manifest.toml
|
2024-07-16 15:59:33 +05:00
|
|
|
cd dist/blenderbim && $(SED) "s/8888888/$(LAST_COMMIT_HASH)/" __init__.py
|
2024-06-11 00:09:20 +10:00
|
|
|
cd dist && zip -r blenderbim-$(VERSION).$(VERSION_DATE)-$(PYVERSION)-$(PLATFORM).zip ./*
|
|
|
|
|
endif
|
2019-12-19 04:35:19 +01:00
|
|
|
rm -rf dist/blenderbim
|
2019-10-06 19:59:41 +11:00
|
|
|
|
2021-09-03 14:11:15 +10:00
|
|
|
.PHONY: test
|
|
|
|
|
test:
|
|
|
|
|
make test-core
|
2021-09-29 14:14:10 +10:00
|
|
|
make test-tool
|
2021-09-03 14:11:15 +10:00
|
|
|
make test-bim
|
|
|
|
|
|
|
|
|
|
.PHONY: test-core
|
|
|
|
|
test-core:
|
|
|
|
|
pytest -p no:pytest-blender test/core
|
|
|
|
|
|
|
|
|
|
.PHONY: test-bim
|
|
|
|
|
test-bim:
|
2022-05-08 15:45:47 +10:00
|
|
|
ifndef MODULE
|
2021-09-03 14:11:15 +10:00
|
|
|
pytest test/bim
|
2022-05-08 15:45:47 +10:00
|
|
|
else
|
|
|
|
|
pytest test/bim -m "$(MODULE)" ./ --maxfail=1
|
|
|
|
|
endif
|
2021-09-03 14:11:15 +10:00
|
|
|
|
2021-09-29 14:14:10 +10:00
|
|
|
.PHONY: test-tool
|
|
|
|
|
test-tool:
|
2022-05-08 15:45:47 +10:00
|
|
|
ifndef MODULE
|
2021-09-29 14:14:10 +10:00
|
|
|
pytest test/tool
|
2022-05-08 15:45:47 +10:00
|
|
|
else
|
|
|
|
|
pytest test/tool/test_$(MODULE).py
|
|
|
|
|
endif
|
2021-09-29 14:14:10 +10:00
|
|
|
|
2021-09-09 21:27:23 +10:00
|
|
|
.PHONY: qa
|
|
|
|
|
qa:
|
|
|
|
|
black .
|
2021-09-10 10:01:06 +10:00
|
|
|
pylint ./* --output-format=colorized --disable all --enable E --disable import-error
|
2021-09-09 21:27:23 +10:00
|
|
|
|
2021-09-03 14:11:15 +10:00
|
|
|
.PHONY: coverage
|
|
|
|
|
coverage:
|
|
|
|
|
coverage run --source blenderbim.core -m pytest -p no:pytest-blender test/core
|
|
|
|
|
coverage html
|
|
|
|
|
xdg-open htmlcov/index.html
|
|
|
|
|
|
|
|
|
|
.PHONY: license
|
|
|
|
|
license:
|
2022-01-07 14:22:34 +11:00
|
|
|
copyright-header --license GPL3 --copyright-holder "Dion Moult <dion@thinkmoult.com>" --copyright-year "2022" --copyright-software "BlenderBIM Add-on" --copyright-software-description "OpenBIM Blender Add-on" -a ./ -o ./
|
2021-09-03 14:11:15 +10:00
|
|
|
|
2019-10-06 19:59:41 +11:00
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf dist
|
2021-09-03 14:11:15 +10:00
|
|
|
rm -rf htmlcov
|
2021-09-23 12:29:28 +02:00
|
|
|
|
|
|
|
|
.PHONY: dev
|
|
|
|
|
dev:
|
|
|
|
|
blender -p setup_pytest.py
|