Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k2pdfopt: 2.51a -> 2.53 #93631

Merged
merged 2 commits into from Sep 3, 2020
Merged

Conversation

danielfullmer
Copy link
Contributor

Motivation for this change

Bump to latest version. See: https://www.willus.com/k2pdfopt/k2pdfopt_version.txt

k2pdfopt is a pain to package. Instead of shipping patches for mupdf,
leptonica, and tessertact, k2pdfopt includes modified source files for these
packages. Individual files from the {mupdf,leptonica,tesseract}_mod/
directories are intended to replace the corresponding source files in the
upstream packages, for a particular version of that upstream package.

The previous packaging approach involved manually replacing these files and
producing patches which could then be applied to those packages. The benefit
of creating and applying these patches in this way is that minor updates
(esp. security fixes) might still allow these patches to apply successfully.

The current approach creates these patches using nix. This has the benefit of
easier review and should hopefully be simpler to update in the future.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

# easier review and should hopefully be simpler to update in the future.

let
# Create a patch against src based on changes applied in patchCommands
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That actually looks so useful that it might be nice to have in the standard library :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does seem pretty generic. I wonder if there are other places in nixpkgs that could use something like this.

Copy link
Contributor

@Moredread Moredread left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides maybe improving comments in the derivation everything looks fine.

Ran nix-review and used k2pdfopt on a PDF file.

pkgs/applications/misc/k2pdfopt/default.nix Outdated Show resolved Hide resolved
pkgs/applications/misc/k2pdfopt/default.nix Outdated Show resolved Hide resolved
@danielfullmer
Copy link
Contributor Author

@Moredread Thanks for the review! I've addressed your comments, and also improved the comment paragraph explaining the unique packaging approach for k2pdfopt here.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/213

@AndersonTorres AndersonTorres merged commit 6b043b1 into NixOS:master Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants