Update pl recipes using chef DSL

This commit is contained in:
Aoran Zeng 2025-08-10 15:01:52 +08:00
parent 27f145ba2b
commit 341369f347
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
5 changed files with 161 additions and 247 deletions

View File

@ -1,42 +1,50 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : czyt <czyt.go@gmail.com>
* | MadDogOwner <xiaoran@xrgzs.top>
* |
* Created On : <2023-09-10>
* Major Revision : 2
* Last Modified : <2025-07-11>
*
* 2024-09-14: Dart和Flutter拆分为两个Target
* 3 Dart Flutter URL模式都不一样
* ------------------------------------------------------------*/
#define PL_Dart_Flutter_Speed_URL_Postfix "/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz"
/**
* @update 2025-04-15
*/
static SourceProvider_t pl_dart_flutter_upstream =
def_target(pl_dart_flutter);
void
pl_dart_flutter_prelude (void)
{
def_upstream, "https://storage.googleapis.com",
{NotSkip, NA, NA, "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz", ACCURATE} // 231 MB
};
use_this(pl_dart_flutter);
static Source_t pl_dart_flutter_sources[] =
{
{&pl_dart_flutter_upstream, "https://storage.googleapis.com", DelegateToUpstream},
{&FlutterCN, "https://storage.flutter-io.cn", DelegateToMirror},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", NULL }, /* 官方文档也没有给后缀,怀疑是否存在问题 */
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-04-15");
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter",
"https://mirrors.tuna.tsinghua.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix},
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 2,
"czyt", "czyt.go@gmail.com",
"MadDogOwner", "xiaoran@xrgzs.top");
{&Nju, "https://mirror.nju.edu.cn/flutter",
"https://mirror.nju.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix}
};
def_sources_n(pl_dart_flutter);
chef_allow_get();
chef_allow_set();
chef_allow_reset();
chef_forbid_local_mode (this);
chef_allow_english(this);
chef_allow_user_define(this);
chef_set_note ("2024-09-14: 不得不将Dart和Flutter拆分为两个Target因为3家教育网镜像站给出的 Dart 和 Flutter 换源URL模式都不一样",
"2024-09-14: Had to split Dart and Flutter into two Targets, because the 3 educational network mirror sites have different URL patterns for Dart and Flutter source switching");
def_sources_begin()
{&upstream, "https://storage.googleapis.com", "https://storage.googleapis.com" PL_Dart_Flutter_Speed_URL_Postfix},
{&FlutterCN, "https://storage.flutter-io.cn", DelegateToMirror},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", NULL }, /* 官方文档也没有给后缀,怀疑是否存在问题 */
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter",
"https://mirrors.tuna.tsinghua.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix},
{&Nju, "https://mirror.nju.edu.cn/flutter",
"https://mirror.nju.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix}
def_sources_end()
}
/**
@ -92,27 +100,3 @@ pl_dart_flutter_resetsrc (char *option)
{
pl_dart_flutter_setsrc (option);
}
/**
* chsrc ls flutter
*/
Feature_t
pl_dart_flutter_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = true;
f.cap_locally = CanNot;
f.cap_locally_explain = NULL;
f.can_english = true;
f.can_user_define = true;
f.note = "该换源通过写入环境变量实现若多次换源请手动清理profile文件";
return f;
}
def_target_gsrf(pl_dart_flutter);

View File

@ -1,32 +1,37 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : czyt <czyt.go@gmail.com>
* | MadDogOwner <xiaoran@xrgzs.top>
* |
* Created On : <2023-09-10>
* Major Revision : 3
* Last Modified : <2025-07-11>
*
* Dart Pub
* ------------------------------------------------------------*/
#define PL_Dart_Pub_Speed_URL_Postfix "/packages/flutter_vision/versions/1.1.4.tar.gz"
/**
* @update 2025-04-15
*/
static SourceProvider_t pl_dart_upstream =
{
def_upstream, "https://pub.dev",
{NotSkip, NA, NA, "https://pub.dev/packages/flutter_vision/versions/1.1.4.tar.gz", ACCURATE} // 37.05 MB
};
def_target(pl_dart);
static Source_t pl_dart_sources[] =
void
pl_dart_prelude (void)
{
{&pl_dart_upstream, "https://pub.dev", DelegateToUpstream},
use_this(pl_dart);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-04-15");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 2,
"czyt", "czyt.go@gmail.com",
"MadDogOwner", "xiaoran@xrgzs.top");
chef_allow_get();
chef_allow_set();
chef_allow_reset();
chef_allow_local_mode (this, FullyCan, "Pub 支持项目级换源", "Pub supports project-level source changing");
chef_allow_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&upstream, "https://pub.dev", "https://pub.dev" PL_Dart_Pub_Speed_URL_Postfix},
{&FlutterCN, "https://pub.flutter-io.cn",
"https://pub.flutter-io.cn" PL_Dart_Pub_Speed_URL_Postfix},
@ -38,8 +43,8 @@ static Source_t pl_dart_sources[] =
{&Nju, "https://mirror.nju.edu.cn/dart-pub",
"https://mirror.nju.edu.cn/dart-pub" PL_Dart_Pub_Speed_URL_Postfix}
};
def_sources_n(pl_dart);
def_sources_end()
}
void
@ -92,24 +97,3 @@ pl_dart_resetsrc (char *option)
{
pl_dart_setsrc (option);
}
Feature_t
pl_dart_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = true;
f.cap_locally = CanNot;
f.cap_locally_explain = NULL;
f.can_english = true;
f.can_user_define = true;
f.note = "该换源通过写入环境变量实现若多次换源请手动清理profile文件";
return f;
}
def_target_gsrf(pl_dart);

