From 0bde9b69923718383947ef8ff73cc3d3fb21fb64 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 2 Sep 2024 15:19:18 +0200
Subject: [PATCH] Set base image to 24.04.

---
 ogscm/building_blocks/ogs_base.py |  2 +-
 ogscm/cli.py                      |  5 ++++-
 ogscm/recipes/ogs.py              | 10 +++++-----
 ogscm/recipes/ogs_jupyter.py      |  2 +-
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ogscm/building_blocks/ogs_base.py b/ogscm/building_blocks/ogs_base.py
index 0b9ab24..02899c2 100644
--- a/ogscm/building_blocks/ogs_base.py
+++ b/ogscm/building_blocks/ogs_base.py
@@ -40,7 +40,7 @@ class ogs_base(bb_base):
         self += python(devel=True, python2=False)
         self += packages(ospackages=["python3-pip", "python3-virtualenv"])
         self += shell(
-            commands=["pip3 install --break-system-packages pre-commit cmake-format"]
+            commands=["pip3 install pre-commit cmake-format"]
         )
         self += packages(ospackages=self.__ospackages, epel=True)
         self += shell(commands=self.__commands)
diff --git a/ogscm/cli.py b/ogscm/cli.py
index 612c3f3..354f4b4 100644
--- a/ogscm/cli.py
+++ b/ogscm/cli.py
@@ -48,7 +48,7 @@ def main():  # pragma: no cover
     general_g.add_argument(
         "--base_image",
         type=str,
-        default="ubuntu:23.04",
+        default="ubuntu:24.04",
         help="The base image.",
     )
     general_g.add_argument(
@@ -231,6 +231,9 @@ def main():  # pragma: no cover
     versions = None  # versions.json
     pip_requirements = []
 
+    Stage0 += environment(variables={'PIP_BREAK_SYSTEM_PACKAGES': '1'})
+    Stage1 += environment(variables={'PIP_BREAK_SYSTEM_PACKAGES': '1'})
+
     for recipe in recipe_args_parser.parse_known_args()[0].recipe:
         import importlib.resources as pkg_resources
         from ogscm import recipes
diff --git a/ogscm/recipes/ogs.py b/ogscm/recipes/ogs.py
index af473f0..816ad0f 100644
--- a/ogscm/recipes/ogs.py
+++ b/ogscm/recipes/ogs.py
@@ -322,7 +322,7 @@ if local_args.gui:
     Stage1 += packages(
         apt=[
             "libosmesa6",
-            "libgl1-mesa-glx",
+            "libglx-mesa0/",
             "libglu1-mesa",
             "libxt6",
             "libopengl0",
@@ -441,7 +441,7 @@ if local_args.ogs != "clean":
                     "libexpat1",
                     "libfontconfig1",
                     "libfreetype6",
-                    "libgl1-mesa-glx",
+                    "libglx-mesa0",
                     "libglib2.0-0",
                     "libx11-6",
                     "libx11-xcb1",
@@ -644,7 +644,7 @@ if local_args.mfront and local_args.pm == "system":
     if "tfel-rliv" in versions["minimum_version"]:
         tfel_version = versions["minimum_version"]["tfel-rliv"]
     Stage0 += generic_cmake(
-        cmake_opts=["-Denable-python-bindings=ON", "-Denable-portable-build=ON"],
+        cmake_opts=["-Denable-python-bindings=ON", "-Denable-portable-build=ON", "-DPython_ADDITIONAL_VERSIONS=3.12"],
         directory=f"tfel-rliv-{tfel_version}",
         ldconfig=True,
         url=f"https://github.com/thelfer/tfel/archive/refs/heads/rliv-{tfel_version}.zip",
@@ -712,10 +712,10 @@ if local_args.ogs != "off" and local_args.ogs != "clean":
 # https://github.com/Kaggle/docker-python/pull/358
 # xvfb for PyVista
 Stage0 += packages(
-    apt=["libgl1", "xvfb", "libgl1-mesa-glx", "libglu1-mesa"],
+    apt=["libgl1", "xvfb", "libglx-mesa0", "libglu1-mesa"],
     yum=["mesa-libGL", "xorg-x11-server-Xvfb", "mesa-libGLU"],
 )
 Stage1 += packages(
-    apt=["libgl1", "xvfb", "libgl1-mesa-glx", "libglu1-mesa"],
+    apt=["libgl1", "xvfb", "libglx-mesa0", "libglu1-mesa"],
     yum=["mesa-libGL", "xorg-x11-server-Xvfb", "mesa-libGLU"],
 )
diff --git a/ogscm/recipes/ogs_jupyter.py b/ogscm/recipes/ogs_jupyter.py
index efbbd12..72e52ad 100644
--- a/ogscm/recipes/ogs_jupyter.py
+++ b/ogscm/recipes/ogs_jupyter.py
@@ -34,7 +34,7 @@ out_dir += f"/jupyter"
 Stage1 += comment(f"Begin {filename}")
 
 Stage1 += packages(
-    apt=["git", "libgl1-mesa-glx"]
+    apt=["git", "libglx-mesa0"]
 )  # for pip packages via git, for gmsh conda package
 
 conda_packages = []
-- 
GitLab