Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ Images for [Bend 2](https://github.com/bendlang/bend).

## Install

With [Bend](https://github.com/bendlang/bend) alone there is nothing to
install: import ezimg by its hub name and `bend` fetches it from
ezimg is built and checked on bend 2.0.34.

With [Bend](https://github.com/bendlang/bend) alone there is no install
step: import ezimg by its hub name and `bend` fetches it from
[the hub](https://hub.bend-lang.com) into `~/.bend/lib` on the first run.
`0xde7817074d0d382dc55dfca454298427` is ezimg v1.1.0.
`emerging-ezimg@1.2.0.0` is ezimg v1.2.0:

```
import 0xde7817074d0d382dc55dfca454298427/main.bend as Img
import emerging-ezimg@1.2.0.0/main.bend as Img
```

That name resolves to `0x57618559b9b26dd8415f821176a3e692`.
To pin by content instead, import `0x57618559b9b26dd8415f821176a3e692/main.bend`.

Or with [ez](https://github.com/Emerging-Patterns/ez), which records the
package in `ez.toml` (`ez init` makes one):

Expand All @@ -35,7 +40,7 @@ repeats its level in R, G and B.
`height`, `size`, `count`, and `fill` are the pixel helpers.

```
import 0xde7817074d0d382dc55dfca454298427/main.bend as Img
import emerging-ezimg@1.2.0.0/main.bend as Img

def main() -> U32:
Img.width(Img.raster(2, 3, [0, 1, 2, 3, 4, 5]))
Expand Down
6 changes: 3 additions & 3 deletions ez.lock.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ hub = "https://hub.bend-lang.com"
[tools]
[tools.bolt]
git = "https://github.com/Emerging-Patterns/bolt"
rev = "d5a67600a96ba423f2212bd661a30c1fba38eb55"
tag = "v1.9.0"
rev = "91efe4bbaad91953652794ad55be7b49c10a2eff"
tag = "v1.11.0"
root = "."
narHash = "sha256-HmJ8J1xDshBdSWXIiEp48GZ9qHsm+bmpHw06ZWwcDVE="
narHash = "sha256-0xjoxoByI8PKBrbFy4eYGbKQ3ZVscknZLKkWQroYAUI="
entry = "main.bend"
8 changes: 4 additions & 4 deletions ez.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "ezimg"
entry = "main.bend"

[tools]
[tools.bolt]
git = "https://github.com/Emerging-Patterns/bolt"
rev = "d5a67600a96ba423f2212bd661a30c1fba38eb55"
tag = "v1.9.0"
rev = "91efe4bbaad91953652794ad55be7b49c10a2eff"
tag = "v1.11.0"
root = "."
narHash = "sha256-HmJ8J1xDshBdSWXIiEp48GZ9qHsm+bmpHw06ZWwcDVE="
narHash = "sha256-0xjoxoByI8PKBrbFy4eYGbKQ3ZVscknZLKkWQroYAUI="
entry = "main.bend"
18 changes: 2 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
ez = inputs.ez.lib.${system};
ezBin = inputs.ez.packages.${system}.default;
bend = inputs.bend.packages.${system}.default;
bolt = ez.toolPackage { name = "bolt"; src = self; wrapFlags = [ "--gpu" "off" ]; };
bolt = ez.toolPackage { name = "bolt"; src = self; inherit bend; wrapFlags = [ "--gpu" "off" ]; };
bend-cc = ez.bend-cc;

bench = import ./bench {
Expand All @@ -41,21 +41,7 @@
apps.${system} = bench.apps;

checks.${system} = {
# every PROOF.bend on this flake's bend: its first line must be
# ALL PROOFS CHECK.
proofs = pkgs.runCommand "ezimg-proofs" {
nativeBuildInputs = [ bend ];
BEND_LIB = ez.bendLib ./ez.lock.toml;
} ''
export HOME=$TMPDIR
cp -r ${self} src && chmod -R u+w src && cd src
for p in $(find . -name PROOF.bend -not -path './.ez/*' | sort); do
first=$(cd "$(dirname "$p")" && bend "$(basename "$p")" | head -n 1)
echo "$p: $first"
[ "$first" = "ALL PROOFS CHECK" ] || exit 1
done
touch $out
'';
proofs = ez.mkProofs { ez = ezBin; src = self; };
lint = ez.mkLint { src = self; };
} // bench.checks;

Expand Down
Loading