diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 7494e682e6..bda3c53d55 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -750,9 +750,12 @@ class Freezer: ('.abi{0}.so'.format(sys.version_info[0]), 'rb', 3), ('.so', 'rb', 3), ] - else: - print("Unknown platform %s" % (self.platform)) - self.moduleSuffixes = imp.get_suffixes() + else: # FreeBSD et al. + self.moduleSuffixes += [ + ('.cpython-{0}{1}m.so'.format(*sys.version_info), 'rb', 3), + ('.abi{0}.so'.format(*sys.version_info), 'rb', 3), + ('.so', 'rb', 3), + ] def excludeFrom(self, freezer): """ Excludes all modules that have already been processed by diff --git a/direct/src/showutil/dist.py b/direct/src/showutil/dist.py index dfae276317..61e96a947a 100644 --- a/direct/src/showutil/dist.py +++ b/direct/src/showutil/dist.py @@ -78,7 +78,7 @@ class build_apps(distutils.core.Command): whldir = os.path.join(self.build_base, '__whl_cache__') abi_tag = pip.pep425tags.get_abi_tag() - if 'u' in abi_tag and not platform.startswith('manylinux'): + if 'u' in abi_tag and (platform.startswith('win') or platform.startswith('macosx')): abi_tag = abi_tag.replace('u', '') pip_args = [ diff --git a/pandatool/src/deploy-stub/deploy-stub.c b/pandatool/src/deploy-stub/deploy-stub.c index 3e066fe762..c46508fff6 100644 --- a/pandatool/src/deploy-stub/deploy-stub.c +++ b/pandatool/src/deploy-stub/deploy-stub.c @@ -3,6 +3,9 @@ #include "Python.h" #ifdef _WIN32 #include "malloc.h" + +#ifdef __FreeBSD__ +#include #endif #include @@ -165,7 +168,18 @@ int main(int argc, char *argv[]) { wchar_t buffer[2048]; GetModuleFileNameW(NULL, buffer, 2048); runtime = _wfopen(buffer, L"rb"); +#elif defined(__FreeBSD__) + size_t bufsize = 4096; + char buffer[4096]; + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; + mib[3] = getpid(); + if (sysctl(mib, 4, (void *)buffer, &bufsize, NULL, 0) == -1) { + perror("sysctl"); + return 1; + } + runtime = fopen(buffer, "rb"); #else + // Let's hope that it was invoked with the executable name as first arg. runtime = fopen(argv[0], "rb"); #endif