GNU bug report logs - #29186
building guile-emacs fails: required libaries not found: libjpeg

Previous Next

Package: guix;

Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>

Date: Mon, 6 Nov 2017 22:23:01 UTC

Severity: normal

Done: Jan Nieuwenhuizen <janneke <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29186 in the body.
You can then email your comments to 29186 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Mon, 06 Nov 2017 22:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 06 Nov 2017 22:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: building guile-emacs fails: required libaries not found: libjpeg
Date: Mon, 06 Nov 2017 23:22:16 +0100
guix build guile-emacs fails with

checking jerror.h usability... yes
checking jerror.h presence... yes
checking for jerror.h... yes
checking for jpeg_destroy_compress in -ljpeg... yes
configure: WARNING: libjpeg found, but not version 6b or later
checking for library containing inflateEnd... -lz
checking for png... yes
checking whether png_longjmp is declared... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for TIFFGetVersion in -ltiff... yes
checking gif_lib.h usability... yes
checking gif_lib.h presence... yes
checking for gif_lib.h... yes
checking for GifMakeMapObject in -lgif... yes
configure: error: The following required libraries were not found:
     libjpeg
Maybe some development libraries/packages are missing?
If you don't want to link with them give
     --with-jpeg=no
as options to configure
phase `configure' failed after 10.5 seconds

Obviously that's fu, because libjpeg-8 is available.  I tried several
things, previous versions of libjpeg; not sure what's going on here.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Tue, 07 Nov 2017 05:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Tue, 07 Nov 2017 00:53:24 -0500
Jan Nieuwenhuizen <janneke <at> gnu.org> writes:

> guix build guile-emacs fails with
>
> checking jerror.h usability... yes
> checking jerror.h presence... yes
> checking for jerror.h... yes
> checking for jpeg_destroy_compress in -ljpeg... yes
> configure: WARNING: libjpeg found, but not version 6b or later
> checking for library containing inflateEnd... -lz
> checking for png... yes
> checking whether png_longjmp is declared... yes
> checking tiffio.h usability... yes
> checking tiffio.h presence... yes
> checking for tiffio.h... yes
> checking for TIFFGetVersion in -ltiff... yes
> checking gif_lib.h usability... yes
> checking gif_lib.h presence... yes
> checking for gif_lib.h... yes
> checking for GifMakeMapObject in -lgif... yes
> configure: error: The following required libraries were not found:
>      libjpeg
> Maybe some development libraries/packages are missing?
> If you don't want to link with them give
>      --with-jpeg=no
> as options to configure
> phase `configure' failed after 10.5 seconds
>
> Obviously that's fu, because libjpeg-8 is available.  I tried several
> things, previous versions of libjpeg; not sure what's going on here.

Can you try building it with --keep-failed, and then look at the
config.log file in the failed build directory?  It should show details
of what went wrong.  Typically these tests try compiling small test
programs, and likely there was some other error that lead it to the
erroneous conclusion.  config.log will contain the test program and
error messages.

       Mark




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Tue, 07 Nov 2017 17:08:01 GMT) Full text and rfc822 format available.

Message #11 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Tue, 07 Nov 2017 18:06:50 +0100
[Message part 1 (text/plain, inline)]
Mark H Weaver writes:

> Can you try building it with --keep-failed, and then look at the
> config.log file in the failed build directory?  It should show details
> of what went wrong.  Typically these tests try compiling small test
> programs, and likely there was some other error that lead it to the
> erroneous conclusion.  config.log will contain the test program and
> error messages.

Thanks for the heads up!

Attached is a patch that fixes this configure problem.  However, now the
build fails with a segfault:

EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload \
   --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"../../git-checkout/lisp/calendar/cal-loaddefs.el\")))" \
   -f batch-update-autoloads ../../git-checkout/lisp/calendar
make[2]: *** [Makefile:466: ../../git-checkout/lisp/calendar/cal-loaddefs.el] Segmentation fault


Greetings,
janneke

[0001-gnu-guile-emacs-Resurrect-fixes-29186.patch (text/x-patch, inline)]
From c0cecb3e3f39de01c674dadf8949186e94d5fb9b Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Tue, 7 Nov 2017 08:08:21 +0100
Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.

