Initial scaffold
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# kama-packages
|
||||
|
||||
The central package (recipe) repository for [Keru OS](https://github.com/AstralZX/KeruOS),
|
||||
built by [Kama](https://github.com/AstralZX/kama).
|
||||
|
||||
Every package is a plain POSIX shell script that describes how to compile and
|
||||
install one piece of software. Nothing more — no manifests, no metadata files,
|
||||
no build databases. The recipe *is* the package.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
TEMPLATE.sh starting point for new recipes
|
||||
busybox.sh easy-tier example (autotools-ish, static build)
|
||||
runit.sh advanced-tier example (custom fetch/patch, pkg_post)
|
||||
```
|
||||
|
||||
## Recipe syntax (quick)
|
||||
|
||||
```sh
|
||||
name=busybox
|
||||
version=1.36.1
|
||||
url=https://busybox.net/downloads/busybox-1.36.1.tar.bz2
|
||||
deps=() # build-time deps (AUR-style: built then purged)
|
||||
|
||||
build() { make defconfig; make -j"$JOBS"; } # configure + compile
|
||||
install() { make install CONFIG_PREFIX="$pkgdir"; } # stage into $pkgdir
|
||||
```
|
||||
|
||||
Kama handles download, extraction, staging, and temp-dep cleanup. For advanced
|
||||
needs (custom fetch, patches, post-install hooks, splitting), override
|
||||
`pkg_fetch`, `pkg_post`, or `pkg_split`. See the
|
||||
[full format spec](https://github.com/AstralZX/KeruOS/blob/main/docs/recipe-format.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Copy `TEMPLATE.sh` to `<name>.sh`.
|
||||
2. Fill in `name`, `version`, `url`, and the build/install functions.
|
||||
3. Verify with `sh -n <name>.sh` and by building it (`kama make <name>`).
|
||||
4. Open a pull request.
|
||||
|
||||
<p align="center"><i>Every package a kiln-load — fire it from source.</i></p>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env sh
|
||||
# Kama recipe template
|
||||
#
|
||||
# Copy this file to packages/<name>.sh (or packages/<name>/recipe.sh) and
|
||||
# fill in the easy tier. Step up to the advanced tier only if you need it.
|
||||
#
|
||||
# For the simple case you only need: name, version, url, build(), install().
|
||||
# Kama handles downloading + extraction automatically (the default_fetch).
|
||||
|
||||
name=
|
||||
version=
|
||||
url=
|
||||
deps=() # build-time deps (AUR-style: compiled then purged)
|
||||
|
||||
# ---- advanced (optional) ------------------------------------------------
|
||||
# runtime_deps=()
|
||||
# license=()
|
||||
# provides=()
|
||||
# conflicts=()
|
||||
# arch=()
|
||||
# noextract=()
|
||||
#
|
||||
# pkg_fetch() { default_fetch; patch -p1 < ../something.patch; }
|
||||
# pkg_post() { :; }
|
||||
# pkg_split() { :; }
|
||||
|
||||
build() {
|
||||
# configure + compile here
|
||||
:
|
||||
}
|
||||
|
||||
install() {
|
||||
# install into $pkgdir (staging), NOT into $ROOT
|
||||
:
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env sh
|
||||
# busybox — easy-tier recipe example
|
||||
# Kama auto-fetches + auto-extracts; we just build and stage-install.
|
||||
|
||||
name=busybox
|
||||
version=1.36.1
|
||||
url=https://busybox.net/downloads/busybox-1.36.1.tar.bz2
|
||||
deps=() # no build-time deps for a static busybox
|
||||
|
||||
build() {
|
||||
make defconfig
|
||||
make -j"$JOBS"
|
||||
}
|
||||
|
||||
install() {
|
||||
make install CONFIG_PREFIX="$pkgdir"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env sh
|
||||
# runit — advanced-tier recipe example
|
||||
# Shows overriding pkg_fetch (patch before build) and using pkg_post.
|
||||
|
||||
name=runit
|
||||
version=2.1.2
|
||||
url=https://smarden.org/runit/runit-2.1.2.tar.gz
|
||||
deps=(gcc)
|
||||
runtime_deps=()
|
||||
license=(BSD-3-Clause)
|
||||
provides=(init)
|
||||
|
||||
# patch the default package/ target so install lands in $pkgdir
|
||||
pkg_fetch() {
|
||||
default_fetch
|
||||
cd "$src"
|
||||
# runit's makefile assumes an absolute package/ dir; inject DESTDIR
|
||||
sed -i 's|^package/.*|& DESTDIR="'"$pkgdir"'"|' src/Makefile 2>/dev/null || true
|
||||
}
|
||||
|
||||
build() {
|
||||
cd src
|
||||
make -j"$JOBS"
|
||||
}
|
||||
|
||||
install() {
|
||||
cd src
|
||||
./install.sh "$pkgdir" 2>/dev/null || make install DESTDIR="$pkgdir"
|
||||
}
|
||||
|
||||
pkg_post() {
|
||||
# runit expects to own /service etc; staged, so just create dirs
|
||||
mkdir -p "$pkgdir/etc/sv" "$pkgdir/service"
|
||||
ln -sf /usr/sbin/runit-init "$pkgdir/sbin/init"
|
||||
}
|
||||
Reference in New Issue
Block a user