-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Hack to get around needing to depend on phoenix 6's binaries and | ||
# they aren't exported directly | ||
|
||
|
||
from os.path import abspath, join, dirname | ||
import phoenix6 | ||
|
||
_root = abspath(dirname(phoenix6.__file__)) | ||
|
||
libinit_import = "ctre._init_phoenix6" | ||
depends = [] | ||
pypi_package = "phoenix6" | ||
|
||
|
||
def get_include_dirs(): | ||
return [] | ||
|
||
|
||
def get_library_dirs(): | ||
return [join(_root, "lib")] | ||
|
||
|
||
def get_library_dirs_rel(): | ||
return ["lib"] | ||
|
||
|
||
def get_library_names(): | ||
return [ | ||
"CTRE_PhoenixTools_Sim", | ||
"CTRE_SimCANCoder", | ||
"CTRE_SimPigeonIMU", | ||
"CTRE_SimProCANcoder", | ||
"CTRE_SimProPigeon2", | ||
"CTRE_SimProTalonFX", | ||
"CTRE_SimTalonFX", | ||
"CTRE_SimTalonSRX", | ||
"CTRE_SimVictorSPX", | ||
] | ||
|
||
|
||
def get_library_full_names(): | ||
return [ | ||
"libCTRE_PhoenixTools_Sim.dylib", | ||
"libCTRE_SimCANCoder.dylib", | ||
"libCTRE_SimPigeonIMU.dylib", | ||
"libCTRE_SimProCANcoder.dylib", | ||
"libCTRE_SimProPigeon2.dylib", | ||
"libCTRE_SimProTalonFX.dylib", | ||
"libCTRE_SimTalonFX.dylib", | ||
"libCTRE_SimTalonSRX.dylib", | ||
"libCTRE_SimVictorSPX.dylib", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
|
||
# HACK: insert an entrypoint for phoenix 6 so we can link to it | ||
if sys.platform.startswith("darwin"): | ||
import robotpy_build.pkgcfg_provider | ||
from importlib.metadata import entry_points, EntryPoint | ||
|
||
def entry_points_hook(*args, **kwargs): | ||
ep = EntryPoint( | ||
name="phoenix6_workaround", | ||
value="ctre._osx_phoenix6_pkgcfg", | ||
group="robotpybuild", | ||
) | ||
|
||
eps = entry_points(*args, **kwargs) | ||
if isinstance(eps, dict): | ||
eps["robotpybuild"] = (ep, *eps.get("robotpybuild", tuple())) | ||
else: | ||
eps = (ep, *eps) | ||
return eps | ||
|
||
robotpy_build.pkgcfg_provider.entry_points = entry_points_hook | ||
|
||
from robotpy_build.setup import setup | ||
|
||
setup() |