在 cygwin 上为 byobu 安装 python 模块 snack

在 cygwin 上为 byobu 安装 python 模块 snack

byobu我正在cygwin 上设置终端多路复用器。
但它无法完全工作,因为它有一些 python 依赖项。

例如F9切换菜单,依赖于byobu-config
这需要python-newtsnack

答案1

这不是一个完整的答案,但我得到的答案是:

CFLAGS="-I/usr/x86_64-w64-mingw32/sys-root/mingw/include/" CXXFLAGS="-I/usr/x86_64-w64-mingw32/sys-root/mingw/include/" CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc pip install snack
Collecting snack
  Using cached https://files.pythonhosted.org/packages/15/52/7889541bad6bd053c6554e3158c91cf0d4092b251b34de5fa35e20040968/snack-0.0.3.tar.gz
Building wheels for collected packages: snack
  Running setup.py bdist_wheel for snack ... error
  Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-eYmYsm/snack/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-Bqg0M2 --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.cygwin-2.10.0-x86_64-2.7
  creating build/lib.cygwin-2.10.0-x86_64-2.7/snack
  copying snack/__init__.py -> build/lib.cygwin-2.10.0-x86_64-2.7/snack
  running build_ext
  building 'snack._snack' extension
  creating build/temp.cygwin-2.10.0-x86_64-2.7
  creating build/temp.cygwin-2.10.0-x86_64-2.7/snack
  creating build/temp.cygwin-2.10.0-x86_64-2.7/lib-bhtsne
  x86_64-w64-mingw32-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/ -I/usr/lib/python2.7/site-packages/numpy/core/include -Ilib-bhtsne -I/usr/include/python2.7 -c snack/_snack.cpp -o build/temp.cygwin-2.10.0-x86_64-2.7/snack/_snack.o -O3 -ffast-math -fopenmp
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:5:0,
                   from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                   from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from snack/_snack.cpp:614:
  /usr/lib/python2.7/site-packages/numpy/core/include/numpy/npy_endian.h:13:24: fatal error: endian.h: No such file or directory
       #include <endian.h>
                          ^
  compilation terminated.
  error: command 'x86_64-w64-mingw32-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for snack
  Running setup.py clean for snack
Failed to build snack
Installing collected packages: snack
  Running setup.py install for snack ... error
    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-eYmYsm/snack/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-M5cP4e/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.cygwin-2.10.0-x86_64-2.7
    creating build/lib.cygwin-2.10.0-x86_64-2.7/snack
    copying snack/__init__.py -> build/lib.cygwin-2.10.0-x86_64-2.7/snack
    running build_ext
    building 'snack._snack' extension
    creating build/temp.cygwin-2.10.0-x86_64-2.7
    creating build/temp.cygwin-2.10.0-x86_64-2.7/snack
    creating build/temp.cygwin-2.10.0-x86_64-2.7/lib-bhtsne
    x86_64-w64-mingw32-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/ -I/usr/lib/python2.7/site-packages/numpy/core/include -Ilib-bhtsne -I/usr/include/python2.7 -c snack/_snack.cpp -o build/temp.cygwin-2.10.0-x86_64-2.7/snack/_snack.o -O3 -ffast-math -fopenmp
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:5:0,
                     from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from snack/_snack.cpp:614:
    /usr/lib/python2.7/site-packages/numpy/core/include/numpy/npy_endian.h:13:24: fatal error: endian.h: No such file or directory
         #include <endian.h>
                            ^
    compilation terminated.
    error: command 'x86_64-w64-mingw32-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-eYmYsm/snack/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-M5cP4e/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-eYmYsm/snack/

我使用以下符号链接完成了此操作然后放弃了,但看起来理论上应该是可能的。

$ find /usr/x86_64-w64-mingw32/sys-root/mingw/ -type l -exec file -s {} \; | awk '{print "    "$0}'
/usr/x86_64-w64-mingw32/sys-root/mingw/include/machine: symbolic link to /usr/include/machine/
/usr/x86_64-w64-mingw32/sys-root/mingw/include/newlib.h: symbolic link to /usr/include/newlib.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/config.h: symbolic link to /usr/include/sys/config.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/features.h: symbolic link to /usr/include/sys/features.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/lock.h: symbolic link to /usr/include/sys/lock.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/select.h: symbolic link to /usr/include/sys/select.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/termio.h: symbolic link to /usr/include/sys/termio.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/termios.h: symbolic link to /usr/include/sys/termios.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/timespec.h: symbolic link to /usr/include/sys/timespec.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_default_fcntl.h: symbolic link to /usr/include/sys/_default_fcntl.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_intsup.h: symbolic link to /usr/include/sys/_intsup.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_pthreadtypes.h: symbolic link to /usr/include/sys/_pthreadtypes.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_sigset.h: symbolic link to /usr/include/sys/_sigset.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_stdint.h: symbolic link to /usr/include/sys/_stdint.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_timespec.h: symbolic link to /usr/include/sys/_timespec.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_timeval.h: symbolic link to /usr/include/sys/_timeval.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/_types.h: symbolic link to /usr/include/sys/_types.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/_ansi.h: symbolic link to /usr/include/_ansi.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/_newlib_version.h: symbolic link to /usr/include/_newlib_version.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/_syslist.h: symbolic link to /usr/include/_syslist.h

相关内容