Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

197.4. ifcopenshell-0.8.5

IFC (BIM) toolkit: the C++ parser and OpenCASCADE geometry, IfcConvert and the ifcopenshell Python module FreeCAD's BIM workbench imports

Version 0.8.5, release 2
Shelf cad — Mechanical, architectural and 2D CAD, geometry kernels, meshing and FEM
Phase 42_graphics (Graphics Stack), 72 of 189 in build order
Licence LGPL-3.0-or-later
Homepage https://ifcopenshell.org/
Build time 29.8 SBU
Installed size 93.9 MiB in 1124 files
Recipe ports/core/cad/ifcopenshell/kpkgbuild

About

IfcOpenShell reads and writes IFC, the open file format of building information modelling (BIM). The port builds its C++ parser (IfcParse), its geometry library (IfcGeom, on OpenCASCADE), the IfcConvert command, which turns an IFC model into OBJ, glTF, STEP, IGES, SVG, HDF5, XML or another IFC, and the ifcopenshell Python module. FreeCAD’s BIM workbench imports that module to open and edit IFC files natively.

Sources

Dependencies

Depends on: cmake, ninja, swig, python3, boost, eigen, opencascade, hdf5, libxml2, nlohmann-json, zlib, numpy, python3-lark, python3-dateutil, python3-typing-extensions, python3-isodate, python3-shapely.

Required by (1): freecad.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install ifcopenshell'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/cad/ifcopenshell.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/cad/ifcopenshell
echo '185b97d79c800603685c60abd1497df242050dbb117dcaccbaebdec0cdf25dd5  ifcopenshell-0.8.5.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/ifcopenshell
SRC=$SRC_ROOT/ifcopenshell-0.8.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ifcopenshell-0.8.5.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _tag and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/python-version.patch"

patch -p1 -i "$PORT_SRC/swig-4.5.patch"

patch -p1 -i "$PORT_SRC/boost-optional.patch"

patch -p1 -i "$PORT_SRC/hdf5-shared.patch"

cmake -S cmake -B build -G Ninja -Wno-dev \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR:PATH=lib \
	-DCMAKE_INSTALL_INCLUDEDIR:PATH=include/ifcopenshell \
	-DBUILD_SHARED_LIBS=ON \
	-DVERSION_OVERRIDE=ON \
	-DADD_COMMIT_SHA=OFF \
	-DUSE_CCACHE=OFF \
	-DBUILD_ONLY_COMMON_SCHEMAS=ON \
	-DBUILD_IFCGEOM=ON \
	-DBUILD_IFCPYTHON=ON \
	-DBUILD_CONVERT=ON \
	-DBUILD_GEOMSERVER=OFF \
	-DBUILD_QTVIEWER=OFF \
	-DBUILD_EXAMPLES=OFF \
	-DBUILD_DOCUMENTATION=OFF \
	-DWITH_OPENCASCADE=ON \
	-DWITH_CGAL=OFF \
	-DCOLLADA_SUPPORT=OFF \
	-DGLTF_SUPPORT=ON \
	-DHDF5_SUPPORT=ON \
	-DIFCXML_SUPPORT=ON \
	-DUSD_SUPPORT=OFF \
	-DWITH_PROJ=OFF \
	-DWITH_ROCKSDB=OFF \
	-DUSE_MMAP=OFF \
	-DPYTHON_EXECUTABLE=/usr/bin/python3 \
	-DPython_EXECUTABLE=/usr/bin/python3
cmake --build build
DESTDIR=$PKG cmake --install build

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/ifcopenshell, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf ifcopenshell-0.8.5-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/ifcopenshell, and runs the triggers its paths call for.

Contents

Installed programs: IfcConvert.

Installed libraries: libIfcGeom.so, libIfcParse.so, libSerializers.so, libgeometry_kernel_opencascade.so, libgeometry_serializer.so.

Installed directories: /usr/include/ifcopenshell, /usr/lib/cmake/IfcOpenShell, /usr/lib/python3.14/site-packages/ifcopenshell, /usr/share/licenses/ifcopenshell.