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

Failed to install package #80

Open
nrcsuc opened this issue Dec 24, 2022 · 4 comments
Open

Failed to install package #80

nrcsuc opened this issue Dec 24, 2022 · 4 comments

Comments

@nrcsuc
Copy link

nrcsuc commented Dec 24, 2022

clang: error: no such file or directory: 'pytox/av.c'
clang: error: no input files
error: command '/usr/bin/clang' failed with exit code 1
@longnetwork
Copy link

longnetwork commented Feb 29, 2024

In ubuntu 20.4LTS:

  1. create directory pytox and clone from this directory:
    git clone --recurse-submodules https://github.com/Toktok/c-toxcore
    git clone https://github.com/TokTok/py-toxcore-c.git
  2. create script build-toxcore.sh with +x mode:
#!/bin/bash

# dependencies for toxcore: libsodium, libm, libpthread, librt
# gits:
# git clone --recurse-submodules https://github.com/Toktok/c-toxcore
# git clone https://github.com/TokTok/py-toxcore-c.git


cd c-toxcore

rm -rf _build > /dev/null 2>&1

cmake -B _build -D BOOTSTRAP_DAEMON=OFF -D BUILD_TOXAV=OFF -D DHT_BOOTSTRAP=OFF -D ENABLE_SHARED=ON

cd _build

make


cd ../../

cp -r c-toxcore/toxav/* py-toxcore-c/pytox/toxav/
cp -r c-toxcore/toxcore/* py-toxcore-c/pytox/toxcore/
cp -r c-toxcore/toxencryptsave/* py-toxcore-c/pytox/toxencryptsave/


cp c-toxcore/_build/lib*.* py-toxcore-c/pytox/


# edit library-path in py-toxcore-c/setup.py: libraries = ["py-toxcore-c/pytox/toxcore",]

# pip install py-toxcore-c/

  1. edit cmake-options as you wish and execute build-toxcore.sh

  2. if the build is successful, then edit the correct path to the library in the file py-toxcore-c/setup.py:

from distutils.core import Extension
from distutils.core import setup

libraries = [
    "py-toxcore-c/pytox/toxcore",  # This !
]
cflags = [
    "-funsigned-char",
]

setup(
    name="py-toxcore-c",
    version="0.2.19",
    description="Python binding for Tox the skype replacement",
    author="Iphigenia Df",
    author_email="[email protected]",
    url="http://github.com/TokTok/py-toxcore-c",
    license="GPL",
    py_modules=["pytox.common"],
    ext_modules=[
        #Extension(
        #    "pytox.toxav.toxav",
        #    ["pytox/toxav/toxav.c"],
        #    extra_compile_args=cflags,
        #    libraries=libraries,
        #),
        Extension(
            "pytox.toxcore.tox",
            ["pytox/toxcore/tox.c"],
            extra_compile_args=cflags,
            libraries=libraries,
        ),
        #Extension(
        #    "pytox.toxencryptsave.toxencryptsave",
        #    ["pytox/toxencryptsave/toxencryptsave.c"],
        #    extra_compile_args=cflags,
        #    libraries=libraries,
        #),
    ],
)
  1. Enjoy:
    pip install py-toxcore-c/

@iphydf
Copy link
Member

iphydf commented Feb 29, 2024

You need to run cython (for now). See the Dockerfile for an example. I'll add cythonize to the setup.py soon.

@longnetwork
Copy link

longnetwork commented Feb 29, 2024

iphydf, Please regenerate the api for the master branch toxcore
Something is missing:
python3 -c 'import pytox.toxcore.tox as core; print(core.Tox_Ptr.__init__.__doc__)' produce undefined symbol send_group_invite_packet:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /home/mint/_freeLance/8Work_kivy/src/.venv/lib/python3.8/site-packages/pytox/toxcore/tox.cpython-38-x86_64-linux-gnu.so: undefined symbol: send_group_invite_packet

@iphydf
Copy link
Member

iphydf commented Mar 1, 2024

I'll look into it next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants