Lines 24-29
Link Here
|
24 |
*) die "EAPI=${EAPI} is not supported" ;; |
24 |
*) die "EAPI=${EAPI} is not supported" ;; |
25 |
esac |
25 |
esac |
26 |
|
26 |
|
|
|
27 |
# @FUNCTION: waf-utils_waflibdir |
28 |
# @USAGE: [<waf-binary>] |
29 |
# @DESCRIPTION: |
30 |
# Echoes the absolute path to the directory containing the waf-based |
31 |
# project's waflib python module. Ensures that the waflib shipped with a |
32 |
# project is unpacked if it isn't already. This waflib may be safely |
33 |
# patched because waf-lite will not touch the waflib directory if it |
34 |
# already exists. Uses the waf binary specified in WAF_BINARY. |
35 |
# |
36 |
# @EXAMPLE |
37 |
# The simplest case, for a monolithic compilation: |
38 |
# |
39 |
# @CODE |
40 |
# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib" |
41 |
# epatch "${FILESDIR}"/${P}-waf-fix.patch |
42 |
# popd |
43 |
# @CODE |
44 |
# |
45 |
# Note that if you are using the python eclass and installating python |
46 |
# modules, you must either call python_set_active_version or call |
47 |
# waf-utils_waflibdir() from within a function run by |
48 |
# python_execute(). This is because waf uses a different directory for |
49 |
# waflib when using python3 than when using python2. |
50 |
# |
51 |
# @CODE |
52 |
# SUPPORT_PYTHON_ABIS=1 |
53 |
# inherit eutils python waf-utils |
54 |
# |
55 |
# # Always use the waf associated with the current python ABI. |
56 |
# WAF_BINARY=./waf |
57 |
# |
58 |
# src_prepare() { |
59 |
# python_copy_sources |
60 |
# |
61 |
# myprepare() { |
62 |
# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch |
63 |
# |
64 |
# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib" |
65 |
# epatch "${FILESDIR}"/${P}-waf-fix.patch |
66 |
# popd |
67 |
# } |
68 |
# python_execute_function -s myprepare |
69 |
# } |
70 |
# @CODE |
71 |
waf-utils_waflibdir() { |
72 |
debug-print-function ${FUNCNAME} "$@" |
73 |
|
74 |
: ${WAF_BINARY:="${S}/waf"} |
75 |
|
76 |
python -c "import imp, sys; sys.argv[0] = '${WAF_BINARY}'; waflite = imp.load_source('waflite', '${WAF_BINARY}'); print(waflite.find_lib());" \ |
77 |
|| die "Unable to locate or unpack waflib module from the waf script at ${WAF_BINARY}" |
78 |
} |
79 |
|
27 |
# @FUNCTION: waf-utils_src_configure |
80 |
# @FUNCTION: waf-utils_src_configure |
28 |
# @DESCRIPTION: |
81 |
# @DESCRIPTION: |
29 |
# General function for configuring with waf. |
82 |
# General function for configuring with waf. |