SimonN / LixD

Lix: Lemmings-like game with puzzles, editor, multiplayer
https://www.lixgame.com
132 stars 17 forks source link

AUR: LixD does not compile #469

Closed Timofei302 closed 5 months ago

Timofei302 commented 1 year ago

I tried installing LixD via pamac and aura, but in the end, ldc/dmd completes compilation with an error. I tried to install lix and lix-git

Compiling Lex 0.15 with LDC for Linux, 64-bit... Linking lix /usr/bin/ld: cannot be found -lallegro_acodec-5: No such file or directory /usr/bin/ld: cannot be found -lallegro_image-5: No such file or directory /usr/bin/ld: cannot be found -lallegro_primitives-5: No such file or directory /usr/bin/ld: cannot be found -lallegro_ttf-5: No such file or directory collect2: error: ld execution ended with return code 1 Error: /usr/bin/cc failed with status: 1 Error /usr/bin/ldc2 failed with exit code 1. ==> ERROR: There was a failure in build(). Interrupt...

SimonN commented 1 year ago

Hi!

Have you installed Allegro 5? What is your output of:

$ find /usr -name liballeg\*so

If Allegro 5 is installed, you should see lines with liballegro_acodec.so and similar.

Have you installed pkg-config? In Lix's dub.json, I tell the linker to link against allegro_acodec-5 instead of against allegro_acodec (which would match the installed filename) because dub (the build system that Lix uses) likes to resolve library names with pkg-config first, and pkg-config needs the name allegro_acodec-5.

If pkg-config is not installed, please install it, e.g., with

# pacman -S pkgconf

... and then retry to build one of the AUR Lix package.

@Lucki: You maintain AUR packages lix and lix-git. They install allegro (via Arch packaging) but not pkgconf. Let's see if installing pkgconf fixes the issue here; it makes sense then to add it to the Lix AUR packages as an Arch packaging requirement.

Timofei302 commented 1 year ago

Hi!

Have you installed Allegro 5? What is your output of:

$ find /usr -name liballeg\*so

If Allegro 5 is installed, you should see lines with liballegro_acodec.so and similar.

Have you installed pkg-config? In Lix's dub.json, I tell the linker to link against allegro_acodec-5 instead of against allegro_acodec (which would match the installed filename) because dub (the build system that Lix uses) likes to resolve library names with pkg-config first, and pkg-config needs the name allegro_acodec-5.

If pkg-config is not installed, please install it, e.g., with

# pacman -S pkgconf

... and then retry to build one of the AUR Lix package.

@Lucki: You maintain AUR packages lix and lix-git. They install allegro (via Arch packaging) but not pkgconf. Let's see if installing pkgconf fixes the issue here; it makes sense then to add it to the Lix AUR packages as an Arch packaging requirement.

I have had Allegro installed for so long that I no longer remember which package required it from me. But I didn't have pkgconf installed, and installing it solved the problem. Screenshot_20230914_153332

SimonN commented 1 year ago

All right, then it was the missing pkg-config. Thanks for your quick feedback, and enjoy Lix!

I'll discuss with Lucki if it makes sense to add pkgconf to the dependencies of the AUR Lix packages.

SimonN commented 1 year ago

The AUR introduction wiki page says:

1 Getting started Ensure base-devel is installed. 2.1 Prerequisites Note: Packages in the AUR assume that base-devel is installed in the build environment.

Installing base-devel will install pkgconf. Thus, when Lucki created lix-git, he didn't list pkgconf as a dependency because AUR packages may silently rely on base-devel.

The main problem is: With only the silent reliance (instead of explicitly listing pkgconf as a dependency), the failed build produces misleading errors. The errors sound as if we have a half-installed Allegro 5 or as if my dub.json fails to list Lix's link-time libraries proprely. But the real problem is the library name resolution because dub prefers pkg-config. I can list only the Allegro 5 core library in a pkg-config-agnostic way, but not the Allegro 5 add-on libraries.

@Lucki: In light of these misleading error messages, should we add pkgconf as an explicit dependency to lix-git? I am aware that the AUR introduction page explains several times that base-devel must be installed, which installs pkgconf.

SimonN commented 5 months ago

@Lucki: I still advise to add pkgconf as an explicit dependency to the AUR Lix package.

Reason: If somebody forgets to install base-devel, he'll nearly succeed with building Lix, but he'll run into those fiendish linker errors that don't point to the problem (missing pkg-config).

I'm closing this bug nonetheless because Timofei succeeded in building Lix after all.