View File

@ -1,44 +1,54 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* |
* Created On : <2023-08-29>
* Last Modified : <2025-07-14>
* ------------------------------------------------------------*/
static SourceProvider_t pl_ruby_upstream =
{
def_upstream, "https://rubygems.org",
{NotSkip, NA, NA, "https://rubygems.org/gems/nokogiri-1.15.0-java.gem", ACCURATE}
};
static MirrorSite_t RubyChina =
{
IS_DedicatedMirrorSite,
"rubychina", "RubyChina", "Ruby China 社区", "https://gems.ruby-china.com/",
{NotSkip, NA, NA, "https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem", ACCURATE} // 9.9 MB
"https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem", // 9.9 MB
ACCURATE
};
/**
* @update 2024-12-18
*/
static Source_t pl_ruby_sources[] =
def_target(pl_ruby);
void
pl_ruby_prelude (void)
{
{&pl_ruby_upstream, "https://rubygems.org", NULL},
{&RubyChina, "https://gems.ruby-china.com/", NULL},
{&Ustc, "https://mirrors.ustc.edu.cn/rubygems/", NULL}
use_this(pl_ruby);
// {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rubygems/", NULL},
// {&Bfsu, "https://mirrors.bfsu.edu.cn/rubygems/", NULL},
chef_set_created_on (this, "2023-08-29");
chef_set_last_updated (this, "2025-07-14");
chef_set_sources_last_updated (this, "2024-12-18");
// {&Tencent, "https://mirrors.tencent.com/rubygems/", NULL},
// {&Tencent_Intra, "https://mirrors.tencentyun.com/rubygems/", NULL},
// {&Ali, "https://mirrors.aliyun.com/rubygems/", NULL},
// {&Huawei, "https://mirrors.huaweicloud.com/repository/rubygems/", NULL},
};
def_sources_n(pl_ruby);
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"Nil Null", "nil@null.org");
chef_allow_get();
chef_allow_set();
chef_allow_reset();
chef_allow_local_mode (this, PartiallyCan, "Support `bundler`. No support for `gem`", "Support `bundler`. No support for `gem`");
chef_allow_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&upstream, "https://rubygems.org", "https://rubygems.org/gems/nokogiri-1.15.0-java.gem"},
{&RubyChina, "https://gems.ruby-china.com/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/rubygems/", DelegateToMirror}
// {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rubygems/", DelegateToMirror},
// {&Bfsu, "https://mirrors.bfsu.edu.cn/rubygems/", DelegateToMirror},
// {&Tencent, "https://mirrors.tencent.com/rubygems/", DelegateToMirror},
// {&Tencent_Intra, "https://mirrors.tencentyun.com/rubygems/", DelegateToMirror},
// {&Ali, "https://mirrors.aliyun.com/rubygems/", DelegateToMirror},
// {&Huawei, "https://mirrors.huaweicloud.com/repository/rubygems/", DelegateToMirror},
def_sources_end()
}
void
@ -97,24 +107,3 @@ pl_ruby_resetsrc (char *option)
{
pl_ruby_setsrc (option);
}
Feature_t
pl_ruby_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = true;
f.cap_locally = PartiallyCan;
f.cap_locally_explain = "Support `bundler`. No support for `gem`";
f.can_english = true;
f.can_user_define = true;
f.note = NULL;
return f;
}
def_target_gsrf(pl_ruby);

View File

