Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / interpreters / duktape / default.nix
blob360666d898af12d036be7a0a1635f770981f1415
1 { lib, stdenv, fetchurl }:
3 stdenv.mkDerivation rec {
4   pname = "duktape";
5   version = "2.6.0";
6   src = fetchurl {
7     url = "http://duktape.org/duktape-${version}.tar.xz";
8     sha256 = "19szwxzvl2g65fw95ggvb8h0ma5bd9vvnnccn59hwnc4dida1x4n";
9   };
11   postPatch = ''
12     substituteInPlace Makefile.sharedlibrary \
13       --replace 'gcc' '${stdenv.cc.targetPrefix}cc' \
14       --replace 'g++' '${stdenv.cc.targetPrefix}c++'
15     substituteInPlace Makefile.cmdline \
16       --replace 'gcc' '${stdenv.cc.targetPrefix}cc' \
17       --replace 'g++' '${stdenv.cc.targetPrefix}c++'
18   '';
19   buildPhase = ''
20     make -f Makefile.sharedlibrary
21     make -f Makefile.cmdline
22   '';
23   installPhase = ''
24     install -d $out/bin
25     install -m755 duk $out/bin/
26     install -d $out/lib
27     install -d $out/include
28     make -f Makefile.sharedlibrary install INSTALL_PREFIX=$out
29   '';
30   enableParallelBuilding = true;
32   meta = with lib; {
33     description = "An embeddable Javascript engine, with a focus on portability and compact footprint";
34     homepage = "https://duktape.org/";
35     downloadPage = "https://duktape.org/download.html";
36     license = licenses.mit;
37     maintainers = [ maintainers.fgaz ];
38     platforms = platforms.all;
39   };