pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/python37 and libuuid



Thomas Klausner <tk%giga.or.at@localhost> wrote:
>On Wed, Jul 17, 2019 at 11:59:15PM +0100, Robert Swindells wrote:
>> 
>> I wrote:
>> >Can we make lang/python37 only use devel/libuuid/buildlink3.mk on
>> >platforms that really need it ?
>> >
>> >I'm guessing that this would be Linux that would require it.
>> >
>> >The python37 package builds fine on NetBSD without including libuuid
>> >but would fail if libuuid was installed as setup.py will find. Maybe
>> >need some changes to the setup.py patch to change the logic around
>> >uuid detection.
>> >
>> >A NetBSD-8 build host would probably have installed libuuid as a
>> >dependency of fonts/fontconfig.
>> 
>> I looked into this a bit more, python37 doesn't need libuuid at all
>> on NetBSD, it can use the UUID functions in libc.
>
>That's true. But then the test_uuid self test fails :(

How long does "make test" typically take to run ?

It is at "running: test_threading (4 hour 24 min)" 

I also have a change to patch-setup.py, only including the relavent
section as line numbers have changed for the rest of the patch.

There are three build cases.

  Have /usr/include/uuid.h
  Don't have /usr/include/uuid.h so need pkgsrc devel/libuuid
  Have /usr/include/uuid.h but pkgsrc devel/libuuid is installed already.

I had not tested the third one before sending the previous email, I
don't have devel/libuuid on my -current systems.

Also need to compare setup.py between Python-3.7.3 and Python-3.7.4
before we patch them. The change log suggested that there was a
difference in how the uuid module config was done.


@@ -1670,11 +1692,13 @@ class PyBuildExt(build_ext):
 
         # Build the _uuid module if possible
         uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"])
-        if uuid_incs is not None:
+        if uuid_incs is None:
+            uuid_incs = find_file("uuid/uuid.h", inc_dirs, [])
             if self.compiler.find_library_file(lib_dirs, 'uuid'):
                 uuid_libs = ['uuid']
-            else:
-                uuid_libs = []
+        else:
+            uuid_libs = []
+        if uuid_incs is not None:
             self.extensions.append(Extension('_uuid', ['_uuidmodule.c'],
                                    libraries=uuid_libs,
                                    include_dirs=uuid_incs))


Home | Main Index | Thread Index | Old Index