Skip to content

Commit ec5347f

Browse files
authored
Merge pull request #297 from stweil/python
Add new macro PYTHON_VERSION
2 parents ceef6cf + f6de542 commit ec5347f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ BIN = $(VIRTUAL_ENV)/bin
3131
SHARE = $(VIRTUAL_ENV)/share
3232
ACTIVATE_VENV = $(VIRTUAL_ENV)/bin/activate
3333

34+
# Get Python major and minor versions for some conditional rules.
35+
PYTHON_VERSION := $(shell $(PYTHON) -c 'import sys; print("%u.%u" % (sys.version_info.major, sys.version_info.minor))')
36+
3437
define SEMGIT
3538
$(if $(shell sem --version 2>/dev/null),sem --will-cite --fg --id ocrd_all_git,$(error cannot find package GNU parallel))
3639
endef
@@ -53,7 +56,13 @@ export PKG_CONFIG_PATH
5356
OCRD_EXECUTABLES = $(BIN)/ocrd # add more CLIs below
5457
CUSTOM_DEPS = unzip wget python3-venv parallel git less # add more packages for deps-ubuntu below (or modules as preqrequisites)
5558

56-
DISABLED_MODULES ?= cor-asv-fst opencv-python ocrd_ocropy
59+
DEFAULT_DISABLED_MODULES = cor-asv-fst opencv-python ocrd_ocropy
60+
ifeq ($(PYTHON_VERSION),3.10)
61+
# Python 3.10.x does not work with current kraken.
62+
DEFAULT_DISABLED_MODULES += ocrd_kraken
63+
endif
64+
DISABLED_MODULES ?= $(DEFAULT_DISABLED_MODULES)
65+
5766
# Default to all submodules, but allow overriding by user
5867
# (and treat the empty value as if it was unset)
5968
# opencv-python is only needed for aarch64-linux-gnu and other less common platforms,

0 commit comments

Comments
 (0)