mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
make, scripts: Now excplicitly calling python2 executable instead of python
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e9aafbdc85
commit
e68d4eb83b
11 changed files with 23 additions and 16 deletions
|
|
@ -14,7 +14,7 @@ endif
|
||||||
MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/scripts $(MODDIR)/bin))
|
MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/scripts $(MODDIR)/bin))
|
||||||
|
|
||||||
# -- Query the build system about other projects:
|
# -- 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_cmd = $(PYTHON) $(MOD_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS)
|
||||||
proj_query = $(shell $(proj_query_cmd) $(1))
|
proj_query = $(shell $(proj_query_cmd) $(1))
|
||||||
proj_dir = $(call proj_query,proj-dir $(1))
|
proj_dir = $(call proj_query,proj-dir $(1))
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
ENV_PYTHONPATH := $(PYTHONPATH)
|
ENV_PYTHONPATH := $(PYTHONPATH)
|
||||||
PYTHON ?= python
|
PYTHON ?= python2
|
||||||
#PYTHON = python3
|
#PYTHON = python3
|
||||||
|
|
||||||
ifneq ($(DEVELOPMENT),true)
|
ifneq ($(DEVELOPMENT),true)
|
||||||
PY_SITE_PACKAGES_PATH = $(shell $(PYTHON) -c "import site; print site.getsitepackages()[0]")
|
PY_SITE_PACKAGES_PATH = $(shell $(PYTHON) -c "import site; print site.getsitepackages()[0]")
|
||||||
else
|
else
|
||||||
PY_SITE_PACKAGES_PATH = $(PREFIX)/python/site-packages
|
PY_SITE_PACKAGES_PATH = $(PREFIX)/python2/site-packages
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PY_PREREQ_BUILD ?= $(shell $(proj_query_cmd) pkg-requires --subsections jw -d ' ' -p --no-version build $(PROJECT))
|
PY_PREREQ_BUILD ?= $(shell $(proj_query_cmd) pkg-requires --subsections jw -d ' ' -p --no-version build $(PROJECT))
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ install-reg.done: install-dirs.done $(PY_INSTALLED_REG)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
%.pyc: %.py
|
%.pyc: %.py
|
||||||
python -c "import py_compile; py_compile.compile(\"$<\")"
|
python2 -c "import py_compile; py_compile.compile(\"$<\")"
|
||||||
|
|
||||||
$(PY_INSTALL_DIR)/%.py: %.py
|
$(PY_INSTALL_DIR)/%.py: %.py
|
||||||
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,5 @@ clean:
|
||||||
distclean:
|
distclean:
|
||||||
|
|
||||||
run:
|
run:
|
||||||
/usr/bin/python $(EXE) $(EXE_ARGS)
|
/usr/bin/python2 $(EXE) $(EXE_ARGS)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ clean:
|
||||||
distclean:
|
distclean:
|
||||||
|
|
||||||
run:
|
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:
|
pyc.clean:
|
||||||
find . -name '*.pyc' -print0 | xargs -r -0 $(RM) -f
|
find . -name '*.pyc' -print0 | xargs -r -0 $(RM) -f
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ endif
|
||||||
HOME_BIN_EXE_SH = $(addprefix $(HOME)/bin/, $(notdir $(EXE_SH)))
|
HOME_BIN_EXE_SH = $(addprefix $(HOME)/bin/, $(notdir $(EXE_SH)))
|
||||||
|
|
||||||
$(HOME)/bin/%.py: %.py
|
$(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
|
chmod 755 $@.tmp
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ else ifeq ($(SWIG_TARGET),android)
|
||||||
|
|
||||||
else ifeq ($(SWIG_TARGET),python)
|
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_MAJOR_VERSION ?= $(basename $(PYTHON_VERSION))
|
||||||
PYTHON_MINOR_VERSION ?= $(patsubst .%,%,$(suffix $(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_GENERATED_EXTRA += $(SWIG_PY_MODULE_PYC)
|
||||||
SWIG_INSTALLED_EXTRA += $(SWIG_MODULE_TARGET_DIR)/$(SWIG_PY_MODULE_PYC)
|
SWIG_INSTALLED_EXTRA += $(SWIG_MODULE_TARGET_DIR)/$(SWIG_PY_MODULE_PYC)
|
||||||
|
|
||||||
INCLUDE += $(shell pkg-config --cflags python)
|
INCLUDE += $(shell pkg-config --cflags python2)
|
||||||
BUILD_LDFLAGS += $(shell pkg-config --libs python) $(shell php-config --ldflags --libs)
|
BUILD_LDFLAGS += $(shell pkg-config --libs python2) $(shell php-config --ldflags --libs)
|
||||||
|
|
||||||
INSTALL_LIBDIR = $(SWIG_MODULE_TARGET_DIR)
|
INSTALL_LIBDIR = $(SWIG_MODULE_TARGET_DIR)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
%.pyc: %.py
|
%.pyc: %.py
|
||||||
python -m py_compile $<
|
python2 -m py_compile $<
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)"
|
ssh git.jannet.de "/opt/jw-build/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(RPM_PROJECT)"
|
||||||
|
|
||||||
projects-%:
|
projects-%:
|
||||||
python $(MOD_SCRIPT_DIR)/build.py $* $(RPM_PROJECT)
|
python2 $(MOD_SCRIPT_DIR)/build.py $* $(RPM_PROJECT)
|
||||||
|
|
||||||
install-deps-devel:
|
install-deps-devel:
|
||||||
sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
||||||
|
|
@ -156,7 +156,7 @@ prefix.done:
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
echo-prereq-build:
|
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-files echo-files:
|
||||||
@$(LIST_VCS_FILES) -f
|
@$(LIST_VCS_FILES) -f
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python -u
|
#!/usr/bin/python2 -u
|
||||||
# -*- coding: iso-8859-15 -*-
|
# -*- coding: iso-8859-15 -*-
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
@ -188,7 +188,7 @@ exclude=args.exclude.split()
|
||||||
proj_base=args.base
|
proj_base=args.base
|
||||||
target=args.target
|
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', '')
|
env_exclude=os.getenv('BUILD_EXCLUDE', '')
|
||||||
if len(env_exclude):
|
if len(env_exclude):
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,13 @@ cmd_install()
|
||||||
}
|
}
|
||||||
eval run sudo $env -S apt-get $global_opts 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\""
|
fatal "Tried to install on unsupported platform \"$ID\""
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python -u
|
#!/usr/bin/python2 -u
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue