File tree Expand file tree Collapse file tree 3 files changed +82
-1
lines changed Expand file tree Collapse file tree 3 files changed +82
-1
lines changed Original file line number Diff line number Diff line change 1+ # Hack to get around needing to depend on phoenix 6's binaries and
2+ # they aren't exported directly
3+
4+
5+ from os .path import abspath , join , dirname
6+ import phoenix6
7+
8+ _root = abspath (dirname (phoenix6 .__file__ ))
9+
10+ libinit_import = "ctre._init_phoenix6"
11+ depends = []
12+ pypi_package = "phoenix6"
13+
14+
15+ def get_include_dirs ():
16+ return []
17+
18+
19+ def get_library_dirs ():
20+ return [join (_root , "lib" )]
21+
22+
23+ def get_library_dirs_rel ():
24+ return ["lib" ]
25+
26+
27+ def get_library_names ():
28+ return [
29+ "CTRE_PhoenixTools_Sim" ,
30+ "CTRE_SimCANCoder" ,
31+ "CTRE_SimPigeonIMU" ,
32+ "CTRE_SimProCANcoder" ,
33+ "CTRE_SimProPigeon2" ,
34+ "CTRE_SimProTalonFX" ,
35+ "CTRE_SimTalonFX" ,
36+ "CTRE_SimTalonSRX" ,
37+ "CTRE_SimVictorSPX" ,
38+ ]
39+
40+
41+ def get_library_full_names ():
42+ return [
43+ "libCTRE_PhoenixTools_Sim.dylib" ,
44+ "libCTRE_SimCANCoder.dylib" ,
45+ "libCTRE_SimPigeonIMU.dylib" ,
46+ "libCTRE_SimProCANcoder.dylib" ,
47+ "libCTRE_SimProPigeon2.dylib" ,
48+ "libCTRE_SimProTalonFX.dylib" ,
49+ "libCTRE_SimTalonFX.dylib" ,
50+ "libCTRE_SimTalonSRX.dylib" ,
51+ "libCTRE_SimVictorSPX.dylib" ,
52+ ]
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ install_requires = [
1212
1313[build-system ]
1414requires = [
15- " robotpy-build<2025.0.0,>=2024.0.0b4 " ,
15+ " robotpy-build<2025.0.0,>=2024.0.0b5 " ,
1616 " wpilib<2025.0.0,>=2024.0.0b2" ,
1717 " phoenix6~=24.0.0b2" ,
1818]
@@ -153,6 +153,12 @@ depends = [
153153 " ctre_tools_sim" ,
154154]
155155
156+ [tool .robotpy-build .wrappers ."ctre ._cci_sim" .override .os_osx ]
157+ depends = [
158+ " ctre_tools_sim" ,
159+ " phoenix6_workaround"
160+ ]
161+
156162[tool .robotpy-build .wrappers ."ctre ._cci_sim" .override .arch_athena ]
157163ignore = true
158164
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3+ import sys
4+
5+ # HACK: insert an entrypoint for phoenix 6 so we can link to it
6+ if sys .platform .startswith ("darwin" ):
7+ import robotpy_build .pkgcfg_provider
8+ from importlib .metadata import entry_points , EntryPoint
9+
10+ def entry_points_hook (* args , ** kwargs ):
11+ ep = EntryPoint (
12+ name = "phoenix6_workaround" ,
13+ value = "ctre._osx_phoenix6_pkgcfg" ,
14+ group = "robotpybuild" ,
15+ )
16+
17+ eps = entry_points (* args , ** kwargs )
18+ if isinstance (eps , dict ):
19+ eps ["robotpybuild" ] = (ep , * eps .get ("robotpybuild" , tuple ()))
20+ else :
21+ eps = (ep , * eps )
22+ return eps
23+
24+ robotpy_build .pkgcfg_provider .entry_points = entry_points_hook
25+
326from robotpy_build .setup import setup
427
528setup ()
You can’t perform that action at this time.
0 commit comments