Error when using 3rd-party script with pyvips and media-libs

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
strategictraveler
n00b
n00b
Posts: 4
Joined: Sat Oct 19, 2024 1:42 pm

Error when using 3rd-party script with pyvips and media-libs

Post by strategictraveler »

I'm trying to re-add tilesets to games-roguelike/catclysm-dda::guru since upsteam removed them from the main repo (they build them into releases using CI now), but the problem is that I keep having errors related to vips.

Theoretically I the ebuild should pull the tilesets from https://github.com/I-am-Erk/CDDA-Tilesets and the then run tools/gfx_tools/compose.py from https://github.com/CleverRaven/Cataclysm-DDA on every single tileset set in the USE flags. The script requires pyvips (not packaged in either ::gentoo or ::guru) and media-libs/vips[introspection,png].
For development I installed pyvips in a Python venv.

When I manually run compose.py on a tileset, the following error happens:

Code: Select all

(testvenv) user@a5b4e8eedb6e ~/test $ ./Cataclysm-DDA/tools/gfx_tools/compose.py ./CDDA-Tilesets/gfx/UltimateCataclysm
Traceback (most recent call last):
  File "/home/user/test/testvenv/lib/python3.13/site-packages/pyvips/vimage.py", line 1316, in __getattr__
    Introspect.get(name)
    ~~~~~~~~~~~~~~^^^^^^
  File "/home/user/test/testvenv/lib/python3.13/site-packages/pyvips/voperation.py", line 151, in get
    cls._introspect_cache[operation_name] = Introspect(operation_name)
                                            ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/home/user/test/testvenv/lib/python3.13/site-packages/pyvips/voperation.py", line 37, in __init__
    op = Operation.new_from_name(operation_name)
  File "/home/user/test/testvenv/lib/python3.13/site-packages/pyvips/voperation.py", line 191, in new_from_name
    raise Error(f'no such operation {operation_name}')
pyvips.error.Error: no such operation icc_transform
  VipsOperation: class "icc_transform" not found


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 1012, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 1001, in main
    tileset_worker.compose()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 346, in compose
    sheet.walk_dirs()
    ~~~~~~~~~~~~~~~^^
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 608, in walk_dirs
    self.process_png(filepath)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 635, in process_png
    self.sprites.append(self.load_image(filepath))
                        ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/user/test/./Cataclysm-DDA/tools/gfx_tools/compose.py", line 668, in load_image
    image = image.icc_transform('srgb')
            ^^^^^^^^^^^^^^^^^^^
  File "/home/user/test/testvenv/lib/python3.13/site-packages/pyvips/vimage.py", line 1320, in __getattr__
    raise AttributeError
AttributeError
I did all of the above inside a container based on the official stage3 Docker image. The only extra packages I installed was git, vips, and pyvips inside a venv. The script runs successfully inside a Ubuntu container.
User avatar
RumpletonBongworth
Apprentice
Apprentice
Posts: 152
Joined: Mon Jun 17, 2024 1:17 am

Post by RumpletonBongworth »

You may require media-libs/vips[lcms] for colour profile support.
Post Reply