From 29477fd368ac726714373502f7c670ec49d21f2a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 16 Nov 2025 19:36:17 +0800 Subject: [PATCH 1/4] Fix meson build on Ubuntu 24.04 --- .github/workflows/ci.yml | 4 +-- meson.build | 2 +- src/meson.build | 26 +++++++++++++++++++ subprojects/flint.wrap | 4 ++- .../packagefiles/flint/cmakelinux.patch | 15 +++++++++++ 5 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 subprojects/packagefiles/flint/cmakelinux.patch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14ed18ffc1c..6eb5d4f69a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,8 @@ jobs: - debian:forky - ghcr.io/void-linux/void-glibc-full - archlinux - #- ubuntu:22.04 - fails due to issue with cypari2 - #- ubuntu:24.04 - fails due to issue with cypari2 + - ubuntu:22.04 + - ubuntu:24.04 - ubuntu:25.04 container: image: ${{ matrix.container }} diff --git a/meson.build b/meson.build index 7f5f0acf9c6..720991a331e 100755 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project( version: files('VERSION.txt'), license: 'GPL v3', default_options: ['c_std=c17', 'cpp_std=c++17', 'python.install_env=auto'], - meson_version: '>=1.2', + meson_version: '>=1.5', ) # Python module diff --git a/src/meson.build b/src/meson.build index 920a37dc1f7..526dd59df55 100644 --- a/src/meson.build +++ b/src/meson.build @@ -87,6 +87,32 @@ except Exception: endif # Cannot be found via pkg-config pari = cc.find_library('pari', required: not is_windows, disabler: true) +if pari.found() and not meson.is_cross_build() + # Verify PARI version + pari_version_code = ''' + #include + #include + int main(void) { + pari_init(1000000, 2); + GEN v = pari_version(), M = gel(v,1), m = gel(v,2), p = gel(v,3); + printf("%ld.%ld.%ld", itos(M), itos(m), itos(p)); + pari_close(); + return 0; + } + ''' + pari_version = cc.run( + pari_version_code, + args: ['-v'], + name: 'pari version', + dependencies: [pari], + required: true, + ).stdout().strip() + if pari_version.version_compare('<=2.17.0') + message('PARI version > 2.17.0 required, found ' + pari_version) + pari = disabler() + endif +endif + mpfr = dependency('mpfr') diff --git a/subprojects/flint.wrap b/subprojects/flint.wrap index b2aa8b8aee6..e85ef64b7ef 100644 --- a/subprojects/flint.wrap +++ b/subprojects/flint.wrap @@ -3,6 +3,8 @@ url = https://github.com/flintlib/flint.git revision = main depth = 1 patch_directory = flint +diff_files = flint/cmakelinux.patch +method = cmake [provide] -dependency_names = flint +flint = flint_dep diff --git a/subprojects/packagefiles/flint/cmakelinux.patch b/subprojects/packagefiles/flint/cmakelinux.patch new file mode 100644 index 00000000000..32244e3bb94 --- /dev/null +++ b/subprojects/packagefiles/flint/cmakelinux.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d959fb..5dcbf6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,10 +12,6 @@ + + cmake_minimum_required(VERSION 3.22) + +-if(NOT WIN32) +- message(FATAL_ERROR "Detected system is not Windows. Please use the Autotools configuration along with the Makefile instead as it is more up-to-date. Read INSTALL.md.") +-endif() +- + include(CheckCCompilerFlag) + include(CheckCSourceRuns) + include(CheckIPOSupported) From f59266661fc32cfba75cbac35106101ca979ac98 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 17 Nov 2025 17:06:50 +0800 Subject: [PATCH 2/4] Install git for ubuntu 22.04 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eb5d4f69a0..af1efdbc7f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,10 @@ jobs: # but we need the maxima help to be in place sed -i '/^NoExtract/d' /etc/pacman.conf fi + if [ "${{ matrix.container }}" = "ubuntu:22.04" ]; then + apt-get update + apt-get install -y git + fi - name: Checkout code # cannot use v4 yet because of https://github.com/actions/checkout/issues/1487 From eb1cfd892f8fec3715bc73a578659f18a4852dbc Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 17 Nov 2025 17:09:48 +0800 Subject: [PATCH 3/4] Add --allowerasing for Fedora install to fix: Problem: systemd-257.3-7.fc42.i686 from fedora has inferior architecture - package gap-pkg-scscp-2.4.3-5.fc42.noarch from fedora requires systemd, but none of the providers can be installed - problem with installed package - installed package systemd-standalone-tmpfiles-257.10-1.fc42.x86_64 conflicts with systemd provided by systemd-257.3-7.fc42.x86_64 from fedora - package systemd-standalone-tmpfiles-257.10-1.fc42.x86_64 from updates conflicts with systemd provided by systemd-257.3-7.fc42.x86_64 from fedora - package systemd-257.3-7.fc42.x86_64 from fedora conflicts with systemd-standalone-tmpfiles provided by systemd-standalone-tmpfiles-257.3-7.fc42.x86_64 from fedora - systemd-257.10-1.fc42.i686 from updates has inferior architecture - installed package systemd-standalone-tmpfiles-257.10-1.fc42.x86_64 conflicts with systemd provided by systemd-257.10-1.fc42.x86_64 from updates - package systemd-257.10-1.fc42.x86_64 from updates conflicts with systemd-standalone-tmpfiles provided by systemd-standalone-tmpfiles-257.10-1.fc42.x86_64 from updates - package systemd-257.10-1.fc42.x86_64 from updates conflicts with systemd-standalone-tmpfiles provided by systemd-standalone-tmpfiles-257.3-7.fc42.x86_64 from fedora - conflicting requests --- build/bin/sage-print-system-package-command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/bin/sage-print-system-package-command b/build/bin/sage-print-system-package-command index 054122ab234..13bafa22dc0 100755 --- a/build/bin/sage-print-system-package-command +++ b/build/bin/sage-print-system-package-command @@ -153,7 +153,7 @@ case $system:$command in fi ;; @(fedora*|redhat*|centos*):install) - [ "$YES" = yes ] && options="$options -y" + [ "$YES" = yes ] && options="$options -y --allowerasing" [ "$IGNORE_MISSING" = yes ] && options="$options --skip-unavailable" [ -n "$system_packages" ] && print_shell_command ${SUDO}dnf install $options $system_packages ;; From 6fe0569b9bdeba5f9bb959b39ba0185e8884a1db Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 17 Nov 2025 17:54:05 +0800 Subject: [PATCH 4/4] Disable ubuntu 22.04 again, as gap is outdated there --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af1efdbc7f6..e8c0955835a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - debian:forky - ghcr.io/void-linux/void-glibc-full - archlinux - - ubuntu:22.04 + #- ubuntu:22.04 - gap is outdated there (only 4.11) - ubuntu:24.04 - ubuntu:25.04 container: