2021-07-23 09:01:44 -07:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import shutil
|
|
|
|
|
|
2022-07-01 06:41:44 -07:00
|
|
|
from upstream_utils import (
|
|
|
|
|
walk_cwd_and_copy_if,
|
2024-07-16 17:20:07 -07:00
|
|
|
Lib,
|
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 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(
|
2023-08-28 15:07:13 -07:00
|
|
|
lambda dp, f: dp.startswith("./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(
|
2023-08-28 15:07:13 -07:00
|
|
|
lambda dp, f: dp.startswith("./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"
|
|
|
|
|
tag = "11.0.1"
|
|
|
|
|
|
|
|
|
|
patch_list = ["0001-Suppress-warnings-we-can-t-fix.patch"]
|
|
|
|
|
|
|
|
|
|
fmt = Lib(name, url, tag, patch_list, copy_upstream_src)
|
|
|
|
|
fmt.main()
|
|
|
|
|
|
|
|
|
|
|
2021-07-23 09:01:44 -07:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|