I assume, that you are using bastibe/lunatic-python and Python 2.
commands
package used in setup.py
is unix-only. Error that you see is caused by following code: http://hg.python.org/cpython/file/3a1db0d2747e/Lib/commands.py#l59
It is necessary to replace following part in setup.py
.. :
# ..
for package in packages:
(pcstatus, pcoutput) = commands.getstatusoutput(
"pkg-config --libs --cflags %s" % package)
if pcstatus == 0:
break
else:
sys.exit("pkg-config failed for %s; "
"most recent output was:\n%s" %
(", ".join(packages), pcoutput))
# ..
.. with equivalent subprocess
code:
# ..
import subprocess
pcoutput = ""
for package in packages:
# raises exception if:
# - pkg-config is not found
# - pkg-config returns some error
pcoutput += subprocess.check_output(
"pkg-config --libs --cflags %s" % package
)
# ..
Now error messages should become clearer.
(Added #1)
The code above tries to run pkg-config
command and it turns out that for some reason it fails. If you open MSYS shell (usually located at C:\MinGW\msys\1.0\msys.bat
and run pkg-config
command, then the expected output is following:
$ pkg-config --libs --cflags lua
-IC:/MinGW/msys/1.0/include -LC:/MinGW/msys/1.0/lib -llua -lm
Articles "gcc -L / -l option flags" and "Using pkg-config files" may help to decipher command above.
(Added #2)
To have msys shell available, MinGW has to installed with msys-base
package selected. Good tutorial on how to install MinGW: Installing Minimum GNU for Windows (MinGW)
pkg-config
has to installed separately. Take look at MinGW FAQ and Ctrl+F for "How do I get pkg-config installed?".
In short you have to download pkg-config-lite and extract zip file contents to C:\MinGW\msys\1.0
.
From msys
shell:
wget http://garr.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
unzip pkg-config-lite-0.28-1_bin-win32.zip
cp -R pkg-config-lite-0.28-1/* /usr
And then create pkgconfig
directory:
mkdir /usr/lib/pkgconfig
To verify that pkg-config is working (and to see where is tries to find config files):
pkg-config --debug
And to verify that you have all necessary dependencies installed:
$ which gcc g++ wget tar make unzip
/usr/bin/gcc.exe
/usr/bin/g++.exe
/usr/bin/wget.exe
/usr/bin/tar.exe
/usr/bin/make.exe
/usr/bin/unzip.exe
Most likely lua has to be build from source:
wget http://www.lua.org/ftp/lua-5.2.3.tar.gz
tar -xf lua-5.2.3.tar.gz
cd lua-5.2.3
make mingw
make INSTALL_TOP=/usr install
Now you'll have to manually create /usr/lib/pkgconfig/lua.pc
. Or use one found on Linux From Scratch page: http://www.linuxfromscratch.org/blfs/view/svn/general/lua.html
Now pkg-config
should work as described above.