@ -1,31 +1,37 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2023-08-30>
* Last Modified : <2025-07-22>
* ------------------------------------------------------------*/
static SourceProvider_t pl_rust_cargo_upstream =
def_target(pl_rust_cargo);
void
pl_rust_cargo_prelude (void)
{
def_upstream, "https://crates.io/",
{NotSkip, NA, NA, "https://crates.io/api/v1/crates/windows/0.58.0/download", ACCURATE}
/* 跳转为: https://static.crates.io/crates/windows/windows-0.58.0.crate */
};
use_this(pl_rust_cargo);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-07-22");
chef_set_sources_last_updated (this, "2025-06-18");
/**
* @update 2025-06-18
*
* @note `sparse+`
* @note `/`
*/
static Source_t pl_rust_cargo_sources[] =
{
{&pl_rust_cargo_upstream, "https://github.com/rust-lang/crates.io-index/", DelegateToUpstream},
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"Mikachu2333", "mikachu.23333@zohomail.com");
chef_allow_get();
chef_allow_set();
chef_allow_reset();
chef_allow_local_mode (this, PartiallyCan, "可以基于本项目换源吗?请帮助确认", "Can it change sources based on this project? Please help confirm");
chef_forbid_english (this);
chef_allow_user_define(this);
chef_set_note ("以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`。链接末尾的 `/` 不能缺少",
"All sources support sparse index, we will add `sparse+` by default when changing sources. The trailing `/` in URLs cannot be missing");
def_sources_begin()
{&upstream, "https://crates.io/", "https://crates.io/api/v1/crates/windows/0.58.0/download"},
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/", DelegateToMirror},
{&RsProxyCN, "https://rsproxy.cn/index/", DelegateToMirror},
@ -48,13 +54,10 @@ static Source_t pl_rust_cargo_sources[] =
// {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/", DelegateToMirror},
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/", DelegateToMirror}
};
def_sources_n(pl_rust_cargo);
def_sources_end()
}
/**
* chsrc get cargo
*/
void
pl_rust_cargo_getsrc (char *option)
{
@ -65,8 +68,6 @@ pl_rust_cargo_getsrc (char *option)
/**
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/
* @consult https://help.mirrors.cernet.edu.cn/crates.io-index
*
* chsrc set cargo
*/
void
pl_rust_cargo_setsrc (char *option)
@ -85,32 +86,8 @@ pl_rust_cargo_setsrc (char *option)
}
/**
* chsrc reset cargo
*/
void
pl_rust_cargo_resetsrc (char *option)
{
pl_rust_cargo_setsrc (option);
}
Feature_t
pl_rust_cargo_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = true;
f.cap_locally = PartiallyCan;
f.cap_locally_explain = "可以基于本项目换源吗?请帮助确认";
f.can_english = false;
f.can_user_define = true;
f.note = NULL;
return f;
}
def_target_gsrf(pl_rust_cargo);

View File

@ -1,30 +1,39 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Yangmoooo <yangmoooo@outlook.com>
* | Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2024-10-02>
* Last Modified : <2025-08-07>
* ------------------------------------------------------------*/
// Size: 20MB
#define PL_Rustup_Speed_URL_Suffix "/dist/2025-06-26/cargo-1.88.0-x86_64-unknown-illumos.tar.gz"
static SourceProvider_t pl_rust_binary_upstream =
def_target(pl_rust_rustup);
void
pl_rust_rustup_prelude (void)
{
def_upstream, "https://www.rust-lang.org/",
def_need_measure_info
};
use_this(pl_rust_rustup);
/**
* @update 2025-08-07
*/
static Source_t pl_rust_rustup_sources[] = {
{&pl_rust_binary_upstream, "https://static.rust-lang.org",
chef_set_created_on (this, "2024-10-02");
chef_set_last_updated (this, "2025-08-07");
chef_set_sources_last_updated (this, "2025-08-07");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 2,
"Yangmoooo", "yangmoooo@outlook.com",
"Mikachu2333", "mikachu.23333@zohomail.com");
chef_allow_get();
chef_allow_set();
chef_forbid_reset();
chef_forbid_local_mode (this);
chef_forbid_english (this);
chef_allow_user_define(this);
def_sources_begin()
{&upstream, "https://static.rust-lang.org",
"https://static.rust-lang.org" PL_Rustup_Speed_URL_Suffix},
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup", NULL},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup",
@ -49,13 +58,12 @@ static Source_t pl_rust_rustup_sources[] = {
"https://mirrors.aliyun.com/rustup" PL_Rustup_Speed_URL_Suffix},
{&RsProxyCN, "https://rsproxy.cn",
"https://rsproxy.cn" PL_Rustup_Speed_URL_Suffix}};
def_sources_n(pl_rust_rustup);
"https://rsproxy.cn" PL_Rustup_Speed_URL_Suffix}
def_sources_end()
}
/**
* chsrc get rustup
*/
void
pl_rust_rustup_getsrc (char *option)
{
@ -65,8 +73,6 @@ pl_rust_rustup_getsrc (char *option)
/**
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/rustup/
*
* chsrc set rustup
*/
void
pl_rust_rustup_setsrc (char *option)
@ -121,35 +127,9 @@ pl_rust_rustup_setsrc (char *option)
}
/**
* chsrc reset rustup
*/
void
pl_rust_rustup_resetsrc (char *option)
{
pl_rust_rustup_setsrc (option);
}
/**
* chsrc ls rustup
*/
Feature_t
pl_rust_rustup_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = false;
f.cap_locally = CanNot;
f.cap_locally_explain = "";
f.can_english = false;
f.can_user_define = true;
f.note = NULL;
return f;
}
def_target_gsrf(pl_rust_rustup);