Compare commits

...
5 Commits
4 changed files with 39 additions and 15 deletions

No files matched your search

+3 -10
View File
@@ -24,16 +24,9 @@ RUN git clone --depth 1 --branch v${b3d_vs_major}.${b3d_vs_minor} \
https://projects.blender.org/blender/blender.git /opt/blender
# Start build
# install_linux_packages.py (default, no --all) skips a handful of packages
# that are only provided via the precompiled-libs bundle or via --all:
# libepoxy-dev, Boost (all components), OpenImageIO. --all itself is not an
# option here: it also checks its own apt catalog for a python3-dev matching
# [3.11, 3.13[, which fails on Debian trixie regardless of which Python the
# base image runs (that check queries apt's package catalog, not the actual
# interpreter on PATH). Since `make update` below skips the precompiled
# bundle on Linux by default, these are needed from apt regardless - install
# them explicitly instead.
RUN cd /opt/blender/build_files/build_environment && \
# Need to find the linux deps file.
RUN dep=$(find /opt/blender -name install_linux_packages.py) && \
cd "$(dirname "$dep")" && \
chmod a+x ./install_linux_packages.py && \
python install_linux_packages.py && \
apt-get install -y libepoxy-dev libboost-all-dev libopenimageio-dev libembree-dev libpugixml-dev && \
+13 -2
View File
@@ -1,8 +1,12 @@
[![Blender](https://img.shields.io/badge/blender-5.1.2-%23F5792A.svg?style=flat&logo=blender&logoColor=white)](https://www.blender.org/download/)
[![Blender](https://img.shields.io/badge/blender-5.3.0-%23F5792A.svg?style=flat&logo=blender&logoColor=white)](https://www.blender.org/download/)
![Static Badge](https://img.shields.io/badge/docker-hub-blue?logo=docker&logoColor=blue&labelColor=black&link=https%3A%2F%2Fhub.docker.com%2Fr%2Fstilobique%2Fblender)
# Blender Docker
This repository is an automated blender docker image file generated, it's usefully with blender addon unit test.
<p align="center" style="height: 128px;">
<img src=".idea/icon.svg" alt="Blender Docker logo" width="128">
</p>
# Building
@@ -23,12 +27,19 @@ invoke --list
```
## Debug and logs
Some log are generated inside a `logs` folder.
Some log is generated inside a `logs` folder.
- `build`: all operation on build docker file.
- `clean`: from the dedicated function to clean all dockers images and cache.
- `test`: simple class method to try a specific docker image.
## Check if the build work
On each build, your new image are tested with this command:
```shell
./blender --version
```
If an error are return, the test failed.
More information about the [test on the dedicated section](#check-image-build).
# Use case
## Adding an Addon
+7 -3
View File
@@ -4,6 +4,7 @@ import tempfile
import importlib.util
from blender.version import BlenderVersion
from blender.misc import get_linux_deps_file
# "Wayland Protocols" has no "Library" in its name but is still a
# build-critical dependency, so it's matched by name too.
@@ -13,7 +14,7 @@ _EXTRA_PACKAGE_NAMES = {'wayland protocols'}
class BlenderDependency:
def __init__(self, blender: BlenderVersion):
self._blender_version = blender
self._url = rf'https://projects.blender.org/api/v1/repos/blender/blender/raw/build_files/build_environment/install_linux_packages.py?ref=v{self._blender_version.tag_name()}'
self._url = get_linux_deps_file(self._blender_version.tag_name())
self.module = self._get_source_file()
self.packages = list()
@@ -54,8 +55,11 @@ class BlenderDependency:
def _get_complete_list(self):
"""All packages required to build Blender (PACKAGES_BASICS_BUILD) as Debian/Ubuntu apt names."""
if hasattr(self.module, 'PACKAGES_BASICS_BUILD'):
for package in self._flatten(self.module.PACKAGES_BASICS_BUILD):
packages = 'PACKAGES_BASICS_BUILD'
if hasattr(self.module, 'PACKAGES_BUILD'):
packages = 'PACKAGES_BUILD'
for package in self._flatten(getattr(self.module, packages)):
name = package.distro_package_names.get(self.module.DISTRO_ID_DEBIAN)
if isinstance(name, str):
self.packages_complete.append(name)
+16
View File
@@ -92,6 +92,22 @@ def get_all_tags_from_docker():
print(release)
def get_linux_deps_file(tag_name: str) -> str | None:
"""Find the `install_linux_packages.py` about the blender version tested."""
base = r'https://projects.blender.org/api/v1/repos/blender/blender/raw'
links = [
rf'{base}/build_files/build_environment/install_linux_packages.py?ref=v{tag_name}',
rf'{base}/build_files/linux/install_linux_packages.py?ref=v{tag_name}'
]
for url in links:
r = requests.get(url)
if r.status_code == 200:
return url
return None
if __name__ == '__main__':
print('Clean docker')
clean_all_dockers()