Skip to content

Commit 246642d

Browse files
mhklineflit
authored andcommitted
add hook for pyinstaller to copy shared lib to correct place in packaged executable
1 parent f7e3868 commit 246642d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Entry Points for PyInstaller
2+
[options.entry_points]
3+
pyinstaller40 =
4+
hook-dirs = libusb_package.__pyinstaller:get_hook_dirs
5+
16
[metadata]
27
name = libusb-package
38
description = Package containing libusb so it can be installed via Python package managers
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
def get_hook_dirs():
4+
return [os.path.dirname(__file__)]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from PyInstaller.utils.hooks import collect_dynamic_libs
2+
3+
# copy the libusb shared library to the package root directory
4+
binaries = collect_dynamic_libs('libusb_package', destdir='.')

0 commit comments

Comments
 (0)