Skip to content

Commit

Permalink
aider: 0.48.1 -> 0.49.1
Browse files Browse the repository at this point in the history
  • Loading branch information
elohmeier committed Aug 11, 2024
1 parent 55cafbe commit f872246
Showing 1 changed file with 10 additions and 120 deletions.
130 changes: 10 additions & 120 deletions packages/aider/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,124 +2,24 @@
lib,
python3,
fetchFromGitHub,
universal-ctags,
portaudio,
tree-sitter-grammars,
writeText,
}:
let
py3 = python3.override {
packageOverrides = self: super: {
grep-ast = self.buildPythonPackage rec {
pname = "grep_ast";
version = "0.3.2";
src = super.fetchPypi {
inherit pname version;
hash = "sha256-1TvH0l3++v53ZD/sGJqzjjy9g51UbAcKlQ6+2tgu4WQ=";
};
propagatedBuildInputs = with self; [
tree-sitter-languages
pathspec
];
};

tree-sitter-languages = self.buildPythonPackage rec {
pname = "tree-sitter-languages";
version = "1.10.2";
pyproject = true;
jaraco-path = super.jaraco-path.overridePythonAttrs (oldAttrs: {
postPatch = ''
substituteInPlace setup.cfg \
--replace-fail 'pyobjc; platform_system == "Darwin" and platform_python_implementation != "PyPy"' ""
'';

src = fetchFromGitHub {
owner = "grantjenks";
repo = "py-tree-sitter-languages";
rev = "refs/tags/v${version}";
hash = "sha256-AuPK15xtLiQx6N2OATVJFecsL8k3pOagrWu1GascbwM=";
};

nativeBuildInputs = with self; [
cython
setuptools
];

propagatedBuildInputs = with self; [ tree-sitter ];

pythonImportsCheck = [ "tree_sitter_languages" ];

# see upstream https://github.com/grantjenks/py-tree-sitter-languages/blob/main/build.py
preBuild =
let
grammar-sql = fetchFromGitHub {
owner = "DerekStride";
repo = "tree-sitter-sql";
rev = "89fd00d0aff3bc9985ac37caf362ec4fd9b2ba1d"; # 2024-06-07
hash = "sha256-QTKggsvVWhszlcYS/WOPkykUyTDgwV1yVJ7jADA/5SM=";
};

script = writeText "build.py" ''
from tree_sitter import Language
Language.build_library('tree_sitter_languages/languages.so', [
'${tree-sitter-grammars.tree-sitter-bash.src}',
'${tree-sitter-grammars.tree-sitter-c.src}',
'${tree-sitter-grammars.tree-sitter-c-sharp.src}',
'${tree-sitter-grammars.tree-sitter-commonlisp.src}',
'${tree-sitter-grammars.tree-sitter-cpp.src}',
'${tree-sitter-grammars.tree-sitter-css.src}',
'${tree-sitter-grammars.tree-sitter-dockerfile.src}',
'${tree-sitter-grammars.tree-sitter-dot.src}',
'${tree-sitter-grammars.tree-sitter-elisp.src}',
'${tree-sitter-grammars.tree-sitter-elixir.src}',
'${tree-sitter-grammars.tree-sitter-elm.src}',
'${tree-sitter-grammars.tree-sitter-embedded-template.src}',
'${tree-sitter-grammars.tree-sitter-erlang.src}',
'${tree-sitter-grammars.tree-sitter-fortran.src}',
'${tree-sitter-grammars.tree-sitter-go.src}',
'${tree-sitter-grammars.tree-sitter-gomod.src}',
'${tree-sitter-grammars.tree-sitter-haskell.src}',
'${tree-sitter-grammars.tree-sitter-hcl.src}',
'${tree-sitter-grammars.tree-sitter-html.src}',
'${tree-sitter-grammars.tree-sitter-java.src}',
'${tree-sitter-grammars.tree-sitter-javascript.src}',
'${tree-sitter-grammars.tree-sitter-jsdoc.src}',
'${tree-sitter-grammars.tree-sitter-json.src}',
'${tree-sitter-grammars.tree-sitter-julia.src}',
'${tree-sitter-grammars.tree-sitter-kotlin.src}',
'${tree-sitter-grammars.tree-sitter-lua.src}',
'${tree-sitter-grammars.tree-sitter-make.src}',
'${tree-sitter-grammars.tree-sitter-markdown.src}/tree-sitter-markdown',
'${tree-sitter-grammars.tree-sitter-ocaml.src}/grammars/ocaml',
'${tree-sitter-grammars.tree-sitter-perl.src}',
'${tree-sitter-grammars.tree-sitter-php.src}/php',
'${tree-sitter-grammars.tree-sitter-python.src}',
'${tree-sitter-grammars.tree-sitter-ql.src}',
'${tree-sitter-grammars.tree-sitter-r.src}',
'${tree-sitter-grammars.tree-sitter-regex.src}',
'${tree-sitter-grammars.tree-sitter-rst.src}',
'${tree-sitter-grammars.tree-sitter-ruby.src}',
'${tree-sitter-grammars.tree-sitter-rust.src}',
'${tree-sitter-grammars.tree-sitter-scala.src}',
'${grammar-sql}',
'${tree-sitter-grammars.tree-sitter-toml.src}',
'${tree-sitter-grammars.tree-sitter-tsq.src}',
'${tree-sitter-grammars.tree-sitter-typescript.src}/typescript',
'${tree-sitter-grammars.tree-sitter-typescript.src}/tsx',
'${tree-sitter-grammars.tree-sitter-yaml.src}',
])
'';
in
''
python3 ${script}
'';

meta = with lib; {
description = "Module for all tree sitter languages";
homepage = "https://github.com/grantjenks/py-tree-sitter-languages";
license = licenses.asl20;
maintainers = with maintainers; [ fab ];
};
};
doCheck = false;
});
};
};

version = "0.48.1";
version = "0.49.1";
in
py3.pkgs.buildPythonApplication rec {
pname = "aider";
Expand All @@ -130,16 +30,9 @@ py3.pkgs.buildPythonApplication rec {
owner = "paul-gauthier";
repo = "aider";
rev = "v${version}";
hash = "sha256-o/AW1Gisq6azZmpL6B1taAFVZZRkWZywSNXc1p4abZs=";
hash = "sha256-E/Ih1IWwY4J1aPHOJJlNkj7ItQfWDUtfpnopIP2iAWg=";
};

postPatch = ''
rm aider/queries/tree-sitter-javascript-tags.scm # broken
substituteInPlace aider/repomap.py \
--replace '"ctags"' '"${universal-ctags}/bin/ctags"'
'';

propagatedBuildInputs =
with py3.pkgs;
[
Expand Down Expand Up @@ -188,10 +81,7 @@ py3.pkgs.buildPythonApplication rec {
wcwidth
yarl
]
++ [
portaudio
universal-ctags
];
++ [ portaudio ];

checkInputs = with py3.pkgs; [ zipp ];

Expand Down

0 comments on commit f872246

Please sign in to comment.