Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#43254 closed defect (fixed)

gnucash: +python27 variant broken

Reported by: mf2k (Frank Schima) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 2.2.99
Keywords: Cc: nbenm, g5pw (Aljaž Srebrnič), david.spreen+macports@…
Port: gnucash

Description

I'm running OS X 10.9.2. Xcode 5.1.

I see the following configure error trying to build gnu cash +python27:

:info:configure checking for Python include path... -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
:info:configure checking for Python library path... -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib -lpython2.7
:info:configure checking for Python site-packages path... /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
:info:configure checking python extra libraries... -ldl  -framework CoreFoundation
:info:configure checking python extra linking flags... -u _PyMac_Error Python.framework/Versions/2.7/Python
:info:configure checking consistency of all components of python development environment... no
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_mports_trunk_dports_gnome_gnucash/gnucash/work/gnucash-2.6.2':
:info:configure configure: error: 
:info:configure   Could not link test program to Python. Maybe the main Python library has been
:info:configure   installed in some non-standard library path. If so, pass it to configure,
:info:configure   via the LDFLAGS environment variable.
:info:configure   Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
:info:configure   ============================================================================
:info:configure    ERROR!
:info:configure    You probably have to install the development version of the Python package
:info:configure    for your distribution.  The exact name of this package varies among them.
:info:configure   ============================================================================
:info:configure 
:info:configure See `config.log' for more details

Attachments (7)

main.log (32.4 KB) - added by mf2k (Frank Schima) 10 years ago.
config.log (110.0 KB) - added by mf2k (Frank Schima) 10 years ago.
patch-configure-python2.7.diff (1.0 KB) - added by matt@… 9 years ago.
My approach for working around the configure errors on OS X
gnucash-python.diff (2.1 KB) - added by g5pw (Aljaž Srebrnič) 8 years ago.
Portfile patch for python variant
config.2.log (85.4 KB) - added by nbenm 8 years ago.
gnucash-python27.diff (1.5 KB) - added by david.spreen+macports@… 8 years ago.
Re-enable autogen but fix PYTHON_PREFIX and PYTHON_EXEC_PREFIX
gnucash-python27.2.diff (1.5 KB) - added by david.spreen+macports@… 8 years ago.
Execute python2.7-config during configure, not in Portfile

Download all attachments as: .zip

Change History (28)

Changed 10 years ago by mf2k (Frank Schima)

Attachment: main.log added

Changed 10 years ago by mf2k (Frank Schima)

Attachment: config.log added

comment:1 Changed 10 years ago by drkp (Dan Ports)

Status: newassigned
Summary: gnucash +python27 configure failuregnucash: +python27 variant broken

Yes, this is broken at the moment. I meant to leave it commented out until fixed, but looks like I accidentally uncommented it in r118521. Disabled again for now in r118835...

Last edited 10 years ago by drkp (Dan Ports) (previous) (diff)

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Thanks! That helps those of us with +python27 in their variants.conf file.

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Thanks! That helps those of us with +python27 in their variants.conf file.

comment:3 Changed 10 years ago by drkp (Dan Ports)

Yes - I figured that group was larger than the set of people who actually use the gnucash python bindings. :-)

Changed 9 years ago by matt@…

My approach for working around the configure errors on OS X

comment:4 Changed 9 years ago by matt@…

I attached my (hacky) workaround for this issue. I noticed in other discussions about this issue that Python maintainers didn't particularly like the fact that distutils.sysconfig was being used to obtain these values, and that if they could they'd make sure people used python-config instead (Here's the Python documentation change supporting this methodology http://bugs.python.org/issue18164). Since the port already requires python27, python27-config should be available with all the correct information, so I opted to use that instead. I imagine this is actually something that should be fixed upstream with the Python autoconf macros or Gnucash's use of said macros, so if anyone has a strong opinion there, I'd be interested to know where that falls. If someone wants to work with me on getting this submitted, I'm available.

Last edited 9 years ago by matt@… (previous) (diff)

comment:5 Changed 9 years ago by rmonv@…

I can confirm that the patch that Matt added works, though it needs to be updated to work with the latest gnucash version.

comment:6 Changed 9 years ago by reubano (Reuben Cummings)

What's the status on this now?

comment:7 Changed 8 years ago by nbenm

Is there a chance this will work one day ?

comment:8 Changed 8 years ago by nbenm

Cc: nb@… added

Cc Me!

comment:9 Changed 8 years ago by g5pw (Aljaž Srebrnič)

Cc: g5pw@… added

Please note this patch does not work correctly: it installs python files in ${prefix}/lib/python2.7/..., which is not in the default PYTHONPATH. It should install in ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/...

I'll try to look into it.

Changed 8 years ago by g5pw (Aljaž Srebrnič)

Attachment: gnucash-python.diff added

Portfile patch for python variant

comment:10 Changed 8 years ago by g5pw (Aljaž Srebrnič)

It took me some time, but I finally managed to find the best way. I had to strike out the autogen stuff, is it still needed anyway?

comment:11 Changed 8 years ago by mf2k (Frank Schima)

Thank you for looking into it! I never needed python scripting. I just wanted it to build. But if it is working, you might as well put the variant back in place.

comment:12 in reply to:  10 Changed 8 years ago by nbenm

Replying to g5pw@…:

It took me some time, but I finally managed to find the best way. I had to strike out the autogen stuff, is it still needed anyway?

Hello,

Thes are good news. I personally need it. I use a workaround, but I'm not satisfied by working this way. I've tried to compile gnucash-2.6.13b but I have an error at "./configure"

checking ltdl.h usability... no
checking ltdl.h presence... no
checking for ltdl.h... no
configure: error: ltdl.h not found. Perhaps you need to install
the libtool(-ltdl) development package?

The problem is that the package is installed

port installed|grep -i libtool
  libtool @2.4.6_2 (active

and ltdl.h is present (numerous times, probably because of my old compilations)

/Library/Frameworks/Mono.framework/Versions/3.2.3/share/libtool/libltdl/ltdl.h
/opt/local/include/ltdl.h
/opt/local/share/libtool/ltdl.h

Any idea ? I really want to see this issue solved

comment:13 Changed 8 years ago by g5pw (Aljaž Srebrnič)

Hmm... the only difference I see is that I don't have the Mono framework installed, but it's strange that it doesn't find ltdl.h in /opt/local/include. Would you mind attaching the config.log file?

Changed 8 years ago by nbenm

Attachment: config.2.log added

comment:14 in reply to:  13 Changed 8 years ago by nbenm

Replying to g5pw@…:

Hmm... the only difference I see is that I don't have the Mono framework installed, but it's strange that it doesn't find ltdl.h in /opt/local/include. Would you mind attaching the config.log file?

My message has disappeared. I was saying I haven't my MacBook Pro with me, I'm traveling. I tried to compile gnucash on a MacBook Air I have with me. Same problem. I attach config.log as you asked me. I'm not sure it's the same problem as on my MacBook Pro, but it looks like.

Changed 8 years ago by david.spreen+macports@…

Attachment: gnucash-python27.diff added

Re-enable autogen but fix PYTHON_PREFIX and PYTHON_EXEC_PREFIX

comment:15 Changed 8 years ago by david.spreen+macports@…

I adapted g5pw's patch to re-enable the autogen.sh stuff just in case that fixes your issue. Basically, I now run autogen.sh in the post-patch block and then manually replace ${PYTHON_PREFIX} and ${PYTHON_EXEC_PREFIX}. Would you be willing to see if this fixes your issues? I know it's hacky, but it does build fine here and puts the python stuff in the right place.

Last edited 8 years ago by david.spreen+macports@… (previous) (diff)

comment:16 Changed 8 years ago by david.spreen+macports@…

Cc: david.spreen+macports@… added

Cc Me!

Changed 8 years ago by david.spreen+macports@…

Attachment: gnucash-python27.2.diff added

Execute python2.7-config during configure, not in Portfile

comment:17 Changed 8 years ago by david.spreen+macports@…

One more fix. g5pw's patch wouldn't build if python27-config wasn't installed before the Portfile is processed. We can rely on python2.7-config being available after dependencies are processed but not before, so I changed the Portfile to pass python27-config... to the ./configure process instead of executing it in the Portfile. Not gnucash builds with python bindings even if it is the first port to ever be installed.

comment:18 in reply to:  17 Changed 8 years ago by g5pw (Aljaž Srebrnič)

Replying to david.spreen+macports@…:

One more fix. g5pw's patch wouldn't build if python27-config wasn't installed before the Portfile is processed. We can rely on python2.7-config being available after dependencies are processed but not before, so I changed the Portfile to pass python27-config... to the ./configure process instead of executing it in the Portfile. Not gnucash builds with python bindings even if it is the first port to ever be installed.

Aha, good catch david! The patch looks good to me. Should I commit it, dports?

comment:19 Changed 7 years ago by drkp (Dan Ports)

Resolution: fixed
Status: assignedclosed

This is great, thanks!

Committed in r153356.

comment:20 Changed 7 years ago by nbenm

Hi,

I've done a fresh Macports install, and added gnu cash with python27. I have then run a python script that updates funds. Everything worked fine. Thank you very much, I have been waiting for this during two years.

Noury

Note: See TracTickets for help on using tickets.