From owner-freebsd-python@FreeBSD.ORG Sat Mar 1 14:20:42 2014 Return-Path: Delivered-To: python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 819E2EC; Sat, 1 Mar 2014 14:20:42 +0000 (UTC) Received: from smtp.burggraben.net (base.exwg.net [IPv6:2a01:4f8:140:50a2::2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11A531BE8; Sat, 1 Mar 2014 14:20:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.burggraben.net (Postfix) with ESMTP id 98AFA6003CD; Sat, 1 Mar 2014 15:20:39 +0100 (CET) X-Spam-Scanned: by amavisd-new at exwg.net Received: from smtp.burggraben.net ([127.0.0.1]) by localhost (ns.burggraben.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1XDnRl9wUUaA; Sat, 1 Mar 2014 15:20:38 +0100 (CET) Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7b43:1:6a05:caff:fe01:aae9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "elch.exwg.net", Issuer "Christoph Moench-Tegeder" (verified OK)) by smtp.burggraben.net (Postfix) with ESMTPS; Sat, 1 Mar 2014 15:20:38 +0100 (CET) Received: by elch.exwg.net (Postfix, from userid 1000) id 29E8F301A8; Sat, 1 Mar 2014 15:20:38 +0100 (CET) Date: Sat, 1 Mar 2014 15:20:38 +0100 From: Christoph Moench-Tegeder To: bug-followup@FreeBSD.org, ohartman@zedat.fu-berlin.de, python@freebsd.org, koobs.freebsd@gmail.com 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 Message-ID: <20140301142037.GA89147@elch.exwg.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list 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:20:42 -0000 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