Files
nixpkgs/pkgs/development/python-modules/quickjs/default.nix
Philip Taron 2074fa159b python3Packages.quickjs: init at 1.19.4
Due to the new quickjs release on 2025-04-26, there's a minor patch needed to fix things up.
2025-05-31 20:22:56 -07:00

59 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
poetry-core,
pytestCheckHook,
pkgs,
}:
let
inherit (pkgs) quickjs srcOnly;
in
buildPythonPackage rec {
pname = "quickjs";
version = "1.19.4";
pyproject = true;
src = fetchFromGitHub {
owner = "PetterS";
repo = "quickjs";
tag = version;
hash = "sha256-nLloXJWOuaK/enZfwXJI94IcsAMYrkBtG4i3gmxuhfw=";
};
patches = [ ./0001-Update-for-QuickJS-2025-04-26-release.patch ];
# Upstream uses Git submodules; let's de-vendor and use Nix, so that we gain security fixes like
# https://github.com/NixOS/nixpkgs/pull/407469
prePatch = ''
rmdir upstream-quickjs
ln -s ${srcOnly quickjs} upstream-quickjs
'';
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail poetry>=1.5.0 poetry \
--replace-fail poetry poetry-core \
--replace-fail 'version = "0"' 'version = "${version}"'
'';
build-system = [
poetry-core
setuptools
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "quickjs" ];
meta = {
description = "Python wrapper around the quickjs C library";
homepage = "https://github.com/PetterS/quickjs";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ philiptaron ];
};
}