quickjs-ng: adopt and refactor

- strictDeps
- pushd/popd instead of subshell
- adopt by AndersonTorres
This commit is contained in:
Anderson Torres 2024-09-27 10:16:46 -03:00
parent 726d02f644
commit e100ad4eb7

View File

@ -1,9 +1,10 @@
{ lib
, stdenv
, cmake
, fetchFromGitHub
, testers
, texinfo
{
lib,
cmake,
fetchFromGitHub,
stdenv,
testers,
texinfo,
}:
stdenv.mkDerivation (finalAttrs: {
@ -17,7 +18,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-gULpJhOOmhzq2Ydl4soNBiiONtdt2T4sgcSqIBCo3SM=";
};
outputs = [ "bin" "out" "dev" "doc" "info" ];
outputs = [
"out"
"bin"
"dev"
"doc"
"info"
];
nativeBuildInputs = [
cmake
@ -25,18 +32,28 @@ stdenv.mkDerivation (finalAttrs: {
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "BUILD_STATIC_QJS_EXE" stdenv.hostPlatform.isStatic)
];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
"-Wno-error=stringop-overflow"
]);
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
"-Wno-error=stringop-overflow"
]
);
strictDeps = true;
postBuild = ''
pushd ../doc
makeinfo *texi
popd
'';
postInstall = ''
(cd ../doc
makeinfo --output quickjs.info quickjs.texi
install -Dt $info/share/info/ quickjs.info)
pushd ../doc
install -Dm644 -t ''${!outputInfo}/share/info *info
popd
'';
passthru.tests = {
@ -46,12 +63,12 @@ stdenv.mkDerivation (finalAttrs: {
};
};
meta = with lib; {
description = "Mighty JavaScript engine";
meta = {
homepage = "https://github.com/quickjs-ng/quickjs";
license = licenses.mit;
maintainers = [ ];
platforms = platforms.all;
description = "Mighty JavaScript engine";
license = lib.licenses.mit;
mainProgram = "qjs";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.all;
};
})