Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Nov 26, 2024
1 parent 2287e45 commit 13ff0d5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ However, Squoosh utilizes Google Analytics to collect the following:

# Developing

## Web App

To develop for Squoosh:

1. Clone the repository
Expand All @@ -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 changes: 10 additions & 0 deletions nix/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
8 changes: 8 additions & 0 deletions nix/rust-helpers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
rustPlatform,
jq,
rsync,
lib,
stdenv,
# openssl,
pkg-config,
fenix,
}:
{
Expand Down Expand Up @@ -40,6 +43,11 @@
toolchain
jq
rsync
pkg-config
# (lib.getDev openssl)
];
buildInputs = [
# openssl
];
dontConfigure = true;
buildPhase = ''
Expand Down
12 changes: 10 additions & 2 deletions nix/wasm-bindgen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
fetchCrate,
rustPlatform,
curl,
stdenv,
openssl_1_1,
pkg-config,
darwin,
}:
rec {
Expand All @@ -21,10 +24,15 @@ rec {
rustPlatform.buildRustPackage {
name = "wasm-bindgen-cli";
inherit src cargoLock;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
curl
darwin.apple_sdk.frameworks.Security
openssl_1_1
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.IOKit
];

doCheck = false;
};

Expand Down

0 comments on commit 13ff0d5

Please sign in to comment.