summaryrefslogtreecommitdiff
path: root/server
AgeCommit message (Collapse)Author
2026-01-02fix(macos): add poppler and pcre2 to PKG_CONFIG_PATH for Homebrew buildsVedang Manerikar
Some macOS users were experiencing build failures where pkg-config could not find poppler, even with Homebrew's poppler package installed. This occurs when Homebrew doesn't properly link the .pc files to the standard pkg-config search path. Fixes #299
2025-12-30fix(autobuild): add doas as privilege escalation fallbackVedang Manerikar
Alpine Linux deprecated sudo in favor of doas. Add doas support to exec_privileged() so autobuild works on Alpine without requiring users to install and configure sudo. Fixes #323
2025-12-30fix: attempt 1 fixing the appveyor build fileVedang Manerikar
2025-12-29Add support for Android Emacs using TermuxJohan Widén
Notes from the original PR: The dependencies for android in autobuild can not be installed in pdf-tools-install, they have to be installed manually in Termux. But the dependencies are checked when running autobuild. pdf-tools-install successfully installs epdfinfo in Android Emacs. One can then view pdf files. The shebang in autobuild does not work in Termux, I therefore had to create a separate script "autobuild.android" that in turn executes autobuild. The problem with the shebang is that "env" in Termux is not located at "/usr/bin/env". pdf-tools/Makefile does currently not work in Android Emacs, but it is not needed for running pdf-tools-install. Fixing this will have to be done in a separate pull request, if deemed necessary. Reason: There is yet no consensus for how to implement a command line emacs, to be run in batch mode, in Android Emacs. I have successfully run "make test" in Ubuntu, in the repo feature branch. Running "make server-test" in the master branch fails, so I have not tested this in the feature branch. Closes: #230 Author: @johanwiden
2025-12-29feat(midnight-mode): add gamma correction and fix RGB bugsZiv Scully
Add gamma correction options for better contrast control in midnight mode: - pdf-view-midnight-gamma: nonlinearly scale lightness (default 1.0) - pdf-view-midnight-gamma-before-invert: control gamma application order Bug fixes: - Fix RGB normalization (255 not 256) - was causing incorrect background color - Add missing black→foreground fast path (comment existed but code was missing) Closes: #329 Author: @vizziv
2025-12-29feat(server): add Nobara Linux supportGabriel Santos
Add build support for Nobara Linux, a Fedora derivative. - Add os_nobara() detection function (checks /etc/nobara-release) - Uses same packages as Fedora (dnf package manager) - Add to --os argument handling and auto-detection chain Closes: #301 Author: @gs-101
2025-12-28fix(server): replace tempnam with mkstemp/_tempnamJimmy Yuen Ho Wong
Use platform-appropriate temp file creation: - _tempnam() on Windows (Microsoft-recommended) - mkstemp() on Unix-like systems Fixes #110, addresses #316 Supersedes #235
2025-12-28feat(server): add MSYS2 UCRT64 environment supportSundaram Ramaswamy
Support the newer UCRT64 MSYS2 environment (recommended default per msys2.org). - Add UCRT64 detection to server/autobuild - Fix vasprintf implicit declaration error on Windows (synctex_parser.c) - Update configure.ac for Windows compatibility Fixes #282, #286 Supersedes #295 Tested by multiple users on Windows 10/11 with MSYS2. Co-authored-by: legends2k
2024-04-05Fix: Update PKG_CONFIG_PATH to add glib headersVedang Manerikar
Copying my comment from the Github issue: > The problem is that something seems to have changed in the way brew > installs glib, due to which pkg-config does not find the glib headers. > > To fix this, I have updated the autobuild script to manually modify > the PKG_CONFIG_PATH. This should fix the problem. > > I will test the change and close this issue via the commit once I push > it. You will need to update your version of pdf-tools and then restart > Emacs to trigger the re-build again. (It might take a few hours for > Melpa to pick up the latest version of the pdf-tools) > > I will create a linked issue to investigate a better long-term > solution to this problem. Closes: #269
2024-02-26autobuild: Update gentoo packagesThanos Apollo
2023-06-11Allow creation of markup annotations without a text selectionAugusto Stoffel
This allows calling `pdf-info-addannot` from Lisp with a nil `markup-edges` argument, which was previously disallowed. In this case, the annotation covers exactly the selected region of the page, without attempting to match it to a certain text region. This means that you can now highlight an exact region! Just select the region by holding down the Meta key and dragging the mouse. Then invoke `pdf-annot-add-highlight-markup-annotation` (with `C-c C-a h`) and voila! Closes: #191
2023-06-10Add hue contribution of background color to inverted midnight modeZach Kost-Smith
From the comments in the PR, @smithzvk explains the changes: > I was bugged that it didn't pick up the hue from the background, > however, so I made the all color a/b parameters start from the a/b > parameters of the BG color. This makes the PDF background (white) > map to your BG color and PDF foreground (black) map to your FG > color, which can be set to your theme background making it seem > pretty seamless. Note that if you set your BG and FG to a color > theme without zero saturation (a gray tone of some sort), then you > recover the original behavior. > > I also reinstated the cached transforms for background and the last > color computed. > > I also refactored the loop to move the switch statement outside of > the loop. It is more repetitive, but it was needed to get rid of > some warnings about potentially uninitialized variables. It should > also be faster as the branch was removed from the loop. > > I also ditched the gamma correction as it seemed to be doing the > wrong thing and I never had a theoretical reasoning for it. I can > get similar results if I just set my BG color to something like > gray5 instead of black. Barely a difference in background but the > hinting on the fonts is showing again. The root of my issue may > have always been some kind of display calibration issue. Closes: #197
2023-06-10Fix: high contrast render in midnight modeZero
Uses the Lightness values from the `pdf-view-midnight-colors` `fg` and `bg` to scale the inverted color's lightness. Band-aid till better method is found. Relates to: #69
2023-03-22Add `cairo-devel` to Void Linux package listJoão Paulo da Cruz
In Void Linux most heading/development files are separated from the "main" packages and are stored on `${package-name}-devel`. The autobuild for Void fails because it tries to find `cairo-devel`, which contains `cairo`, respectives headers and other dependencies. This Pull Request adds `cairo-devel` to the `PACKAGES` variable
2023-01-17Add support for midnight mode with colorZach Kost-Smith
This inversion method attempts to maintain the color hue and saturation but inverts the lightness using the OKLab color space[^1]. [^1]: https://bottosson.github.io/posts/oklab/ * server/epdfinfo.c (image-recolor): Add feature to support the OKLab inversion method functionality * lisp/pdf-view.el (pdf-view-midnight-invert): Add new variable to invert the image color lightness while maintaining hue. (pdf-view-midnight-minor-mode): Account for above. * lisp/pdf-info.el (pdf-info-query--parse-response): Handle changes to :render/usecolors command Closes: #69 Closes: #169 Closes: politza/pdf-tools#698 Closes: politza/pdf-tools#608
2023-01-16Make selection style configurable by introducing a new variablelennonhill
Make selection-style configurable via `pdf-view-selection-style`. A default value of `word` might be desirable, as selection is usually intended to select entire words is perceptually faster than glyph-based selection. This affects selections and highlights, but not search. Limitation: The selection type is fixed for all currently selected regions. Selecting multiple regions with different selection styles at the same time would require storing the selection style for every region and replacing the protocol for `cmd_addannot` with a more flexible one, e.g. the keyword-based one used by `cmd_renderpage`. Closes: #73
2023-01-15epdfinfo: Extract server code for selection_style validationlennonhill
2022-12-02autobuild: Update script for VoidVedang Manerikar
This commit is a squashed commit of PR #164 by @skyler544 Author: Skyler Mayfield <skyler544@gmail.com> Date: Fri Oct 21 12:00:46 2022 +0200 Closes: #164
2022-11-25autobuild: Recognize NetBSD and install packages via pkginfeature/emacs-26.3Sunil Nimmagadda
Closes: #170
2022-11-25Extend docker testing framework to test against Emacs versionsVedang Manerikar
Until this commit, docker-based local testing only checked whether the epdfinfo server compiled correctly. With this commit, local testing now also runs elisp tests against the different versions of Emacs we currently support. All versions of Emacs are run on Ubuntu at the moment, but going forward I expect that we will add more operating system variants to this matrix as well. As test coverage increases, this will help automate away a lot of the tests! Relates to: #130
2022-11-25Make sure pkg-config is correctly set in autobuildVedang Manerikar
Also, simplify the config script for finding gnu-sed. Relates to: #160
2022-11-25Add support for Alpine Linux to autobuildVedang Manerikar
This ensures that all operating systems currently mentioned in the README are covered in the autobuild script Relates to: #160
2022-10-07Enable testing against MacOS in CI/CD!v0.99Vedang Manerikar
This is pretty cool, I hope it works! 🤞 It uses the `macos` orb provided by CircleCI, as documented here: https://circleci.com/docs/using-macos This commit also rewrites the older anchor style common steps into the newer command syntax, which is more readable. The command syntax is documented here: https://circleci.com/docs/configuration-reference#commands Installing pre-reqs on MacOS via `brew` was non-trivial. This is mainly because of the `sed` command used in the `Makefile`. It isn't a problem normally because it is only used for packaging, which is done on Melpa Relates to: #98
2022-10-06Add make targets to start / stop the podman VMVedang Manerikar
This is just a convenience wrapper for me
2022-10-06Speed up server testing by keeping the containers aroundVedang Manerikar
This allows re-using containers, saving a tremendous amount of time. The drawback here is that any environment change (on the docker / podman containers side) is not detected. The way to deal with this will be to create a process around major releases where I delete all the containers and re-test from scratch. Relates to: #130
2022-10-04Revert "Adds translattion of highlight annotations"Vedang Manerikar
This reverts commit 0107f80dcf268d08ac075b01729820062c0fbd67 The reason for doing this is explained by @vizs in #143, copying the message here: Andreas wrote the function `annotation_translate_quadrilateral`[^1][^2] to fix misplaced annotations due to the then bug in `glib`. This misplacement bug can be seen in the images posted in issue politza/pdf-tools#577, along with PDFs in which the bug can be reproduced. This lack of translation in the `glib` backend was fixed in `poppler 0.86.0` but the workaround was still left hanging in `epdfinfo.c` which brings us to today where this unneeded translation bites our back. I commented out the calls to `annotation_translate_quadrilateral` in `epdinfo.c` and to my surprise, there were no misplaced translations in files which displayed the misplacing behaviour and in files which did not have this behaviour. [1]: https://github.com/politza/pdf-tools/commit/0107f80dcf268d08ac075b01729820062c0fbd67 [2]: politza/pdf-tools#122 Closes: #143 Closes: #146
2022-10-03Fix nix-shell pkg-config dependency nameMario Rodas
Recently nixpkgs removed the `pkgconfig` alias[^1], which broke the build with `nix-shell`. [^1]: https://github.com/NixOS/nixpkgs/pull/192681 Closes: #153 Closes: #158
2022-08-23Revert "synctex_parser: fix vasprintf() not exists in non-GNU environment ↵Vedang Manerikar
(#134)" This reverts commit bea5ddb9fc234b48db6df3dcb66d75e76bec00c8 because `pdf-tools` compilation is broken. Closes: #141 Reopens: #134
2022-08-22synctex_parser: fix vasprintf() not exists in non-GNU environment (#134)lin.sun
The vasprintf() is a GNU extension function, missed in non-GNU build environment, so we define it. Without this change, there will have error message when we build with clang: ``` ./autogen.sh ./configure CC=clang make ``` We will get errors: ``` synctex_parser.c:8448:13: error: call to undeclared function 'vasprintf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (vasprintf(&buffer, format, va) < 0) { ``` This change fixes the problem.
2022-08-22Don't depend on gcc when building with `nix-shell` (#135)Mario Rodas
* Use `--run` flag to execute nix-shell The `--command` flag is only required to spawn a interactive shell. * Do not require gcc to build with nix-shell `nix-shell` already sets CC with a C compiler, for instance Clang on darwin. * Remove outdated require in test-helper `f.el` is not needed anywhere.
2022-08-22Fix: remove execute permisions from temp filesZachary Newman
They aren't used. Fixes #138.
2022-07-21Fix: Dockerfile for ubuntu-18/20 needs fix-missingVedang Manerikar
The output on the terminal suggested using fix-missing, which seems to fix the sources and find the packages :)
2022-07-20Test and Documentation changes: dockerfiles and readmeVedang Manerikar
README changes: - Add documentation on how to test / add support for your favorite operating system. Dockerfile changes: - Rename Dockerfile.in to Dockerfile.common.in, to make the name clearer. - Add make as a prerequisite in the Dockerfile. + It is needed to run make commands and is not available in some of these images. - Add make targets for printing operating systems that are not yet supported in Docker testing. + This should help contributors with adding support for testing on these systems. + New targets are `server-test-supported` and `server-test-unsupported` at the top level. Related to: #130
2022-07-15Make sure autoconf is install on macOS so autoreconf may runJimmy Yuen Ho Wong
2022-05-21Add a Makefile target to clean docker containersVedang Manerikar
No point leaving dead containers lying around. Relates to: #98
2022-05-21Create named containers when running docker/podman testsVedang Manerikar
This simplifies container operations and ensures that we don't have dead containers hanging around. Relates to: #98
2022-05-21Update the current Dockerfile templatesVedang Manerikar
- Move all package installation to the autobuild file. The Dockerfile should simply start a container and make sure that all the package repositories are updated. - Dockerfiles should spin up containers for the latest (ish) releases of the major Linux operating systems. - Disable Dockerfiles for environments which are not working correctly. List of operating systems where `epdfinfo` server compilation is tested and working correctly: - Debian (9, 10, 11) - Ubuntu (18, 20, 22) - Fedora (34, 35, 36) List of operating systems where `epdfinfo` server compilation is failing inside the containers, for unknown reasons: - Gentoo - Centos - Archlinux List of operating systems that need to be added to containerized testing: - MacOSX - Windows via Msys2 (Mingw32, Mingw64) - OpenBSD - FreeBSD - NixOS - Void - OpenSuse Relates to: #98
2022-05-21Remove usage of all private poppler headers in pdf-toolsPi-Cla
This commit also removes C++ entirely, as it is not needed anymore for correct compilation of `epdfinfo`. The following changes are made: - Remove private headers from all the server code. This involves: - Replace private header functionality with the correct public functions provided by poppler. - Remove unneeded headers around date checks - Delete dead-code (headers, m4 macros) - Remove C++, g++ and similar aliases from all the code. Also: - Remove related information from the README - Remove related information from CI and Dockerfiles Work done by: @Pi-Cla Closes: #105, #103, #109, #114
2022-05-11Revert "Use mkstemp instead of tempnam"Vedang Manerikar
This reverts commit 37bbe861755bc60c7cc333359fee3e2a5d919c77. As explained by @ShuguangSun (re: testing the change on Windows) on > Sorry. It is my fault. The issue is still there. The different is > that the temp dir is created now. However, it reports "Unable to > create temporary file". Reopens: #110
2022-05-11Use mkstemp instead of tempnamVedang Manerikar
This reverts commit 8ee31220a6ae3e41549bfffca7a89c481d270004 and brings in @JunyuanChen's change once again. We modify the commit to fix the problem on Windows by changing the code as follows: --- a/server/epdfinfo.c +++ b/server/epdfinfo.c @@ -347,6 +347,6 @@ static char* mktempfile() { - char template[] = "/tmp/epdfinfoXXXXXX"; + char template[] = P_tmpdir "/epdfinfoXXXXXX"; char *filename = malloc(sizeof(template)); memcpy(filename, template, sizeof(template)); This works correctly for Windows (as confirmed by @ShuguangSun), Mac (tested by @vedang) and Linux (tested by @Junyuanchen) Relates to: #101, #94 Closes: #110
2022-05-09Revert "Use mkstemp instead of tempnam"Vedang Manerikar
This reverts commit d63a1e7d87f9b0a19209f2eeb170bcf64612aa2f. In d63a1e7, @JunyuanChen fixed a long standing compilation warning by replacing `tempnam` with `mkstemp` in `epdfinfo`. However, the `mkstemp` implementation does not work correctly on MS Windows (probably because the path template is "wrong" for Windows). I am reverting the commit and opening a new issue #110 to track the correct implementation of `mkstemp` (or equivalent) on MS Windows. It would also be great to add a test against Windows CI to open a PDF and check that the operation completes successfully. Closes: #101
2022-05-09Add workaround for compilation using C++17 standard libraryVedang Manerikar
As explained in #102 by @Pi-Cla and @uliw, `pdf-tools` relies on private headers provided by `poppler`. In order to compile these correctly, we need the standard library provided by C++17. `pdf-tools` is built and tested against C++11. This workaround provides the correct CXXFLAGS to compile the library and fixes the immediate broken compilation problem. There should be two "correct" fixes to these: 1. Remove dependence on private `poppler` headers. This is being tracked in #103 and #105 2. Upgrade `pdf-tools` to build and run against new C++ versions. This is being tracked in #109. Closes: #70, #76, #102, #108, politza/pdf-tools#706.
2022-04-26Add pkgconf to opensuse buildPi-Cla
Nearly forgot to add pkgconf.
2022-04-26Add support for openSUSE except MicroPi-Cla
I am not qualified to add support for the Micros versions of openSUSE, but this supports the most commonly used versions.
2022-04-26Add to PKG_CONFIG_PATH, instead of replacing it.Vedang Manerikar
This is a better solution as it takes into account paths that have already been set up by users. Potentially fixes: #70
2022-04-25Install automake on Mingw systemsVedang Manerikar
This fixes the `server/autobuild` installation on Windows, as mentioned in #86. Fixes: #86
2022-04-25Use mkstemp instead of tempnamJunyuanChen
Removes the following warning when compiling `epdfinfo`: ``` build/server/epdfinfo.c:354: warning: the use of `tempnam' is dangerous, better use `mkstemp' ```
2022-01-25Fix: build on NixOS without nixpkgs in the Nix pathYevhen Shymotiuk
People who use [Nix Flakes](https://nixos.wiki/wiki/Flakes) do not usually have `nixpkgs` in their `NIX_PATH`, which leads to failed builds, because `nix-shell` relies on it. I suppose some users might not have `nixpkgs` in `NIX_PATH` for other reasons also. I propose to use [NixOS/nixpkgs](https://github.com/NixOS/nixpkgs) in such cases Merges, Closes: #72
2022-01-07Install base-devel, autoconf on AppveyorVedang Manerikar
Since 6th Jan, 2022, builds on Appveyor are failing because they cannot find `autoreconf`[1][2]. This should be implemented from `base-devel`, but even with `base-devel` available the builds are failing. Adding an explicit require on `autoconf` in the hope that this is fixed. 1: https://ci.appveyor.com/project/vedang/pdf-tools/builds/42114287 2: https://ci.appveyor.com/project/vedang/pdf-tools/builds/42101965 Relates to: #68
2022-01-03Add Void Linux OS and package manager to autobuild scriptgoiabae
Very simple addition to the autobuild script to include the xbps package manager and Void Linux. Closes: politza#685