From 7bb3aab28518e34ba23fc522975a9ac53cd08da8 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Mon, 14 Jul 2025 23:44:21 +0800 Subject: [PATCH] Update PL recipes --- src/recipe/lang/Haskell.c | 32 ++++++++++++++++++++++++------- src/recipe/lang/Java.c | 31 ++++++++++++++++++++++++------ src/recipe/lang/Julia.c | 13 ++++++------- src/recipe/lang/Lua.c | 30 +++++++++++++++++++++++------ src/recipe/lang/NuGet.c | 30 ++++++++++++++++++++++------- src/recipe/lang/OCaml.c | 29 +++++++++++++++++++++++----- src/recipe/lang/Perl.c | 39 ++++++++++++++++++++++++++++---------- src/recipe/lang/R.c | 40 ++++++++++++++++++++++++++++----------- 8 files changed, 185 insertions(+), 59 deletions(-) diff --git a/src/recipe/lang/Haskell.c b/src/recipe/lang/Haskell.c index f5a7c8e..fcb853a 100644 --- a/src/recipe/lang/Haskell.c +++ b/src/recipe/lang/Haskell.c @@ -4,7 +4,7 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-09-10> - * Last Modified : <2024-08-15> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ /** @@ -12,11 +12,11 @@ */ static Source_t pl_haskell_sources[] = { - {&UpstreamProvider, NULL}, - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/hackage"}, - {&Bfsu, "https://mirrors.bfsu.edu.cn/hackage"}, - {&Nju, "https://mirror.nju.edu.cn/hackage"}, - {&Ustc, "https://mirrors.ustc.edu.cn/hackage"} + {&UpstreamProvider, NULL, NULL}, + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/hackage", DelegateToMirror}, + {&Bfsu, "https://mirrors.bfsu.edu.cn/hackage", DelegateToMirror}, + {&Nju, "https://mirror.nju.edu.cn/hackage", DelegateToMirror}, + {&Ustc, "https://mirrors.ustc.edu.cn/hackage", DelegateToMirror} }; def_sources_n(pl_haskell); @@ -67,4 +67,22 @@ pl_haskell_setsrc (char *option) chsrc_conclude (&source); } -def_target_s (pl_haskell); + +Feature_t +pl_haskell_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = false; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = true; + + f.note = NULL; + return f; +} + +def_target_sf (pl_haskell); diff --git a/src/recipe/lang/Java.c b/src/recipe/lang/Java.c index a015c68..22ed7f6 100644 --- a/src/recipe/lang/Java.c +++ b/src/recipe/lang/Java.c @@ -5,7 +5,7 @@ * Contributors : Nil Null * | * Created On : <2023-08-31> - * Last Modified : <2024-12-18> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ static SourceProvider_t pl_java_upstream = @@ -19,10 +19,11 @@ static SourceProvider_t pl_java_upstream = */ static Source_t pl_java_sources[] = { - {&pl_java_upstream, NULL}, - {&Ali, "https://maven.aliyun.com/repository/public/"}, - {&Huawei, "https://mirrors.huaweicloud.com/repository/maven/"}, - {&Netease, "http://mirrors.163.com/maven/repository/maven-public/"} // 网易的24小时更新一次 + {&pl_java_upstream, NULL, NULL}, + {&Ali, "https://maven.aliyun.com/repository/public/", DelegateToMirror}, + {&Huawei, "https://mirrors.huaweicloud.com/repository/maven/", DelegateToMirror}, + /* 网易的24小时更新一次 */ + {&Netease, "http://mirrors.163.com/maven/repository/maven-public/", DelegateToMirror} }; def_sources_n(pl_java); @@ -106,4 +107,22 @@ pl_java_setsrc (char *option) chsrc_conclude (&source); } -def_target(pl_java); + +Feature_t +pl_java_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = true; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = true; + + f.note = NULL; + return f; +} + +def_target_gsf(pl_java); diff --git a/src/recipe/lang/Julia.c b/src/recipe/lang/Julia.c index ff135da..39b21e1 100644 --- a/src/recipe/lang/Julia.c +++ b/src/recipe/lang/Julia.c @@ -4,19 +4,18 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-08-31> - * Last Modified : <2024-11-22> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ /** - * @update 2023-09-05 - * @note 缺少商业公司或开源社区软件源 + * @update 2025-07-14 */ static Source_t pl_julia_sources[] = { - {&UpstreamProvider, NULL}, - {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/julia"}, - {&Pku, "https://mirrors.pku.edu.cn/julia"}, - {&Nju, "https://mirror.nju.edu.cn/julia"} + {&UpstreamProvider, NULL, NULL}, + {&Pku, "https://mirrors.pku.edu.cn/julia", DelegateToMirror}, + {&Nju, "https://mirror.nju.edu.cn/julia", DelegateToMirror}, + {&Iscas, "https://mirror.iscas.ac.cn/julia", DelegateToMirror} }; def_sources_n(pl_julia); diff --git a/src/recipe/lang/Lua.c b/src/recipe/lang/Lua.c index 3262813..74b7368 100644 --- a/src/recipe/lang/Lua.c +++ b/src/recipe/lang/Lua.c @@ -4,7 +4,7 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-09-27> - * Last Modified : <2024-08-09> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ static MirrorSite_t Api7 = @@ -16,13 +16,13 @@ static MirrorSite_t Api7 = /** - * @update 2023-09-27 + * @update 2025-07-14 * @note 目前只有一个源 */ static Source_t pl_lua_sources[] = { - {&UpstreamProvider, NULL}, - {&Api7, "https://luarocks.cn"}, + {&UpstreamProvider, NULL, NULL}, + {&Api7, "https://luarocks.cn", NULL}, }; def_sources_n(pl_lua); @@ -53,10 +53,28 @@ pl_lua_setsrc (char *option) "server = \"", source.url, "\""); chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):"); - p(upload_config); + println (upload_config); chsrc_determine_chgtype (ChgType_Manual); chsrc_conclude (&source); } -def_target(pl_lua); + +Feature_t +pl_lua_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = true; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = true; + + f.note = NULL; + return f; +} + +def_target_gsf(pl_lua); diff --git a/src/recipe/lang/NuGet.c b/src/recipe/lang/NuGet.c index 333f9fe..cf4bc92 100644 --- a/src/recipe/lang/NuGet.c +++ b/src/recipe/lang/NuGet.c @@ -23,21 +23,20 @@ static MirrorSite_t NugetOrg = */ static Source_t pl_nuget_sources[] = { - {&UpstreamProvider, NULL}, - {&NugetOrg, "https://www.nuget.org/api/v2/"}, - {&Huawei, "https://mirrors.huaweicloud.com/repository/nuget/v3"} + {&UpstreamProvider, NULL, NULL}, + {&NugetOrg, "https://www.nuget.org/api/v2/", NULL}, + {&Huawei, "https://mirrors.huaweicloud.com/repository/nuget/v3", DelegateToMirror} }; def_sources_n(pl_nuget); + void pl_nuget_getsrc (char *option) { chsrc_error ("暂时无法查看NuGet源,若有需求,请提交issue"); } -/** - * NuGet 换源 - */ + void pl_nuget_setsrc (char *option) { @@ -45,4 +44,21 @@ pl_nuget_setsrc (char *option) } -def_target_s (pl_nuget); +Feature_t +pl_nuget_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = false; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = false; + + f.note = NULL; + return f; +} + +def_target_gsf(pl_nuget); diff --git a/src/recipe/lang/OCaml.c b/src/recipe/lang/OCaml.c index 80d7bb4..1c35732 100644 --- a/src/recipe/lang/OCaml.c +++ b/src/recipe/lang/OCaml.c @@ -4,16 +4,16 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-09-15> - * Last Modified : <2024-08-15> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ /** - * @update 2023-09-15 + * @update 2025-07-14 */ static Source_t pl_ocaml_sources[] = { - {&UpstreamProvider, NULL}, - {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git"} + {&UpstreamProvider, NULL, NULL}, + {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git", NULL} }; def_sources_n(pl_ocaml); @@ -56,4 +56,23 @@ pl_ocaml_setsrc (char *option) chsrc_conclude (&source); } -def_target(pl_ocaml); + +Feature_t +pl_ocaml_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = true; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = true; + + f.note = NULL; + return f; +} + + +def_target_gsf(pl_ocaml); diff --git a/src/recipe/lang/Perl.c b/src/recipe/lang/Perl.c index ecf38da..cb2e69a 100644 --- a/src/recipe/lang/Perl.c +++ b/src/recipe/lang/Perl.c @@ -5,7 +5,7 @@ * Contributors : Nil Null * | * Created On : <2023-09-31> - * Last Modified : <2024-12-18> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ static SourceProvider_t pl_perl_upstream = @@ -19,13 +19,13 @@ static SourceProvider_t pl_perl_upstream = */ static Source_t pl_perl_sources[] = { - {&pl_perl_upstream, NULL}, - {&Bfsu, "https://mirrors.bfsu.edu.cn/CPAN/"}, - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CPAN/"}, - {&Bjtu, "https://mirror.bjtu.edu.cn/cpan/"}, - {&Hust, "https://mirrors.hust.edu.cn/CPAN/"}, - {&Ali, "https://mirrors.aliyun.com/CPAN/"}, - {&Lzuoss, "https://mirror.lzu.edu.cn/CPAN/"} + {&pl_perl_upstream, NULL, NULL}, + {&Bfsu, "https://mirrors.bfsu.edu.cn/CPAN/", DelegateToMirror}, + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CPAN/", DelegateToMirror}, + {&Bjtu, "https://mirror.bjtu.edu.cn/cpan/", DelegateToMirror}, + {&Hust, "https://mirrors.hust.edu.cn/CPAN/", DelegateToMirror}, + {&Ali, "https://mirrors.aliyun.com/CPAN/", DelegateToMirror}, + {&Lzuoss, "https://mirror.lzu.edu.cn/CPAN/", DelegateToMirror} }; def_sources_n(pl_perl); @@ -61,10 +61,29 @@ pl_perl_setsrc (char *option) chsrc_run (cmd, RunOpt_Default); chsrc_note2 ("请使用 perl -v 以及 cpan -v,若 Perl >= v5.36 或 CPAN >= 2.29,请额外手动调用下面的命令"); - p("perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('pushy_https', 0);; CPAN::HandleConfig->commit()\""); + p ("perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('pushy_https', 0);; CPAN::HandleConfig->commit()\""); chsrc_determine_chgtype (ChgType_SemiAuto); chsrc_conclude (&source); } -def_target(pl_perl); + +Feature_t +pl_perl_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = true; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = true; + + f.note = NULL; + return f; +} + + +def_target_gsf(pl_perl); diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index a7243b8..45615b8 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -4,25 +4,25 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-09-21> - * Last Modified : <2024-11-22> + * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ /** * @update 2023-09-04 - * @note { + * + * @note * 以下注释的,是不含有bioconductor的镜像站, * 我们在换cran的同时,也直接帮助用户换bioconductor - * } */ static Source_t pl_r_sources[] = { - {&UpstreamProvider, NULL}, - {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/cran/"}, - // {&Ali, "https://mirrors.aliyun.com/CRAN/"}, - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CRAN/"}, - // {&Sustech, "https://mirrors.sustech.edu.cn/CRAN"}, - // {&Bfsu, "https://mirrors.bfsu.edu.cn/CRAN/"}, - // {&Bjtu, "https://mirror.bjtu.edu.cn/cran/"}, + {&UpstreamProvider, NULL, NULL}, + {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/cran/", DelegateToMirror}, + // {&Ali, "https://mirrors.aliyun.com/CRAN/", DelegateToMirror}, + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CRAN/", DelegateToMirror}, + // {&Sustech, "https://mirrors.sustech.edu.cn/CRAN", DelegateToMirror}, + // {&Bfsu, "https://mirrors.bfsu.edu.cn/CRAN/", DelegateToMirror}, + // {&Bjtu, "https://mirror.bjtu.edu.cn/cran/", DelegateToMirror}, }; def_sources_n(pl_r); @@ -75,4 +75,22 @@ pl_r_setsrc (char *option) chsrc_conclude (&source); } -def_target(pl_r); + +Feature_t +pl_r_feat (char *option) +{ + Feature_t f = {0}; + + f.can_get = true; + f.can_reset = false; + + f.cap_locally = CanNot; + f.cap_locally_explain = NA; + f.can_english = false; + f.can_user_define = false; + + f.note = NULL; + return f; +} + +def_target_gsf(pl_r);