From 9666b769a14a0caf8bd2052702002edf1dd8ac2a Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Fri, 10 Oct 2025 23:32:52 +0800 Subject: [PATCH 01/17] =?UTF-8?q?build(.gitignore):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20.res=20=E6=96=87=E4=BB=B6=E5=88=B0=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 66c4a28..8586f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ *.dll *.out *.exe - +*.res ############################## From a5e358fc4a47dbd40da78aa97395517e2a84b6f5 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Fri, 10 Oct 2025 23:33:44 +0800 Subject: [PATCH 02/17] =?UTF-8?q?feat(logo):=20=E6=B7=BB=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=9B=BE=E6=A0=87=E6=96=87=E4=BB=B6=20svg=E4=B8=BA?= =?UTF-8?q?=E7=9F=A2=E9=87=8F=E5=9B=BE=EF=BC=8C=E5=9B=A0=E6=97=A0=E6=8D=9F?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E5=8F=AF=E4=BD=9C=E4=B8=BA=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/image/chsrc.svg | 9 +++++++++ lib/logo.ico | Bin 0 -> 61764 bytes 2 files changed, 9 insertions(+) create mode 100644 doc/image/chsrc.svg create mode 100644 lib/logo.ico diff --git a/doc/image/chsrc.svg b/doc/image/chsrc.svg new file mode 100644 index 0000000..fc00ba6 --- /dev/null +++ b/doc/image/chsrc.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lib/logo.ico b/lib/logo.ico new file mode 100644 index 0000000000000000000000000000000000000000..44c0dc670419536054cc0b96094c673459dc5462 GIT binary patch literal 61764 zcmeEv2|$e77xFXO~nnMI>7)QX?f4 z*+nSPVrjFsnfagdP1C-5e($~i|L@~==li~U&pr3t?QHjcgwRL_!eq)oEK2f32zf#X zk&zMHccl>$ODDw8kidHhazcub98m)4EAJ%;*)50Z1@}wZ5YkT_0Ki2fOrp`1kYk#J zn41gkyACBJX0#9!+U`HC7BRqWx;zdNkWdkAVgkX za33W`Naq}3`H&xQd+`zALHSGwP%OZOhj6i=Zo&(|*0@;k5^h;6K?Hx{Cj=JZa=Gw= zPyHu+KK_CL|L_t1`MFEdsdm1#Dz)zEva+=jtW}XcP$Pl3tgNh0jRb2|RAhaWsuGC% zD6LuJqf(W?!xvu}2_c9J-iZ6K1Ua_J3gWduV!UJx1u+ep6)tffZ;TEIfA|1uN(T+CIk!d?@m=-B zf=&&0(66Zo{=(0n?dNoF00q~0L3>FKSW6Ln4WXJBdpHJYYH@=70F$aX(R_$2bP_{} z0q_oc;#$a!Jx@Z`cVbnGVcOc4V7w8+b0?(2jF1urA)iwT$;~As^#UP#iecV>u=O<| z*RKUBTPhO#p;iA@VX}$37Ke1|988$HAw;ul2*f9dR@W1x zOOKO8r{_u1)!-EAZg`65^*Tj*7@darG|}%HMhuO^h*AGDq|d-`(r?gN(tq$-GSK`S z8EkQZ3>kTmSo{$|Mp|AXqpU8Gag(Bn_2kQB%FGxtb=Flfea=-f(^nCZz3I zLfS!FNfkjq<#!~ed?PZGKc1`wI0yMYB!YjAJmTN4$}bQ3wXC7NoCq=XCdBeAA=4qh zZ4n`^d|9#`@*jo#XCOZp@;`w5Z)@b&f&Avygv@XvWTiK(PiF}^3HjrT2;eD8(jfmU z$o~fNzk~dRkpEka{02Hu{UK2OnNauJ8#xjF_$`F*e3bBg&J+H*n}mPAy8R3Y6Y}?i z{Fab^KIC_W{JSAP8}eU({IQTf3GzdkJ})4DHsr7FKYGM~i~$Hs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y7)}$hm zS>yz3lp(BKGPN*gImuAZGl>(G4%1R_02Z!Sn3@SexNez)I-+%#(D$o#xv138$Dv=% zf_^Zw+V{JqaKMLvQF)da)xU$Mx0Lt7IgZ+2M15OSFfO5Qzriz#@Lkgw;C`!?;dY(`fQMQ^9^LfgBWu@(a!n81OfYnKLjB9w;(S^amX3^-qC}z`ld! z)m($9ISXVIlqGQ70Ujx8%s_*h^`Q0^Fxb}tZ`6%D;yi`l&O`eIz;nYfhUawRJ*I*C zsx#pK&wysi1M~V$P~Hd9z&VY@fuMQ;)ZPX4qoIB2SWtZdk^`#w3A6)PHZ9o!(hCv; z`U^Hk18VE%gX(NZ-e1xr4xC>E&kf7Z2bM`7`=R{-@Vwm808oAfibLxd@Vw|TNu`By z;C>&{8C@Vh0qp~pQLwqwr47)$&Hyf>fos|!ZUct_YWRcd7f|?v{SJ0NaPAlN3@yl< z_R={(zktd)kUyRS!|n)B-%$`7ECwkTan4V|6^cK`Hq;2MUKINWB&s# rs`_IOTyG^0Tzdr^C3yf`gmnP8FzYZ7Hz23d0}wt)4x|RyGzMb;(?`iv literal 0 HcmV?d00001 From de75aaa62b8ff18c03eb894cb89df706540dc426 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Fri, 10 Oct 2025 23:34:30 +0800 Subject: [PATCH 03/17] =?UTF-8?q?docs(chsrc):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=B4=A1=E7=8C=AE=E8=80=85=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/01-开发与构建.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/01-开发与构建.md b/doc/01-开发与构建.md index 27a1422..0112f44 100644 --- a/doc/01-开发与构建.md +++ b/doc/01-开发与构建.md @@ -3,11 +3,11 @@ ! ------------------------------------------------------------- ! Doc Type : Markdown ! Doc Name : 01-开发与构建.md - ! Doc Authors : 曾奥然 - ! Contributors : Nul None + ! Doc Authors : 曾奥然 + ! Contributors : Mikachu2333 ! | ! Created On : <2024-12-27> - ! Last Modified : <2025-08-22> + ! Last Modified : <2025-10-10> ! ---------------------------------------------------------- --> # 开发 chsrc @@ -46,6 +46,8 @@ git clone https://gitee.com/RubyMetric/chsrc.git -b dev ## 编译运行 +**⚠️警告:Windows 上使用 `make` 将无法正确编译版本号与附加信息,仅 `just` 可完整编译** + 共有四种构建模式: 1. **`DEV mode`** From b84f2f9eddd0bb89b3a42b9966be162761d036d0 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Fri, 10 Oct 2025 23:34:18 +0800 Subject: [PATCH 04/17] =?UTF-8?q?feat(build):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Djust=20=E4=BF=AE=E5=A4=8Dmakefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 81 ++++++++++++++++++++++++++++++++--------- include/chsrc_version.h | 24 ++++++++++++ justfile | 17 +++++---- lib/win_res.rc | 44 ++++++++++++++++++++++ src/chsrc-main.c | 4 +- 5 files changed, 143 insertions(+), 27 deletions(-) create mode 100644 include/chsrc_version.h create mode 100644 lib/win_res.rc diff --git a/Makefile b/Makefile index 5f8ab71..3a1184b 100755 --- a/Makefile +++ b/Makefile @@ -3,12 +3,13 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -------------------------------------------------------------- # Build File : Makefile -# File Authors : Aoran Zeng -# Contributors : Yangmoooo -# | sanchuanhehe -# | +# File Authors : Aoran Zeng +# Contributors : Yangmoooo +# | sanchuanhehe +# | Mikachu2333 +# | # Created On : <2023-08-28> -# Last Modified : <2025-07-22> +# Last Modified : <2025-10-11> # # 请阅读 ./doc/01-开发与构建.md 来使用 # -------------------------------------------------------------- @@ -18,17 +19,24 @@ On-Linux = 0 On-Windows = 0 On-macOS = 0 -ifeq ($(shell uname), Linux) - On-Linux = 1 -endif - -ifeq ($(shell uname), Darwin) - On-macOS = 1 -endif - -# 只有Windows会定义$(OS)变量 -ifeq ($(OS), Windows_NT) +# Windows 会定义 OS 或 ComSpec 环境变量 +ifdef ComSpec On-Windows = 1 +else ifdef OS + ifeq ($(OS), Windows_NT) + On-Windows = 1 + endif +endif + +# 只在非 Windows 环境下调用 uname +ifneq ($(On-Windows), 1) + UNAME_S := $(shell uname 2>/dev/null || echo unknown) + ifeq ($(UNAME_S), Linux) + On-Linux = 1 + endif + ifeq ($(UNAME_S), Darwin) + On-macOS = 1 + endif endif #===================================== @@ -36,8 +44,8 @@ endif #======== Default Tooling ============ ifeq ($(On-Windows), 1) - # MSYS2 环境 - CC = cc + # Windows 环境 - 使用 gcc + CC = gcc else ifeq ($(On-macOS), 1) CC = clang else @@ -142,13 +150,25 @@ build-in-debug-mode: build-in-release-mode: CFLAGS += $(CFLAGS_optimization) build-in-release-mode: @echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name) +ifeq ($(On-Windows), 1) + @if exist lib\chsrc.res del /Q lib\chsrc.res 2>nul + @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib + @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) + @del /Q lib\chsrc.res 2>nul +else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) +endif @echo Finished: Build in RELEASE mode # CI release mode 的配置在该文件上方 build-in-ci-release-mode: @echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name) +ifeq ($(On-Windows), 1) + @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib + @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) +else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) +endif @echo Finished: Build in CI-RELEASE mode # 永远重新编译 @@ -163,6 +183,10 @@ test-make-env: @echo "On-macOS: $(On-macOS)" @echo "CC: $(CC)" @echo "CFLAGS: $(CFLAGS)" +ifeq ($(On-Windows), 1) + @echo "USER: $(USERNAME)" + @echo "PWD: $(CURDIR)" +else @echo "USER: $$(whoami)" @echo "PWD: $(shell pwd)" @echo "UID: $$(id -u)" @@ -173,17 +197,28 @@ test-make-env: else \ echo "HOME: $(HOME)"; \ fi +endif # 这两个测试文件都用 DEBUG mode test-xy: CFLAGS += $(CFLAGS_debug) test-xy: +ifeq ($(On-Windows), 1) + @$(CC) test/xy.c $(CFLAGS) -o xy.exe + @xy.exe +else @$(CC) test/xy.c $(CFLAGS) -o xy @./xy +endif test-fw: CFLAGS += $(CFLAGS_debug) test-fw: +ifeq ($(On-Windows), 1) + @$(CC) test/fw.c $(CFLAGS) -o fw.exe + @fw.exe +else @$(CC) test/fw.c $(CFLAGS) -o fw @./fw +endif check: test @@ -195,15 +230,25 @@ test-cli: $(DevMode-Target-Name) @perl ./test/cli.pl clean: +ifeq ($(On-Windows), 1) + -@if exist *.exe del /Q *.exe 2>nul + -@if exist xy.exe del /Q xy.exe 2>nul + -@if exist fw.exe del /Q fw.exe 2>nul + -@if exist README.md.bak* del /Q README.md.bak* 2>nul + -@if exist chsrc.exe del /Q chsrc.exe 2>nul + -@if exist chsrc-debug.exe del /Q chsrc-debug.exe 2>nul + -@if exist chsrc-release.exe del /Q chsrc-release.exe 2>nul + -@if exist chsrc-ci-release.exe del /Q chsrc-ci-release.exe 2>nul +else -@rm *.exe 2>/dev/null -@rm xy 2>/dev/null -@rm fw 2>/dev/null -@rm README.md.bak* 2>/dev/null - -@rm chsrc 2>/dev/null -@rm chsrc-debug 2>/dev/null -@rm chsrc-release 2>/dev/null -@rm chsrc-ci-release 2>/dev/null +endif # -include pkg/deb/Makefile # 不这么做,因为 pkg/deb/Makefile 需要在 pkg/deb 目录下执行 # 保持动词在前的任务名风格 diff --git a/include/chsrc_version.h b/include/chsrc_version.h new file mode 100644 index 0000000..778e4fa --- /dev/null +++ b/include/chsrc_version.h @@ -0,0 +1,24 @@ +/** ------------------------------------------------------------ + * Copyright © 2023-2025 曾奥然, 郭恒 + * SPDX-License-Identifier: MIT + * ------------------------------------------------------------- + * Lib Authors : 曾奥然 + * Contributors : Mikachu2333 + * | + * Created On : <2025-10-10> + * Last Modified : <2025-10-10> + + * !!!警告!!! + * 发布前请修改此处的内容 + * ------------------------------------------------------------*/ + +#define Chsrc_Version "0.2.3" +#define Chsrc_Release_Date "2025/10/06" + +// 以下宏仅用于 Windows +#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) + #define CHSRC_VERSION_MAJOR 0 + #define CHSRC_VERSION_MINOR 2 + #define CHSRC_VERSION_PATCH 3 + #define CHSRC_VERSION_STRING "0.2.3" +#endif diff --git a/justfile b/justfile index 2bacf86..081b4ef 100644 --- a/justfile +++ b/justfile @@ -3,11 +3,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -------------------------------------------------------------- # Build File : justfile -# File Authors : Aoran Zeng -# Contributors : Nul None +# File Authors : Aoran Zeng +# Contributors : Mikachu2333 # | # Created On : <2025-06-18> -# Last Modified : <2025-07-21> +# Last Modified : <2025-10-11> # # 该文件主要用于在原生Windows上执行项目的基本任务,而不借助于 # GNU make 以及相应的 MSYS2、Cygwin 环境 @@ -104,9 +104,9 @@ alias c := clean default: build-in-dev-mode build-in-dev-mode: - @echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}} - @{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}} - @echo Finished: Build in DEV mode + @echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}} + @{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}} + @echo Finished: Build in DEV mode build-in-debug-mode: @echo Starting: Build in DEBUG mode: '{{CC}}' {{CFLAGS_debug_mode_prompt}} -o {{DebugMode-Target-Name}} @@ -115,7 +115,10 @@ build-in-debug-mode: build-in-release-mode: @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} - @{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}} + {{ if os() == 'windows' { '@if exist lib\\chsrc.res del lib\\chsrc.res' } else { '' } }} + {{ if os() == 'windows' { '@windres lib\\win_res.rc -O coff -o lib\\chsrc.res -Iinclude -Ilib' } else { '' } }} + {{ if os() == 'windows' { '@{{CC}} src/chsrc-main.c lib/chsrc.res {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } else { '@{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } }} + {{ if os() == 'windows' { '@del lib\\chsrc.res' } else { '' } }} @echo Finished: Build in RELEASE mode debug: build-in-debug-mode diff --git a/lib/win_res.rc b/lib/win_res.rc new file mode 100644 index 0000000..d45e568 --- /dev/null +++ b/lib/win_res.rc @@ -0,0 +1,44 @@ +// chsrc.rc - Windows Resource Script +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include "chsrc_version.h" + +// 图标资源 +IDI_ICON1 ICON DISCARDABLE "logo.ico" + +// 版本信息 +VS_VERSION_INFO VERSIONINFO + FILEVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0 + PRODUCTVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Github RubyMetric" + VALUE "FileDescription", "Change Source everywhere for every software" + VALUE "FileVersion", Chsrc_Version + VALUE "InternalName", "chsrc" + VALUE "LegalCopyright", "Copyright (c) 2023-2025 RubyMetric" + VALUE "OriginalFilename", "chsrc.exe" + VALUE "ProductName", "chsrc" + VALUE "ProductVersion", Chsrc_Release_Date + VALUE "Comments", "MIT License" + VALUE "LegalTrademarks", "" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0804, 1200, 0x0409, 1200 // 简体中文和英语 + END +END diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 98318a7..94f4031 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -30,8 +30,8 @@ * 然的加入,逐渐成长为互相支持的伙伴。 * ------------------------------------------------------------*/ -#define Chsrc_Version "0.2.3" -#define Chsrc_Release_Date "2025/10/06" +#include "chsrc_version.h" + #define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc" #define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc" From 1829f6e622dc92fe235214f7d65e53397a4cc046 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Sun, 12 Oct 2025 00:19:20 +0800 Subject: [PATCH 05/17] =?UTF-8?q?feat(chsrc):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E6=97=A0=E7=94=A8=E7=9A=84=E5=AE=8F=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E5=88=A0=E9=99=A4=E6=96=87=E6=A1=A3=E8=BF=87?= =?UTF-8?q?=E6=97=B6=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/01-开发与构建.md | 4 +--- include/chsrc_version.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/01-开发与构建.md b/doc/01-开发与构建.md index 0112f44..a2d3b1e 100644 --- a/doc/01-开发与构建.md +++ b/doc/01-开发与构建.md @@ -7,7 +7,7 @@ ! Contributors : Mikachu2333 ! | ! Created On : <2024-12-27> - ! Last Modified : <2025-10-10> + ! Last Modified : <2025-10-11> ! ---------------------------------------------------------- --> # 开发 chsrc @@ -46,8 +46,6 @@ git clone https://gitee.com/RubyMetric/chsrc.git -b dev ## 编译运行 -**⚠️警告:Windows 上使用 `make` 将无法正确编译版本号与附加信息,仅 `just` 可完整编译** - 共有四种构建模式: 1. **`DEV mode`** diff --git a/include/chsrc_version.h b/include/chsrc_version.h index 778e4fa..4e5181c 100644 --- a/include/chsrc_version.h +++ b/include/chsrc_version.h @@ -20,5 +20,4 @@ #define CHSRC_VERSION_MAJOR 0 #define CHSRC_VERSION_MINOR 2 #define CHSRC_VERSION_PATCH 3 - #define CHSRC_VERSION_STRING "0.2.3" #endif From 6aac016c02acc3a5630877a745ea8e072af7998c Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Sun, 12 Oct 2025 20:53:21 +0800 Subject: [PATCH 06/17] =?UTF-8?q?refactor(include):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E5=BC=95=E7=94=A8=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chsrc-main.c | 2 +- include/chsrc_version.h => src/framework/version.h | 0 {lib => src/res}/logo.ico | Bin {lib => src/res}/win_res.rc | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename include/chsrc_version.h => src/framework/version.h (100%) rename {lib => src/res}/logo.ico (100%) rename {lib => src/res}/win_res.rc (98%) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 94f4031..0325b75 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -30,7 +30,7 @@ * 然的加入,逐渐成长为互相支持的伙伴。 * ------------------------------------------------------------*/ -#include "chsrc_version.h" +#include "version.h" #define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc" #define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc" diff --git a/include/chsrc_version.h b/src/framework/version.h similarity index 100% rename from include/chsrc_version.h rename to src/framework/version.h diff --git a/lib/logo.ico b/src/res/logo.ico similarity index 100% rename from lib/logo.ico rename to src/res/logo.ico diff --git a/lib/win_res.rc b/src/res/win_res.rc similarity index 98% rename from lib/win_res.rc rename to src/res/win_res.rc index d45e568..b2f0414 100644 --- a/lib/win_res.rc +++ b/src/res/win_res.rc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include -#include "chsrc_version.h" +#include "version.h" // 图标资源 IDI_ICON1 ICON DISCARDABLE "logo.ico" From 91692d62151baa8c3d72b1da43aee7bd719ed137 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Sun, 12 Oct 2025 21:07:15 +0800 Subject: [PATCH 07/17] =?UTF-8?q?build(Makefile):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=85=8D=E7=BD=AE=E4=BB=A5=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=A4=B4=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 +++++++------- justfile | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 3a1184b..01640a4 100755 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ endif #======== Compilation Config ========== -CFLAGS += -Iinclude -Ilib +CFLAGS += -Iinclude -Ilib -Isrc/framework -Isrc/res ifeq ($(On-Windows), 1) CLANG_FLAGS = -target x86_64-pc-windows-gnu @@ -151,10 +151,10 @@ build-in-release-mode: CFLAGS += $(CFLAGS_optimization) build-in-release-mode: @echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name) ifeq ($(On-Windows), 1) - @if exist lib\chsrc.res del /Q lib\chsrc.res 2>nul - @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib - @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) - @del /Q lib\chsrc.res 2>nul + @if exist src\\res\\chsrc.res del src\\res\\chsrc.res + @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res + @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) + @del src\\res\\chsrc.res else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) endif @@ -164,8 +164,8 @@ endif build-in-ci-release-mode: @echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name) ifeq ($(On-Windows), 1) - @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib - @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) + @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res + @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) endif diff --git a/justfile b/justfile index 081b4ef..3902916 100644 --- a/justfile +++ b/justfile @@ -53,7 +53,7 @@ CFLAGS_chk_Clang := if os() == 'windows' { } else {''} -CFLAGS_base := '-Iinclude -Ilib ' + CFLAGS_chk_Clang +CFLAGS_base := '-Iinclude -Ilib -Isrc/framework ' + CFLAGS_chk_Clang WARN := '-Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation' + ' ' + \ '-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare' @@ -115,10 +115,10 @@ build-in-debug-mode: build-in-release-mode: @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} - {{ if os() == 'windows' { '@if exist lib\\chsrc.res del lib\\chsrc.res' } else { '' } }} - {{ if os() == 'windows' { '@windres lib\\win_res.rc -O coff -o lib\\chsrc.res -Iinclude -Ilib' } else { '' } }} - {{ if os() == 'windows' { '@{{CC}} src/chsrc-main.c lib/chsrc.res {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } else { '@{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } }} - {{ if os() == 'windows' { '@del lib\\chsrc.res' } else { '' } }} + {{ if os() == 'windows' { '@if exist src\\res\\chsrc.res del src\\res\\chsrc.res' } else { '' } }} + {{ if os() == 'windows' { '@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res' } else { '' } }} + {{ if os() == 'windows' { '@' + CC + ' src/chsrc-main.c src/res/chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } else { '@' + CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } }} + {{ if os() == 'windows' { '@del src\\res\\chsrc.res' } else { '' } }} @echo Finished: Build in RELEASE mode debug: build-in-debug-mode From 717b0f96b872a695fcdf360e4ebb289d43c2b918 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Tue, 14 Oct 2025 01:48:46 +0800 Subject: [PATCH 08/17] =?UTF-8?q?feat(build):=20=E5=A2=9E=E5=BC=BAWindows?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=8C=E5=8A=A8=E6=80=81=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=9C=BA=E5=99=A8=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01640a4..39f290a 100755 --- a/Makefile +++ b/Makefile @@ -64,8 +64,18 @@ endif #======== Compilation Config ========== CFLAGS += -Iinclude -Ilib -Isrc/framework -Isrc/res +Target-Is-Windows = 0 +Use-Windows-Resource = 0 + ifeq ($(On-Windows), 1) CLANG_FLAGS = -target x86_64-pc-windows-gnu + Target-Machine := $(shell $(CC) -dumpmachine 2>nul || echo unknown) + ifneq ($(findstring mingw,$(Target-Machine)),) + Target-Is-Windows = 1 + else ifneq ($(findstring windows,$(Target-Machine)),) + Target-Is-Windows = 1 + endif + Use-Windows-Resource := $(Target-Is-Windows) endif ifeq ($(CC), clang) @@ -150,7 +160,7 @@ build-in-debug-mode: build-in-release-mode: CFLAGS += $(CFLAGS_optimization) build-in-release-mode: @echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name) -ifeq ($(On-Windows), 1) +ifeq ($(Use-Windows-Resource), 1) @if exist src\\res\\chsrc.res del src\\res\\chsrc.res @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) @@ -163,7 +173,7 @@ endif # CI release mode 的配置在该文件上方 build-in-ci-release-mode: @echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name) -ifeq ($(On-Windows), 1) +ifeq ($(Use-Windows-Resource), 1) @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) else From cfe850382d4fdbb648ff73fb14e36ed5e62d6dbf Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Wed, 15 Oct 2025 14:51:40 +0800 Subject: [PATCH 09/17] =?UTF-8?q?revert(Makefile):=20=E5=BD=BB=E5=BA=95?= =?UTF-8?q?=E5=9B=9E=E9=80=80=EF=BC=8C=E6=9C=AA=E4=BF=9D=E7=95=99=E4=BB=BB?= =?UTF-8?q?=E4=BD=95=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 91 +++++++++++--------------------------------------------- 1 file changed, 18 insertions(+), 73 deletions(-) diff --git a/Makefile b/Makefile index 39f290a..5f8ab71 100755 --- a/Makefile +++ b/Makefile @@ -3,13 +3,12 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -------------------------------------------------------------- # Build File : Makefile -# File Authors : Aoran Zeng -# Contributors : Yangmoooo -# | sanchuanhehe -# | Mikachu2333 -# | +# File Authors : Aoran Zeng +# Contributors : Yangmoooo +# | sanchuanhehe +# | # Created On : <2023-08-28> -# Last Modified : <2025-10-11> +# Last Modified : <2025-07-22> # # 请阅读 ./doc/01-开发与构建.md 来使用 # -------------------------------------------------------------- @@ -19,24 +18,17 @@ On-Linux = 0 On-Windows = 0 On-macOS = 0 -# Windows 会定义 OS 或 ComSpec 环境变量 -ifdef ComSpec - On-Windows = 1 -else ifdef OS - ifeq ($(OS), Windows_NT) - On-Windows = 1 - endif +ifeq ($(shell uname), Linux) + On-Linux = 1 endif -# 只在非 Windows 环境下调用 uname -ifneq ($(On-Windows), 1) - UNAME_S := $(shell uname 2>/dev/null || echo unknown) - ifeq ($(UNAME_S), Linux) - On-Linux = 1 - endif - ifeq ($(UNAME_S), Darwin) - On-macOS = 1 - endif +ifeq ($(shell uname), Darwin) + On-macOS = 1 +endif + +# 只有Windows会定义$(OS)变量 +ifeq ($(OS), Windows_NT) + On-Windows = 1 endif #===================================== @@ -44,8 +36,8 @@ endif #======== Default Tooling ============ ifeq ($(On-Windows), 1) - # Windows 环境 - 使用 gcc - CC = gcc + # MSYS2 环境 + CC = cc else ifeq ($(On-macOS), 1) CC = clang else @@ -62,20 +54,10 @@ endif #======== Compilation Config ========== -CFLAGS += -Iinclude -Ilib -Isrc/framework -Isrc/res - -Target-Is-Windows = 0 -Use-Windows-Resource = 0 +CFLAGS += -Iinclude -Ilib ifeq ($(On-Windows), 1) CLANG_FLAGS = -target x86_64-pc-windows-gnu - Target-Machine := $(shell $(CC) -dumpmachine 2>nul || echo unknown) - ifneq ($(findstring mingw,$(Target-Machine)),) - Target-Is-Windows = 1 - else ifneq ($(findstring windows,$(Target-Machine)),) - Target-Is-Windows = 1 - endif - Use-Windows-Resource := $(Target-Is-Windows) endif ifeq ($(CC), clang) @@ -160,25 +142,13 @@ build-in-debug-mode: build-in-release-mode: CFLAGS += $(CFLAGS_optimization) build-in-release-mode: @echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name) -ifeq ($(Use-Windows-Resource), 1) - @if exist src\\res\\chsrc.res del src\\res\\chsrc.res - @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res - @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) - @del src\\res\\chsrc.res -else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) -endif @echo Finished: Build in RELEASE mode # CI release mode 的配置在该文件上方 build-in-ci-release-mode: @echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name) -ifeq ($(Use-Windows-Resource), 1) - @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res - @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) -else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) -endif @echo Finished: Build in CI-RELEASE mode # 永远重新编译 @@ -193,10 +163,6 @@ test-make-env: @echo "On-macOS: $(On-macOS)" @echo "CC: $(CC)" @echo "CFLAGS: $(CFLAGS)" -ifeq ($(On-Windows), 1) - @echo "USER: $(USERNAME)" - @echo "PWD: $(CURDIR)" -else @echo "USER: $$(whoami)" @echo "PWD: $(shell pwd)" @echo "UID: $$(id -u)" @@ -207,28 +173,17 @@ else else \ echo "HOME: $(HOME)"; \ fi -endif # 这两个测试文件都用 DEBUG mode test-xy: CFLAGS += $(CFLAGS_debug) test-xy: -ifeq ($(On-Windows), 1) - @$(CC) test/xy.c $(CFLAGS) -o xy.exe - @xy.exe -else @$(CC) test/xy.c $(CFLAGS) -o xy @./xy -endif test-fw: CFLAGS += $(CFLAGS_debug) test-fw: -ifeq ($(On-Windows), 1) - @$(CC) test/fw.c $(CFLAGS) -o fw.exe - @fw.exe -else @$(CC) test/fw.c $(CFLAGS) -o fw @./fw -endif check: test @@ -240,25 +195,15 @@ test-cli: $(DevMode-Target-Name) @perl ./test/cli.pl clean: -ifeq ($(On-Windows), 1) - -@if exist *.exe del /Q *.exe 2>nul - -@if exist xy.exe del /Q xy.exe 2>nul - -@if exist fw.exe del /Q fw.exe 2>nul - -@if exist README.md.bak* del /Q README.md.bak* 2>nul - -@if exist chsrc.exe del /Q chsrc.exe 2>nul - -@if exist chsrc-debug.exe del /Q chsrc-debug.exe 2>nul - -@if exist chsrc-release.exe del /Q chsrc-release.exe 2>nul - -@if exist chsrc-ci-release.exe del /Q chsrc-ci-release.exe 2>nul -else -@rm *.exe 2>/dev/null -@rm xy 2>/dev/null -@rm fw 2>/dev/null -@rm README.md.bak* 2>/dev/null + -@rm chsrc 2>/dev/null -@rm chsrc-debug 2>/dev/null -@rm chsrc-release 2>/dev/null -@rm chsrc-ci-release 2>/dev/null -endif # -include pkg/deb/Makefile # 不这么做,因为 pkg/deb/Makefile 需要在 pkg/deb 目录下执行 # 保持动词在前的任务名风格 From 6af3e51566b9997559f67f5f594f0a4903162dc5 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Wed, 15 Oct 2025 16:51:04 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAndroid=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=A3=80=E6=B5=8B=20(#313)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xy.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/xy.h b/lib/xy.h index 08dda24..a1991cf 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -1290,18 +1290,21 @@ xy_detect_os () char buf[256] = {0}; fread (buf, 1, sizeof(buf) - 1, fp); fclose (fp); - if (strstr (buf, "Android")) - { - xy.on_android = true; - return; - } - else if (strstr (buf, "Linux")) + if (strstr (buf, "Linux")) { xy.on_linux = true; return; } } + // @consult https://android.googlesource.com/platform/system/core/+/refs/heads/main/rootdir/init.environ.rc.in + char *android_env = getenv ("ANDROID_ROOT"); + if (xy_str_find (android_env, "/system").found) + { + xy.on_android = true; + return; + } + /* 判断 macOS */ DIR *d = opendir ("/System/Applications"); if (d) @@ -1312,6 +1315,7 @@ xy_detect_os () { xy.on_macos = true; closedir (d); + return; } } @@ -1333,6 +1337,7 @@ xy_detect_os () pclose (fp); if (strstr (buf, "BSD") != NULL) xy.on_bsd = true; + return; } if (!(xy.on_windows || xy.on_linux || xy.on_android || xy.on_macos || xy.on_bsd)) From f9268343847da5c0edd573fb4c3820f9081a88ae Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 15 Oct 2025 17:02:43 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E9=81=BF=E5=85=8DAPI=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B6=88=E6=9E=81=E7=94=A8=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xy.h | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/xy.h b/lib/xy.h index a1991cf..eca9b68 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -9,7 +9,7 @@ * | BingChunMoLi * | * Created On : <2023-08-28> - * Last Modified : <2025-10-06> + * Last Modified : <2025-10-15> * * * xy: 襄阳、咸阳 @@ -122,15 +122,24 @@ xy = #define assert_str(a, b) assert (xy_streql ((a), (b))) -#define xy_panic(reason) assert(!reason) +#define xy_throw(reason) assert(!reason) -// @flavor Perl, PHP, Raku -#define die xy_panic +/** + * @depreacated 避免消极用语 + * + * @flavor Perl, PHP, Raku + */ +// #define die xy_throw -#define xy_unsupported() xy_panic("Unsuppoted") -#define xy_unimplemented() xy_panic("Unimplemented temporarily") -#define xy_unreached() xy_panic("This code shouldn't be reached") -#define xy_cant_be_null(p) if(!p) xy_panic("This pointer can't be null") +/** + * @depreacated 避免消极用语 + */ +// #define xy_panic xy_throw + +#define xy_unsupported() xy_throw("Unsuppoted") +#define xy_unimplemented() xy_throw("Unimplemented temporarily") +#define xy_unreached() xy_throw("This code shouldn't be reached") +#define xy_cant_be_null(p) if(!p) xy_throw("This pointer can't be null") @@ -164,7 +173,7 @@ static void _xy_println_const_str (const char *str) {printf ("%s\n", str);} bool: _xy_print_bool, \ char *: _xy_print_str, \ const char *: _xy_print_const_str, \ - default: xy_panic("Unsupported type for print()!") \ + default: xy_throw("Unsupported type for print()!") \ )(x) /** @@ -179,7 +188,7 @@ static void _xy_println_const_str (const char *str) {printf ("%s\n", str);} bool: _xy_println_bool, \ char *: _xy_println_str, \ const char *: _xy_println_const_str, \ - default: xy_panic("Unsupported type for println()/say()!") \ + default: xy_throw("Unsupported type for println()/say()!") \ )(x) /* @flavor Raku, Perl */ #define say println @@ -1341,7 +1350,7 @@ xy_detect_os () } if (!(xy.on_windows || xy.on_linux || xy.on_android || xy.on_macos || xy.on_bsd)) - xy_panic ("Unknown operating system"); + xy_throw ("Unknown operating system"); } @@ -1450,7 +1459,7 @@ xy_seq_at (XySeq_t *seq, int n) { xy_cant_be_null (seq); - if (0 == n) xy_panic ("The index must begin from 1, not 0"); + if (0 == n) xy_throw ("The index must begin from 1, not 0"); if (1 == n) return seq->first_item ? seq->first_item->data : NULL; From ebc9e167f268edfe2fb867c116333f147c39c099 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 15 Oct 2025 18:09:50 +0800 Subject: [PATCH 12/17] Refactor Windows resource compiling --- justfile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/justfile b/justfile index 3902916..24b659b 100644 --- a/justfile +++ b/justfile @@ -2,12 +2,12 @@ # -------------------------------------------------------------- # SPDX-License-Identifier: GPL-3.0-or-later # -------------------------------------------------------------- -# Build File : justfile -# File Authors : Aoran Zeng -# Contributors : Mikachu2333 -# | +# Build File : justfile +# File Authors : 曾奥然 +# Contributors : Mikachu2333 +# | # Created On : <2025-06-18> -# Last Modified : <2025-10-11> +# Last Modified : <2025-10-15> # # 该文件主要用于在原生Windows上执行项目的基本任务,而不借助于 # GNU make 以及相应的 MSYS2、Cygwin 环境 @@ -53,7 +53,7 @@ CFLAGS_chk_Clang := if os() == 'windows' { } else {''} -CFLAGS_base := '-Iinclude -Ilib -Isrc/framework ' + CFLAGS_chk_Clang +CFLAGS_base := '-Iinclude -Ilib ' + CFLAGS_chk_Clang WARN := '-Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation' + ' ' + \ '-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare' @@ -114,12 +114,17 @@ build-in-debug-mode: @echo Finished: Build in DEBUG mode build-in-release-mode: - @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} - {{ if os() == 'windows' { '@if exist src\\res\\chsrc.res del src\\res\\chsrc.res' } else { '' } }} - {{ if os() == 'windows' { '@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res' } else { '' } }} - {{ if os() == 'windows' { '@' + CC + ' src/chsrc-main.c src/res/chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } else { '@' + CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } }} - {{ if os() == 'windows' { '@del src\\res\\chsrc.res' } else { '' } }} - @echo Finished: Build in RELEASE mode + @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} + @{{ if os() == 'windows' { \ + 'if exist chsrc.res del chsrc.res' + \ + ' & windres src/resource/chsrc.rc -O coff -o chsrc.res' \ + } else { '' } }} + @{{ if os() == 'windows' { \ + CC + ' src/chsrc-main.c chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \ + } else { \ + CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \ + } }} + @echo Finished: Build in RELEASE mode debug: build-in-debug-mode @{{DEBUGGER}} {{DebugMode-Target-Name}} From 19d09e537a8322d338f28efa355365a289804d02 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 15 Oct 2025 18:10:19 +0800 Subject: [PATCH 13/17] Rename directory from `res` to `resource` --- src/{res/win_res.rc => resource/chsrc.rc} | 16 ++++++++-------- src/{res => resource}/logo.ico | Bin 2 files changed, 8 insertions(+), 8 deletions(-) rename src/{res/win_res.rc => resource/chsrc.rc} (66%) rename src/{res => resource}/logo.ico (100%) diff --git a/src/res/win_res.rc b/src/resource/chsrc.rc similarity index 66% rename from src/res/win_res.rc rename to src/resource/chsrc.rc index b2f0414..aaeb5ff 100644 --- a/src/res/win_res.rc +++ b/src/resource/chsrc.rc @@ -2,15 +2,15 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include -#include "version.h" +#include "../framework/version.h" // 图标资源 IDI_ICON1 ICON DISCARDABLE "logo.ico" // 版本信息 VS_VERSION_INFO VERSIONINFO - FILEVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0 - PRODUCTVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0 + FILEVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,0 + PRODUCTVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -25,16 +25,16 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "Github RubyMetric" + VALUE "CompanyName", "RubyMetric" VALUE "FileDescription", "Change Source everywhere for every software" - VALUE "FileVersion", Chsrc_Version + VALUE "FileVersion", Chsrc_Version VALUE "InternalName", "chsrc" VALUE "LegalCopyright", "Copyright (c) 2023-2025 RubyMetric" VALUE "OriginalFilename", "chsrc.exe" VALUE "ProductName", "chsrc" - VALUE "ProductVersion", Chsrc_Release_Date - VALUE "Comments", "MIT License" - VALUE "LegalTrademarks", "" + VALUE "ProductVersion", Chsrc_Version + VALUE "Comments", "Released on " Chsrc_Release_Date " (GPLv3+)" + VALUE "LegalTrademarks", "RubyMetric" END END BLOCK "VarFileInfo" diff --git a/src/res/logo.ico b/src/resource/logo.ico similarity index 100% rename from src/res/logo.ico rename to src/resource/logo.ico From 8ebe5812ed8e946b6f37edfee3afe253d50eed87 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 15 Oct 2025 18:21:41 +0800 Subject: [PATCH 14/17] Redefine Windows resource script macro --- justfile | 2 +- src/chsrc-main.c | 3 +-- src/framework/version.h | 32 ++++++++++++++++---------------- src/resource/chsrc.rc | 10 +++++++--- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/justfile b/justfile index 24b659b..f9de64c 100644 --- a/justfile +++ b/justfile @@ -116,7 +116,7 @@ build-in-debug-mode: build-in-release-mode: @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} @{{ if os() == 'windows' { \ - 'if exist chsrc.res del chsrc.res' + \ + '(if exist chsrc.res del chsrc.res)' + \ ' & windres src/resource/chsrc.rc -O coff -o chsrc.res' \ } else { '' } }} @{{ if os() == 'windows' { \ diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 0325b75..895adeb 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -30,11 +30,10 @@ * 然的加入,逐渐成长为互相支持的伙伴。 * ------------------------------------------------------------*/ -#include "version.h" - #define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc" #define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc" +#include "framework/version.h" #include "framework/core.c" #include "framework/chef.c" diff --git a/src/framework/version.h b/src/framework/version.h index 4e5181c..e8f65dc 100644 --- a/src/framework/version.h +++ b/src/framework/version.h @@ -1,23 +1,23 @@ /** ------------------------------------------------------------ - * Copyright © 2023-2025 曾奥然, 郭恒 - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: GPL-3.0-or-later * ------------------------------------------------------------- - * Lib Authors : 曾奥然 - * Contributors : Mikachu2333 + * File Name : version.h + * File Authors : 曾奥然 + * | Mikachu2333 + * Contributors : Nil Null * | * Created On : <2025-10-10> - * Last Modified : <2025-10-10> - - * !!!警告!!! - * 发布前请修改此处的内容 + * Last Modified : + * + * 发布新版本前请修改此文件 * ------------------------------------------------------------*/ -#define Chsrc_Version "0.2.3" -#define Chsrc_Release_Date "2025/10/06" +#define Chsrc_Version "0.2.3.1-dev1" -// 以下宏仅用于 Windows -#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) - #define CHSRC_VERSION_MAJOR 0 - #define CHSRC_VERSION_MINOR 2 - #define CHSRC_VERSION_PATCH 3 -#endif +// 以下四个宏仅用于 resource/chsrc.rc +#define Chsrc_Version_Major 0 +#define Chsrc_Version_Minor 2 +#define Chsrc_Version_Patch 3 +#define Chsrc_Version_Pre 1 + +#define Chsrc_Release_Date "2025/10/15" diff --git a/src/resource/chsrc.rc b/src/resource/chsrc.rc index aaeb5ff..9deb8ac 100644 --- a/src/resource/chsrc.rc +++ b/src/resource/chsrc.rc @@ -9,8 +9,9 @@ IDI_ICON1 ICON DISCARDABLE "logo.ico" // 版本信息 VS_VERSION_INFO VERSIONINFO - FILEVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,0 - PRODUCTVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,0 + FILEVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,Chsrc_Version_Pre + // 经实验,该值会被下面的 ProductVersion 替换 + // PRODUCTVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,Chsrc_Version_Pre FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -27,7 +28,10 @@ BEGIN BEGIN VALUE "CompanyName", "RubyMetric" VALUE "FileDescription", "Change Source everywhere for every software" - VALUE "FileVersion", Chsrc_Version + + // 经实验,该值会被上面的 FILEVERSION 替换 + // VALUE "FileVersion", Chsrc_Version + VALUE "InternalName", "chsrc" VALUE "LegalCopyright", "Copyright (c) 2023-2025 RubyMetric" VALUE "OriginalFilename", "chsrc.exe" From 28d8e4ad0c1b0af646a38430bd7de918b7bac6d7 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 15 Oct 2025 18:33:21 +0800 Subject: [PATCH 15/17] Only use `$(OS)` to ensure MSYS2 --- Makefile | 13 ++++++++----- justfile | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5f8ab71..1345d17 100755 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ # -------------------------------------------------------------- # SPDX-License-Identifier: GPL-3.0-or-later # -------------------------------------------------------------- -# Build File : Makefile -# File Authors : Aoran Zeng -# Contributors : Yangmoooo +# Build File : Makefile +# File Authors : 曾奥然 +# Contributors : Yangmoooo # | sanchuanhehe # | # Created On : <2023-08-28> -# Last Modified : <2025-07-22> +# Last Modified : <2025-10-15> # # 请阅读 ./doc/01-开发与构建.md 来使用 # -------------------------------------------------------------- @@ -26,10 +26,12 @@ ifeq ($(shell uname), Darwin) On-macOS = 1 endif -# 只有Windows会定义$(OS)变量 +# 只有 MSYS2 会定义 $(OS) 变量 ifeq ($(OS), Windows_NT) On-Windows = 1 endif +# 注意, 原生 Windows 会定义 $(ComSpec) 变量,且区分大小写 +# 但是 MSYS2 并不会定义 #===================================== @@ -196,6 +198,7 @@ test-cli: $(DevMode-Target-Name) clean: -@rm *.exe 2>/dev/null + -@rm *.res 2>/dev/null -@rm xy 2>/dev/null -@rm fw 2>/dev/null -@rm README.md.bak* 2>/dev/null diff --git a/justfile b/justfile index f9de64c..016986d 100644 --- a/justfile +++ b/justfile @@ -148,6 +148,7 @@ test-cli: clean: -@{{BIN_rm}} *.exe + -@{{BIN_rm}} *.res -@{{BIN_rm}} xy -@{{BIN_rm}} fw -@{{BIN_rm}} chsrc From 1058d3310b87bb4cd5b606a7e636183099162f65 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Mon, 27 Oct 2025 22:05:17 +0800 Subject: [PATCH 16/17] Rename option controlling API to `deny` --- src/framework/chef.c | 6 +++--- src/recipe/lang/Clojure.c | 2 +- src/recipe/lang/Go.c | 2 +- src/recipe/lang/Haskell.c | 2 +- src/recipe/lang/Java.c | 2 +- src/recipe/lang/Lua.c | 2 +- src/recipe/lang/NuGet.c | 4 ++-- src/recipe/lang/OCaml.c | 2 +- src/recipe/lang/PHP.c | 2 +- src/recipe/lang/Perl.c | 2 +- src/recipe/lang/R.c | 2 +- src/recipe/lang/Rust/Cargo.c | 2 +- src/recipe/lang/Rust/rustup.c | 2 +- src/recipe/os/APT/Armbian.c | 4 ++-- src/recipe/os/APT/Debian.c | 4 ++-- src/recipe/os/APT/Kali-Linux.c | 4 ++-- src/recipe/os/APT/Linux-Lite.c | 4 ++-- src/recipe/os/APT/Linux-Mint.c | 4 ++-- src/recipe/os/APT/ROS.c | 4 ++-- src/recipe/os/APT/Raspberry-Pi-OS.c | 4 ++-- src/recipe/os/APT/Termux.c | 4 ++-- src/recipe/os/APT/Trisquel.c | 4 ++-- src/recipe/os/APT/Ubuntu.c | 4 ++-- src/recipe/os/APT/deepin.c | 4 ++-- src/recipe/os/APT/openKylin.c | 4 ++-- src/recipe/os/Alpine-Linux.c | 2 +- src/recipe/os/BSD/FreeBSD.c | 4 ++-- src/recipe/os/BSD/NetBSD.c | 4 ++-- src/recipe/os/BSD/OpenBSD.c | 4 ++-- src/recipe/os/Gentoo-Linux.c | 2 +- src/recipe/os/Solus.c | 2 +- src/recipe/os/Void-Linux.c | 2 +- src/recipe/os/YUM/AlmaLinux.c | 4 ++-- src/recipe/os/YUM/Anolis-OS.c | 4 ++-- src/recipe/os/YUM/Fedora-Linux.c | 4 ++-- src/recipe/os/YUM/Rocky-Linux.c | 4 ++-- src/recipe/os/YUM/openEuler.c | 4 ++-- src/recipe/os/openSUSE.c | 4 ++-- src/recipe/os/pacman/Arch-Linux.c | 8 ++++---- src/recipe/os/pacman/MSYS2.c | 4 ++-- src/recipe/os/pacman/Manjaro-Linux.c | 4 ++-- src/recipe/recipe-template.c | 4 ++-- src/recipe/ware/Anaconda/Anaconda.c | 4 ++-- src/recipe/ware/CocoaPods.c | 2 +- src/recipe/ware/Docker/Docker.c | 2 +- src/recipe/ware/Emacs.c | 4 ++-- src/recipe/ware/Flatpak.c | 2 +- src/recipe/ware/Guix.c | 4 ++-- src/recipe/ware/Homebrew/Homebrew.c | 2 +- src/recipe/ware/Nix.c | 4 ++-- src/recipe/ware/TeX-Live.c | 2 +- src/recipe/ware/WinGet.c | 2 +- 52 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/framework/chef.c b/src/framework/chef.c index 886fef3..9291ad5 100644 --- a/src/framework/chef.c +++ b/src/framework/chef.c @@ -5,7 +5,7 @@ * File Authors : 曾奥然 * Contributors : BingChunMoLi * Created On : <2025-08-09> - * Last Modified : <2025-08-27> + * Last Modified : <2025-10-27> * * chef DSL: for chefs (recipe makers) to define a target * ------------------------------------------------------------*/ @@ -186,7 +186,7 @@ chef_allow_english (Target_t *target) } void -chef_forbid_english (Target_t *target) +chef_deny_english (Target_t *target) { xy_cant_be_null (target); target->can_english = false; @@ -226,7 +226,7 @@ chef_allow_user_define (Target_t *target) } void -chef_forbid_user_define (Target_t *target) +chef_deny_user_define (Target_t *target) { xy_cant_be_null (target); diff --git a/src/recipe/lang/Clojure.c b/src/recipe/lang/Clojure.c index e052f81..aa345c6 100644 --- a/src/recipe/lang/Clojure.c +++ b/src/recipe/lang/Clojure.c @@ -18,7 +18,7 @@ pl_clojure_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, FullyCan, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/lang/Go.c b/src/recipe/lang/Go.c index 92990ec..e0f93e3 100644 --- a/src/recipe/lang/Go.c +++ b/src/recipe/lang/Go.c @@ -32,7 +32,7 @@ pl_go_prelude () chef_set_sauciers (this, 2, "@czyt", "@techoc"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/Haskell.c b/src/recipe/lang/Haskell.c index 7d742da..38c688e 100644 --- a/src/recipe/lang/Haskell.c +++ b/src/recipe/lang/Haskell.c @@ -18,7 +18,7 @@ pl_haskell_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/lang/Java.c b/src/recipe/lang/Java.c index 1bf4a81..29cae8f 100644 --- a/src/recipe/lang/Java.c +++ b/src/recipe/lang/Java.c @@ -18,7 +18,7 @@ pl_java_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); // 阿里巴巴开源镜像站需要修改为此才能测速 diff --git a/src/recipe/lang/Lua.c b/src/recipe/lang/Lua.c index 52b81f3..6abc620 100644 --- a/src/recipe/lang/Lua.c +++ b/src/recipe/lang/Lua.c @@ -25,7 +25,7 @@ pl_lua_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/lang/NuGet.c b/src/recipe/lang/NuGet.c index 19b0bea..401fe1e 100644 --- a/src/recipe/lang/NuGet.c +++ b/src/recipe/lang/NuGet.c @@ -18,8 +18,8 @@ pl_nuget_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://www.nuget.org/api/v3/", DelegateToUpstream}, diff --git a/src/recipe/lang/OCaml.c b/src/recipe/lang/OCaml.c index 7571548..44da4ab 100644 --- a/src/recipe/lang/OCaml.c +++ b/src/recipe/lang/OCaml.c @@ -18,7 +18,7 @@ pl_ocaml_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/lang/PHP.c b/src/recipe/lang/PHP.c index 1fdb212..4cdfade 100644 --- a/src/recipe/lang/PHP.c +++ b/src/recipe/lang/PHP.c @@ -18,7 +18,7 @@ pl_php_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, FullyCan, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/lang/Perl.c b/src/recipe/lang/Perl.c index c5ccff1..691942f 100644 --- a/src/recipe/lang/Perl.c +++ b/src/recipe/lang/Perl.c @@ -18,7 +18,7 @@ pl_perl_prelude () chef_set_sauciers (this, 2, "@hezonglun", "@Mikachu2333"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english (this); + chef_deny_english (this); chef_allow_user_define (this); def_sources_begin() diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index 6dac62d..9a0a045 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -18,7 +18,7 @@ pl_r_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); // 以下注释的,是不含有bioconductor的镜像站,我们在换cran的同时,也直接帮助用户换bioconductor diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 776a702..5ca237a 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -18,7 +18,7 @@ pl_rust_cargo_prelude (void) chef_set_sauciers (this, 1, "@happy-game"); chef_allow_local_mode (this, FullyCan, NULL, NULL); - chef_forbid_english (this); + chef_deny_english (this); chef_allow_user_define (this); diff --git a/src/recipe/lang/Rust/rustup.c b/src/recipe/lang/Rust/rustup.c index e152d86..d79c73b 100644 --- a/src/recipe/lang/Rust/rustup.c +++ b/src/recipe/lang/Rust/rustup.c @@ -21,7 +21,7 @@ pl_rust_rustup_prelude (void) chef_set_sauciers (this, 2, "@Yangmoooo", "@Mikachu2333"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english (this); + chef_deny_english (this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/os/APT/Armbian.c b/src/recipe/os/APT/Armbian.c index ce8e1d2..8fe2194 100644 --- a/src/recipe/os/APT/Armbian.c +++ b/src/recipe/os/APT/Armbian.c @@ -18,8 +18,8 @@ os_armbian_prelude () chef_set_sauciers (this, 2, "@ccmywish", "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Debian.c b/src/recipe/os/APT/Debian.c index 44cd22c..f56ebb5 100644 --- a/src/recipe/os/APT/Debian.c +++ b/src/recipe/os/APT/Debian.c @@ -18,8 +18,8 @@ os_debian_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Kali-Linux.c b/src/recipe/os/APT/Kali-Linux.c index 7b85209..6ac6749 100644 --- a/src/recipe/os/APT/Kali-Linux.c +++ b/src/recipe/os/APT/Kali-Linux.c @@ -18,8 +18,8 @@ os_kali_prelude () chef_set_sauciers (this, 2, "@Yangmoooo", "@happy-game"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Linux-Lite.c b/src/recipe/os/APT/Linux-Lite.c index 5b951a6..23ccc0f 100644 --- a/src/recipe/os/APT/Linux-Lite.c +++ b/src/recipe/os/APT/Linux-Lite.c @@ -18,8 +18,8 @@ os_linuxlite_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Linux-Mint.c b/src/recipe/os/APT/Linux-Mint.c index 36371cf..794a7c4 100644 --- a/src/recipe/os/APT/Linux-Mint.c +++ b/src/recipe/os/APT/Linux-Mint.c @@ -18,8 +18,8 @@ os_linuxmint_prelude () chef_set_sauciers (this, 1, "@happy-game"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); /* @note 实际上镜像站里的内容和Ubuntu的不太一样 */ diff --git a/src/recipe/os/APT/ROS.c b/src/recipe/os/APT/ROS.c index fa38c24..0ccb50d 100644 --- a/src/recipe/os/APT/ROS.c +++ b/src/recipe/os/APT/ROS.c @@ -18,8 +18,8 @@ os_ros_prelude () chef_set_sauciers (this, 2, "@ccmywish", "@zouri"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, "该换源方案中,URL存在拼凑,因此不能手动使用某URL来换源", "In this switching method, URLs are constructed, so manual URL specification is not supported"); diff --git a/src/recipe/os/APT/Raspberry-Pi-OS.c b/src/recipe/os/APT/Raspberry-Pi-OS.c index 182c51a..7b2162f 100644 --- a/src/recipe/os/APT/Raspberry-Pi-OS.c +++ b/src/recipe/os/APT/Raspberry-Pi-OS.c @@ -20,8 +20,8 @@ os_raspberrypi_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Termux.c b/src/recipe/os/APT/Termux.c index a0b0eee..e696379 100644 --- a/src/recipe/os/APT/Termux.c +++ b/src/recipe/os/APT/Termux.c @@ -18,8 +18,8 @@ os_termux_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, "该 recipe 存在对应的 bootstrapper", "This recipe has a corresponding bootstrapper"); diff --git a/src/recipe/os/APT/Trisquel.c b/src/recipe/os/APT/Trisquel.c index 3ac2e79..7502f57 100644 --- a/src/recipe/os/APT/Trisquel.c +++ b/src/recipe/os/APT/Trisquel.c @@ -20,8 +20,8 @@ os_trisquel_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/Ubuntu.c b/src/recipe/os/APT/Ubuntu.c index 9c4f8a5..7a5dff5 100644 --- a/src/recipe/os/APT/Ubuntu.c +++ b/src/recipe/os/APT/Ubuntu.c @@ -19,8 +19,8 @@ os_ubuntu_prelude () chef_set_sauciers (this, 1, "@XUANJI233"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/deepin.c b/src/recipe/os/APT/deepin.c index 8f01ed1..304d100 100644 --- a/src/recipe/os/APT/deepin.c +++ b/src/recipe/os/APT/deepin.c @@ -18,8 +18,8 @@ os_deepin_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/APT/openKylin.c b/src/recipe/os/APT/openKylin.c index 8d6ddd4..39157bb 100644 --- a/src/recipe/os/APT/openKylin.c +++ b/src/recipe/os/APT/openKylin.c @@ -21,8 +21,8 @@ os_openkylin_prelude () chef_set_sauciers (this, 1, "@ccmywish"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/Alpine-Linux.c b/src/recipe/os/Alpine-Linux.c index f7e98bd..f1d03c3 100644 --- a/src/recipe/os/Alpine-Linux.c +++ b/src/recipe/os/Alpine-Linux.c @@ -19,7 +19,7 @@ os_alpine_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); - chef_forbid_user_define(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/BSD/FreeBSD.c b/src/recipe/os/BSD/FreeBSD.c index 05a30e7..6c853e1 100644 --- a/src/recipe/os/BSD/FreeBSD.c +++ b/src/recipe/os/BSD/FreeBSD.c @@ -18,8 +18,8 @@ os_freebsd_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); // 2023-09-24: 以下三个USTC, NJU, Netease 均维护了 freebsd-pkg freebsd-ports diff --git a/src/recipe/os/BSD/NetBSD.c b/src/recipe/os/BSD/NetBSD.c index 9551288..6c4d03d 100644 --- a/src/recipe/os/BSD/NetBSD.c +++ b/src/recipe/os/BSD/NetBSD.c @@ -19,8 +19,8 @@ os_netbsd_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/", DelegateToUpstream}, diff --git a/src/recipe/os/BSD/OpenBSD.c b/src/recipe/os/BSD/OpenBSD.c index 62acaae..dfc2996 100644 --- a/src/recipe/os/BSD/OpenBSD.c +++ b/src/recipe/os/BSD/OpenBSD.c @@ -18,8 +18,8 @@ os_openbsd_prelude () chef_set_sauciers (this, 1, "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://cdn.openbsd.org/pub/OpenBSD/", DelegateToUpstream}, diff --git a/src/recipe/os/Gentoo-Linux.c b/src/recipe/os/Gentoo-Linux.c index 4e25fdb..b13c09f 100644 --- a/src/recipe/os/Gentoo-Linux.c +++ b/src/recipe/os/Gentoo-Linux.c @@ -19,7 +19,7 @@ os_gentoo_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); - chef_forbid_user_define(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/Solus.c b/src/recipe/os/Solus.c index 989da7b..feaabc1 100644 --- a/src/recipe/os/Solus.c +++ b/src/recipe/os/Solus.c @@ -19,7 +19,7 @@ os_solus_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/Void-Linux.c b/src/recipe/os/Void-Linux.c index ace7dd6..2254df1 100644 --- a/src/recipe/os/Void-Linux.c +++ b/src/recipe/os/Void-Linux.c @@ -18,7 +18,7 @@ os_voidlinux_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/YUM/AlmaLinux.c b/src/recipe/os/YUM/AlmaLinux.c index 2112c3a..0b1d7f5 100644 --- a/src/recipe/os/YUM/AlmaLinux.c +++ b/src/recipe/os/YUM/AlmaLinux.c @@ -18,8 +18,8 @@ os_almalinux_prelude () chef_set_sauciers (this, 1, "@Yangmoooo"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/YUM/Anolis-OS.c b/src/recipe/os/YUM/Anolis-OS.c index 6761ef7..e56f696 100644 --- a/src/recipe/os/YUM/Anolis-OS.c +++ b/src/recipe/os/YUM/Anolis-OS.c @@ -18,8 +18,8 @@ os_anolis_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index 9abbed9..e1c7777 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -18,8 +18,8 @@ os_fedora_prelude () chef_set_sauciers (this, 1, "@ccmywish"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/YUM/Rocky-Linux.c b/src/recipe/os/YUM/Rocky-Linux.c index db748d7..7bd28be 100644 --- a/src/recipe/os/YUM/Rocky-Linux.c +++ b/src/recipe/os/YUM/Rocky-Linux.c @@ -18,8 +18,8 @@ os_rockylinux_prelude () chef_set_sauciers (this, 1, "@happy-game"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://dl.rockylinux.org", DelegateToUpstream}, diff --git a/src/recipe/os/YUM/openEuler.c b/src/recipe/os/YUM/openEuler.c index f7a2517..0263d66 100644 --- a/src/recipe/os/YUM/openEuler.c +++ b/src/recipe/os/YUM/openEuler.c @@ -18,8 +18,8 @@ os_openeuler_prelude () chef_set_sauciers (this, 3, "@ccmywish", "@Yangmoooo", "@happy-game"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/openSUSE.c b/src/recipe/os/openSUSE.c index bb5052f..e26448c 100644 --- a/src/recipe/os/openSUSE.c +++ b/src/recipe/os/openSUSE.c @@ -18,8 +18,8 @@ os_opensuse_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note(this, NULL, NULL); diff --git a/src/recipe/os/pacman/Arch-Linux.c b/src/recipe/os/pacman/Arch-Linux.c index e77760c..cd92a76 100644 --- a/src/recipe/os/pacman/Arch-Linux.c +++ b/src/recipe/os/pacman/Arch-Linux.c @@ -21,8 +21,8 @@ os_arch_prelude () chef_set_sauciers (this, 2, "@happy-game", "@Young-Lord"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note (this, "可额外使用 chsrc set archlinuxcn 来更换 Arch Linux CN Repository 源", @@ -124,8 +124,8 @@ os_archlinuxcn_prelude () chef_set_sauciers (this, 2, "@happy-game", "@Young-Lord"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note (this, "可额外使用 chsrc set arch 来更换 Arch Linux 源", diff --git a/src/recipe/os/pacman/MSYS2.c b/src/recipe/os/pacman/MSYS2.c index e281d5e..6e031d5 100644 --- a/src/recipe/os/pacman/MSYS2.c +++ b/src/recipe/os/pacman/MSYS2.c @@ -18,8 +18,8 @@ os_msys2_prelude () chef_set_sauciers (this, 2, "@ccmywish", "@hezonglun"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://mirror.msys2.org/", DelegateToUpstream}, diff --git a/src/recipe/os/pacman/Manjaro-Linux.c b/src/recipe/os/pacman/Manjaro-Linux.c index 1859897..620847b 100644 --- a/src/recipe/os/pacman/Manjaro-Linux.c +++ b/src/recipe/os/pacman/Manjaro-Linux.c @@ -17,8 +17,8 @@ os_manjaro_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, NULL, DelegateToUpstream} diff --git a/src/recipe/recipe-template.c b/src/recipe/recipe-template.c index 8f75e26..442e030 100644 --- a/src/recipe/recipe-template.c +++ b/src/recipe/recipe-template.c @@ -73,10 +73,10 @@ void chef_allow_local_mode (this, PartiallyCan, "具体说明是否支持项目级换源...", "Tell users the local mode support"); // chef_allow_english(this); // 项目是否支持英文 - chef_forbid_english(this); + chef_deny_english(this); // chef_allow_user_define(this); // 是否支持用户自定义镜像源 - chef_forbid_user_define(this); + chef_deny_user_define(this); chef_set_note ("中文备注说明...", "English note..."); diff --git a/src/recipe/ware/Anaconda/Anaconda.c b/src/recipe/ware/Anaconda/Anaconda.c index d265ff1..36a15d1 100644 --- a/src/recipe/ware/Anaconda/Anaconda.c +++ b/src/recipe/ware/Anaconda/Anaconda.c @@ -20,8 +20,8 @@ wr_anaconda_prelude () chef_set_sauciers (this, 2, "@Yangmoooo", "@xyx1926885268"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://repo.anaconda.com", DelegateToUpstream}, diff --git a/src/recipe/ware/CocoaPods.c b/src/recipe/ware/CocoaPods.c index 88f4f78..58573ab 100644 --- a/src/recipe/ware/CocoaPods.c +++ b/src/recipe/ware/CocoaPods.c @@ -19,7 +19,7 @@ wr_cocoapods_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/ware/Docker/Docker.c b/src/recipe/ware/Docker/Docker.c index 09bba30..dc6784d 100644 --- a/src/recipe/ware/Docker/Docker.c +++ b/src/recipe/ware/Docker/Docker.c @@ -35,7 +35,7 @@ wr_docker_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/ware/Emacs.c b/src/recipe/ware/Emacs.c index d0b7e84..9e9ca5b 100644 --- a/src/recipe/ware/Emacs.c +++ b/src/recipe/ware/Emacs.c @@ -25,8 +25,8 @@ wr_emacs_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note (this, "Emacs用户往往只需要一次性换源,只会极少次调用 chsrc,我们只给用户提供文档", "Emacs users typically only need to switch sources once and rarely call chsrc, so we only provide documentation to users"); diff --git a/src/recipe/ware/Flatpak.c b/src/recipe/ware/Flatpak.c index 0163298..902a66f 100644 --- a/src/recipe/ware/Flatpak.c +++ b/src/recipe/ware/Flatpak.c @@ -18,7 +18,7 @@ wr_flatpak_prelude () chef_set_sauciers (this, 1, "@jialinlvcn"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); chef_set_note (this, "对Flathub目标进行测速的文件非常小,测速效果严重失真,若你知道可供测速的URL,欢迎参与贡献: chsrc issue", diff --git a/src/recipe/ware/Guix.c b/src/recipe/ware/Guix.c index a31483a..2546530 100644 --- a/src/recipe/ware/Guix.c +++ b/src/recipe/ware/Guix.c @@ -18,8 +18,8 @@ wr_guix_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); chef_set_note (this, "目前只有一个源, guixcn 的源不知道是否可用", "Currently only one source available, guixcn source availability unknown"); diff --git a/src/recipe/ware/Homebrew/Homebrew.c b/src/recipe/ware/Homebrew/Homebrew.c index 286fdb5..99bcc4d 100644 --- a/src/recipe/ware/Homebrew/Homebrew.c +++ b/src/recipe/ware/Homebrew/Homebrew.c @@ -21,7 +21,7 @@ wr_homebrew_prelude () chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); - chef_forbid_user_define(this); + chef_deny_user_define(this); chef_set_note (this, "该换源通过写入环境变量实现,若多次换源,请手动清理profile文件", "This source switching is implemented by writing environment variables. If switching sources multiple times, please manually clean the profile file"); diff --git a/src/recipe/ware/Nix.c b/src/recipe/ware/Nix.c index b39379c..8656f5d 100644 --- a/src/recipe/ware/Nix.c +++ b/src/recipe/ware/Nix.c @@ -18,8 +18,8 @@ wr_nix_prelude () chef_set_sauciers (this, 0); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); - chef_forbid_user_define(this); + chef_deny_english(this); + chef_deny_user_define(this); def_sources_begin() {&UpstreamProvider, "https://channels.nixos.org/", DelegateToUpstream}, diff --git a/src/recipe/ware/TeX-Live.c b/src/recipe/ware/TeX-Live.c index b267159..c590b6b 100644 --- a/src/recipe/ware/TeX-Live.c +++ b/src/recipe/ware/TeX-Live.c @@ -20,7 +20,7 @@ wr_tex_prelude () chef_set_sauciers (this, 1, "@Mikachu2333"); chef_allow_local_mode (this, CanNot, NULL, NULL); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() diff --git a/src/recipe/ware/WinGet.c b/src/recipe/ware/WinGet.c index a05f2a8..a843b0c 100644 --- a/src/recipe/ware/WinGet.c +++ b/src/recipe/ware/WinGet.c @@ -17,7 +17,7 @@ wr_winget_prelude () chef_set_cooks (this, 1, "@ccmywish"); chef_set_sauciers (this, 1, "@Mikachu2333"); - chef_forbid_english(this); + chef_deny_english(this); chef_allow_user_define(this); def_sources_begin() From c6897bd73ece0431ff7e01478233c4d84f59aae5 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Mon, 27 Oct 2025 22:11:34 +0800 Subject: [PATCH 17/17] Remove `free()` in recipes --- src/recipe/lang/Rust/Cargo.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 5ca237a..d4dbbb1 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -75,7 +75,6 @@ pl_rust_cargo_getsrc (char *option) char *raw_content = xy_file_read (cargo_config_file); char *formatted_content = xy_str_gsub (raw_content, " ", ""); formatted_content = xy_str_gsub (formatted_content, "'", "\""); - free (raw_content); XyStrFindResult_t result_has_mirror = xy_str_find (formatted_content, "replace-with"); if (result_has_mirror.found) @@ -112,7 +111,6 @@ pl_write_rust_config (const char *path, const char *url) char *content = RAWSTR_pl_rust_cargo_config; content = xy_str_gsub (content, "@url@", url); chsrc_overwrite_file (content, path); - free (content); } /** @@ -172,7 +170,6 @@ pl_rust_cargo_setsrc (char *option) char *final_content = xy_str_gsub (raw_content, mirror_url, xy_2strcat ("sparse+", source.url)); chsrc_overwrite_file (final_content, cargo_config_file); - free (final_content); goto finish; }