nixpkgs/pkgs/misc
Maximilian Bosch d9218155d2
ghostscript: use system-wide openjpeg
The following error occurs when using `imagemagickBig`:

    $ ./result/bin/identify sample.jp2
    [1]    699089 IOT instruction (core dumped)  ./result/bin/identify sample.jp2

When looking at the call-trace it seems as if certain symbols, e.g.
`opj_malloc` are mixed up:

    #8  0x00007f78c79ad2f5 in MagickSignalHandler.cold () from /nix/store/bqy80qiw6czqh7vsmmmivwdswp9zzjgl-imagemagick-7.1.0-29/lib/libMagickCore-7.Q16HDRI.so.10
    #9  <signal handler called>
    #10 0x00007f78c5a6095f in opj_malloc () from /nix/store/wg6ly83k1k1fjiygiv1jr7li3p6dwsvq-ghostscript-with-X-9.55.0/lib/libgs.so.9
    #11 0x00007f78c5a60981 in opj_calloc () from /nix/store/wg6ly83k1k1fjiygiv1jr7li3p6dwsvq-ghostscript-with-X-9.55.0/lib/libgs.so.9
    #12 0x00007f78c4f48e24 in opj_create_decompress () from /nix/store/qwalb0kjz1p9c4j48qkk6ql47ds2lnhh-openjpeg-2.4.0/lib/libopenjp2.so.7

The `opj_create_decompress()` is called from the `openjpeg`-integration
of `imagemagick` and thus shouldn't affect `ghostscript` at all.
However, `ghostscript` (`libgs.so` to be precise) also exposes e.g.
`opj_malloc`:

    $ objdump -t /nix/store/wg6ly83k1k1fjiygiv1jr7li3p6dwsvq-ghostscript-with-X-9.55.0/lib/libgs.so.9.55|grep opj_malloc
    0000000000205940 g     F .text	000000000000002b              opj_malloc

Because of that, two incompatible symbols are used in the same process
and thus the `identify`-call breaks because the wrong one is used. To
work around that I decided to use the system-wide openjpeg instead.
I'm not sure why `libgs.so` wants to expose these symbols anyways, but
with that workaround the problem is solved.

Even though it's mentioned that ghostscript's openjpeg is heavily
patched, I think that this is somewhat outdated or at least irrelevant
considering that both ArchLinux[1] and Fedora[2] use the system-wide
`openjpeg` instead.

[1] bafcb5473b/trunk/PKGBUILD (L50)
[2] e4eec13ab6/f/ghostscript.spec (_245)
2022-04-23 00:54:22 +02:00
..
acpilight acpilight: set mainProgram = "xbacklight" 2022-04-19 19:12:32 -04:00
ananicy ananicy: init at unstable-2021-11-05 2021-11-11 02:05:42 +02:00
ananicy-cpp ananicy-cpp: init at unstable-2021-10-13 2021-11-11 02:05:42 +02:00
apulse
arm-trusted-firmware make meta.license be a list rather than a single value 2022-02-08 01:53:25 -08:00
autoadb autoadb: init at unstable-2020-06-01 (#165244) 2022-03-23 06:29:45 +01:00
autotiling autotiling: 1.5 -> 1.6 2021-12-05 17:21:49 +00:00
barebox
base16-builder treewide: pass and inherit writeShellScript in node2nix packages 2021-11-16 16:08:23 +01:00
base16-shell-preview
beep beep: 1.4.11 -> 1.4.12 2022-02-12 16:13:58 +01:00
brightnessctl
calaos/installer
cbeams
cliscord maintainers: rename legendofmiracles to lom 2021-12-01 17:19:48 -06:00
cups treewide: move autoconf, automake to nativeBuildInputs 2022-03-30 20:17:24 -05:00
documentation-highlighter
doge
drivers argononed: init at unstable-2022-03-26 2022-04-05 13:59:50 -03:00
dumb treewide/meta: Remove chiiruno and replace with Madouura (#169096) 2022-04-18 02:13:36 +03:00
dxvk dxvk: 1.10 -> 1.10.1 2022-03-26 21:04:44 -04:00
flashfocus flashfocus: unpin pyyaml 2022-01-11 18:47:31 -08:00
frescobaldi frescobaldi: mark as broken on darwin 2022-01-02 18:22:24 -05:00
ghostscript ghostscript: use system-wide openjpeg 2022-04-23 00:54:22 +02:00
gnu-shepherd gnu-shepherd: init at 0.8.1 2021-12-31 20:51:10 +01:00
gnuk treewide: rename name to pname&version 2022-01-22 18:13:29 +01:00
hdt
i3a i3a: init at 2.0.1 2022-02-24 15:09:05 +08:00
ite-backlight ite-backlight: init at v1.1 2022-01-05 12:33:50 -08:00
jackaudio jackaudio: remove unneeded PKGCONFIG variable 2022-04-10 17:12:11 +02:00
jitsi-meet-prosody jitsi-meet-prosody: 1.0.5415 -> 1.0.5675 2021-12-30 12:47:31 -05:00
kitty-themes kitty-themes: init at unstable-2022-02-03 2022-02-06 16:37:15 -08:00
lguf-brightness treewide: add meta.mainProgram to many packages 2022-04-14 10:24:01 -07:00
libcardiacarrest
lightspark
lilypond lilypond: 2.22.1 -> 2.22.2 2022-03-04 20:41:47 -06:00
logging packetbeat: remove after being marked broken for over two years 2022-04-03 16:14:59 +01:00
long-shebang
meson-tools
mnemonicode
mxt-app mxt-app: 1.33 -> 1.36 2022-02-11 15:12:13 +01:00
my-env
openrussian-cli openrussian-cli: refactor to use lua.withPackages instead of luaPackages 2022-03-09 16:12:00 +10:00
opensbi opensbi: init at 1.0 2022-01-10 11:26:06 -08:00
plasma-hud plasma-hud: init at 19.10.1 (#74085) 2021-11-25 01:00:48 +01:00
present maintainers: rename legendofmiracles to lom 2021-12-01 17:19:48 -06:00
ptouch-print
pylode
rich-cli rich-cli: init at 1.5.1 2022-03-11 16:04:40 +10:00
riscv-pk
rkdeveloptool
sagetex sagetex: etc 2022-01-25 13:22:25 +00:00
sailsd
scimark treewide: add meta.mainProgram to many packages 2022-04-14 10:24:01 -07:00
scrcpy scrcpy: install shell completions 2022-02-24 01:36:43 +05:30
screensavers Merge pull request #163582 from Stunkymonkey/treewide-fetchFromGitHub-1 2022-03-22 07:27:54 +01:00
seafile-shared
sndio treewide/meta: Remove chiiruno and replace with Madouura (#169096) 2022-04-18 02:13:36 +03:00
solfege
sound-of-sorting
source-and-tags
stabber
t-rec t-rec: 0.6.0 -> 0.7.3 2022-03-21 19:20:06 +00:00
talkfilters
tmux-plugins tmux-thumbs: init at 0.7.1 2022-04-03 13:04:03 +02:00
tpm2-pkcs11
uboot Merge pull request #163429 from bartsch/maintainer-add-bartsch 2022-03-10 04:11:10 +01:00
uq
urbit
wiki-tui maintainers: add builditluc 2022-04-17 12:28:34 +02:00
xosd