nur-packages

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

default.nix (888B)


      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   src = fetchFromGitHub {
     13     owner = "cesanta";
     14     repo = "mjs";
     15     rev = finalAttrs.version;
     16     hash = "sha256-FBMoP28942Bwx0zFISBPYvH6jvXqLFmvDXHkxLHBCjY=";
     17   };
     18 
     19   postPatch = ''
     20     patchShebangs tools
     21     substituteInPlace Makefile \
     22       --replace-warn "MAKEFLAGS" "#MAKEFLAGS" \
     23       --replace-warn " clang " " \$(CC) "
     24   '';
     25 
     26   nativeBuildInputs = [ python3 ];
     27 
     28   makeFlags = [
     29     "DOCKER_GCC="
     30     "DOCKER_CLANG="
     31   ];
     32 
     33   installPhase = ''
     34     install -Dm755 build/mjs -t $out/bin
     35   '';
     36 
     37   meta = {
     38     description = "Embedded JavaScript engine for C/C++";
     39     homepage = "https://mongoose.ws/";
     40     license = lib.licenses.gpl2;
     41     maintainers = [ lib.maintainers.sikmir ];
     42     platforms = lib.platforms.unix;
     43     mainProgram = "mjs";
     44   };
     45 })