Update pds to 0.4.74
This commit is contained in:
parent
4770422c0e
commit
e5d179c7bf
2 changed files with 41 additions and 5516 deletions
|
@ -1,13 +1,17 @@
|
|||
{ fetchFromGitHub
|
||||
{ stdenv
|
||||
, makeBinaryWrapper
|
||||
, removeReferencesTo
|
||||
, srcOnly
|
||||
, python3
|
||||
, pnpm
|
||||
, fetchFromGitHub
|
||||
, nodejs
|
||||
, buildNpmPackage
|
||||
, vips
|
||||
, pkg-config
|
||||
, writeShellApplication
|
||||
, bash
|
||||
, xxd
|
||||
, openssl
|
||||
, nixosTests
|
||||
, lib
|
||||
,
|
||||
}:
|
||||
|
@ -28,61 +32,72 @@ let
|
|||
echo "PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32)"
|
||||
'';
|
||||
};
|
||||
|
||||
nodeSources = srcOnly nodejs;
|
||||
customPython3 = python3.withPackages (p: [ p.setuptools ]);
|
||||
in
|
||||
|
||||
# NOTE: Package comes with `pnpm-lock.yaml` but we cannot use `pnpm.fetchDeps` here because it
|
||||
# does not work with `sharp` NPM dependency that needs `vips` and `pkg-config`
|
||||
# Regenerate `package-lock.json` with `npm i --package-lock-only`
|
||||
# Next release should have bumped `sharp` with pre-built binaries
|
||||
buildNpmPackage rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pds";
|
||||
version = "0.4.67";
|
||||
version = "0.4.74";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bluesky-social";
|
||||
repo = "pds";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-dEB5u++Zx+F4TH5q44AF/tuwAhLEyYT+U5/18viT4sw=";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-kNHsQ6funmo8bnkFBNWHQ0Fmd5nf/uh+x9buaRJMZnM=";
|
||||
};
|
||||
|
||||
sourceRoot = "${src.name}/service";
|
||||
sourceRoot = "${finalAttrs.src.name}/service";
|
||||
|
||||
npmDepsHash = "sha256-uQKhODaVHLj+JEq6LYiJ/zXuu7kDCLmpxOs/VCc0GqQ=";
|
||||
|
||||
postPatch = ''
|
||||
cp ${./package-lock.json} package-lock.json
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
nodejs
|
||||
customPython3
|
||||
pkg-config
|
||||
pnpm.configHook
|
||||
];
|
||||
|
||||
# Required for `sharp` NPM dependency
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ vips ];
|
||||
|
||||
pnpmDeps = pnpm.fetchDeps {
|
||||
inherit (finalAttrs)
|
||||
pname
|
||||
version
|
||||
src
|
||||
sourceRoot
|
||||
;
|
||||
hash = "sha256-oU4dwlBdsMmgAUv1ICaOqaqucmg/TjKOZxjnxpm0qL8=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
for f in $(find -path '*/node_modules/better-sqlite3' -type d); do
|
||||
(cd "$f" && (
|
||||
npm run build-release --offline --nodedir="${nodeSources}"
|
||||
find build -type f -exec \
|
||||
${lib.getExe removeReferencesTo} \
|
||||
-t "${nodeSources}" {} \;
|
||||
))
|
||||
done
|
||||
makeWrapper "${lib.getExe nodejs}" "$out/bin/pds" \
|
||||
--add-flags --enable-source-maps \
|
||||
--add-flags "$out/lib/pds/index.js" \
|
||||
--set-default NODE_ENV production
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib/pds}
|
||||
mv node_modules $out/lib/pds
|
||||
mv index.js $out/lib/pds
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit generateSecrets;
|
||||
tests = {
|
||||
inherit (nixosTests) pds;
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
@ -96,4 +111,4 @@ buildNpmPackage rec {
|
|||
platforms = lib.platforms.unix;
|
||||
mainProgram = "pds";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
5490
services/pds/pkg/pds/package-lock.json
generated
5490
services/pds/pkg/pds/package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue