0

I'm trying to install pdf-tools on my Windows System, I'm using the same config as for Arch Linux where this error is fixed by installing the arch linux pdf-tools package via pacman.

Obviously this is not possible with Windows.

The error is that pdf-tools-install tries to build the epdfinfo program.

To fix another error during this building process I had to install mysys64 and now there is the new error log

    c\:/Users/stackoverflow/AppData/Roaming/.emacs.d/elpa/pdf-tools-1.0/server/autobuild -i 
    
    c\:/Users/stackoverflow/AppData/Roaming/.emacs.d/elpa/pdf-tools-1.0/
        ---------------------------
            Installing packages    
        ---------------------------
        pacman -S --needed base-devel
                              mingw-w64-x86_64-libpng
                              mingw-w64-x86_64-poppler
                              mingw-w64-x86_64-toolchain
                              mingw-w64-x86_64-zlib
        error: failed to init transaction (unable to lock database)
        error: could not lock database: File exists
          if you're sure a package manager is not already
          running, you can remove /var/lib/pacman/db.lck
---------------------------
 Configuring and compiling 
---------------------------
No such program: autoreconf

Do you know how to fix this? I thought that it would be less pain to make pdf-tools work on every machine.

Maybe something is wrong with my init.el

    (require 'package)
(add-to-list 'package-archives
         '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
;(unless (package-installed-p 'use-package)
;  (package-refresh-contents)
;  (package-install 'use-package))
;'(eval-when-compile
;  (require 'use-package))



(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'zenburn t)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-safe-themes
   '("1410978f21ad4be59873f27d5020500803a747d2f6ef617608d53c3cf63cc75b" default))
 '(package-selected-packages '(org-roam pdf-tools ## auctex)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )





(require 'pdf-tools)
(pdf-tools-build-server (expand-file-name (concat user-emacs-directory "elpa/pdf-tools-1.0")) nil nil nil (expand-file-name (concat user-emacs-directory "elpa/pdf-tools-1.0/server")))

(pdf-tools-install)



  (use-package pdf-tools
:init
(pdf-tools-install)
:config
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
      TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
      TeX-source-correlate-start-server t)
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
(setq pdf-view-use-scaling t)
(setq pdf-view-resize-factor 1.05)
:bind (:map pdf-view-mode-map
            ("<left>" . pdf-view-previous-page-command)
            ("<right>" . pdf-view-next-page-command)))

      (setq TeX-source-correlate-mode t)
(setq font-latex-fontify-script nil)
(setq reftex-extra-bindings t)  ;; Must be befor require reftex! (require 'reftex) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (add-hook 'LaTeX-mode-hook (lambda() (display-line-numbers-mode 1))) (add-hook 'LaTeX-mode-hook (lambda() (visual-line-mode 1))) (setq reftex-plug-into-auctex t)
;; magic words: (setq reftex-label-alist '((nil ?e nil nil nil ("system" "systems" "estimate" "estimates")))) (setq TeX-save-query nil)



;; turn off welcome window, inhibit startup message
;; setq to indicate function
;; inhibit-startup-message to true
(setq inhibit-startup-message t)

Also tested this config on macOS now and it also tries to build epdfinfo

Edit:

To fix the error with the locked database I had to remove msys64/var/lib/pacman/db.lck but I still get the error that autoreconf is missing.

1 Answer 1

0

Solved it with the following config for every machine I have, i.e. Windows 11, Arch Linux & macOS:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)


(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'zenburn t)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-safe-themes
   '("1410978f21ad4be59873f27d5020500803a747d2f6ef617608d53c3cf63cc75b" default))
 '(package-selected-packages '(org-roam pdf-tools ## auctex)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )








  (use-package pdf-tools
:init
(pdf-tools-install)
:config
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
      TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
      TeX-source-correlate-start-server t)
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
(setq pdf-view-use-scaling t)
(setq pdf-view-resize-factor 1.05)
:bind (:map pdf-view-mode-map
            ("<left>" . pdf-view-previous-page-command)
            ("<right>" . pdf-view-next-page-command)))

      (setq TeX-source-correlate-mode t)
(setq font-latex-fontify-script nil)
(setq reftex-extra-bindings t)  ;; Must be befor require reftex! (require 'reftex) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (add-hook 'LaTeX-mode-hook (lambda() (display-line-numbers-mode 1))) (add-hook 'LaTeX-mode-hook (lambda() (visual-line-mode 1))) (setq reftex-plug-into-auctex t)
;; magic words: (setq reftex-label-alist '((nil ?e nil nil nil ("system" "systems" "estimate" "estimates")))) (setq TeX-save-query nil)



;; turn off welcome window, inhibit startup message
;; setq to indicate function
;; inhibit-startup-message to true
(setq inhibit-startup-message t)

Basically I had to reinstall pdf-tools from MEPA.

And in MSYS64 I did

$ 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

I hope this helps someone from the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.