Skip to content

Commit 29477fd

Browse files
committed
Fix meson build on Ubuntu 24.04
1 parent 5c8d9e9 commit 29477fd

File tree

5 files changed

+47
-4
lines changed

5 files changed

+47
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
- debian:forky
2727
- ghcr.io/void-linux/void-glibc-full
2828
- archlinux
29-
#- ubuntu:22.04 - fails due to issue with cypari2
30-
#- ubuntu:24.04 - fails due to issue with cypari2
29+
- ubuntu:22.04
30+
- ubuntu:24.04
3131
- ubuntu:25.04
3232
container:
3333
image: ${{ matrix.container }}

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(
44
version: files('VERSION.txt'),
55
license: 'GPL v3',
66
default_options: ['c_std=c17', 'cpp_std=c++17', 'python.install_env=auto'],
7-
meson_version: '>=1.2',
7+
meson_version: '>=1.5',
88
)
99

1010
# Python module

src/meson.build

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,32 @@ except Exception:
8787
endif
8888
# Cannot be found via pkg-config
8989
pari = cc.find_library('pari', required: not is_windows, disabler: true)
90+
if pari.found() and not meson.is_cross_build()
91+
# Verify PARI version
92+
pari_version_code = '''
93+
#include <stdio.h>
94+
#include <pari/pari.h>
95+
int main(void) {
96+
pari_init(1000000, 2);
97+
GEN v = pari_version(), M = gel(v,1), m = gel(v,2), p = gel(v,3);
98+
printf("%ld.%ld.%ld", itos(M), itos(m), itos(p));
99+
pari_close();
100+
return 0;
101+
}
102+
'''
103+
pari_version = cc.run(
104+
pari_version_code,
105+
args: ['-v'],
106+
name: 'pari version',
107+
dependencies: [pari],
108+
required: true,
109+
).stdout().strip()
110+
if pari_version.version_compare('<=2.17.0')
111+
message('PARI version > 2.17.0 required, found ' + pari_version)
112+
pari = disabler()
113+
endif
114+
endif
115+
90116

91117
mpfr = dependency('mpfr')
92118

subprojects/flint.wrap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ url = https://github.com/flintlib/flint.git
33
revision = main
44
depth = 1
55
patch_directory = flint
6+
diff_files = flint/cmakelinux.patch
7+
method = cmake
68

79
[provide]
8-
dependency_names = flint
10+
flint = flint_dep
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 8d959fb..5dcbf6e 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -12,10 +12,6 @@
6+
7+
cmake_minimum_required(VERSION 3.22)
8+
9+
-if(NOT WIN32)
10+
- 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.")
11+
-endif()
12+
-
13+
include(CheckCCompilerFlag)
14+
include(CheckCSourceRuns)
15+
include(CheckIPOSupported)

0 commit comments

Comments
 (0)