Skip to content

Commit 3939fbf

Browse files
author
Release Manager
committed
gh-40577: Meson: use pkg-config for more libraries <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Use the new pkgconfig files of sirocco, homfly, brial, ... I didn't test that it's indeed discovering the new pkg-config files and that compilation is successful. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40577 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents b37c262 + 191b7de commit 3939fbf

File tree

5 files changed

+58
-32
lines changed

5 files changed

+58
-32
lines changed

src/meson.build

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,16 @@ if not m4rie.found()
148148
# For some reason, m4rie is not found via pkg-config on some systems (eg Conda)
149149
m4rie = cc.find_library('m4rie', required: not is_windows, disabler: true)
150150
endif
151-
# Cannot be found via pkg-config
152-
mtx = cc.find_library(
153-
'mtx',
154-
required: get_option('meataxe'),
155-
disabler: true,
156-
has_headers: ['meataxe.h'],
157-
)
151+
mtx = dependency('mtx', required: false)
152+
if not mtx.found()
153+
# fallback for older versions without pkg-config
154+
mtx = cc.find_library(
155+
'mtx',
156+
required: get_option('meataxe'),
157+
disabler: true,
158+
has_headers: ['meataxe.h'],
159+
)
160+
endif
158161
png = dependency(['libpng', 'png', 'png16'], version: '>=1.2')
159162
zlib = dependency('zlib', version: '>=1.2.11')
160163
# We actually want >= 20231212, but the version number is not updated in the pkgconfig

src/sage/graphs/meson.build

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ if cc.has_header('mcqd.h', required: get_option('mcqd'))
55
# mcqd is a header-only library
66
mcqd = declare_dependency()
77
endif
8-
cliquer = cc.find_library('cliquer', required: not is_windows, disabler: true)
98

10-
# Cannot be found via pkg-config
11-
planarity = cc.find_library(
12-
'planarity',
13-
required: not is_windows,
14-
disabler: true,
15-
)
9+
cliquer = dependency('libcliquer', required: false, disabler: true)
10+
if not cliquer.found()
11+
# fallback for older versions without pkg-config
12+
cliquer = cc.find_library('cliquer', required: not is_windows, disabler: true)
13+
endif
14+
15+
planarity = dependency('libplanarity', required: false, disabler: true)
16+
if not planarity.found()
17+
# fallback for older versions without pkg-config
18+
planarity = cc.find_library(
19+
'planarity',
20+
required: not is_windows,
21+
disabler: true,
22+
)
23+
endif
1624

1725
py.install_sources(
1826
'__init__.py',

src/sage/libs/meson.build

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
sirocco = cc.find_library(
2-
'sirocco',
3-
required: get_option('sirocco'),
4-
disabler: true,
5-
)
1+
sirocco = dependency('libsirocco', required: false, disabler: true)
2+
if not sirocco.found()
3+
# fallback for older versions without pkg-config
4+
sirocco = cc.find_library(
5+
'sirocco',
6+
required: get_option('sirocco'),
7+
disabler: true,
8+
)
9+
endif
610
# cannot be found via pkg-config
711
ecl = cc.find_library('ecl', required: false, disabler: true)
812
if not ecl.found() and not is_windows
@@ -81,12 +85,16 @@ gc = dependency(
8185
required: not is_windows,
8286
disabler: true,
8387
)
84-
homfly = cc.find_library(
85-
'homfly',
86-
has_headers: ['homfly.h'],
87-
required: false,
88-
disabler: true,
89-
)
88+
homfly = dependency('libhomfly', required: false, disabler: true)
89+
if not homfly.found()
90+
# fallback for older versions without pkg-config
91+
homfly = cc.find_library(
92+
'homfly',
93+
has_headers: ['homfly.h'],
94+
required: false,
95+
disabler: true,
96+
)
97+
endif
9098

9199
py.install_sources(
92100
'__init__.py',

src/sage/libs/symmetrica/meson.build

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# Cannot be found by pkg-config
2-
symmetrica = cc.find_library(
3-
'symmetrica',
4-
required: not is_windows,
5-
disabler: true,
6-
)
1+
symmetrica = dependency('symmetrica', required: false, disabler: true)
2+
if not symmetrica.found()
3+
# fallback for older versions without pkg-config
4+
symmetrica = cc.find_library(
5+
'symmetrica',
6+
required: not is_windows,
7+
disabler: true,
8+
)
9+
endif
710

811
py.install_sources('__init__.py', 'all.py', subdir: 'sage/libs/symmetrica')
912

src/sage/rings/polynomial/pbori/meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
brial = cc.find_library('brial', required: get_option('brial'), disabler: true)
1+
brial = dependency('brial', required: false, disabler: true)
2+
if not brial.found()
3+
# fallback for older versions without pkg-config
4+
brial = cc.find_library('brial', required: get_option('brial'), disabler: true)
5+
endif
26
# Cannot be found via pkg-config
37
brial_groebner = cc.find_library(
48
'brial_groebner',

0 commit comments

Comments
 (0)