2021-07-23 09:01:44 -07:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import shutil
|
|
|
|
|
|
2024-11-02 17:56:55 -07:00
|
|
|
from upstream_utils import Lib, walk_cwd_and_copy_if
|
2021-07-23 09:01:44 -07:00
|
|
|
|
|
|
|
|
|
2024-07-16 17:20:07 -07:00
|
|
|
def copy_upstream_src(wpilib_root):
|
2022-08-20 07:26:34 -07:00
|
|
|
wpiutil = os.path.join(wpilib_root, "wpiutil")
|
2021-07-23 09:01:44 -07:00
|
|
|
|
|
|
|
|
# Delete old install
|
2022-07-22 18:08:36 -07:00
|
|
|
for d in [
|
|
|
|
|
"src/main/native/thirdparty/fmtlib/src",
|
|
|
|
|
"src/main/native/thirdparty/fmtlib/include",
|
|
|
|
|
]:
|
2021-07-23 09:01:44 -07:00
|
|
|
shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True)
|
|
|
|
|
|
|
|
|
|
# Copy fmt source files into allwpilib
|
2024-07-20 07:01:06 -07:00
|
|
|
walk_cwd_and_copy_if(
|
2024-08-24 09:52:52 -04:00
|
|
|
lambda dp, f: dp.startswith(os.path.join(".", "src"))
|
|
|
|
|
and f.endswith(".cc")
|
|
|
|
|
and f != "fmt.cc",
|
2022-07-22 18:08:36 -07:00
|
|
|
os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib"),
|
2022-07-01 06:41:44 -07:00
|
|
|
)
|
2021-07-23 09:01:44 -07:00
|
|
|
|
|
|
|
|
# Copy fmt header files into allwpilib
|
2024-07-20 07:01:06 -07:00
|
|
|
walk_cwd_and_copy_if(
|
2024-08-24 09:52:52 -04:00
|
|
|
lambda dp, f: dp.startswith(os.path.join(".", "include", "fmt")),
|
2022-07-22 18:08:36 -07:00
|
|
|
os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib"),
|
2022-07-01 06:41:44 -07:00
|
|
|
)
|
2021-07-23 09:01:44 -07:00
|
|
|
|
|
|
|
|
|
2024-07-16 17:20:07 -07:00
|
|
|
def main():
|
|
|
|
|
name = "fmt"
|
|
|
|
|
url = "https://github.com/fmtlib/fmt"
|
2024-12-26 17:14:02 -08:00
|
|
|
tag = "11.1.0"
|
2024-07-16 17:20:07 -07:00
|
|
|
|
2024-07-23 15:58:15 -07:00
|
|
|
fmt = Lib(name, url, tag, copy_upstream_src)
|
2024-07-16 17:20:07 -07:00
|
|
|
fmt.main()
|
|
|
|
|
|
|
|
|
|
|
2021-07-23 09:01:44 -07:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|