* gnu/packages/patches/emacs-fix-configure-jpeg.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/emacs.scm (guile-emacs): Use it.  Fixes #29186.
---
 gnu/local.mk                                       |  2 +
 gnu/packages/emacs.scm                             |  1 +
 .../patches/emacs-fix-configure-jpeg.patch         | 99 ++++++++++++++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 gnu/packages/patches/emacs-fix-configure-jpeg.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 90dc7aec1..25082b9ad 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -11,6 +11,7 @@
 # Copyright © 2016 Ben Woodcroft <donttrustben <at> gmail.com>
 # Copyright © 2016, 2017 Alex Vong <alexvong1995 <at> gmail.com>
 # Copyright © 2016, 2017 Efraim Flashner <efraim <at> flashner.co.il>
+# Copyright © 2016, 2017 Jan Nieuwenhuizen <janneke <at> gnu.org>
 # Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
 # Copyright © 2017 Clément Lassieur <clement <at> lassieur.org>
 # Copyright © 2017 Mathieu Othacehe <m.othacehe <at> gmail.com>
@@ -598,6 +599,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/elixir-disable-failing-tests.patch	\
   %D%/packages/patches/einstein-build.patch			\
   %D%/packages/patches/emacs-exec-path.patch			\
+  %D%/packages/patches/emacs-fix-configure-jpeg.patch		\
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch	\
   %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch	\
   %D%/packages/patches/emacs-source-date-epoch.patch		\
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 026b27bf8..e5329b4c5 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -276,6 +276,7 @@ editor (without an X toolkit)" )
               (uri (git-reference
                     (url "git://git.hcoop.net/git/bpt/emacs.git")
                     (commit "41120e0f595b16387eebfbf731fff70481de1b4b")))
