diff options
| author | Roger Iyengar <ri@rogeriyengar.com> | 2018-03-02 01:57:50 -0500 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2018-04-21 18:36:20 +0200 |
| commit | 73ead2b71368fdacc4a1209b5af252a3ea604fac (patch) | |
| tree | 64c03aa13826c9c7c99214be5d3d4247a95d3e3f | |
| parent | 10960babfa98b1f383d39072b3a25a91cbef83b4 (diff) | |
Fixed Path Issue on Windows and updated readme
Changed install to always prompt Windows users for MSYS2 location. This
allows users who have their cygwin bin directory in their path variable
to install pdf-tools properly
| -rw-r--r-- | README.org | 42 | ||||
| -rw-r--r-- | lisp/pdf-tools.el | 6 |
2 files changed, 19 insertions, 29 deletions
@@ -165,20 +165,10 @@ emacs. This includes the standard binaries provided by the GNU project, those available as MSYS2 packages and numerous third-party binaries. It has been tested with emacs 25.1. Instructions are - provided under [[Compilation and installation on Windows]], below. -**** Compiling on Cygwin - On [[https://www.cygwin.com/][Cygwin]] the following dependencies are needed. - - - libpoppler-devel (*Lib* category) - - libpoppler-glib-devel (*Lib* category) - - libpng-devel (*Devel* category) - - make (*Devel* category) - - gcc-core (*Devel* category) - - gcc-g++ (*Devel* category) - - autoconf (*Devel* category) - - automake (*Devel* category) - - perl (*Perl* category) - - emacs-w32 (*Editors* category) + provided under [[#compilation-and-installation-on-windows][Compilation and installation on Windows]], below. + PDF Tools will successfully compile using Cygwin, but it will not be + able to open PDFs properly due to the way binaries compiled with Cygwin + handle file paths. *** Compilation :PROPERTIES: @@ -213,28 +203,28 @@ 2. Update and install dependencies, skipping any you already have #+BEGIN_SRC sh - pacman -Syu - pacman -S base-devel - pacman -S mingw-w64-x86_64-toolchain - pacman -S mingw-w64-x86_64-zlib - pacman -S mingw-w64-x86_64-libpng - pacman -S mingw-w64-x86_64-poppler - pacman -S mingw-w64-x86_64-imagemagick + $ pacman -Syu + $ pacman -S base-devel + $ pacman -S mingw-w64-x86_64-toolchain + $ pacman -S mingw-w64-x86_64-zlib + $ pacman -S mingw-w64-x86_64-libpng + $ pacman -S mingw-w64-x86_64-poppler + $ pacman -S mingw-w64-x86_64-imagemagick #+END_SRC 3. Install PDF tools in Emacs, but do not try to compile the server. Instead, get a separate copy of the source somewhere else. #+BEGIN_SRC sh - git clone https://github.com/politza/pdf-tools + $ git clone https://github.com/politza/pdf-tools #+END_SRC - 4. Open mingw64 shell + 4. Open mingw64 shell (*Note:* You must use mingw64.exe and not msys2.exe) 5. Compile pdf-tools #+BEGIN_SRC sh - cd pdf-tools/build - make -s + $ cd /path/to/pdf-tools + $ make -s #+END_SRC 6. This should produce a file ~server/epdfinfo.exe~. Copy this file @@ -259,7 +249,7 @@ #+BEGIN_SRC emacs-lisp (setenv "PATH" (concat "C:\\msys64\\mingw64\\bin;" (getenv "PATH"))) - #+END_SRC + #+END_SRC *** ELisp Prerequisites This package depends on the following Elisp packages, which should diff --git a/lisp/pdf-tools.el b/lisp/pdf-tools.el index 7731eeb..bc2d069 100644 --- a/lisp/pdf-tools.el +++ b/lisp/pdf-tools.el @@ -263,11 +263,11 @@ Returns always nil, unless `system-type' equals windows-nt." (defun pdf-tools-find-bourne-shell () "Locate a usable sh." - (or (executable-find "sh") - (and (eq system-type 'windows-nt) + (or (and (eq system-type 'windows-nt) (let* ((directory (pdf-tools-msys2-directory))) (when directory - (expand-file-name "usr/bin/bash.exe" directory)))))) + (expand-file-name "usr/bin/bash.exe" directory)))) + (executable-find "sh"))) (defun pdf-tools-build-server (target-directory &optional |
