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
## Web App
To develop for Squoosh:
1. Clone the repository
@@ -31,8 +33,28 @@ To develop for Squoosh:
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
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
[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,
jq,
rsync,
lib,
stdenv,
# openssl,
pkg-config,
fenix,
}:
{
@@ -40,6 +43,11 @@
toolchain
jq
rsync
pkg-config
# (lib.getDev openssl)
];
buildInputs = [
# openssl
];
dontConfigure = true;
buildPhase = ''

View File

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