Create a from-source Nix package for oils-for-nix

This commit is contained in:
Nettika 2026-02-14 01:42:45 -08:00
commit 5f14fab320
No known key found for this signature in database
GPG key ID: C357EE70D5027BCC
5 changed files with 194 additions and 0 deletions

40
mypy-0.780.nix Normal file
View file

@ -0,0 +1,40 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonPackage rec {
pname = "mypy";
# This is the version oils-for-unix uses for mycpp Python-to-C++ translation
version = "0.780";
src = fetchFromGitHub {
owner = "python";
repo = "mypy";
rev = "v${version}";
# Fetch submodules to include typeshed (required for type stubs)
fetchSubmodules = true;
hash = "sha256-czwCx6ZjCu3CrVmbI6NbstzWM0GvuPTWJiiUhXSznu4=";
};
# Do not use mypyc to compile.
# Rather, build interpreted so mycpp can extend its classes.
preBuild = ''
export MYPY_USE_MYPYC=0
'';
# Skip tests to speed up build
doCheck = false;
dependencies = with python3.pkgs; [
mypy-extensions
typing-extensions
typed-ast
];
# Ensure we're not pulling in a compiled version
pythonImportsCheck = [ "mypy" ];
meta.license = lib.licenses.mit;
}