Skip to content

Build the packages with CPack instead of source packages - #64

Draft
AnHeuermann wants to merge 1 commit into
OpenModelica:masterfrom
AnHeuermann:cpack-packaging
Draft

AnHeuermann wants to merge 1 commit into
OpenModelica:masterfrom
AnHeuermann:cpack-packaging

Conversation

@AnHeuermann

@AnHeuermann AnHeuermann commented Sep 17, 2026

Copy link
Copy Markdown
Member

Issue

OpenModelica/OpenModelica#16377

Changes

The Linux packages are now built with CMake and CPack straight from a git checkout of OpenModelica. No more source packages: no .dsc, no debian/rules, no RPM spec. What goes into which package is defined once, in OpenModelica's cmake/packaging/, where the same definition also serves the Windows installer. This repository keeps only what decides how OpenModelica is built for a package.

cpack/build-packages.sh configures, builds and installs OpenModelica, downloads the Modelica library cache with the staged omc, and runs cpack -G DEB or -G RPM. The build policy is the one the debhelper rules and the spec carried: clang when installed, Qt 6 where its WebEngine is installed and Qt 5 elsewhere, no C++ runtime on armhf, OMOptim and encryption off, and the testsuite off so omc-diff stays out of the omc package. It checks up front that the checkout has a version to package, so a shallow clone fails in seconds instead of after the build.

cpack/test-packages.sh installs packages into a clean system from a local apt or dnf repository, so the dependencies between them are resolved the way a user's package manager resolves them, and then compiles and simulates a model. Installing the files by name is how an omc that could not find the simulation runtime went unnoticed before.

CI follows: packaging.yml shellchecks the scripts, since the metadata it used to check is gone, and build-deb.yml becomes build-packages.yml, which builds in the ubuntu-24.04 build-deps image and runs the install test in a clean ubuntu:24.04.

Removed: debian/, rpm/, .ci/, and the standalone OMPlot, OMOptim and OpenModelica-doc source packages no pipeline built. The README lists what OpenModelica's CPack definition still has to take over from them (old package names, /usr prefix, desktop and mime files, copyright, stripping, the RPM layout) and what was obsolete.

Verified end to end on Ubuntu 26.04: build-packages.sh built all 14 packages (version 1.28.0~dev-767-g7e8f9a2110), and test-packages.sh, installing only openmodelica-omc into a clean ubuntu:26.04, pulled in openmodelica-simrt and simulated a model. Running it caught a bug review had not: under pipefail, find exiting 1 on an unreadable directory made a Qt 6 system look like Qt 5.

Do not merge before apt-build stops copying debian/ and fetching the RPM spec from this repository's master.

The Linux packages are now built with CMake and CPack straight from a git
checkout of OpenModelica. No more source packages: no .dsc, no debian/rules,
no RPM spec. What goes into which package is defined once, in OpenModelica's
cmake/packaging/, where the same definition also serves the Windows
installer. This repository keeps only what decides how OpenModelica is
*built* for a package.

cpack/build-packages.sh configures, builds and installs OpenModelica,
downloads the Modelica library cache with the staged omc, and runs
`cpack -G DEB` or `-G RPM`. The build policy is the one the debhelper rules
and the spec carried: clang when installed, Qt 6 where its WebEngine is
installed and Qt 5 elsewhere, no C++ runtime on armhf, OMOptim and
encryption off, and the testsuite off so omc-diff stays out of the omc
package. It checks up front that the checkout has a version to package, so a
shallow clone fails in seconds instead of after the build.

cpack/test-packages.sh installs packages into a clean system from a local
apt or dnf repository, so the dependencies between them are resolved the way
a user's package manager resolves them, and then compiles and simulates a
model. Installing the files by name is how an omc that could not find the
simulation runtime went unnoticed before.

CI follows: packaging.yml shellchecks the scripts, since the metadata it used
to check is gone, and build-deb.yml becomes build-packages.yml, which builds
in the ubuntu-24.04 build-deps image and runs the install test in a clean
ubuntu:24.04.

Removed: debian/, rpm/, .ci/, and the standalone OMPlot, OMOptim and
OpenModelica-doc source packages no pipeline built. The README lists what
OpenModelica's CPack definition still has to take over from them (old
package names, /usr prefix, desktop and mime files, copyright, stripping, the
RPM layout) and what was obsolete.

Verified end to end on Ubuntu 26.04: build-packages.sh built all 14 packages
(version 1.28.0~dev-767-g7e8f9a2110), and test-packages.sh, installing only
openmodelica-omc into a clean ubuntu:26.04, pulled in openmodelica-simrt and
simulated a model. Running it caught a bug review had not: under pipefail,
find exiting 1 on an unreadable directory made a Qt 6 system look like Qt 5.

Do not merge before apt-build stops copying debian/ and fetching the RPM spec
from this repository's master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AnHeuermann AnHeuermann self-assigned this Sep 17, 2026
@AnHeuermann

Copy link
Copy Markdown
Member Author

Testing new workflow .github/workflows/build-packages.yml in https://github.com/AnHeuermann/OpenModelicaBuildScripts/actions/runs/35238874542.

@AnHeuermann

Copy link
Copy Markdown
Member Author

I'm not sure if there is a lot left in this repository when this is merged. We delegate most if not all task to CMake + CPack.
What's left is a short script to build and pack with CMake and a bunch of (outdated?) Dockerfiles.

We might be better of including the scripts needed for CPack directly into OpenModelica.

AnHeuermann added a commit to OpenModelica/build-deps that referenced this pull request Sep 17, 2026
OpenModelica's OMEdit needs Qt Quick 3D when OM_OMEDIT_ENABLE_ANIMATION is
on, and on the ubuntu-24.04 image that find_package fails:

  Qt6Quick3D could not be found because dependency Qt6Quick3DRuntimeRender
  could not be found.

Qt6Quick3DRuntimeRender's CMake config requires ShaderTools, and noble's
qt6-quick3d-dev does not pull in qt6-shadertools-dev. The comment on QT_PKGS
said 24.04+ does; that is true of 26.04 and Trixie only. Jammy and Bookworm
already name ShaderTools in their own Qt lists.

Found by the full package build of
OpenModelica/OpenModelicaBuildScripts#64, which
builds in ubuntu-24.04 and stopped at OMEdit's configure.

Verified in the published ubuntu-24.04 image: find_package(Qt6 COMPONENTS
Quick Quick3D Qml QuickWidgets) fails as it is and succeeds with
qt6-shadertools-dev, and OpenModelica master then configures completely with
OpenModelicaBuildScripts' cpack/build-packages.sh. On 26.04 and Trixie the
package is already installed as a dependency, so adding it to the shared list
changes nothing there.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant