Heuristics for determining python2 for OKL4

This commit is contained in:
Norman Feske 2012-04-16 11:45:58 +02:00
parent 5bf5aa5e32
commit de2723c794
2 changed files with 13 additions and 8 deletions

View File

@ -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)

View File

@ -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.