From c3917f27cb93a0eae18d833cc6ad78cf8ac418af Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 11 Sep 2022 00:12:45 -0700 Subject: [PATCH] forgot that FreeBSD's lib format is slightly different, this should work --- python/setup.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/python/setup.py b/python/setup.py index dcaeeb0..cdc0c58 100644 --- a/python/setup.py +++ b/python/setup.py @@ -6,14 +6,25 @@ from distutils.core import setup import os import sys -libext = dict(darwin='.dylib').get(sys.platform, '.so') +def libname(ver): + vars = dict( + name='libdecaf', + ver=ver, + ) + + if sys.platform == 'darwin': + return '%(name)s.%(ver)d.dylib' % vars + + return '%(name)s.so.%(ver)d' % vars class my_build(build): def run(self): build.run(self) if not self.dry_run: - os.spawnlp(os.P_WAIT, 'sh', 'sh', '-c', 'cd .. && mkdir build && cd build && cmake .. && make') - self.copy_file(os.path.join('..', 'build', 'src', 'libdecaf.0' + libext), os.path.join(self.build_lib, 'edgold', 'libdecaf.so')) + os.spawnlp(os.P_WAIT, 'sh', 'sh', '-c', + 'cd .. && mkdir build && cd build && cmake .. && make') + self.copy_file(os.path.join('..', 'build', 'src', libname(0)), + os.path.join(self.build_lib, 'edgold', 'libdecaf.so')) cmdclass = {} cmdclass['build'] = my_build