+              (patches (search-patches "emacs-fix-configure-jpeg.patch"))
               (sha256
                (base32
                 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
diff --git a/gnu/packages/patches/emacs-fix-configure-jpeg.patch b/gnu/packages/patches/emacs-fix-configure-jpeg.patch
new file mode 100644
index 000000000..5205877af
--- /dev/null
+++ b/gnu/packages/patches/emacs-fix-configure-jpeg.patch
@@ -0,0 +1,99 @@
+Backported from
+
+    From fdf532b9c915ad9ba72155646d29d0f530fd72ec Mon Sep 17 00:00:00 2001
+    From: Paul Eggert <address <at> hidden>
+    Date: Wed, 15 Apr 2015 18:30:01 -0700
+    Subject: [PATCH] Port jpeg configuration to Solaris 10 with Sun C
+
+    * configure.ac: Check for jpeglib 6b by trying to link it, instead
+    of relying on cpp magic that has problems in practice.  Check for
+    both jpeglib.h and jerror.h features.  Remove special case for
+    mingw32, which should no longer be needed (and if it were needed,
+    should now be addressable by hotwiring emacs_cv_jpeglib).
+    Fixes: bug#20332
+
+Fixes: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29186
+
+Upstream status: not yet presented upstream.
+
+--- a/configure.ac	2017-11-07 07:49:49.359550593 +0100
++++ b/configure.ac	2017-11-07 07:50:50.864551155 +0100
+@@ -3014,44 +3014,40 @@ AC_SUBST(LIBXPM)
+ ### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
+ HAVE_JPEG=no
+ LIBJPEG=
+-if test "${opsys}" = "mingw32"; then
+-  if test "${with_jpeg}" != "no"; then
+-    dnl Checking for jpeglib.h can lose because of a redefinition of
+-    dnl HAVE_STDLIB_H.
+-    AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
+-  fi
+-  AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    AC_DEFINE(HAVE_JPEG)
+-    AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+-        [#include <jpeglib.h>
+-	 version=JPEG_LIB_VERSION
+-],
+-        [AC_DEFINE(HAVE_JPEG)],
+-        [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+-        HAVE_JPEG=no])
+-  fi
+-elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+-  if test "${with_jpeg}" != "no"; then
+-    dnl Checking for jpeglib.h can lose because of a redefinition of
+-    dnl  HAVE_STDLIB_H.
+-    AC_CHECK_HEADER(jerror.h,
+-      [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+-  fi
+-
+-  AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    AC_DEFINE(HAVE_JPEG)
+-    AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+-	[#include <jpeglib.h>
+-	 version=JPEG_LIB_VERSION
+-],
+-	[AC_DEFINE(HAVE_JPEG)],
+-	[AC_MSG_WARN([libjpeg found, but not version 6b or later])
+-	HAVE_JPEG=no])
+-  fi
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    LIBJPEG=-ljpeg
++if test "${with_jpeg}" != "no"; then
++  AC_CACHE_CHECK([for jpeglib 6b or later],
++    [emacs_cv_jpeglib],
++    [OLD_LIBS=$LIBS
++     for emacs_cv_jpeglib in yes -ljpeg no; do
++       case $emacs_cv_jpeglib in
++	 yes) ;;
++         no) break;;
++	 *) LIBS="$LIBS $emacs_cv_jpeglib";;
++       esac
++       AC_LINK_IFELSE(
++	 [AC_LANG_PROGRAM(
++	    [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision.  */
++	      #include <stdio.h> /* jpeglib.h needs FILE and size_t.  */
++	      #include <jpeglib.h>
++	      #include <jerror.h>
++	      char verify[JPEG_LIB_VERSION < 62 ? -1 : 1];
++	      struct jpeg_decompress_struct cinfo;
++	    ]],
++	    [[
++	      jpeg_create_decompress (&cinfo);
++	      WARNMS (&cinfo, JWRN_JPEG_EOF);
++	      jpeg_destroy_decompress (&cinfo);
++	    ]])],
++	 [emacs_link_ok=yes],
++	 [emacs_link_ok=no])
++       LIBS=$OLD_LIBS
++       test $emacs_link_ok = yes && break
++     done])
++  if test "$emacs_cv_jpeglib" != no; then
++    HAVE_JPEG=yes
++    AC_DEFINE([HAVE_JPEG], 1,
++      [Define to 1 if you have the jpeg library (typically -ljpeg).])
++    test "$emacs_cv_jpeglib" != yes && LIBJPEG=$emacs_cv_jpeglib
+   fi
+ fi
+ AC_SUBST(LIBJPEG)
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

[Message part 3 (text/plain, inline)]
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Tue, 07 Nov 2017 19:07:01 GMT) Full text and rfc822 format available.

Message #14 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Tue, 07 Nov 2017 20:06:05 +0100
[Message part 1 (text/plain, inline)]
Jan Nieuwenhuizen writes:

