-
Notifications
You must be signed in to change notification settings - Fork 307
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
fix building with python2 and python3 #483
Conversation
In ROSA 2016.1 it is /usr/include/python3.5m and build script tried to find /usr/include/python3.5 Use python-config to get includes
|
I hope it works well enough for all. |
|
Hi, [1] |
|
@sergiomb2 why? Is |
|
Hi,
I have another suggestion which I think is better final line [1]
[1]
|export PYTHON_INCLUDE=`"$PYTHON" -c "from sysconfig import get_paths;
print(get_paths()['include'])"` |
This works incorrectly on Ubuntu 19.04 and Python 2:
user@pay2:~$ python -c "from sysconfig import get_paths;
print(get_paths()['include'])"
/usr/local/include/python2.7
There is nothing in /usr/local/include/python2.7, system-wide prefix is
/usr, not /usr/local
This gives correct results on ROSA:
rosa-2016 ~ # python -c "from sysconfig import get_paths;
print(get_paths()['include'])"
/usr/include/python2.7
But note that python[23]-configs gives ready to use CFALGS:
rosa-2016 ~ # python3-config --includes
-I/usr/include/python3.5m -I/usr/include/python3.5m
rosa-2016 ~ # python3-config --libs
-lpython3.5m -lpthread -ldl -lutil -lm
rosa-2016 ~ #
Using your method will require constructing (guessing!) CFLAGS manually.
Output of python[23]-config may be different on different OSes, for
eample note --ldflags on DragonFlyBSD and compare them with GNU/Linux
ROSA and Ubuntu above:
[root@nas-dfly ~]# python3-config --includes
-I/usr/local/include/python3.6m -I/usr/local/include/python3.6m
[root@nas-dfly ~]# python3-config --ldflags
-L/usr/local/lib -lpython3.6m -lintl -ldl -L/usr/local/lib -lintl
-lutil -lm -Wl,--export-dynamic
[root@nas-dfly ~]#
python-config has given us ready to use working CFLAGS, and we do not
have to guess them.
|
|
here [1] is the problem when PYTHON_INCLUDE=-I/usr/local/include/python3.6m -I/usr/local/include/python3.6m . [1] [2] |
|
note that all swig/python/*.py have she bangs to one python version , for example [1] [1] |
|
07.11.2019 12:28, Sérgio Basto пишет:
I don't understand what the problem is. How do you get /usr/local when building a distro package in Fedora?!
That is a hack.
Good catch... We should fix it |
|
Shebang is not a problem because it does not exist in |
|
my propose #496 |
No, python2 is no longer supported. Now, I regret accepting the change that restores support for it in MLT. if you need it in your distro, patch the source for your package and do not try to upstream it - at least for this package.
No, we should not. If you want to use the example python script with python 2.x, then invoke it with that interpreter or edit the example.
|
|
OK , no problem , we in Fedora + RPMFusion have one python-mlt client which is Flowblade . About Thank you |
Yes, I made that change. |
I wanted to build mlt with both python2 and python3 for ROSA Linux and had to patch like this to allow this to be done.
https://abf.io/import/mlt/commit/eff21006ee45d596cf4456ff2469f51f5d55cde9