Description of problem: waf is in Fedora: https://admin.fedoraproject.org/pkgdb/acls/name/waf but python3-cairo contains an embedded copy: $ less pycairo-1.8.10.tar.bz2 | grep waf -rwxr-x--- dev/user 92546 2010-09-11 03:14 pycairo-1.8.10/waf Presumably we should remove the embedded "waf" during %prep and use a shared version. Note that the embedded copy appears to be buggy: I'm attempting to recompile python3-cairo against the latest python3 in rawhide (3.2b2) for the PEP 3149 ABI changes, but it's not finding the python headers: + python3 ./waf --prefix=/usr --libdir=/usr/lib64 configure Checking for program gcc or cc : /usr/bin/gcc Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for gcc : ok Checking for program python : /usr/bin/python3 Checking for Python version >= 3.1.0 : ok 3.2.0 Checking for library python3.2 : not found Checking for library python3.2 : not found Checking for library python32 : not found Checking for program python3.2-config : /usr/bin/python3.2-config Checking for custom code : Could not find the python development headers /home/david/dist-git/python3-cairo/master/pycairo-1.8.10/wscript:37: error: the configuration failed (see '/home/david/dist-git/python3-cairo/master/pycairo-1.8.10/build_directory/config.log') ./set_options() ./init() ./configure() Version-Release number of selected component (if applicable): 1.8.10-9
We had this debate between shared version and packaged version. In the end package version was the only thing that worked. From my sketchy recollection, the system version did not support Python 3 or have all of the plugins needed. Btw, if the headers can not be found I would think this is an issue with /usr/bin/python3.2-config. In any case can you track down why the headers are not being found before we take any actions? If the system waf works, I would say it is fine to use that.
waf tries to build a test-binary with linker flags -lpython3.2 -lpython3.2 and -lpython32 The latest python3 has renamed the libs to libpython3.2mu.so, so this will fail: [1/2] cc: build_directory/.conf_check_0/test.c -> build_directory/.conf_check_0/testbuild/default/test_1.o '/usr/bin/gcc', '../test.c', '-c', '-o', 'default/test_1.o'] [2/2] cc_link: build_directory/.conf_check_0/testbuild/default/test_1.o -> build_directory/.conf_check_0/testbuild/default/testprog /usr/bin/ld: cannot find -lpython3.2 collect2: ld returned 1 exit status ['/usr/bin/gcc', 'default/test_1.o', '-o', '/builddir/build/BUILD/pycairo-1.8.10/build_directory/.conf_check_0/testbuild/default/testprog', '-L/usr/lib64', '-Wl,-Bdynamic', '-lpython3.2', '-lm', '-lpthread', '-ldl', '-lutil'] command returned 'Build failed: -> task failed (err #1): \n\t{task: cc_link test_1.o -> testprog}'not found https://bugzilla.redhat.com/show_bug.cgi?id=670478 shows a similar problem and has a pointer to the reason for the name change, the proper fix is the same: use pkg-config or python3.2-config --libs instead of trying to figure out the paths on your own. > pkg-config --libs python3 -lpython3.2mu > python3.2-config --libs -lpthread -ldl -lutil -lm -lpython3.2mu The same problem will probably show up with the include directory, it got moved to /usr/include/python3.2mu: > pkg-config --cflags-only-I python3 -I/usr/include/python3.2mu > python3.2-config --include -I/usr/include/python3.2mu -I/usr/include/python3.2mu
Created attachment 476051 [details] use python-config to find name of python lib something like this will work, but applying it to the embedded copy of waf will require to unpack that first
Ah, after updating to rawhide I now understand the issue. How would we go about applying this? e.g. what format is waf packed in? Can we just patch the system waf and use that? Upstream pycairo is pretty unresponsive these days.
Created attachment 478104 [details] Log of waf build from git It seems that the git version of pycairo does find the correct directories but doesn't use them when compiling. python3 waf configure --prefix /home/johnp/devel/gnome/install --libdir /home/johnp/devel/gnome/install/lib64
Created attachment 478110 [details] Work in progress patch to specfile Here's a possible approach for how to patch waf from the rpm build (assuming a patch to the unpacked waf sources)
I've combined my specfile patch from comment #6 and a version of Karsten's patch from comment #3 and it builds locally; I can instantiate objects from the cairo._cairo shared library. Committed & pushed as: http://pkgs.fedoraproject.org/gitweb/?p=python3-cairo.git;a=commit;h=c572cc4dd4bb5cca1aba48d7315079fa0f2694de Building python3-cairo-1.8.10-11.fc16 for dist-rawhide Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2830881
built in rawhide and F15 updates-candidates