about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2023-12-26 16:04:20 -0500
committerGitHub <noreply@github.com>2023-12-26 16:04:20 -0500
commitd9c468dc0ac0229a59c51316e782062ad9cf5098 (patch)
tree8d7035b8a5e7366efdf945ed6eb30e94a0c93c37 /pkgs/by-name
parent126fcb5e9953472505a40b23b377f9e3d51635e9 (diff)
parente7ab3d878c3ec321446d7d248cc56632e6792e1d (diff)
Merge pull request #276651 from marsam/add-quickjs-ng
quickjs-ng: init at 0.3.0
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/qu/quickjs-ng/package.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/by-name/qu/quickjs-ng/package.nix b/pkgs/by-name/qu/quickjs-ng/package.nix
new file mode 100644
index 0000000000000..13e728b4b66b3
--- /dev/null
+++ b/pkgs/by-name/qu/quickjs-ng/package.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, cmake
+, fetchFromGitHub
+, testers
+, texinfo
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "quickjs-ng";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "quickjs-ng";
+    repo = "quickjs";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-4nFc9xdxrfRWeOY9VNQAI4Ph7G1GMnw06XZiO6xA72o=";
+  };
+
+  outputs = [ "bin" "out" "dev" "doc" "info" ];
+
+  nativeBuildInputs = [
+    cmake
+    texinfo
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    (lib.cmakeBool "BUILD_STATIC_QJS_EXE" stdenv.hostPlatform.isStatic)
+  ];
+
+  postInstall = ''
+    (cd ../doc
+     makeinfo --output quickjs.info quickjs.texi
+     install -Dt $info/share/info/ quickjs.info)
+  '';
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = finalAttrs.finalPackage;
+      command = "qjs --help || true";
+    };
+  };
+
+  meta = with lib; {
+    description = "A mighty JavaScript engine";
+    homepage = "https://github.com/quickjs-ng/quickjs";
+    license = licenses.mit;
+    maintainers = with maintainers; [ marsam ];
+    platforms = platforms.all;
+    mainProgram = "qjs";
+  };
+})