From owner-freebsd-python@FreeBSD.ORG Sat Mar 1 14:30:01 2014 Return-Path: Delivered-To: freebsd-python@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90D38521 for ; Sat, 1 Mar 2014 14:30:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9C41C56 for ; Sat, 1 Mar 2014 14:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s21EU13T029156 for ; Sat, 1 Mar 2014 14:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s21EU1kV029155; Sat, 1 Mar 2014 14:30:01 GMT (envelope-from gnats) Date: Sat, 1 Mar 2014 14:30:01 GMT Message-Id: <201403011430.s21EU1kV029155@freefall.freebsd.org> To: freebsd-python@FreeBSD.org Cc: From: Christoph Moench-Tegeder Subject: Re: ports/187174: lang/python27: pkg-static: lstat(/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/readline.so): No such file or directory X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Christoph Moench-Tegeder List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 14:30:01 -0000 The following reply was made to PR ports/187174; it has been noted by GNATS. From: Christoph Moench-Tegeder To: bug-followup@FreeBSD.org, ohartman@zedat.fu-berlin.de, python@freebsd.org, koobs.freebsd@gmail.com Cc: Subject: Re: ports/187174: lang/python27: pkg-static: lstat(/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/readline.so): No such file or directory Date: Sat, 1 Mar 2014 15:20:38 +0100 Hi, the relevant portion of the build log is here: : building 'readline' extension : cc -fPIC -fno-strict-aliasing -O2 -pipe -march=core2 -fno-strict-aliasing -DNDEBUG -I. -IInclude -I./../Include -I/usr/local/include -I/usr/ports/lang/python27/work/Python-2.7.6/Include -I/usr/ports/lang/python27/work/Python-2.7.6/portbld.static -c /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c -o build/temp.freebsd-10.0-RELEASE-amd64-2.7/usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.o : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:914:24: error: use of undeclared identifier 'Function' : rl_startup_hook = (Function *)on_startup_hook; : ^ : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:914:34: error: expected expression : rl_startup_hook = (Function *)on_startup_hook; : ^ : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:916:26: error: use of undeclared identifier 'Function' : rl_pre_input_hook = (Function *)on_pre_input_hook; : ^ : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:916:36: error: expected expression : rl_pre_input_hook = (Function *)on_pre_input_hook; : ^ : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:919:41: error: use of undeclared identifier 'CPPFunction'; did you mean 'PyCFunction'? : rl_attempted_completion_function = (CPPFunction *)flex_complete; : ^ : /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:919:54: error: expected expression : rl_attempted_completion_function = (CPPFunction *)flex_complete; : ^ : 6 errors generated. The "old-style" typedefs (Function, VFunction, CPFunction and CPPFunciton) where removed from readline 6.3. Here's a patch which "works for me" (by using the "new-style" typedefs if available), ready for being used as ports/lang/python27/files/patch-Modules-readline.c . In case some mail system mangles this patch, it's also here: http://burggraben.net/hacks/patch-Modules-readline.c.gz --- Modules/readline.c.orig 2014-03-01 14:59:16.000000000 +0100 +++ Modules/readline.c 2014-03-01 15:04:48.000000000 +0100 @@ -911,12 +911,24 @@ rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); /* Set our hook functions */ +#ifdef _RL_FUNCTION_TYPEDEF + rl_startup_hook = (rl_hook_func_t *)on_startup_hook; +#else rl_startup_hook = (Function *)on_startup_hook; +#endif #ifdef HAVE_RL_PRE_INPUT_HOOK +#ifdef _RL_FUNCTION_TYPEDEF + rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook; +#else rl_pre_input_hook = (Function *)on_pre_input_hook; #endif +#endif /* Set our completion function */ +#ifdef _RL_FUNCTION_TYPEDEF + rl_attempted_completion_function = (rl_completion_func_t *)flex_complete; +#else rl_attempted_completion_function = (CPPFunction *)flex_complete; +#endif /* Set Python word break characters */ completer_word_break_characters = rl_completer_word_break_characters = I haven't checked if this has been fixed upstream (I'll have to check their repo). If not I'll report it there, and in any case I'll report back with a link to the issue in the python tracker and/or repo. In the meantime, please review and test my patch :) I believe this or something very similar should fix the issue in the other python verions (e.g. PR ports/187176). Regards, Christoph -- Spare Space