Personal tools
You are here: Home Forum Install & build libmed-python3-patch

libmed-python3-patch

Up to Install & build

libmed-python3-patch

Posted by Lorenz Lechner at April 06. 2018

some python3 patches for libmed.

- import medenum does not work in python3 -> use relative imports

  done by: 

###################################

-%module medenum
+%module(package="med") medenum

###################################

- add py3 build option (maybe this is not necessary)

 

feel free to include them for the next release.

Attachments

Re: libmed-python3-patch

Posted by Lorenz Lechner at April 07. 2018

some further diff.

Attachments

Re: libmed-python3-patch

Posted by sl1pkn07 at April 20. 2018

Hi

 

thanks for the patch.

 

one question, can you add support for "DESTDIR" for the python modules?

 

when install the python files fail to build because expect DCMAKE_INSTALL_PREFIX, but not DESTDIR when is set in 'make install', lead fail like:

 

[code]

-- Installing: /tmp/makepkg/med/pkg/med/usr/lib/python3.6/site-packages/med/medenum.py
-- py compiling /usr/lib/python3.6/site-packages/med/medenum.py
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "/usr/lib/python3.6/py_compile.py", line 122, in compile
   source_bytes = loader.get_data(file)
 File "<frozen importlib._bootstrap_external>", line 832, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.6/site-packages/med/medenum.py'
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "/usr/lib/python3.6/py_compile.py", line 122, in compile
   source_bytes = loader.get_data(file)
 File "<frozen importlib._bootstrap_external>", line 832, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.6/site-packages/med/medenum.py'

[code]

 

greetings

Re: libmed-python3-patch

Posted by sl1pkn07 at April 20. 2018

ok. i found how do this (in here https://github.com/Aorimn/dislocker/pull/55/files)

change from:

[code]

INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${PYFILELOC}/${inputname}')\")")

[/code]

by:

[code]

INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('\$ENV{DESTDIR}${PYFILELOC}/${inputname}')\")")

[/code]

in the file config/cmake_files/medMacros.cmake

 

greetings

p, li { white-space: pre-wrap; }
Powered by Ploneboard
Document Actions