This commit is contained in:
Surma
2024-11-26 11:44:40 +00:00
parent 2287e4517e
commit 13ff0d5934
4 changed files with 51 additions and 3 deletions

View File

@@ -15,6 +15,8 @@ However, Squoosh utilizes Google Analytics to collect the following:
# Developing # Developing
## Web App
To develop for Squoosh: To develop for Squoosh:
1. Clone the repository 1. Clone the repository
@@ -31,8 +33,28 @@ To develop for Squoosh:
npm run dev npm run dev
``` ```
## Codecs
All build instructions for codecs are written using [Nix]. If you have Nix installed, you can rebuild the WebAssembly binaries by running:
```sh
# Build the codec
cd codec/<codec>
nix run '.#updateRepoBinaries'
```
If you do not have Nix installed, you can use the provided Docker image to create a shell with nix available:
```sh
# Build the image (only needs to be done once).
docker build -t squoosh-nix ./nix
docker run --name squoosh-nix -ti -v $PWD:/app squoosh-nix /bin/sh
# ... continue with the steps above
```
# Contributing # Contributing
Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md). Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md).
[squoosh]: https://squoosh.app [squoosh]: https://squoosh.app
[nix]: https://nixos.org

10
nix/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM nixos/nix:2.24.5
RUN <<EOF
cat >> /etc/nix/nix.conf << EOL
experimental-features = nix-command flakes
EOL
EOF
WORKDIR /app
CMD ["nix", "run", ".#updateRepoBinaries"]

View File

@@ -2,7 +2,10 @@
rustPlatform, rustPlatform,
jq, jq,
rsync, rsync,
lib,
stdenv, stdenv,
# openssl,
pkg-config,
fenix, fenix,
}: }:
{ {
@@ -40,6 +43,11 @@
toolchain toolchain
jq jq
rsync rsync
pkg-config
# (lib.getDev openssl)
];
buildInputs = [
# openssl
]; ];
dontConfigure = true; dontConfigure = true;
buildPhase = '' buildPhase = ''

View File

@@ -3,6 +3,9 @@
fetchCrate, fetchCrate,
rustPlatform, rustPlatform,
curl, curl,
stdenv,
openssl_1_1,
pkg-config,
darwin, darwin,
}: }:
rec { rec {
@@ -21,10 +24,15 @@ rec {
rustPlatform.buildRustPackage { rustPlatform.buildRustPackage {
name = "wasm-bindgen-cli"; name = "wasm-bindgen-cli";
inherit src cargoLock; inherit src cargoLock;
buildInputs = [ nativeBuildInputs = [
curl pkg-config
darwin.apple_sdk.frameworks.Security
]; ];
buildInputs = [
openssl_1_1
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.IOKit
];
doCheck = false; doCheck = false;
}; };