nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit 2f406bff5b2ebe788633c316c9fdc9f99c9dd1b0
parent 6d8c98471aad29b3dc6e4a7ef52083f6f7e6302e
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Mon, 25 Mar 2024 00:49:53 +0400

Add mjs

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/misc/mjs/default.nix | 36++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -377,6 +377,7 @@ lib.makeScope newScope ( messenger-gtk = callPackage ./misc/messenger-gtk { }; miband4 = callPackage ./misc/miband4 { }; mitzasql = callPackage ./misc/mitzasql { }; + mjs = callPackage ./misc/mjs { }; modbus-tools = callPackage ./misc/modbus-tools { inherit (darwin.apple_sdk.frameworks) IOKit; }; diff --git a/pkgs/misc/mjs/default.nix b/pkgs/misc/mjs/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, python3 }: + +stdenv.mkDerivation (finalAttrs: { + pname = "mjs"; + version = "2.20.0"; + + src = fetchFromGitHub { + owner = "cesanta"; + repo = "mjs"; + rev = finalAttrs.version; + hash = "sha256-FBMoP28942Bwx0zFISBPYvH6jvXqLFmvDXHkxLHBCjY="; + }; + + postPatch = '' + substituteInPlace Makefile \ + --replace-warn "MAKEFLAGS" "#MAKEFLAGS" \ + --replace-warn " clang " " \$(CC) " + ''; + + nativeBuildInputs = [ python3 ]; + + makeFlags = [ "DOCKER_GCC=" "DOCKER_CLANG=" ]; + + installPhase = '' + install -Dm755 build/mjs -t $out/bin + ''; + + meta = with lib; { + description = "Embedded JavaScript engine for C/C++"; + homepage = "https://mongoose.ws/"; + license = licenses.gpl2; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + mainProgram = "mjs"; + }; +})