Skip to content

Commit 29eb149

Browse files
Martin Belangerigaw
authored andcommitted
PyPI: fix missing symbolic link libnvme.so.x -> libnvme.so.X.Y.Z
When we "pip install" a PyPI package previously built with "pipx run build --sdist", there is a missing symbolic link in the directory where libnvme.so.X.Y.Z is installed. For example, let's say we build libnvme.so.3.0.0. There needs to be a symbolic link installed along with the library as follows: libnvme.so.3 -> libnvme.so.3.0.0 Signed-off-by: Martin Belanger <martin.belanger@dell.com>
1 parent 2ba22df commit 29eb149

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

libnvme/src/meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ libnvme = library(
5555
install: true,
5656
)
5757

58+
# Explicitly create the symlinks in the same directory. When building the
59+
# PyPI package (pipx run build --sdist), the symbolic link don't get installed
60+
# unless we explicitly set them as below.
61+
# 1st: libnvme.so.X -> libnvme.so.X.Y.Z
62+
major_version = libnvme_so_version.split('.')[0]
63+
install_symlink(
64+
'libnvme.so.@0@'.format(major_version),
65+
pointing_to: 'libnvme.so.@0@'.format(libnvme_so_version),
66+
install_dir: get_option('libdir'),
67+
)
68+
69+
# 2nd: libnvme.so -> libnvme.so.X
70+
major_version = libnvme_so_version.split('.')[0]
71+
install_symlink(
72+
'libnvme.so',
73+
pointing_to: 'libnvme.so.@0@'.format(major_version),
74+
install_dir: get_option('libdir'),
75+
)
76+
5877
pkg = import('pkgconfig')
5978
pkg.generate(libnvme,
6079
filebase: 'libnvme',

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
22
[build-system]
33
build-backend = 'mesonpy'
4-
requires = ['meson-python']
4+
requires = ['meson-python', 'meson', 'ninja', 'swig']
55

66
[project]
77
name = "libnvme"

0 commit comments

Comments
 (0)