✨ init(*): 初始化项目。
This commit is contained in:
commit
c4b95933f4
136 files changed
+4550
No files matched your search
+194
@@ -0,0 +1,194 @@
|
||||
# Sarasa Gothic Nerd Fonts
|
||||
|
||||
[](https://aur.archlinux.org/packages/ttf-sarasa-mono-sc-nerd-font)
|
||||
[](https://aur.archlinux.org/packages/ttf-sarasa-nerd-font)
|
||||
[](aur-packages/LICENSE)
|
||||
|
||||
Independent AUR packages for every Sarasa Gothic Nerd Font variant —— **48 standalone font packages**
|
||||
across styles and orthographies, plus metapackages at style, orthography, and collection level
|
||||
(63 package bases in total).
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> Sarasa Gothic itself is a CJK programming font built on Iosevka and Source Han Sans,
|
||||
> licensed under the SIL Open Font License 1.1. This repository only packages the Nerd Font
|
||||
> patched builds; it does not modify the font data.
|
||||
|
||||
## Package layout
|
||||
|
||||
```text
|
||||
aur-packages/
|
||||
├── ttf-sarasa-<style>-<orthography>-nerd-font/ # standalone: 1 ZIP → 1 package (48)
|
||||
├── ttf-sarasa-<orthography>-nerd-font/ # metapackage: all styles for one orthography
|
||||
├── ttf-sarasa-<style>-nerd-font/ # metapackage: all orthographies for one style
|
||||
└── ttf-sarasa-nerd-font/ # metapackage: all 48 standalone packages
|
||||
```
|
||||
|
||||
- `aur-packages/ttf-sarasa-<style>-<orthography>-nerd-font/` contains one standalone font package.
|
||||
Each PKGBUILD downloads and packages only its matching upstream ZIP.
|
||||
- `aur-packages/ttf-sarasa-<orthography>-nerd-font/` is a metapackage depending on all styles for one orthography.
|
||||
- `aur-packages/ttf-sarasa-<style>-nerd-font/` is a metapackage depending on all orthographies for one style.
|
||||
- `aur-packages/ttf-sarasa-nerd-font/` is a metapackage depending on all 48 standalone font packages.
|
||||
|
||||
Each directory under `aur-packages/` is an independent AUR package base.
|
||||
Publish that directory's `PKGBUILD` and generated `.SRCINFO` to the matching AUR repository.
|
||||
The root directory contains only shared metadata, source data, and tools.
|
||||
|
||||
The root `LICENSE` is reserved for this repository's license.
|
||||
The upstream font's SIL Open Font License is stored at `aur-packages/LICENSE`
|
||||
and is used as the checksum source for font packages.
|
||||
Per Arch font packaging guidelines, that license is installed under
|
||||
`/usr/share/licenses/<pkgname>/` in each package.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> 48 standalone packages × styles × orthographies can look overwhelming.
|
||||
> Start with a metapackage —— `ttf-sarasa-nerd-font` pulls in everything,
|
||||
> while `ttf-sarasa-mono-sc-nerd-font` gives you just Mono + Simplified Chinese.
|
||||
|
||||
## Publish to AUR
|
||||
|
||||
The publishing helper supports first submissions and updates.
|
||||
First, prepare upload archives containing only `PKGBUILD` and `.SRCINFO`:
|
||||
|
||||
```bash
|
||||
bash tools/publish-aur.sh prepare
|
||||
```
|
||||
|
||||
This creates one tarball per package in `aur-upload/` (all 63 packages under `aur-packages/`).
|
||||
Upload each tarball through the AUR website's package submission page.
|
||||
You can prepare selected packages by listing their package bases,
|
||||
or set `AUR_UPLOAD_DIR` to choose another output directory.
|
||||
|
||||
After the AUR package exists, updates can be pushed with:
|
||||
|
||||
```bash
|
||||
bash tools/publish-aur.sh push ttf-sarasa-mono-sc-nerd-font
|
||||
```
|
||||
|
||||
The script clones the matching AUR repository into `aur-repos/` if needed,
|
||||
verifies its remote, refuses to overwrite a dirty checkout,
|
||||
stages only `PKGBUILD` and `.SRCINFO`, commits, and pushes to `master`.
|
||||
Set `AUR_REPO_DIR` to use another clone directory.
|
||||
Use `push --all` only when intentionally updating every package.
|
||||
|
||||
The local ZIPs are never included in upload tarballs or Git commits.
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> `push --all` iterates over every package base under `aur-packages/`.
|
||||
> Run it only when you have regenerated and verified the whole collection ——
|
||||
> a single stale `.SRCINFO` will be pushed alongside the intended updates.
|
||||
|
||||
## Install from this checkout
|
||||
|
||||
Build and install one font package from the local checkout:
|
||||
|
||||
```bash
|
||||
bash tools/install-local.sh ttf-sarasa-mono-sc-nerd-font
|
||||
```
|
||||
|
||||
You can also select a style, orthography, or full collection metapackage.
|
||||
The installer reads `.SRCINFO`, builds local dependencies first,
|
||||
and installs packages with `makepkg`;
|
||||
review the order without changing the system by using `--dry-run`:
|
||||
|
||||
```bash
|
||||
bash tools/install-local.sh --dry-run ttf-sarasa-ui-nerd-font
|
||||
```
|
||||
|
||||
Run the script as a regular user.
|
||||
`makepkg` will use pacman to install packages and any missing dependencies,
|
||||
prompting for confirmation as usual.
|
||||
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> `install-local.sh` does not use `sudo` internally.
|
||||
> `makepkg` escalates via pacman only when installing dependencies or the built package,
|
||||
> so you will still see the usual pacman confirmation prompt.
|
||||
|
||||
## Regenerate packages
|
||||
|
||||
Edit version, checksums, and bilingual names in `package-data.sh`, then run:
|
||||
|
||||
```bash
|
||||
bash tools/generate-packages.sh --force
|
||||
```
|
||||
|
||||
The generator writes each standalone PKGBUILD with one font ZIP source,
|
||||
produces `.SRCINFO` files using `makepkg`, and refreshes all 63 packages under `aur-packages/`,
|
||||
including the all-font metapackage.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A[package-data.sh<br/>version / checksums / names] --> B[generate-packages.sh --force]
|
||||
B --> C[48 standalone PKGBUILDs<br/>1 ZIP source each]
|
||||
B --> D[15 metapackage PKGBUILDs<br/>style / orthography / collection]
|
||||
C --> E[makepkg --printsrcinfo]
|
||||
D --> E
|
||||
E --> F[aur-packages/<br/>PKGBUILD + .SRCINFO]
|
||||
F --> G[publish-aur.sh prepare]
|
||||
F --> H[install-local.sh]
|
||||
G --> I[aur-upload/*.tar.gz]
|
||||
```
|
||||
|
||||
## Update checksums
|
||||
|
||||
Update checksums and regenerate package metadata with:
|
||||
|
||||
```bash
|
||||
bash tools/update-checksums.sh
|
||||
```
|
||||
|
||||
The default mode compares each ZIP with the `pkgver` and first `sha256sums` entry in its `.SRCINFO`.
|
||||
Missing ZIPs, stale `.SRCINFO`, old-version ZIPs, or modified ZIPs are downloaded
|
||||
from the release selected by `pkgver` into their corresponding package directories.
|
||||
To force-refresh all 48 ZIPs, use:
|
||||
|
||||
```bash
|
||||
bash tools/update-checksums.sh --download
|
||||
```
|
||||
|
||||
To prefer SHA-256 digests reported by GitHub's Release Assets API, use:
|
||||
|
||||
```bash
|
||||
bash tools/update-checksums.sh --api
|
||||
```
|
||||
|
||||
The API's `digest` field can be null or unavailable.
|
||||
A matching API digest can validate a cached ZIP;
|
||||
otherwise the script uses `.SRCINFO` to verify its version and hash,
|
||||
downloading it when stale or unknown.
|
||||
`--download` forces a refresh even when the API digest matches.
|
||||
|
||||
An optional GitHub token can raise the API rate limit.
|
||||
Export it only in the current shell, then run the API mode:
|
||||
|
||||
```bash
|
||||
export GITHUB_TOKEN='your-token'
|
||||
bash tools/update-checksums.sh --api
|
||||
unset GITHUB_TOKEN
|
||||
```
|
||||
|
||||
The token is sent only in the API request and is not written to package files.
|
||||
Font LICENSE checksums are calculated from `aur-packages/LICENSE`.
|
||||
|
||||
> [!CAUTION]
|
||||
>
|
||||
> The API `digest` field is not guaranteed to be present.
|
||||
> When it is missing, `--api` silently falls back to `.SRCINFO` verification ——
|
||||
> a green API run does not prove every ZIP matched an API digest.
|
||||
> Use `--download` when you need a guaranteed full refresh.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Arch Linux or an Arch-based system with `base-devel` and `pacman`.
|
||||
- `bash`, `curl`, `makepkg`, and `sha256sum` available in `PATH`.
|
||||
- Network access to `github.com` and `aur.archlinux.org` for publishing and checksum refresh.
|
||||
- AUR account with SSH key configured for `publish-aur.sh push`.
|
||||
|
||||
## License
|
||||
|
||||
This repository's own code and metadata are covered by the root `LICENSE`.
|
||||
The font data and the upstream SIL Open Font License are stored at `aur-packages/LICENSE`
|
||||
and remain under OFL-1.1.
|
||||
Reference in new issue
Block a user