Skip to content

Commit 1a768ef

Browse files
committed
more fixes
1 parent 24c6867 commit 1a768ef

3 files changed

Lines changed: 34 additions & 28 deletions

File tree

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
# Generate a Dockerfile using your python script, passing the FULL base image
7474
- name: Generate Dockerfile
7575
run: |
76-
python3 ci/g4pkglist.py -p "${{ matrix.distro }}" --install > Dockerfile.generated
76+
python3 ci/g4pkglist.py -p "${{ matrix.distro }}" -f "${{ matrix.docker_from }}" --install > Dockerfile.generated
7777
echo "Generated Dockerfile:"
7878
sed -n '1,60p' Dockerfile.generated
7979
@@ -82,7 +82,7 @@ jobs:
8282
run: |
8383
PLATS="linux/amd64,linux/arm64"
8484
case "${{ matrix.distro }}" in
85-
arch:*) PLATS="linux/amd64" ;; # Arch has no arm64 base
85+
archlinux:*) PLATS="linux/amd64" ;; # Arch has no arm64 base
8686
esac
8787
echo "plats=$PLATS" >> "$GITHUB_OUTPUT"
8888

ci/distros_tags.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -euo pipefail
33

44
get_ubuntu_lts() { echo "24.04"; }
55
get_fedora_latest() { echo "40"; }
6-
get_arch_latest() { echo "latest"; }
6+
get_archlinux_latest() { echo "latest"; }
77
get_almalinux_latest() { echo "9.4"; }
88
get_debian_latest() { echo "12"; }
99
get_rhel_latest() { echo "9.4"; }
@@ -13,11 +13,11 @@ get_geant4_tag() { echo "11.3.2"; }
1313
build_matrix() {
1414
local json
1515
json=$(
16-
cat <<EOF
16+
cat <<EOF
1717
{"include":[
1818
{"distro":"ubuntu","docker_from":"ubuntu:$(get_ubuntu_lts)","geant4_tag":"$(get_geant4_tag)"},
1919
{"distro":"fedora","docker_from":"fedora:$(get_fedora_latest)","geant4_tag":"$(get_geant4_tag)"},
20-
{"distro":"arch","docker_from":"archlinux:$(get_arch_latest)","geant4_tag":"$(get_geant4_tag)"},
20+
{"distro":"archlinux","docker_from":"archlinux:$(get_archlinux_latest)","geant4_tag":"$(get_geant4_tag)"},
2121
{"distro":"almalinux","docker_from":"almalinux:$(get_almalinux_latest)","geant4_tag":"$(get_geant4_tag)"},
2222
{"distro":"debian","docker_from":"debian:$(get_debian_latest)","geant4_tag":"$(get_geant4_tag)"},
2323
{"distro":"rhel","docker_from":"redhat/ubi9:$(get_rhel_latest)","geant4_tag":"$(get_geant4_tag)"}
@@ -75,10 +75,10 @@ main() {
7575
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
7676
local DELIM="MATRIX_$(date +%s%N)"
7777
{
78-
echo "matrix<<$DELIM"
78+
echo "matrix<<$DELIM"
7979
build_matrix
80-
echo "$DELIM"
81-
echo "image=$image"
80+
echo "$DELIM"
81+
echo "image=$image"
8282
} >>"$GITHUB_OUTPUT"
8383
else
8484
build_matrix

ci/g4pkglist.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
#!/usr/bin/env python3
22
import argparse
33

4-
DISTROS = ["fedora", "ubuntu", "arch", "almalinux", "debian", "rhel"]
4+
DISTROS = ["fedora", "ubuntu", "archlinux", "almalinux", "debian", "rhel"]
55

66
# ------------------------------------------------------------------------------
77
# Package groups by purpose
88
pkg_sections = {
99
"cxx_essentials": {
1010
"fedora": ["git", "make", "cmake", "gcc-c++", "gdb", "valgrind"],
1111
"ubuntu": ["git", "make", "cmake", "g++", "gdb", "valgrind"],
12-
"arch": ["git", "make", "cmake", "gcc", "gdb", "valgrind"],
12+
"archlinux": ["git", "make", "cmake", "gcc", "gdb", "valgrind"],
1313
# debian uses same as ubuntu (handled by mapping below)
1414
},
1515
"expat": {
1616
"fedora": ["expat-devel"],
1717
"ubuntu": ["libexpat1-dev"],
18-
"arch": ["expat"],
18+
"archlinux": ["expat"],
1919
},
2020
"sql": {
2121
"fedora": ["mariadb-devel", "sqlite-devel"],
2222
"ubuntu": ["libmysqlclient-dev", "libsqlite3-dev"],
2323
# On Arch, dev headers are included in the main pkgs; no -devel splits
24-
"arch": ["mariadb", "mariadb-libs", "sqlite"],
24+
"archlinux": ["mariadb", "mariadb-libs", "sqlite"],
2525
},
2626
"python_ninja": {
2727
"fedora": ["python3-devel", "ninja-build"],
2828
"ubuntu": ["python3-dev", "ninja-build"],
29-
"arch": ["python", "python-pip", "ninja"],
29+
"archlinux": ["python", "python-pip", "ninja"],
3030
},
3131
"x11_1": {
3232
"fedora": ["mesa-libGLU-devel", "libX11-devel", "libXpm-devel", "libXft-devel"],
3333
"ubuntu": ["libglu1-mesa-dev", "libx11-dev", "libxpm-dev", "libxft-dev"],
34-
"arch": ["mesa", "glu", "libx11", "libxpm", "libxft"],
34+
"archlinux": ["mesa", "glu", "libx11", "libxpm", "libxft"],
3535
},
3636
"x11_2": {
3737
"fedora": ["libXt-devel", "libXmu-devel", "libXrender-devel",
@@ -40,7 +40,7 @@
4040
"ubuntu": ["libxt-dev", "libxmu-dev", "libxrender-dev",
4141
"xvfb", "x11-xserver-utils"],
4242
# Arch: xrandr is xorg-xrandr; xvfb via xorg-server-xvfb
43-
"arch": ["libxt", "libxmu", "libxrender",
43+
"archlinux": ["libxt", "libxmu", "libxrender",
4444
"xorg-server-xvfb", "xorg-xrandr"],
4545
},
4646
"utilities_1": {
@@ -49,33 +49,33 @@
4949
# Ubuntu/Debian: 'which' is 'which' (not gnu-which)
5050
"ubuntu": ["bzip2", "wget", "curl", "nano", "bash", "tcsh", "zsh",
5151
"hostname", "gedit", "environment-modules", "pv", "which", "ca-certificates"],
52-
"arch": ["bzip2", "wget", "curl", "nano", "bash", "tcsh", "zsh",
52+
"archlinux": ["bzip2", "wget", "curl", "nano", "bash", "tcsh", "zsh",
5353
"hostname", "gedit", "environment-modules", "pv", "which"],
5454
},
5555
"utilities_2": {
5656
"fedora": ["psmisc", "procps", "mailcap", "net-tools", "rsync", "patch"],
5757
"ubuntu": ["psmisc", "procps", "mailcap", "net-tools", "rsync", "patch"],
58-
"arch": ["psmisc", "procps", "mailcap", "net-tools", "rsync", "patch"],
58+
"archlinux": ["psmisc", "procps", "mailcap", "net-tools", "rsync", "patch"],
5959
},
6060
"vnc": {
6161
"fedora": ["xterm", "x11vnc", "novnc"],
6262
"ubuntu": ["xterm", "x11vnc", "novnc"],
63-
"arch": ["xterm", "x11vnc", "novnc"],
63+
"archlinux": ["xterm", "x11vnc", "novnc"],
6464
},
6565
"qt6": {
6666
"fedora": ["qt6-qtbase-devel"],
6767
"ubuntu": ["qt6-base-dev", "libqt6opengl6t64", "libqt6openglwidgets6t64"],
68-
"arch": ["qt6-base", "qt6-base-devel"],
68+
"archlinux": ["qt6-base", "qt6-base-devel"],
6969
},
7070
"root": {
7171
"fedora": ["root"],
7272
"ubuntu": [],
73-
"arch": ["root"],
73+
"archlinux": ["root"],
7474
},
7575
"sanitizers": {
7676
"fedora": ["liblsan", "libasan", "libubsan", "libtsan", "tbb"],
7777
"ubuntu": ["liblsan0", "libasan8", "libubsan1", "libtsan2", "libtbb12"],
78-
"arch": ["gcc-libs", "tbb"],
78+
"archlinux": ["gcc-libs", "tbb"],
7979
},
8080
}
8181

@@ -86,7 +86,7 @@ def base_name(name: str) -> str:
8686

8787
def map_family(platform: str) -> str:
8888
p = base_name(platform)
89-
if p in ("almalinux", "rhel", "centos", "rockylinux"):
89+
if p in ("almalinux", "rhel", "centos"):
9090
return "fedora"
9191
if p == "debian":
9292
return "ubuntu"
@@ -105,6 +105,7 @@ def debian_adjustments(pkgs: list[str]) -> list[str]:
105105
rep = {
106106
"libqt6opengl6t64": "libqt6opengl6",
107107
"libqt6openglwidgets6t64": "libqt6openglwidgets6",
108+
"libmysqlclient-dev": "libmariadb-dev"
108109
}
109110
return [rep.get(p, p) for p in pkgs]
110111

@@ -123,7 +124,7 @@ def debian_adjustments(pkgs: list[str]) -> list[str]:
123124
" \\\n && apt-get -y autoclean"
124125
" \\\n && rm -rf /var/lib/apt/lists/* \n"
125126
),
126-
"arch": (
127+
"archlinux": (
127128
" \\\n && pacman -Syu --noconfirm"
128129
" \\\n && pacman -Scc --noconfirm"
129130
" \\\n && rm -rf /var/cache/pacman/pkg/* \n"
@@ -164,6 +165,7 @@ def debian_adjustments(pkgs: list[str]) -> list[str]:
164165
rep = {
165166
"libqt6opengl6t64": "libqt6opengl6",
166167
"libqt6openglwidgets6t64": "libqt6openglwidgets6",
168+
"libmysqlclient-dev": "libmariadb-dev"
167169
}
168170
out = []
169171
for p in pkgs:
@@ -234,13 +236,13 @@ def curl_command(url: str) -> str:
234236
ca = jlab_certificate()
235237
return f"bash -lc 'CA=\"{ca}\"; EXTRA=\"\"; [ -f \"$CA\" ] && EXTRA=\"--cacert $CA\"; curl -S --location-trusted --progress-bar --retry 4 $EXTRA -k -O {url}'"
236238

237-
def packages_install_commands(image: str) -> str:
239+
def packages_install_commands(image: str, base: str) -> str:
238240
family = map_family(image)
239241
packages = packages_to_be_installed(image)
240242
cleanup = cleanup_string_by_family.get(family, "")
241243
local_setup_file = local_setup_filename()
242244
commands = ""
243-
commands += docker_header(image)
245+
commands += docker_header(base)
244246

245247
is_alma = "almalinux" in image.lower()
246248
is_rhel = "rhel" in image.lower()
@@ -267,7 +269,7 @@ def packages_install_commands(image: str) -> str:
267269
)
268270
commands += install_root_tarball(image, local_setup_file)
269271

270-
elif family == "arch":
272+
elif family == "archlinux":
271273
commands += f"RUN pacman -Syu --noconfirm {packages}{cleanup}"
272274

273275
commands += install_meson()
@@ -282,7 +284,11 @@ def main():
282284
)
283285
parser.add_argument(
284286
"-p", "--platform", required=True,
285-
help="Target base image (e.g., fedora:40 / almalinux:9 / rhel:9 / ubuntu:24.04 / debian:13 / archlinux:latest)"
287+
help="Target base os (e.g., fedora, almalinux, rhel, ubuntu, debian, rchlinux"
288+
)
289+
parser.add_argument(
290+
"-f", "--base", required=True,
291+
help="Target base image version (e.g., fedora:40 / almalinux:9 / rhel:9 / ubuntu:24.04 / debian:13 / archlinux:latest)"
286292
)
287293
parser.add_argument(
288294
"--install", action="store_true",
@@ -291,7 +297,7 @@ def main():
291297

292298
args = parser.parse_args()
293299
if args.install:
294-
print(packages_install_commands(args.platform))
300+
print(packages_install_commands(args.platform, args.base))
295301
else:
296302
print(packages_to_be_installed(args.platform))
297303

0 commit comments

Comments
 (0)