> However, now the build fails with a segfault:
>
> EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload \
>    --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
>    --eval "(setq generated-autoload-file (expand-file-name
> (unmsys--file-name
> \"../../git-checkout/lisp/calendar/cal-loaddefs.el\")))" \
>    -f batch-update-autoloads ../../git-checkout/lisp/calendar
> make[2]: *** [Makefile:466: ../../git-checkout/lisp/calendar/cal-loaddefs.el] Segmentation fault

Attempting to debug this segfault, I configured using

    CFLAGS=-g ./configure

however, now the segfault is gone.

Additional patch attached.  WDY(all)T?

Greetings,
janneke

[0001-gnu-guile-emacs-compile-with-g-rather-than-O2.patch (text/x-patch, inline)]
From 2a369f5151e0c7565fc271fb52def543b447477d Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Tue, 7 Nov 2017 20:02:35 +0100
Subject: [PATCH] gnu: guile-emacs: compile with -g (rather than -O2?)

---
 gnu/packages/emacs.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index c133c745c..5c33d0874 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -293,6 +293,9 @@ editor (without an X toolkit)" )
                                      ,@(package-arguments emacs))
        ((#:phases phases)
         `(modify-phases ,phases
+           (add-before 'configure 'setenv
+             (lambda _
+               (setenv "CFLAGS" "-g")))
            (add-after 'unpack 'autogen
                       (lambda _
                         (zero? (system* "sh" "autogen.sh"))))))))))
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

[Message part 3 (text/plain, inline)]
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Wed, 08 Nov 2017 10:12:01 GMT) Full text and rfc822 format available.

Message #17 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Mark H Weaver <mhw <at> netris.org>, 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Wed, 8 Nov 2017 12:11:35 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 07, 2017 at 08:06:05PM +0100, Jan Nieuwenhuizen wrote:
> Jan Nieuwenhuizen writes:
> 
> > However, now the build fails with a segfault:
> >
> > EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload \
> >    --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
> >    --eval "(setq generated-autoload-file (expand-file-name
> > (unmsys--file-name
> > \"../../git-checkout/lisp/calendar/cal-loaddefs.el\")))" \
> >    -f batch-update-autoloads ../../git-checkout/lisp/calendar
> > make[2]: *** [Makefile:466: ../../git-checkout/lisp/calendar/cal-loaddefs.el] Segmentation fault
> 
> Attempting to debug this segfault, I configured using
> 
>     CFLAGS=-g ./configure
> 
> however, now the segfault is gone.
> 
> Additional patch attached.  WDY(all)T?
> 
> Greetings,
> janneke
> 

Will it build with libjpeg-turbo or libjpeg-9? I'm not sure how feasable
it is, but I'd like to remove libjpeg-8 (and some other old libraries)
if its possible.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Wed, 08 Nov 2017 10:13:01 GMT) Full text and rfc822 format available.

Message #20 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Mark H Weaver <mhw <at> netris.org>, 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Wed, 8 Nov 2017 12:12:26 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 07, 2017 at 08:06:05PM +0100, Jan Nieuwenhuizen wrote:
> Jan Nieuwenhuizen writes:
> 
> From 2a369f5151e0c7565fc271fb52def543b447477d Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke <at> gnu.org>
> Date: Tue, 7 Nov 2017 20:02:35 +0100
> Subject: [PATCH] gnu: guile-emacs: compile with -g (rather than -O2?)
> 
> ---
>  gnu/packages/emacs.scm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index c133c745c..5c33d0874 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -293,6 +293,9 @@ editor (without an X toolkit)" )
>                                       ,@(package-arguments emacs))
>         ((#:phases phases)
>          `(modify-phases ,phases
> +           (add-before 'configure 'setenv
> +             (lambda _
> +               (setenv "CFLAGS" "-g")))
>             (add-after 'unpack 'autogen
>                        (lambda _
>                          (zero? (system* "sh" "autogen.sh"))))))))))

Couldn't this be a make-flag or a configure-flag?

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Wed, 08 Nov 2017 14:46:02 GMT) Full text and rfc822 format available.

Message #23 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Mark H Weaver <mhw <at> netris.org>, 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Wed, 08 Nov 2017 15:44:39 +0100
Efraim Flashner writes:

> Will it build with libjpeg-turbo or libjpeg-9? I'm not sure how feasable
> it is, but I'd like to remove libjpeg-8 (and some other old libraries)
> if its possible.

As communicated over irc; yes, it build with libjpeg-9.
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Wed, 08 Nov 2017 14:48:02 GMT) Full text and rfc822 format available.

Message #26 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Mark H Weaver <mhw <at> netris.org>, 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Wed, 08 Nov 2017 15:46:40 +0100
[Message part 1 (text/plain, inline)]
Efraim Flashner writes:

>> +           (add-before 'configure 'setenv
>> +             (lambda _
>> +               (setenv "CFLAGS" "-g")))
>>             (add-after 'unpack 'autogen
>>                        (lambda _
>>                          (zero? (system* "sh" "autogen.sh"))))))))))
>
> Couldn't this be a make-flag or a configure-flag?

Yes, as a configure flags also works.  However, I tracked down the
segfault, backported a patch and and now it builds with -O2.

New patch attached.

[0001-gnu-guile-emacs-Resurrect-fixes-29186.patch (text/x-patch, inline)]
From f6633adf4c5ceee3a63da9a3909a94c22f55b68a Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Tue, 7 Nov 2017 08:08:21 +0100
Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.

