22

I just upgraded Emacs on my Windows 10 machine from 24.5 to 25.1. For Emacs 24.5 I had GnuTLS correctly setup and for 25.1 I did what I thought I remembered I did:

  1. Got prebuilt Emacs binaries from the GNU Emacs website's download page. I'm using 32 bit Windows, so I got the i686 version of Emacs.

  2. Got a copy of GnuTLS from ezwinports and extracted the zip file to the same directory as Emacs --the way the gnutls zip is organized means that this way both the dll's and the exe's for gnutls wind up in the same directory as the Emacs exe's. (I got version 3.3.11 this time; I don't remember what version of GnuTLS I had when I had version 24.5 of Emacs.)

That didn't work this time. gnutls-available-p returns nil, the package manager is only able to connect to http repositories and not https ones, eww can't handle https either.

How do I setup GnuTLS for Emacs 25.1? Am I misremembering what I did for 24.5? Maybe the binaries from the GNU Emacs website are compiled without GnuTLS and for 24.5 I actually got binaries from somewhere else...

Omar
  • 4,732
  • 1
  • 17
  • 32
  • I deleted my original answer, since it didn't address your Emacs version. In your question, you could maybe clarify that you copied the files into ./bin – henning Sep 21 '16 at 07:29
  • @henning: That's what the sentence "the way the gnutls zip is organized means that this way both the dll's and the exe's for gnutls wind up in the same directory as the Emacs exe's" was meant to convey, I'll try to reword it in a clearer way tomorrow. – Omar Sep 21 '16 at 08:50
  • It looks more like a problem on the Emacs 25.1 rather than the gnutls itself because today I've downloaded Emacs 25.1 and got the same problem. Emacs 24.1 calls gnutls with the options: --insecure -p 443 --protocols ssl3 whereas 25.1 calls it with: -x509cafile nil -p 443. It might have something to do with these different calling options. – Terry Sep 21 '16 at 15:49
  • 2
    I don't have the details to hand, but I briefly looked into this earlier. I think Emacs 25.1 is expecting libgnutls-30.dll but only libgnutls-28.dll is packaged by ezwinports at the moment. – Stuart Hickinbottom Sep 21 '16 at 17:09

1 Answers1

31

@StuartHickinbottom explained what I was doing wrong: using libgnutls-28.dll when Emacs 25.1 requires the newer and incompatible libgnutls-30.dll. Then it was a matter of finding binaries of libgnutls-30.dll and other required libraries. Thankfully Phillip Lord has compiled Windows versions of all the GnuTLS libraries and dependencies and many other libraries you might want for Emacs! They are available here: get emacs-25-i686-deps.zip if you use 32-bit Windows and get emacs-25-x86_64-deps.zip if you use 64-bit; then unzip in the root folder of your Emacs installation (so that the bin folder of the zip files gets decompressed into the bin folder of your Emacs installation, etc.)

EDIT: I figured out how to find out which version of a library Emacs is expecting: look in the variable dynamic-library-alist.

chwarr
  • 105
  • 6
Omar
  • 4,732
  • 1
  • 17
  • 32
  • 1
    Thanks for the edit -- I never knew about that variable but it makes tracking down this type of thing much easier. – Stuart Hickinbottom Sep 22 '16 at 08:25
  • 1
    Actually, I didn't compile the binaries, just zipped them. They should all work. And I need to improve the README. It's too complicated. – Phil Lord Dec 04 '16 at 14:08
  • Then I guess I meant "compiled" in the non-computer sense of put together a list of things from various sources, @PhilLord :) – Omar Dec 04 '16 at 17:27
  • confirmed to work for for Emacs 25.2 – Lorenzo Gatti May 10 '17 at 20:17
  • Using dumpbin I was able to identify exactly which DLLs are needed: https://gist.github.com/okorz001/7715b40104ed0446bd228b40d7876674 – Oscar Korz Oct 11 '17 at 06:17
  • `emacs-25-x86_64-deps.zip` is a 101MB zip and takes a while to unzip. – Grant Bowman Dec 16 '17 at 18:45
  • @PhilLord After installing the dependencies, is it necessary to add `C:\Program Files\Emacs\bin` (or whatever) to `PATH` prior to starting Emacs? It would be nice if that could be added to the `README`. – feklee Jan 20 '19 at 09:30
  • 2
    @feklee For Emacs-26, just unpack the zip and away you go -- at least that is the theory. Yeah, agreed, README needs updating. There isn't one at the moment. Me being rubbish. – Phil Lord Jan 20 '19 at 19:46