关于 Finx
About Finx
Finx 是 Fink 的延续。Fink 是 macOS 上老牌的包管理器,建立在 Debian 的 dpkg / apt 体系之上:它下载原始源码,按需打补丁,为 Darwin 配置好,编译并安装。
Finx is the continuation of Fink, the long-standing macOS package manager built on Debian's dpkg / apt stack: it downloads original source releases, patches them when necessary, configures them for Darwin, then compiles and installs.
名字里的 x 取「扩展」之意。dpkg / apt 的依赖求解与副作用控制至今依然先进,值得保留;需要扩展的是安装前缀、文档与可维护性 —— 而不是换掉内核。
The x stands for extension. dpkg / apt dependency solving and side-effect control are still ahead of their time and worth keeping; what needs extending is the install prefix, the documentation, and maintainability — not the kernel.
为什么选择 Finx
Why Finx
- 真有依赖求解。 走 dpkg / apt,而不是「先装这个再装那个」的脚本约定:
Depends、Conflicts、Provides、虚拟包、shlibs符号依赖都由包管理器算。 - 副作用可控。
conffiles让你改过的配置在升级时不被覆盖;preinst/postinst/prerm/postrm四个维护者脚本定义了每一步该做什么。 - 落地前先求解。 安装前会用一致性求解算出「为了装这批包,需要临时卸掉谁」,而不是装到一半才发现冲突。
- 单一规范前缀。 全仓库统一到
/opt/finx,不再按 macOS 版本在/sw与/opt/sw之间分叉。 - 源码与二进制双分发。 有预编译包就下,没有就从源码编;两者走同一条安装路径。
- 纯 Perl + Shell。 没有编译型依赖,读代码不需要先配好工具链。
- 锁是真锁。 先抢 dpkg 数据库锁再
exec,锁随子进程继承,并发操作不会互相踩。
- Real dependency solving. dpkg / apt, not a "install this before that" convention:
Depends,Conflicts,Provides, virtual packages andshlibssymbol dependencies are computed by the package manager. - Controlled side effects.
conffileskeep your edited configuration across upgrades; the four maintainer scripts —preinst,postinst,prerm,postrm— define exactly what happens at each step. - Resolved before landing. A consistency pass works out which packages must be temporarily removed to satisfy the install, instead of discovering the conflict halfway through.
- One canonical prefix. Everything is unified on
/opt/finx; no more splitting between/swand/opt/swby macOS version. - Source and binary distribution. Use a prebuilt package when one exists, compile when it does not; both take the same install path.
- Perl and Shell only. No compiled dependencies, so reading the code does not require a working toolchain.
- Real locking. The dpkg database lock is taken before
exec, so the child inherits it and concurrent operations cannot trample each other.
支持的 macOS 版本
Supported macOS Versions
当前发行版树为 10.9-libcxx,覆盖 macOS 10.9 及以上,Intel 与 Apple 芯片均在支持范围内。更早的系统需要更老的发行版树。
The current distribution tree is 10.9-libcxx, covering macOS 10.9 and later on both Intel and Apple silicon. Earlier systems need older distribution trees.
安装 Finx
Install Finx
dpkg,再用这个 dpkg 安装自己。
dpkg first, then uses that dpkg to install itself.
准备环境
Prepare
$ xcode-select --install $ sudo xcodebuild -license
从源码自举
Bootstrap from source
$ tar xf finx-0.45.99.tar.gz $ cd finx-0.45.99 $ ./bootstrap
自举会先编译 tar 与 dpkg 到临时脚手架,再用它们把基础包装进 /opt/finx,最后删掉脚手架。详细过程见仓库里的 INSTALL。
Bootstrap compiles tar and dpkg into a scratch tree first, uses them to install the base packages into /opt/finx, then removes the scaffolding. The full procedure lives in INSTALL.
配置 shell 环境
Set up your shell
$ . /opt/finx/bin/init.sh
使用
Usage
$ fink install wget # 安装 $ fink list # 列出可用软件包 $ fink describe wget # 查看包描述 $ fink remove wget # 卸载,保留配置文件 $ fink purge wget # 卸载并删除配置文件 $ fink selfupdate # 更新包管理器自身 $ fink update-all # 更新全部已安装包
装包操作需要 root,fink 会自己调用 sudo,不必手动加。
Package operations need root; fink invokes sudo itself, so you do not add it by hand.
与 Fink 的关系
Relationship to Fink
| 方面 | Aspect | Fink | Fink | Finx | Finx |
|---|---|---|---|---|---|
| 安装前缀 | Install prefix | /sw / /opt/sw |
/opt/finx |
||
| 包管理内核 | Package kernel | dpkg / apt | dpkg / apt | dpkg / apt | dpkg / apt |
| 实现语言 | Language | Perl + Shell | Perl + Shell | Perl + Shell | Perl + Shell |
| 文档 | Documentation | 分散,版本滞后 | Scattered and stale | 统一到 docs/,与代码同步 |
Consolidated under docs/, kept in sync |
| 安装器 | Installer | 必须源码自举 | Source bootstrap only | 二进制种子安装器(开发中) | Seed-based installer (in progress) |
面向开发者
For Developers
$ make test # 完整性检查 + 全部测试 $ make format # 缩进检查(Perl 用 tab,shell 用 4 空格) $ ./inject.pl /opt/finx # 把工作副本装进已有安装
仓库里还有 docs/TECHNICAL-GUIDE.md,讲自举链路、装包流水线与 dpkg 定制;AGENTS.md 记录了代码约定。
The repository also ships docs/TECHNICAL-GUIDE.md covering the bootstrap chain, the packaging pipeline and the dpkg patches, plus AGENTS.md for conventions.
许可证
License
Finx 沿用 Fink 的许可证,以 GPL v2 发布。详见仓库中的 COPYING。
Finx keeps Fink's license and is released under the GPL v2. See COPYING in the repository.