diff --git a/pkgs/by-name/pu/purescm/.gitignore b/pkgs/by-name/pu/purescm/.gitignore new file mode 100644 index 000000000000..c2658d7d1b31 --- /dev/null +++ b/pkgs/by-name/pu/purescm/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/pkgs/by-name/pu/purescm/README.rst b/pkgs/by-name/pu/purescm/README.rst new file mode 100644 index 000000000000..635d4b46d811 --- /dev/null +++ b/pkgs/by-name/pu/purescm/README.rst @@ -0,0 +1,19 @@ +======================================================================== +purescm +======================================================================== + + +Suggested additional ``buildInputs`` +==================================== + +``chez-racket`` + Upstream is using the Racket fork of Chez Scheme to execute the + generated Scheme output. + + +To update this package +====================== + +#. Bump the ``./package.json`` version pin +#. Run ``nix-shell -p nodejs --command "npm i --package-lock-only"`` +#. Update ``npmDeps.hash`` in the ``package.nix`` diff --git a/pkgs/by-name/pu/purescm/package-lock.json b/pkgs/by-name/pu/purescm/package-lock.json new file mode 100644 index 000000000000..979e42ae62fd --- /dev/null +++ b/pkgs/by-name/pu/purescm/package-lock.json @@ -0,0 +1,20 @@ +{ + "name": "purescm", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "purescm": "1.8.2" + } + }, + "node_modules/purescm": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/purescm/-/purescm-1.8.2.tgz", + "integrity": "sha512-r+iaiRagOO2rHxGIke391l+pMlpE85vOVpQA32pdftJTdKeUVGIYy0UAs1nOkQSNxdHMXsNIkrskAwOSiyX3PA==", + "bin": { + "purescm": "index.js" + } + } + } +} diff --git a/pkgs/by-name/pu/purescm/package.json b/pkgs/by-name/pu/purescm/package.json new file mode 100644 index 000000000000..96b51c2d5e1d --- /dev/null +++ b/pkgs/by-name/pu/purescm/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "purescm": "1.8.2" + } +} diff --git a/pkgs/by-name/pu/purescm/package.nix b/pkgs/by-name/pu/purescm/package.nix new file mode 100644 index 000000000000..c03f1339d18a --- /dev/null +++ b/pkgs/by-name/pu/purescm/package.nix @@ -0,0 +1,45 @@ +{ 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 = ./.; + dontNpmBuild = true; + + npmDeps = fetchNpmDeps { + src = ./.; + 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