On Fri, 24 Feb 2017 14:22:26 +0100
Matteo Bernardini <[email protected]> wrote:

> 2017-02-24 14:19 GMT+01:00 Matteo Bernardini
> <[email protected]>:
> > 2017-02-24 12:32 GMT+01:00 Duncan Roe <[email protected]>:  
> >> Hi Matteo,
> >>
> >> This looks to be an upstream bug.
> >>
> >> I built and installed the latest lz4 (1.7.5), but spice does not
> >> build with LZ4 support.
> >>
> >> Looking at config.log, I think I can see the problem:
> >>
> >>   $PKG_CONFIG --exists --print-errors "liblz4 >= 129"
> >>
> >> What has happened is: lz4 used to have plain numeric revs. The
> >> last of these was 131, released on Jun 29, 2015. After that, lz4
> >> changed to x.y.z revision format, starting with 1.7.3 released on
> >> Nov 17, 2016.
> >>
> >> The proper fix is to spice-common/m4/spice-deps.m4:188, which
> >> should be expanded to accept either >= 129 or >= 1.7.3.  
> >
> > yes, it's definitely an upstream bug: a quick fix should be to
> > modify the SlackBuild like this
> >
> > --- ./spice.SlackBuild.orig     2017-02-23 11:12:28.218760310 +0100
> > +++ ./spice.SlackBuild  2017-02-24 14:14:43.292547670 +0100
> > @@ -78,6 +78,9 @@
> >   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440
> > -o -perm 400 \) \
> >   -exec chmod 644 {} \;
> >
> > +sed -i "s|129|1.7.3|" spice-common/m4/spice-deps.m4
> > +autoreconf -fi
> > +
> >  CFLAGS="$SLKCFLAGS" \
> >  CXXFLAGS="$SLKCFLAGS" \
> >  ./configure \  
> 
> but it seems it's already fixed in the newer spice-common (included in
> spice), so it will probably will go in the next spice release
> 
> https://cgit.freedesktop.org/spice/spice-common/commit/?id=48da2c6654f37fcf02711aa86a08d6404dd6d215


Here's the patch (slightly modified to fix the dir); apply with:
  patch -p1 < $CWD/fix-lz4-detection.diff

See attached.

-RW 
From 48da2c6654f37fcf02711aa86a08d6404dd6d215 Mon Sep 17 00:00:00 2001
From: Pavel Grunt <[email protected]>
Date: Fri, 25 Nov 2016 13:17:49 +0100
Subject: spice-deps: Make LZ4 check depending on function

LZ4 changed versioning scheme from r131 to v1.7.3 making our configure
fail with (1.7.3 < 129).

Switch from version checking to checking that the necessary function
is available.

Acked-by: Frediano Ziglio <[email protected]>

diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 54e0d82..3b22422 100644
--- a/spice-common/m4/spice-deps.m4
+++ b/spice-common/m4/spice-deps.m4
@@ -184,12 +184,26 @@ AC_DEFUN([SPICE_CHECK_LZ4], [
 
     have_lz4="no"
     if test "x$enable_lz4" != "xno"; then
-      PKG_CHECK_MODULES([LZ4], [liblz4 >= 129], [have_lz4="yes"], [have_lz4="no"])
+      # LZ4_compress_default is available in liblz4 >= 129, however liblz has changed
+      # versioning scheme making the check failing. Rather check for function definition
+      PKG_CHECK_MODULES([LZ4], [liblz4], [have_lz4="yes"], [have_lz4="no"])
 
       if test "x$have_lz4" = "xyes"; then
-        AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
-      elif test "x$enable_lz4" = "xyes"; then
-        AC_MSG_ERROR([lz4 support requested but liblz4 could not be found])
+        # It is necessary to set LIBS and CFLAGS before AC_CHECK_FUNC
+        old_LIBS="$LIBS"
+        old_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $LZ4_CFLAGS"
+        LIBS="$LIBS $LZ4_LIBS"
+
+        AC_CHECK_FUNC([LZ4_compress_default], [
+            AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])],
+            [have_lz4="no"])
+
+        LIBS="$old_LIBS"
+        CFLAGS="$old_CFLAGS"
+      fi
+      if test "x$enable_lz4" = "xyes" && test "x$have_lz4" = "xno"; then
+        AC_MSG_ERROR([lz4 support requested but liblz4 >= 129 could not be found])
       fi
     fi
     AM_CONDITIONAL(HAVE_LZ4, test "x$have_lz4" = "xyes")
-- 
cgit v0.10.2

Attachment: pgpBWrFBtqsG_.pgp
Description: OpenPGP digital signature

_______________________________________________
SlackBuilds-users mailing list
[email protected]
http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/

Reply via email to