diff --git a/make/projects.mk b/make/projects.mk index 8caa720a..1c3e2cc8 100644 --- a/make/projects.mk +++ b/make/projects.mk @@ -14,7 +14,7 @@ endif MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/scripts $(MODDIR)/bin)) # -- Query the build system about other projects: -PYTHON ?= /usr/bin/python +PYTHON ?= /usr/bin/python2 proj_query_cmd = $(PYTHON) $(MOD_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS) proj_query = $(shell $(proj_query_cmd) $(1)) proj_dir = $(call proj_query,proj-dir $(1)) diff --git a/make/py-defs.mk b/make/py-defs.mk index bad75455..894a919d 100644 --- a/make/py-defs.mk +++ b/make/py-defs.mk @@ -1,11 +1,11 @@ ENV_PYTHONPATH := $(PYTHONPATH) -PYTHON ?= python +PYTHON ?= python2 #PYTHON = python3 ifneq ($(DEVELOPMENT),true) PY_SITE_PACKAGES_PATH = $(shell $(PYTHON) -c "import site; print site.getsitepackages()[0]") else - PY_SITE_PACKAGES_PATH = $(PREFIX)/python/site-packages + PY_SITE_PACKAGES_PATH = $(PREFIX)/python2/site-packages endif PY_PREREQ_BUILD ?= $(shell $(proj_query_cmd) pkg-requires --subsections jw -d ' ' -p --no-version build $(PROJECT)) diff --git a/make/py-mod.mk b/make/py-mod.mk index a31eeb94..7d0054a8 100644 --- a/make/py-mod.mk +++ b/make/py-mod.mk @@ -28,7 +28,7 @@ install-reg.done: install-dirs.done $(PY_INSTALLED_REG) touch $@ %.pyc: %.py - python -c "import py_compile; py_compile.compile(\"$<\")" + python2 -c "import py_compile; py_compile.compile(\"$<\")" $(PY_INSTALL_DIR)/%.py: %.py $(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@ diff --git a/make/py-run.mk b/make/py-run.mk index 853f5272..c7d1b3c9 100644 --- a/make/py-run.mk +++ b/make/py-run.mk @@ -12,5 +12,5 @@ clean: distclean: run: - /usr/bin/python $(EXE) $(EXE_ARGS) + /usr/bin/python2 $(EXE) $(EXE_ARGS) diff --git a/make/python-cli.mk b/make/python-cli.mk index bdf7d2ba..ac19ed18 100644 --- a/make/python-cli.mk +++ b/make/python-cli.mk @@ -9,7 +9,7 @@ clean: distclean: run: - python -m $(shell echo $(patsubst %.py,%,$(EXE)) | sed 's%^\./%%; s%/%.%g') $(EXE_ARGS) + python2 -m $(shell echo $(patsubst %.py,%,$(EXE)) | sed 's%^\./%%; s%/%.%g') $(EXE_ARGS) pyc.clean: find . -name '*.pyc' -print0 | xargs -r -0 $(RM) -f diff --git a/make/scripts-targets.mk b/make/scripts-targets.mk index e078726d..dd618988 100644 --- a/make/scripts-targets.mk +++ b/make/scripts-targets.mk @@ -11,7 +11,7 @@ endif HOME_BIN_EXE_SH = $(addprefix $(HOME)/bin/, $(notdir $(EXE_SH))) $(HOME)/bin/%.py: %.py - echo -e "#!/bin/bash\nexec /usr/bin/python $(shell $(PWD))/$<" '"$$@"' > $@.tmp + echo -e "#!/bin/bash\nexec /usr/bin/python2 $(shell $(PWD))/$<" '"$$@"' > $@.tmp chmod 755 $@.tmp mv $@.tmp $@ diff --git a/make/swig.mk b/make/swig.mk index cfef22a2..310d1023 100644 --- a/make/swig.mk +++ b/make/swig.mk @@ -45,7 +45,7 @@ else ifeq ($(SWIG_TARGET),android) else ifeq ($(SWIG_TARGET),python) - PYTHON_VERSION ?= $(basename $(lastword $(shell python --version 2>&1))) + PYTHON_VERSION ?= $(basename $(lastword $(shell python2 --version 2>&1))) PYTHON_MAJOR_VERSION ?= $(basename $(PYTHON_VERSION)) PYTHON_MINOR_VERSION ?= $(patsubst .%,%,$(suffix $(PYTHON_VERSION))) @@ -60,15 +60,15 @@ else ifeq ($(SWIG_TARGET),python) SWIG_GENERATED_EXTRA += $(SWIG_PY_MODULE_PYC) SWIG_INSTALLED_EXTRA += $(SWIG_MODULE_TARGET_DIR)/$(SWIG_PY_MODULE_PYC) - INCLUDE += $(shell pkg-config --cflags python) - BUILD_LDFLAGS += $(shell pkg-config --libs python) $(shell php-config --ldflags --libs) + INCLUDE += $(shell pkg-config --cflags python2) + BUILD_LDFLAGS += $(shell pkg-config --libs python2) $(shell php-config --ldflags --libs) INSTALL_LIBDIR = $(SWIG_MODULE_TARGET_DIR) all: %.pyc: %.py - python -m py_compile $< + python2 -m py_compile $< else diff --git a/make/topdir.mk b/make/topdir.mk index 2cad212d..4f0f2abd 100644 --- a/make/topdir.mk +++ b/make/topdir.mk @@ -131,7 +131,7 @@ git-update-project-description: ssh git.jannet.de "/opt/jw-build/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(RPM_PROJECT)" projects-%: - python $(MOD_SCRIPT_DIR)/build.py $* $(RPM_PROJECT) + python2 $(MOD_SCRIPT_DIR)/build.py $* $(RPM_PROJECT) install-deps-devel: sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//") @@ -156,7 +156,7 @@ prefix.done: touch $@ echo-prereq-build: - @python $(MOD_SCRIPT_DIR)/projects.py --topdir . $(PROJECTS_PY_EXTRA_ARGS) requires-pkg $(RPM_PROJECT) + @python2 $(MOD_SCRIPT_DIR)/projects.py --topdir . $(PROJECTS_PY_EXTRA_ARGS) requires-pkg $(RPM_PROJECT) list-files echo-files: @$(LIST_VCS_FILES) -f diff --git a/scripts/build.py b/scripts/build.py index 3e1f5d01..60dda4ba 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/python2 -u # -*- coding: iso-8859-15 -*- from __future__ import print_function @@ -188,7 +188,7 @@ exclude=args.exclude.split() proj_base=args.base target=args.target -projects_py="/usr/bin/python " + my_dir + "/projects.py --prefix " + proj_base + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "") +projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + proj_base + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "") env_exclude=os.getenv('BUILD_EXCLUDE', '') if len(env_exclude): diff --git a/scripts/pkg-manager.sh b/scripts/pkg-manager.sh index d42e089e..9f138124 100644 --- a/scripts/pkg-manager.sh +++ b/scripts/pkg-manager.sh @@ -60,6 +60,13 @@ cmd_install() } eval run sudo $env -S apt-get $global_opts install "$@" ;; + arch) + [ "$non_interactive" = 1 ] && { + global_opts="$global_opts --noconfirm" + env="$env DEBIAN_FRONTEND=noninteractive" + } + eval run sudo $env -S pacman $global_opts -S "$@" + ;; *) fatal "Tried to install on unsupported platform \"$ID\"" ;; diff --git a/scripts/projects.py b/scripts/projects.py index c808f7f1..121eb943 100644 --- a/scripts/projects.py +++ b/scripts/projects.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/python2 -u from __future__ import print_function import sys