Skip to content

Commit 418f340

Browse files
author
Rafael Martins
committed
Add no readline variants
1 parent c999484 commit 418f340

File tree

5 files changed

+50
-13
lines changed

5 files changed

+50
-13
lines changed

abs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# the conda-build parameters to use for disabling --skip-existing
2+
build_parameters:
3+
- "--suppress-variables"
4+
#- "--skip-existing"
5+
- "--error-overlinking"
6+
- "--error-overdepending"
7+
8+
aggregate_check: false
9+
10+
channels:
11+
- norl
12+
13+
upload_without_merge: true

recipe/build_base.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ _common_configure_args+=(--with-tcltk-includes="-I${PREFIX}/include")
254254
_common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl8.6 -ltk8.6")
255255
_common_configure_args+=(--with-platlibdir=lib)
256256

257+
if [[ "${READLINE_MODE}" = readline ]]; then
258+
_common_configure_args+=(--with-readline=readline)
259+
elif [[ "${READLINE_MODE}" = editline ]]; then
260+
_common_configure_args+=(--with-readline=editline)
261+
elif [[ "${READLINE_MODE}" = none ]]; then
262+
_common_configure_args+=(--without-readline)
263+
fi
264+
257265
# Add more optimization flags for the static Python interpreter:
258266
declare -a PROFILE_TASK=()
259267
if [[ ${_OPTIMIZED} == yes ]]; then
@@ -457,7 +465,7 @@ pushd "${PREFIX}"/lib/python${VER}
457465
# Remove osx sysroot as it depends on the build machine
458466
sed -i.bak "s@-isysroot @@g" sysconfigfile
459467
# make sure $CONDA_BUILD_SYSROOT is not empty ...
460-
if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
468+
if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
461469
sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile
462470
fi
463471
# Remove unfilled config option

recipe/conda_build_config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ python:
33
python_impl:
44
- cpython
55
libffi: # [win]
6-
- 3.4 # [win]
6+
- 3.4 # [win]
77
numpy:
88
- 1.21
9+
readline_mode:
10+
- readline
11+
- editline
12+
- none
913
MACOSX_SDK_VERSION: # [osx and x86_64]
1014
- 10.14 # [osx and x86_64]
1115
CONDA_BUILD_SYSROOT: # [osx and x86_64]

recipe/meta.yaml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% set ver2 = '.'.join(version.split('.')[0:2]) %}
55
{% set ver2nd = ''.join(version.split('.')[0:2]) %}
66
{% set ver3nd = ''.join(version.split('.')[0:3]) %}
7-
{% set build_number = "0" %}
7+
{% set build_number = 1 %}
88
{% set channel_targets = ('abc', 'def') %}
99
# this is just for the initial build, to break dependencies with python -> pip -> libpython-static
1010
{% set bootstrap = "false" %}
@@ -39,6 +39,10 @@
3939
{% set py_interp_debug = "no" %}
4040
{% endif %}
4141

42+
{% set rl_string = "" %} # [win or readline_mode == 'readline']
43+
{% set rl_string = "el_" %} # [not win and readline_mode == 'editline']
44+
{% set rl_string = "norl_" %} # [not win and readline_mode == 'none']
45+
4246
package:
4347
name: python-split
4448
version: {{ version }}{{ dev }}
@@ -90,7 +94,8 @@ source:
9094
{% endif %}
9195

9296
build:
93-
number: {{ build_number }}
97+
number: {{ build_number + 100 }} # [win or readline_mode == 'readline']
98+
number: {{ build_number }} # [not(win or readline_mode == 'readline')]
9499

95100
requirements:
96101
build:
@@ -107,7 +112,9 @@ outputs:
107112
script: build_base.sh # [unix]
108113
script: build_base.bat # [win]
109114
build:
110-
number: {{ build_number }}
115+
number: {{ build_number + 200 }} # [win or readline_mode == 'readline']
116+
number: {{ build_number + 100 }} # [not win and readline_mode == 'editline']
117+
number: {{ build_number }} # [not win and readline_mode == 'none']
111118
activate_in_script: true
112119
# Windows has issues updating python if conda is using files itself.
113120
# Copy rather than link.
@@ -128,13 +135,13 @@ outputs:
128135
# - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux]
129136
# - lib/libpython3.dylib # [osx]
130137
# match python.org compiler standard
131-
skip: true # [win and int(float(vc)) < 14]
138+
skip: true # [win and (int(float(vc)) < 14 or readline_mode != 'none')]
132139
{% if 'conda-forge' in channel_targets %}
133140
skip_compile_pyc:
134141
- '*.py' # [build_platform != target_platform]
135142
{% endif %}
136-
string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")]
137-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")]
143+
string: {{ dev_ }}h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")]
144+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")]
138145
{% if 'conda-forge' in channel_targets %}
139146
run_exports:
140147
noarch:
@@ -145,6 +152,7 @@ outputs:
145152
script_env:
146153
- PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }}
147154
- PY_INTERP_DEBUG={{ py_interp_debug }}
155+
- READLINE_MODE={{ readline_mode }}
148156
# Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs
149157
# after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for
150158
# important env. vars.
@@ -192,7 +200,8 @@ outputs:
192200
- xz
193201
- zlib
194202
- openssl
195-
- readline # [not win]
203+
- readline {{ readline }} # [readline_mode == 'readline']
204+
- libedit # [readline_mode == 'editline']
196205
- tk
197206
- ncurses # [unix]
198207
- libffi 3.4
@@ -291,15 +300,17 @@ outputs:
291300
script: build_static.sh # [unix]
292301
script: build_static.bat # [win]
293302
build:
294-
number: {{ build_number }}
303+
number: {{ build_number + 100 }} # [win or readline_mode == 'readline']
304+
number: {{ build_number }} # [not(win or readline_mode == 'readline')]
295305
activate_in_script: true
296306
{% if 'conda-forge' in channel_targets %}
297307
ignore_run_exports:
298308
- python_abi
299-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
309+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
300310
{% else %}
301-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
311+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
302312
{% endif %}
313+
skip: true # [win and readline_mode != 'none']
303314
requirements:
304315
build:
305316
- {{ compiler('c') }}

recipe/run_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@
8282
import fcntl
8383
import grp
8484
import nis
85-
import readline
8685
import resource
8786
import syslog
8887
import termios
8988

89+
if os.environ["READLINE_MODE"] != 'none':
90+
import readline
9091

9192
if not (armv6l or armv7l or ppc64le or osx105 or arm64):
9293
import tkinter

0 commit comments

Comments
 (0)