pkgsrc-Users archive

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

Re: devel/got-portable: build failure on Darwin, if ossp-uuid is linked



Hi Manuel, 

> I don't have committing acces to pkgsrc and the maintainer hasn't
> replied, so I'm writing to this list

Sorry for having not replied timely. It's been busy weeks and I didn't
have the occasion to check my netbsd.org mailbox.  

>> I'm new to pkgsrc, but I noticed that devel/got-portable fails to build
>> on Darwin, if devel/ossp-uuid is linked.

> Thanks for reporting this

Definitely; as I don't own Apple hardware, any feedback regarding my
packages on macOS is appreciated. 

>> If I change the uuid library to devel/libuuid, devel/got-portable builds
>> fine. I don't have committing acces to pkgsrc and the maintainer hasn't
>> replied, so I'm writing to this list, in the hope, someone may fix this,
>> not only for this sole user, writing this e-mail...

> It's really hard to tell what's wrong and why changing the library would
> be the right thing to do.

> You didn't explain what went wrong.  Does the build of ossp-uuid fail,
> or does got-portable fail even though a successful build of ossp-uuid is
> installed?

upstream recommends the very old ossp-uuid in place of libuuid on macOS
for reasons I didn't investigate. 
In his private message, Manuel wrote me that the build stops at configure
stage as it fails to find a functional uuid library.

Looking at got-portable's sources, I spotted:

(configure.ac):

```
#Don't define HAVE_BSD_UUID on darwin (Apple) as this breaks the BSD API.
# Instead, use the UUID implementation wrapper that's in compat/ plus uuid
# ossp
if test "x$found_uuid" = "xyes" -a "x$PLATFORM" != "darwin"; then
	AC_DEFINE([HAVE_BSD_UUID], [1], [BSD UUID])
else
	PKG_CHECK_MODULES(
		LIBUUID,
		uuid,
		[
			libuuid_CFLAGS="$LIBUUID_CFLAGS"
			libuuid_LIBS="$LIBUUID_LIBS"
			AC_SUBST(libuuid_CFLAGS)
			AC_SUBST(libuuid_LIBS)
			found_libuuid=yes
		],
		[
			found_libuuid=no
		]
	)

	if test "x$found_libuuid" = "xno"; then
		AC_CHECK_HEADER(
			uuid.h,
			found_libuuid=yes,
			found_libuuid=no)
	fi
fi

if test "x$found_libuuid" = "xno"; then
	AC_MSG_ERROR("*** couldn't find uuid ***")
fi
```

(include/got_compat2.h):

```
#ifndef HAVE_BSD_UUID
#include <uuid/uuid.h>
#define uuid_s_ok 0
#define uuid_s_bad_version  1
#define uuid_s_invalid_string_uuid 2
#define uuid_s_no_memory  3

/* Length of a node address (an IEEE 802 address). */
#define _UUID_NODE_LEN  6

struct uuid {
    uint32_t time_low;
    uint16_t time_mid;
    uint16_t time_hi_and_version;
    uint8_t  clock_seq_hi_and_reserved;
    uint8_t  clock_seq_low;
    uint8_t  node[_UUID_NODE_LEN];
};

int32_t uuid_equal(struct uuid *, struct uuid *, uint32_t *);
int32_t uuid_is_nil(struct uuid *, uint32_t *);
void uuid_create(uuid_t *, uint32_t *);
void uuid_create_nil(struct uuid *, uint32_t *);
void uuid_from_string(const char *, uuid_t *, uint32_t *);
void uuid_to_string(uuid_t *, char **, uint32_t *);
#else
#include <uuid.h>
#endif
```

How does `HAVE_BSD_UUID' break the BSD API on Darwin (possibly a good
question for the developers)? 
Does the package work fine (beside compiling successfully) on Darwin
when linked against libuuid?

Regardless, the configure script searches for uuid/uuid.h on macOS. 
By comparing PLISTs for devel/libuuid and devel/ossp-uuid, I noticed
that while libuuid installs a ${PREFIX}/include/uuid/uuid.h header,
ossp-uuid installs a ${PREFIX}/include/uuid.h header, and that's
probably why the configure script doesn't find it.

So either stick to libuuid on macOS too or patch the program to point to
the correct include path when ossp-uuid is used.
What does Greg think of that?

Having somebody with macOS access do this would be preferable in my
opinion, but if Manuel can provide feedback and testing that would be
fine too.

Regards


P.S.: I updated got-portable to the latest version a couple of days ago,
better to use that if you aren't already. 


--
PVO | https://retrobsd.ddns.net

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index