2022-05-09 01:21:54 -04: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
|
2022-05-09 01:21:54 -04:00
|
|
|
|
|
|
|
|
|
2024-07-16 17:20:07 -07:00
|
|
|
def copy_upstream_src(wpilib_root):
|
2022-08-20 07:26:34 -07:00
|
|
|
wpinet = os.path.join(wpilib_root, "wpinet")
|
2022-05-09 01:21:54 -04:00
|
|
|
|
|
|
|
|
# Delete old install
|
|
|
|
|
for d in ["src/main/native/thirdparty/libuv"]:
|
|
|
|
|
shutil.rmtree(os.path.join(wpinet, d), ignore_errors=True)
|
|
|
|
|
|
|
|
|
|
include_ignorelist = [
|
|
|
|
|
"aix.h",
|
|
|
|
|
"os390.h",
|
|
|
|
|
"stdint-msvc2008.h",
|
|
|
|
|
"sunos.h",
|
|
|
|
|
]
|
|
|
|
|
|
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"))
|
|
|
|
|
and f not in include_ignorelist,
|
2022-07-01 06:41:44 -07:00
|
|
|
os.path.join(wpinet, "src/main/native/thirdparty/libuv"),
|
|
|
|
|
)
|
2022-05-09 01:21:54 -04:00
|
|
|
|
|
|
|
|
src_ignorelist = [
|
|
|
|
|
"aix-common.c",
|
|
|
|
|
"aix.c",
|
|
|
|
|
"bsd-proctitle.c",
|
2022-05-18 20:40:27 -07:00
|
|
|
"darwin-stub.c",
|
2022-05-09 01:21:54 -04:00
|
|
|
"haiku.c",
|
2022-05-18 20:40:27 -07:00
|
|
|
"hurd.c",
|
|
|
|
|
"os390-proctitle.c",
|
2022-05-09 01:21:54 -04:00
|
|
|
"os390-syscalls.c",
|
|
|
|
|
"os390-syscalls.h",
|
|
|
|
|
"os390.c",
|
2022-05-18 20:40:27 -07:00
|
|
|
"qnx.c",
|
2022-05-09 01:21:54 -04:00
|
|
|
"sunos.c",
|
2022-05-18 20:40:27 -07:00
|
|
|
"sysinfo-loadavg.c",
|
2022-05-09 01:21:54 -04:00
|
|
|
"sysinfo-memory.c",
|
|
|
|
|
]
|
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 not in src_ignorelist,
|
2022-07-01 06:41:44 -07:00
|
|
|
os.path.join(wpinet, "src/main/native/thirdparty/libuv"),
|
2024-07-20 07:00:13 -07:00
|
|
|
rename_c_to_cpp=True,
|
2022-07-01 06:41:44 -07:00
|
|
|
)
|
2022-05-09 01:21:54 -04:00
|
|
|
|
|
|
|
|
|
2024-07-16 17:20:07 -07:00
|
|
|
def main():
|
|
|
|
|
name = "libuv"
|
|
|
|
|
url = "https://github.com/libuv/libuv"
|
2024-10-19 09:55:45 -07:00
|
|
|
tag = "v1.49.2"
|
2024-07-16 17:20:07 -07:00
|
|
|
|
2024-07-23 15:58:15 -07:00
|
|
|
libuv = Lib(name, url, tag, copy_upstream_src)
|
2024-07-16 17:20:07 -07:00
|
|
|
libuv.main()
|
|
|
|
|
|
|
|
|
|
|
2022-05-09 01:21:54 -04:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|