package.nix (917B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 python3, 6 }: 7 8 stdenv.mkDerivation (finalAttrs: { 9 pname = "mjs"; 10 version = "2.20.0"; 11 12 __structuredAttrs = true; 13 14 src = fetchFromGitHub { 15 owner = "cesanta"; 16 repo = "mjs"; 17 tag = finalAttrs.version; 18 hash = "sha256-FBMoP28942Bwx0zFISBPYvH6jvXqLFmvDXHkxLHBCjY="; 19 }; 20 21 postPatch = '' 22 patchShebangs tools 23 substituteInPlace Makefile \ 24 --replace-warn "MAKEFLAGS" "#MAKEFLAGS" \ 25 --replace-warn " clang " " \$(CC) " 26 ''; 27 28 nativeBuildInputs = [ python3 ]; 29 30 makeFlags = [ 31 "DOCKER_GCC=" 32 "DOCKER_CLANG=" 33 ]; 34 35 installPhase = '' 36 install -Dm755 build/mjs -t $out/bin 37 ''; 38 39 meta = { 40 description = "Embedded JavaScript engine for C/C++"; 41 homepage = "https://mongoose.ws/"; 42 license = lib.licenses.gpl2; 43 maintainers = [ lib.maintainers.sikmir ]; 44 platforms = lib.platforms.unix; 45 mainProgram = "mjs"; 46 }; 47 })
