diff --git a/base-okl4/Makefile b/base-okl4/Makefile index 2747f074a0..40ea4d0553 100644 --- a/base-okl4/Makefile +++ b/base-okl4/Makefile @@ -12,6 +12,18 @@ OKL4_VERSION = okl4_2.1.1-patch.9 OKL4_ARCHIVE = $(OKL4_VERSION).tar.gz OKL4_URI = http://wiki.ok-labs.com/downloads/release-2.1.1-patch.9/$(OKL4_ARCHIVE) PATCHES = $(shell find patches -name *.patch) +SHELL = bash + +# +# Determine python version to use for OKL4's elfweaver +# +PYTHON2 := $(notdir $(lastword $(shell which python2 python2.{4,5,6,7,8}))) +ifeq ($(PYTHON2),) +prepare: python_not_installed +python_not_installed: + $(ECHO) "Error: OKL4 needs Python 2 to be installed" + @false; +endif # # Print help information by default @@ -39,6 +51,7 @@ $(CONTRIB_DIR): $(DOWNLOAD_DIR)/$(OKL4_ARCHIVE) $(VERBOSE)mv $(OKL4_VERSION) $@ $(ECHO) "applying patches to '$(CONTRIB_DIR)/'" $(VERBOSE)for i in $(PATCHES); do patch -d $@ -p1 < $$i; done + $(VERBOSE)sed -i "s/env python/env $(PYTHON2)/" $(CONTRIB_DIR)/tools/pyelf/elfweaver prepare: $(CONTRIB_DIR) diff --git a/base-okl4/patches/elfweaver-python2.patch b/base-okl4/patches/elfweaver-python2.patch deleted file mode 100644 index e8f86492b9..0000000000 --- a/base-okl4/patches/elfweaver-python2.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/tools/pyelf/elfweaver 2012-02-12 15:35:22.347943742 +0100 -+++ b/tools/pyelf/elfweaver 2012-02-12 15:35:26.444610504 +0100 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2 - # - # Copyright (c) 2007 Open Kernel Labs, Inc. (Copyright Holder). - # All rights reserved.