Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: don't build curses and readline modules for host #390

Merged
merged 1 commit into from
Jun 1, 2016

Conversation

escalade
Copy link
Contributor

@escalade escalade commented May 24, 2016

#301 broke compilation of the curses module for some. We need netbsd-curses:host and a patch to fix this:

/root/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel/Python-2.7.11/Modules/_cursesmodule.c: In function 'PyCursesWindow_EchoChar': /root/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel/Python-2.7.11/Modules/_cursesmodule.c:808:18: error: dereferencing pointer to incomplete type 'WINDOW {aka struct __window}' if (self->win->_flags & _ISPAD)

@lrusak
Copy link
Member

lrusak commented May 24, 2016

You don't need to unpack

just do this

pre_build_target() {
  mkdir -p $PKG_BUILD/.$TARGET_NAME
  cp -RP $PKG_BUILD/* $PKG_BUILD/.$TARGET_NAME
}

pre_build_host() {
  mkdir -p $PKG_BUILD/.$HOST_NAME
  cp -RP $PKG_BUILD/* $PKG_BUILD/.$HOST_NAME
}

@escalade
Copy link
Contributor Author

OK, changed.

escalade referenced this pull request May 24, 2016
Python: build readline and curses modules
@escalade
Copy link
Contributor Author

Removed -fPIC from Python, as it gets added where appropriate already.

@TheUlpio
Copy link
Contributor

@escalade your latest patchset builds flawlessly, no issues with mc, so i'm happy with it. Thank you

@escalade
Copy link
Contributor Author

Thanks for the feedback, I guess this is good to go then. Builds fine both for Generic and RPi.

@escalade
Copy link
Contributor Author

There's one issue left (Assumed value of MB_LEN_MAX wrong): http://pastebin.com/tJcF2TJU

This apparently occurs both on Gentoo and Ubuntu. I can't reproduce on Arch, so this is probably yet another case where the system headers mess things up.

Relevant part of stdlib.h:

{
  /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
     But this would only disturb the namespace.  So we define our own
     version here.  */
#define __STDLIB_MB_LEN_MAX     16
#if defined MB_LEN_MAX && MB_LEN_MAX != __STDLIB_MB_LEN_MAX
# error "Assumed value of MB_LEN_MAX wrong"
#endif
  if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s))
    return __wctomb_chk (__s, __wchar, __bos (__s));
  return __wctomb_alias (__s, __wchar);
}

@escalade
Copy link
Contributor Author

The above issue where MB_LEN_MAX is defined somewhere to something else than 16 is pretty much the same issue that has been worked around in the patch attached to this PR, where WINDOW_HAS_FLAGS gets defined somewhere, when it shouldn't. I'm guessing this is another case of the system headers being used instead of those in the toolchain.

Do we even need to build the readline/ncurses modules for the host? If not, a simple fix might be to keep it disabled only for the host build.

@escalade
Copy link
Contributor Author

As compiling the modules for the host build is problematic, it's better to simply disable them for host. I've tested and it works well. Commits changed, please revise and test.

@escalade escalade changed the title Python: fix curses module build Python: don't build curses and readline modules for host May 27, 2016
@lrusak
Copy link
Member

lrusak commented May 30, 2016

👍 looks good

@lrusak lrusak merged commit c03b5a4 into LibreELEC:master Jun 1, 2016
@escalade escalade deleted the pythonfix branch June 1, 2016 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants