YAMI4 in FreeBSD Ports Collection

46 views
Skip to first unread message

Maciej Sobczak

unread,
Jan 4, 2015, 9:24:28 AM1/4/15
to ya...@googlegroups.com
I am pleased to announce that YAMI4 was just included as a new port in FreeBSD Ports Collection:

http://www.freebsd.org/cgi/ports.cgi?query=yami4

--
Maciej Sobczak * http://www.inspirel.com

Waldek M.

unread,
Jan 4, 2015, 4:40:29 PM1/4/15
to ya...@googlegroups.com
Congratulations!

Bartlomiej Kurek

unread,
Mar 23, 2015, 6:45:19 PM3/23/15
to ya...@googlegroups.com
Hi, 

This is great news that YAMI4 eventually made it into the ports collection.

There is a small problem though, yami4 (v1.10.0) fails under python3 (3.4.3 on FreeBSD 10.1). 
The function in yami4cpp.py:

 extern "C" PyMODINIT_FUNC PyInit_yami4py(void)

is missing a return statement before PyModule_Create.
PyModule_Create returns PyObject* in python3, used to be void in python2.
For the surprise - it somehow works on Linux (ubuntu) compiled either with clang or gcc (checked with python3 3.4.0).
On FreeBSD compiling with any of these will result in imp being unable to import the lib with _use_standard_extension_API.
The ctypes did not work for me on 64bit, but i think this is a known issue.

I suggest adding -Wall to yami4 Makefile to make it easy to spot.
I am leaving this report here for anyone else looking for the solution.


Maciej Sobczak

unread,
Mar 24, 2015, 3:17:15 PM3/24/15
to ya...@googlegroups.com

There is a small problem though, yami4 (v1.10.0) fails under python3 (3.4.3 on FreeBSD 10.1). 
The function in yami4cpp.py:

 extern "C" PyMODINIT_FUNC PyInit_yami4py(void)

is missing a return statement before PyModule_Create.
PyModule_Create returns PyObject* in python3, used to be void in python2.

That's right. For Python3 this function should have the following form:

extern "C" PyMODINIT_FUNC PyInit_yami4py(void)
{
    return PyModule_Create(&yami4pymodule);
}

This is one of the incompatibilities between Pythons 2 and 3. Incidentally, some implementations do not use the return value anyway and this is how the bug survived the testing phase. It will be corrected in the next release.
Reply all
Reply to author
Forward
0 new messages