depot/third_party/nixpkgs/pkgs/by-name/pu/purescm/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

58 lines
1.3 KiB
Nix

{ lib
, buildNpmPackage
, fetchNpmDeps
, testers
}:
let
inherit (lib) fileset;
packageLock = builtins.fromJSON (builtins.readFile ./package-lock.json);
pname = "purescm";
version = packageLock.packages."node_modules/${pname}".version;
package = buildNpmPackage {
inherit pname version;
src = fileset.toSource {
root = ./.;
fileset = fileset.unions [
./package.json
./package-lock.json
./.gitignore
];
};
dontNpmBuild = true;
npmDeps = fetchNpmDeps {
src = fileset.toSource {
root = ./.;
fileset = fileset.unions [
./package-lock.json
./package.json
];
};
hash = "sha256-ljeFcLvIET77Q0OR6O5Ok1fGnaxaKaoywpcy2aHq/6o=";
};
installPhase = ''
mkdir -p $out/share/${pname}
cp -r node_modules/ $out/share/${pname}
ln -s $out/share/${pname}/node_modules/.bin $out/bin
'';
passthru.tests = {
version = testers.testVersion { inherit package; };
};
meta = {
description = "Chez Scheme back-end for PureScript";
homepage = "https://github.com/purescm/purescm";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ toastal ];
mainProgram = "purescm";
};
};
in
package