Skip to content

Commit 13ff0d5

Browse files
committed
tmp
1 parent 2287e45 commit 13ff0d5

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ However, Squoosh utilizes Google Analytics to collect the following:
1515

1616
# Developing
1717

18+
## Web App
19+
1820
To develop for Squoosh:
1921

2022
1. Clone the repository
@@ -31,8 +33,28 @@ To develop for Squoosh:
3133
npm run dev
3234
```
3335

36+
## Codecs
37+
38+
All build instructions for codecs are written using [Nix]. If you have Nix installed, you can rebuild the WebAssembly binaries by running:
39+
40+
```sh
41+
# Build the codec
42+
cd codec/<codec>
43+
nix run '.#updateRepoBinaries'
44+
```
45+
46+
If you do not have Nix installed, you can use the provided Docker image to create a shell with nix available:
47+
48+
```sh
49+
# Build the image (only needs to be done once).
50+
docker build -t squoosh-nix ./nix
51+
docker run --name squoosh-nix -ti -v $PWD:/app squoosh-nix /bin/sh
52+
# ... continue with the steps above
53+
```
54+
3455
# Contributing
3556

3657
Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md).
3758

3859
[squoosh]: https://squoosh.app
60+
[nix]: https://nixos.org

nix/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM nixos/nix:2.24.5
2+
3+
RUN <<EOF
4+
cat >> /etc/nix/nix.conf << EOL
5+
experimental-features = nix-command flakes
6+
EOL
7+
EOF
8+
9+
WORKDIR /app
10+
CMD ["nix", "run", ".#updateRepoBinaries"]

nix/rust-helpers/default.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
rustPlatform,
33
jq,
44
rsync,
5+
lib,
56
stdenv,
7+
# openssl,
8+
pkg-config,
69
fenix,
710
}:
811
{
@@ -40,6 +43,11 @@
4043
toolchain
4144
jq
4245
rsync
46+
pkg-config
47+
# (lib.getDev openssl)
48+
];
49+
buildInputs = [
50+
# openssl
4351
];
4452
dontConfigure = true;
4553
buildPhase = ''

nix/wasm-bindgen/default.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
fetchCrate,
44
rustPlatform,
55
curl,
6+
stdenv,
7+
openssl_1_1,
8+
pkg-config,
69
darwin,
710
}:
811
rec {
@@ -21,10 +24,15 @@ rec {
2124
rustPlatform.buildRustPackage {
2225
name = "wasm-bindgen-cli";
2326
inherit src cargoLock;
27+
nativeBuildInputs = [
28+
pkg-config
29+
];
2430
buildInputs = [
25-
curl
26-
darwin.apple_sdk.frameworks.Security
31+
openssl_1_1
32+
] ++ lib.optionals stdenv.isDarwin [
33+
darwin.apple_sdk.frameworks.IOKit
2734
];
35+
2836
doCheck = false;
2937
};
3038

0 commit comments

Comments
 (0)