Merge pull request #301087 from pbsds/bump-pagefind-1712096613

pagefind: 1.0.4 -> 1.1.0
This commit is contained in:
Peder Bergebakken Sundt 2024-04-03 17:42:17 +02:00 committed by GitHub
commit e4b3cf2940
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,26 +14,26 @@
let
wasm-bindgen-84 = wasm-bindgen-cli.override {
version = "0.2.84";
hash = "sha256-0rK+Yx4/Jy44Fw5VwJ3tG243ZsyOIBBehYU54XP/JGk=";
cargoHash = "sha256-vcpxcRlW1OKoD64owFF6mkxSqmNrvY+y3Ckn5UwEQ50=";
wasm-bindgen-92 = wasm-bindgen-cli.override {
version = "0.2.92";
hash = "sha256-1VwY8vQy7soKEgbki4LD+v259751kKxSxmo/gqE6yV0=";
cargoHash = "sha256-aACJ+lYNEU8FFBs158G1/JG8sc6Rq080PeKCMnwdpH0=";
};
in
rustPlatform.buildRustPackage rec {
pname = "pagefind";
version = "1.0.4";
version = "1.1.0";
src = fetchFromGitHub {
owner = "cloudcannon";
repo = "pagefind";
rev = "refs/tags/v${version}";
hash = "sha256-IN+l5Wq89tjppE0xCcvczQSkJc1CLymEFeieJhvQQ54=";
hash = "sha256-pcgcu9zylSTjj5rxNff+afFBWVpN5sGtlpadG1wb93M=";
};
cargoHash = "sha256-T7DBuqfpqaEmu9iItnFYsJVnEFxG1r9uXEkfqJp1mD8=";
cargoHash = "sha256-E4gjG5GrVWkMKgjQiAvEiSy2/tx/yHKe+5isveMZ9tU=";
env.npmDeps_web_js = fetchNpmDeps {
name = "npm-deps-web-js";
@ -50,6 +50,11 @@ rustPlatform.buildRustPackage rec {
src = "${src}/pagefind_ui/modular";
hash = "sha256-O0RqZUsRFtByxMQdwNGNcN38Rh+sDqqNo9YlBcrnsF4=";
};
env.cargoDeps_web = rustPlatform.fetchCargoTarball {
name = "cargo-deps-web";
src = "${src}/pagefind_web/";
hash = "sha256-vDkVXyDePKgYTYE5ZTLLfOHwPYfgaqP9p5/fKCQQi0g=";
};
postPatch = ''
# Tricky way to run npmConfigHook multiple times
@ -60,6 +65,11 @@ rustPlatform.buildRustPackage rec {
npmRoot=pagefind_ui/default npmDeps=$npmDeps_ui_default npmConfigHook
npmRoot=pagefind_ui/modular npmDeps=$npmDeps_ui_modular npmConfigHook
)
(
cd pagefind_web
cargoDeps=$cargoDeps_web cargoSetupPostUnpackHook
cargoDeps=$cargoDeps_web cargoSetupPostPatchHook
)
'';
nativeBuildInputs = [
@ -68,7 +78,7 @@ rustPlatform.buildRustPackage rec {
nodejs
rustc
rustc.llvmPackages.lld
wasm-bindgen-84
wasm-bindgen-92
wasm-pack
];
@ -76,22 +86,27 @@ rustPlatform.buildRustPackage rec {
# based on "test-and-build" in https://github.com/CloudCannon/pagefind/blob/main/.github/workflows/release.yml
preBuild = ''
export HOME=$(mktemp -d)
echo entering pagefind_web_js...
(
cd pagefind_web_js
npm run build-coupled
)
echo entering pagefind_web...
(
cd pagefind_web
export RUSTFLAGS="-C linker=lld"
bash ./local_build.sh
)
echo entering pagefind_ui/default...
(
cd pagefind_ui/default
npm run build
)
echo entering pagefind_ui/modular...
(
cd pagefind_ui/modular
npm run build