On Thursday, 2017-11-16 16:27:35 -0800, Dylan Baker wrote: > Which is required for the gallium media state trackers. > > v4: - Make the full version the hard link and the partial so versiions > the symlinks > > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com> > --- > bin/install_megadrivers.py | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py > index a98d7dd177b..0415e5829eb 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) > @@ -43,11 +44,27 @@ def main(): > shutil.copy(args.megadriver, master) > > for each in args.drivers: > - driver = os.path.join(to, each) > + driver_name = os.path.join(to, each) > + > + if args.so_version: > + driver = '{}.{}'.format(driver_name, args.so_version[0]) > + else: > + driver = driver_name > + > if os.path.exists(driver): > os.unlink(driver) > print('installing {} to {}'.format(args.megadriver, driver)) > os.link(master, driver) > + > + if args.so_version: > + for v in args.so_version[1:]:
I don't see why we would want to have a different major X for `libfoo.so.X` and `libfoo.so.X.Y.Z`? NVidia does it, but they also do a lot of other things we don't want, so I'm not sure they can count as an example for anything :P How about replacing the line above with: versions = [None, args.so_version.split('.')[0]] for v in versions: and making --so-version `action='store', default=None`, and dropping all the partial versions when calling the script. This will result in the behaviour we currently have with autotools. > + if v: > + name = '{}.{}'.format(driver_name, v) > + else: > + name = driver_name > + if os.path.exists(name): > + os.unlink(name) > + os.symlink(driver, name) > os.unlink(master) > > > -- > 2.15.0 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev