Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nix/fasm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ buildPythonPackage rec {
hash = "sha256-oC6vSpI9u8gEA2C85k00WdXzpH5GxeqtfNqqMduW5Jg=";
};

patches = map fetchPatchFromAur [
patches = [
./textx-default.patch
] ++ (map fetchPatchFromAur [
{
name = "0001-cmake-install-parse_fasm.so.patch";
sha256 = "sha256-ZEq/hTXjCIkVkWhgCYWtRe3wftdYMNwhNC4KNnBI2Dc=";
Expand Down Expand Up @@ -70,7 +72,7 @@ buildPythonPackage rec {
name = "0009-Use-cmake-directly-instead-of-letting-setup.py-try-t.patch";
sha256 = "sha256-/Ay+XjTE7MPcQg5yeo7zuKE2T/tE/P1sIMxgRYeSWNI=";
}
];
]);


nativeBuildInputs = [
Expand Down
32 changes: 32 additions & 0 deletions nix/fasm/textx-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/fasm/parser/__init__.py b/fasm/parser/__init__.py
index edd02e4..9d188e0 100644
--- a/fasm/parser/__init__.py
+++ b/fasm/parser/__init__.py
@@ -22,25 +22,8 @@ from warnings import warn
available = []
""" List of parser submodules available. Strings should match module names. """

-try:
- from fasm.parser.antlr import \
- parse_fasm_filename, parse_fasm_string, implementation
- available.append('antlr')
-except ImportError as e:
- warn(
- """Unable to import fast Antlr4 parser implementation.
- ImportError: {}
-
- Falling back to the much slower pure Python textX based parser
- implementation.
-
- Getting the faster antlr parser can normally be done by installing the
- required dependencies and then reinstalling the fasm package with:
- pip uninstall
- pip install -v fasm
-""".format(e), RuntimeWarning)
- from fasm.parser.textx import \
- parse_fasm_filename, parse_fasm_string, implementation
+from fasm.parser.textx import \
+ parse_fasm_filename, parse_fasm_string, implementation

# The textx parser is available as a fallback.
available.append('textx')