duktape: Add pkgconfig file

This commit is contained in:
Zhaofeng Li 2021-06-14 02:48:15 -07:00 committed by Jonathan Ringer
parent 41fa3118b6
commit f5b2b2f1db
2 changed files with 15 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, validatePkgConfig }:
stdenv.mkDerivation rec {
pname = "duktape";
@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "19szwxzvl2g65fw95ggvb8h0ma5bd9vvnnccn59hwnc4dida1x4n";
};
nativeBuildInputs = [ validatePkgConfig ];
postPatch = ''
substituteInPlace Makefile.sharedlibrary \
--replace 'gcc' '${stdenv.cc.targetPrefix}cc' \
@ -23,9 +25,10 @@ stdenv.mkDerivation rec {
installPhase = ''
install -d $out/bin
install -m755 duk $out/bin/
install -d $out/lib
install -d $out/lib/pkgconfig
install -d $out/include
make -f Makefile.sharedlibrary install INSTALL_PREFIX=$out
substituteAll ${./duktape.pc.in} $out/lib/pkgconfig/duktape.pc
'';
enableParallelBuilding = true;

View file

@ -0,0 +1,10 @@
prefix=@out@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: duktape
Description: An embeddable Javascript engine, with a focus on portability and compact footprint
Version: @version@
Libs: -L${libdir} -lduktape
Cflags: -I${includedir}