[Mesa-dev] [PATCH v3 09/15] meson: extend install_megadrivers script to handle symmlinking
Eric Engestrom
eric.engestrom at imgtec.com
Tue Nov 14 14:47:33 UTC 2017
On Monday, 2017-11-13 17:09:13 -0800, Dylan Baker wrote:
> which is required for the gallium media state trackers.
> ---
> bin/install_megadrivers.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
> index a98d7dd177b..581ff9791e5 100755
> --- a/bin/install_megadrivers.py
> +++ b/bin/install_megadrivers.py
> @@ -33,6 +33,7 @@ def main():
> parser.add_argument('megadriver')
> parser.add_argument('libdir')
> parser.add_argument('drivers', nargs='+')
> + parser.add_argument('--so-version', action='append', default=[])
> args = parser.parse_args()
>
> to = os.path.join(os.environ.get('MESON_INSTALL_DESTDIR_PREFIX'), args.libdir)
> @@ -48,6 +49,11 @@ def main():
> os.unlink(driver)
> print('installing {} to {}'.format(args.megadriver, driver))
> os.link(master, driver)
> + for v in args.so_version:
> + name = '{}.{}'.format(driver, v)
> + if os.path.exists(name):
> + os.unlink(name)
> + os.symlink(driver, name)
My understanding is that it should be the other way around: everything
should point to the versioned file.
Taking libEGL.so for instance, autotools currently install it that way:
/usr/lib/libEGL.so -> libEGL.so.1.0.0
/usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
/usr/lib/libEGL.so.1.0.0
I think this is so that one can hot-swap libs, for instance creating
.so.1.0.1, then move the symlink to that, and then remove the old
.so.1.0.0 file. Not sure how much it matters, but for consistency
I would keep that scheme.
By the way, the so-version array should only ever contain
$major.$minor.$patch and $major for the same value of $major, so what
about simply taking that full version as an input and creating the file
with it as the name, then symlink the so_version.split('.')[0] file and
the version-less .so?
> os.unlink(master)
>
>
> --
> 2.15.0
>
More information about the mesa-dev
mailing list