Subject: Re: bug#70708: hyperrogue: correct font path

From: [email-masked]
Date: Thu, 27 Feb 2025 11:24:25 -0500

Hi again,

If I just delete the font file the build fails since `search-input-file`
doesn't recursively check subfolders to find dejavu/share/fonts/truetype.

If we specify the folder of dejavu as I wrote in my patch then the file
in the source will be ignored and I do not understand the benefit of
also deleting it.

Is there a less hardcoded more general purpose way to identify the
folder with the font files? If so I can submit a modified patch to
delete the one from source and then detect the appropriate folder from
dejavu package but otherwise I feel like the patch I submitted is the
best solution.

Regards,
Tadhg

On 2025-02-20 2:36 p.m., Steve George wrote:
> Hi,
> 
> Ah OK, I understand.
> 
> In that case would you be up for updating the patch to remove the font 
> files using a snippet please?
> 
> Thanks,
> 
> Steve / Futurile
> 
> On 20/02/2025 15:39, [email-masked] wrote:
>> The game source code includes a copy of the dejavusans.ttf
>> https://github.com/zenorogue/hyperrogue/blob/master/DejaVuSans.ttf
>>
>> Since the source is considered the first input to the package the
>> function `search-input-file` finds it in the games source code and thus
>> the checkout of the code becomes a runtime dependency. This means that
>> the music and sounds folders which are copied to the package build must
>> be downloaded twice (one in checkout and one in built package) to use
>> the game.
>>
>> If you run `guix graph hyperrogue --type=references -M 1 | grep
>> checkout` you will see the runtime dependency on the code checkout and
>> if you remove font-dejavu from the dependencies without my patch you
>> will see it still renders text fine in game. With my patch it correctly
>> uses the font from the dejavu package and no longer depends on the checkout.
>>
>> If this is intended then at least we should remove the dependency on
>> font-dejavu since it is not used at all and reference the music and
>> sound from the checkout instead of copying it over and then also needing
>> the original.
>>
>>
>> On 2025-02-20 8:03 a.m., Steve George wrote:
>>> Hi Tadhg,
>>>
>>> Your patch in #70708 embeds the font in hyperrogue to be font-dejavu [0]. Can you explain why this is necessary please? I'm not familiar with this game, but I just quickly ran it and the font appeared to be fine in the tutorial.
>>>
>>> Thanks,
>>>
>>> Steve / Futurile
>>>
>>> [0] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70708
>>>
>