* gnu/packages/patches/guile-emacs-fix-configure.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/emacs.scm (guile-emacs): Use it.  Add workaround for src/deps
dir creation.  Fixes #29186.
---
 gnu/local.mk                                       |   1 +
 gnu/packages/emacs.scm                             |   7 +-
 .../patches/guile-emacs-fix-configure.patch        | 208 +++++++++++++++++++++
 3 files changed, 215 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/guile-emacs-fix-configure.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ecee15b1d..71392d86c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -712,6 +712,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/guile-present-coding.patch		\
   %D%/packages/patches/guile-relocatable.patch			\
   %D%/packages/patches/guile-rsvg-pkgconfig.patch		\
+  %D%/packages/patches/guile-emacs-fix-configure.patch		\
   %D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch	\
   %D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
   %D%/packages/patches/gtk2-theme-paths.patch			\
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 45e0635de..502d83b5f 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -276,6 +276,7 @@ editor (without an X toolkit)" )
               (uri (git-reference
                     (url "git://git.hcoop.net/git/bpt/emacs.git")
                     (commit "41120e0f595b16387eebfbf731fff70481de1b4b")))
+              (patches (search-patches "guile-emacs-fix-configure.patch"))
               (sha256
                (base32
                 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
@@ -294,7 +295,11 @@ editor (without an X toolkit)" )
         `(modify-phases ,phases
            (add-after 'unpack 'autogen
                       (lambda _
-                        (zero? (system* "sh" "autogen.sh"))))))))))
+                        (zero? (system* "sh" "autogen.sh"))))
+           ;; Build sometimes fails: deps/dispnew.d: No such file or directory
+           (add-before 'build 'make-deps-dir
+             (lambda _
+               (zero? (system* "mkdir" "-p" "src/deps"))))))))))
 
 
 ;;;
diff --git a/gnu/packages/patches/guile-emacs-fix-configure.patch b/gnu/packages/patches/guile-emacs-fix-configure.patch
new file mode 100644
index 000000000..374972359
--- /dev/null
+++ b/gnu/packages/patches/guile-emacs-fix-configure.patch
@@ -0,0 +1,208 @@
+Two patches here backporting fixes from emacs master.
+
+From dfcb3b6ff318e47b84a28cfc43f50bec42fa3570 Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke <at> gnu.org>
+Date: Tue, 7 Nov 2017 18:48:03 +0100
+Subject: [PATCH 1/2] backport: Port jpeg configuration to Solaris 10 with Sun
+ C.
+
+* configure.ac: Check for jpeglib 6b by trying to link it, instead
+of relying on cpp magic that has problems in practice.  Check for
+both jpeglib.h and jerror.h features.  Remove special case for
+mingw32, which should no longer be needed (and if it were needed,
+should now be addressable by hotwiring emacs_cv_jpeglib).
+Fixes: bug#20332
+
+    From fdf532b9c915ad9ba72155646d29d0f530fd72ec Mon Sep 17 00:00:00 2001
+    From: Paul Eggert <address <at> hidden>
+    Date: Wed, 15 Apr 2015 18:30:01 -0700
+    Subject: [PATCH] Port jpeg configuration to Solaris 10 with Sun C.
+
+    * configure.ac: Check for jpeglib 6b by trying to link it, instead
+    of relying on cpp magic that has problems in practice.  Check for
+    both jpeglib.h and jerror.h features.  Remove special case for
+    mingw32, which should no longer be needed (and if it were needed,
+    should now be addressable by hotwiring emacs_cv_jpeglib).
+    Fixes: bug#20332
+---
+ configure.ac | 72 ++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 34 insertions(+), 38 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2445db4886..36fa8eb390 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3014,44 +3014,40 @@ AC_SUBST(LIBXPM)
+ ### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
+ HAVE_JPEG=no
+ LIBJPEG=
+-if test "${opsys}" = "mingw32"; then
+-  if test "${with_jpeg}" != "no"; then
+-    dnl Checking for jpeglib.h can lose because of a redefinition of
+-    dnl HAVE_STDLIB_H.
+-    AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
+-  fi
+-  AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    AC_DEFINE(HAVE_JPEG)
+-    AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+-        [#include <jpeglib.h>
+-	 version=JPEG_LIB_VERSION
+-],
+-        [AC_DEFINE(HAVE_JPEG)],
+-        [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+-        HAVE_JPEG=no])
+-  fi
+-elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+-  if test "${with_jpeg}" != "no"; then
+-    dnl Checking for jpeglib.h can lose because of a redefinition of
+-    dnl  HAVE_STDLIB_H.
+-    AC_CHECK_HEADER(jerror.h,
+-      [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+-  fi
+-
+-  AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    AC_DEFINE(HAVE_JPEG)
+-    AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+-	[#include <jpeglib.h>
+-	 version=JPEG_LIB_VERSION
+-],
+-	[AC_DEFINE(HAVE_JPEG)],
+-	[AC_MSG_WARN([libjpeg found, but not version 6b or later])
+-	HAVE_JPEG=no])
+-  fi
+-  if test "${HAVE_JPEG}" = "yes"; then
+-    LIBJPEG=-ljpeg
++if test "${with_jpeg}" != "no"; then
++  AC_CACHE_CHECK([for jpeglib 6b or later],
++    [emacs_cv_jpeglib],
++    [OLD_LIBS=$LIBS
++     for emacs_cv_jpeglib in yes -ljpeg no; do
++       case $emacs_cv_jpeglib in
++	 yes) ;;
++         no) break;;
++	 *) LIBS="$LIBS $emacs_cv_jpeglib";;
++       esac
++       AC_LINK_IFELSE(
++	 [AC_LANG_PROGRAM(
++	    [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision.  */
++	      #include <stdio.h> /* jpeglib.h needs FILE and size_t.  */
++	      #include <jpeglib.h>
++	      #include <jerror.h>
++	      char verify[JPEG_LIB_VERSION < 62 ? -1 : 1];
++	      struct jpeg_decompress_struct cinfo;
++	    ]],
++	    [[
++	      jpeg_create_decompress (&cinfo);
++	      WARNMS (&cinfo, JWRN_JPEG_EOF);
++	      jpeg_destroy_decompress (&cinfo);
++	    ]])],
++	 [emacs_link_ok=yes],
++	 [emacs_link_ok=no])
++       LIBS=$OLD_LIBS
++       test $emacs_link_ok = yes && break
++     done])
++  if test "$emacs_cv_jpeglib" != no; then
++    HAVE_JPEG=yes
++    AC_DEFINE([HAVE_JPEG], 1,
++      [Define to 1 if you have the jpeg library (typically -ljpeg).])
++    test "$emacs_cv_jpeglib" != yes && LIBJPEG=$emacs_cv_jpeglib
+   fi
+ fi
+ AC_SUBST(LIBJPEG)
+-- 
+Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
+Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
+
+From f761b92d520b72954be28ad66eb82d1a96c785fb Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke <at> gnu.org>
+Date: Wed, 8 Nov 2017 14:05:43 +0100
+Subject: [PATCH 2/2] backport fix for #24065: calloc loop when compiling with
+ -O2.
+
+This patch fixes
+
+    EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload \
+       --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
+       --eval "(setq generated-autoload-file (expand-file-name
+    (unmsys--file-name
+    \"../../git-checkout/lisp/calendar/cal-loaddefs.el\")))" \
+       -f batch-update-autoloads ../../git-checkout/lisp/calendar
+    make[2]: *** [Makefile:466: ../../git-checkout/lisp/calendar/cal-loaddefs.el] Segmentation fault
+
+in gdb seen as
+
+    in calloc (nmemb=<error reading variable: DWARF-2 expression error:Loop detected (257).>, size=size <at> entry=1) at gmalloc.c:1510
+
+I did not find malloc-fixing commits from emacs master to cleanly
+cherry-pick, so this patch replaces the relevant part in configure
+(emacs 53da55b8cc45e76b836ebaadd23f46e92d25abce).
+
+* configure.ac: backport system_malloc/hybrid_malloc detection.
+---
+ configure.ac | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 36fa8eb390..3cc1794f37 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1966,7 +1966,25 @@ case "$opsys" in
+   darwin|mingw32|sol2-10) system_malloc=yes ;;
+ esac
+ 
++hybrid_malloc=
++system_malloc=yes
++
++test "$CANNOT_DUMP" = yes ||
++case "$opsys" in
++  ## darwin ld insists on the use of malloc routines in the System framework.
++  darwin | mingw32 | nacl | sol2-10) ;;
++  cygwin) hybrid_malloc=yes
++          system_malloc= ;;
++  *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;;
++esac
++
++if test "${system_malloc}" != yes && test "${doug_lea_malloc}" != yes \
++   && test "${UNEXEC_OBJ}" = unexelf.o; then
++  hybrid_malloc=yes
++fi
++
+ GMALLOC_OBJ=
++HYBRID_MALLOC=
+ if test "${system_malloc}" = "yes"; then
+   AC_DEFINE([SYSTEM_MALLOC], 1,
+     [Define to 1 to use the system memory allocator, even if it is not
+@@ -1975,6 +1993,14 @@ if test "${system_malloc}" = "yes"; then
+   GNU_MALLOC_reason="
+     (The GNU allocators don't work with this system configuration.)"
+   VMLIMIT_OBJ=
++elif test "$hybrid_malloc" = yes; then
++  AC_DEFINE(HYBRID_MALLOC, 1,
++    [Define to use gmalloc before dumping and the system malloc after.])
++  HYBRID_MALLOC=1
++  GNU_MALLOC=no
++  GNU_MALLOC_reason=" (only before dumping)"
++  GMALLOC_OBJ=gmalloc.o
++  VMLIMIT_OBJ=
+ else
+   test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
+   VMLIMIT_OBJ=vm-limit.o
+@@ -1993,10 +2019,11 @@ else
+        of the main data segment.])
+   fi
+ fi
++AC_SUBST([HYBRID_MALLOC])
+ AC_SUBST(GMALLOC_OBJ)
+ AC_SUBST(VMLIMIT_OBJ)
+ 
+-if test "$doug_lea_malloc" = "yes" ; then
++if test "$doug_lea_malloc" = "yes" && test "$hybrid_malloc" != yes; then
+   if test "$GNU_MALLOC" = yes ; then
+     GNU_MALLOC_reason="
+       (Using Doug Lea's new malloc from the GNU C Library.)"
+-- 
+Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
+Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
+
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

[Message part 3 (text/plain, inline)]

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Tue, 14 Nov 2017 22:10:01 GMT) Full text and rfc822 format available.

Message #29 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Mark H Weaver <mhw <at> netris.org>, Efraim Flashner <efraim <at> flashner.co.il>,
 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Tue, 14 Nov 2017 23:09:31 +0100
Hello,

Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> Efraim Flashner writes:
>
>>> +           (add-before 'configure 'setenv
>>> +             (lambda _
>>> +               (setenv "CFLAGS" "-g")))
>>>             (add-after 'unpack 'autogen
>>>                        (lambda _
>>>                          (zero? (system* "sh" "autogen.sh"))))))))))
>>
>> Couldn't this be a make-flag or a configure-flag?
>
> Yes, as a configure flags also works.  However, I tracked down the
> segfault, backported a patch and and now it builds with -O2.
>
> New patch attached.

Great that you found out!

>>From f6633adf4c5ceee3a63da9a3909a94c22f55b68a Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke <at> gnu.org>
> Date: Tue, 7 Nov 2017 08:08:21 +0100
> Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.
>
> * gnu/packages/patches/guile-emacs-fix-configure.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/emacs.scm (guile-emacs): Use it.  Add workaround for src/deps
> dir creation.  Fixes #29186.

I’m fine with this patch.  I’m a bit concerned about the risk of
accumulating patches that should really be in guile-emacs proper,
though.  IMO it would be better if this patch were pushed to
guile-emacs, or if an alternate guile-emacs repo were set up if the
current one is inactive.  If that’s too cumbersome though, feel free to
push this patch!

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Tue, 14 Nov 2017 22:27:01 GMT) Full text and rfc822 format available.

Message #32 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Mark H Weaver <mhw <at> netris.org>, Efraim Flashner <efraim <at> flashner.co.il>,
 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Tue, 14 Nov 2017 23:25:25 +0100
Ludovic Courtès writes:

>> Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.
>>
>> * gnu/packages/patches/guile-emacs-fix-configure.patch: New file.

> I’m fine with this patch.  I’m a bit concerned about the risk of
> accumulating patches that should really be in guile-emacs proper,
> though.  IMO it would be better if this patch were pushed to
> guile-emacs, or if an alternate guile-emacs repo were set up if the
> current one is inactive.  If that’s too cumbersome though, feel free to
> push this patch!

Meanwhile, I sent this patch 6 days ago to Robin Templeton <robin <at> igalia.com>.
They were the most recent committer from where we're pulling.  They haven't
responded yet.  Let me know if you know a better address/can we do better?

I can wait a bit more and push if I don't hear anything the coming week.
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Thu, 16 Nov 2017 08:38:01 GMT) Full text and rfc822 format available.

Message #35 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Mark H Weaver <mhw <at> netris.org>, Efraim Flashner <efraim <at> flashner.co.il>,
 29186 <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Thu, 16 Nov 2017 09:37:53 +0100
Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> Ludovic Courtès writes:
>
>>> Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.
>>>
>>> * gnu/packages/patches/guile-emacs-fix-configure.patch: New file.
>
>> I’m fine with this patch.  I’m a bit concerned about the risk of
>> accumulating patches that should really be in guile-emacs proper,
>> though.  IMO it would be better if this patch were pushed to
>> guile-emacs, or if an alternate guile-emacs repo were set up if the
>> current one is inactive.  If that’s too cumbersome though, feel free to
>> push this patch!
>
> Meanwhile, I sent this patch 6 days ago to Robin Templeton <robin <at> igalia.com>.
> They were the most recent committer from where we're pulling.  They haven't
> responded yet.  Let me know if you know a better address/can we do better?
>
> I can wait a bit more and push if I don't hear anything the coming week.

Yes, that sounds like the best approach.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#29186; Package guix. (Fri, 24 Nov 2017 17:26:02 GMT) Full text and rfc822 format available.

Message #38 received at 29186 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Mark H Weaver <mhw <at> netris.org>, 29186 <at> debbugs.gnu.org,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Fri, 24 Nov 2017 18:25:28 +0100
ludo <at> gnu.org (Ludovic Courtès) skribis:

> Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:
>
>> Ludovic Courtès writes:
>>
>>>> Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186.
>>>>
>>>> * gnu/packages/patches/guile-emacs-fix-configure.patch: New file.
>>
>>> I’m fine with this patch.  I’m a bit concerned about the risk of
>>> accumulating patches that should really be in guile-emacs proper,
>>> though.  IMO it would be better if this patch were pushed to
>>> guile-emacs, or if an alternate guile-emacs repo were set up if the
>>> current one is inactive.  If that’s too cumbersome though, feel free to
>>> push this patch!
>>
>> Meanwhile, I sent this patch 6 days ago to Robin Templeton <robin <at> igalia.com>.
>> They were the most recent committer from where we're pulling.  They haven't
>> responded yet.  Let me know if you know a better address/can we do better?
>>
>> I can wait a bit more and push if I don't hear anything the coming week.
>
> Yes, that sounds like the best approach.

I think you can now push the patch in Guix.

Thanks,
Ludo’.





Reply sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
You have taken responsibility. (Sat, 25 Nov 2017 19:53:02 GMT) Full text and rfc822 format available.

Notification sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
bug acknowledged by developer. (Sat, 25 Nov 2017 19:53:02 GMT) Full text and rfc822 format available.

Message #43 received at 29186-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Mark H Weaver <mhw <at> netris.org>, Efraim Flashner <efraim <at> flashner.co.il>,
 29186-done <at> debbugs.gnu.org
Subject: Re: bug#29186: building guile-emacs fails: required libaries not
 found: libjpeg
Date: Sat, 25 Nov 2017 20:51:19 +0100
Ludovic Courtès writes:

> I think you can now push the patch in Guix.

Thanks, push to master as 68cb962a8d6d384a02e3e8eac23af2582d73c6e7

janneke
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Dec 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.