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

inkscape: fix path patch #303748

Merged
merged 2 commits into from
Jun 1, 2024
Merged

inkscape: fix path patch #303748

merged 2 commits into from
Jun 1, 2024

Conversation

TuxCoder
Copy link
Contributor

@TuxCoder TuxCoder commented Apr 13, 2024

Bug

Not be able to open *.ps or *.eps files with inkscape

Reproduce:

create postscript file:
nix run -- nixpkgs#barcode -u mm -g 30x10 -o /tmp/barcode.ps -e ean13 -b 5421357512346

try to open results in an error:

nix run nixpkgs#inkscape /tmp/barcode.ps
/tmp/barcode.ps:1: parser error : Start tag expected, '<' not found
%!PS-Adobe-2.0
^
ink_file_open: '/tmp/barcode.ps' cannot be opened!
InkscapeApplication::document_open: Failed to open: /tmp/barcode.ps
ConcreteInkscapeApplication::on_open: failed to create document!

Not sure if this patch should be back-ported as currently you are not be able to open *.ps or *.eps files with inkscape.

Description of changes

Fix a bug introduced in 0db4b99
by missing the change from location="path" to location="absolute"

Add unit test for auto test this function in the future.

Things done

I tested this patch only on gnu/Linux 23.11, I don't know how it works on darwin.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Maintainer:
@jtojnar


Add a 👍 reaction to pull requests you find important.

fix a bug introduced in 0db4b99
by missing the change from `path` to `absolute` for the `location` argument
@TuxCoder TuxCoder changed the title [inkscape] fix path patch inkscape: fix path patch Apr 13, 2024
Copy link
Member

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks for including a test as well.

{ inkscape, runCommand, writeTextFile }:

let
svg_file = writeTextFile {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could move this SVG into a separate file or use an existing svg file like in

${finalAttrs.finalPackage}/libexec/xdg-desktop-portal-validate-icon --sandbox 512 512 ${../../../applications/audio/zynaddsubfx/ZynLogo.svg} > "$out"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hello @jtojnar ,
I tried to reduce the svg file to a minimum, but would keep external deps to a minimum.
So our test gets not broken by a change in another package.

If you think otherwise I will change to the external file.

to prevent future regressen add a smal test,
to check if ps2pdf plugin is working
by createing a .ps / .eps file and converting it back to svg
@lelgenio
Copy link
Contributor

lelgenio commented Jun 1, 2024

Result of nixpkgs-review pr 303748 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • spring
  • springLobby
52 packages built:
  • adapta-gtk-theme
  • arc-theme
  • arx-libertatis
  • asciidoc-full
  • asciidoc-full-with-plugins
  • asciidoc-full-with-plugins.dist
  • asciidoc-full.dist
  • ayu-theme-gtk
  • breeze-hacked-cursor-theme
  • capitaine-cursors
  • cinnamon.cinnamon-screensaver
  • cinnamon.iso-flags-png-320x420
  • cinnamon.iso-flags-svg
  • clevis
  • clevis.man
  • coreboot-configurator
  • dblatexFull
  • disorderfs
  • emojione
  • fim
  • hackneyed
  • hikounomizu
  • inkscape
  • inkscape-extensions.textext
  • inkscape-extensions.textext.dist
  • inkscape-with-extensions
  • iso-flags
  • k40-whisperer
  • kabeljau
  • rep (kakounePlugins.rep)
  • luksmeta
  • mate.mate-panel-with-applets
  • mate.mate-utils
  • material-cursors
  • mojave-gtk-theme
  • numix-cursor-theme
  • numix-solarized-gtk-theme
  • plata-theme
  • pop-gtk-theme
  • python311Packages.diagrams
  • python311Packages.diagrams.dist
  • python311Packages.osc-diagram
  • python311Packages.osc-diagram.dist
  • python312Packages.diagrams
  • python312Packages.diagrams.dist
  • python312Packages.osc-diagram
  • python312Packages.osc-diagram.dist
  • tang
  • tang.man
  • vimix-cursors
  • volantes-cursors
  • wpa_supplicant_gui

@jtojnar jtojnar added the backport release-24.05 Backport PR automatically label Jun 1, 2024
@jtojnar jtojnar merged commit c753576 into NixOS:master Jun 1, 2024
24 checks passed
Copy link
Contributor

github-actions bot commented Jun 1, 2024

Successfully created backport PR for release-24.05:

@jtojnar
Copy link
Member

jtojnar commented Jun 1, 2024

Sorry I forgot about this. Thanks again.

@TuxCoder
Copy link
Contributor Author

TuxCoder commented Jun 1, 2024

no problem,
also thanks for backporting to 24.05!
and for help maintaining nixos!

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.

3 participants