Skip to content

Problems (and workarounds) when building installer on EndeavourOS #6

@torepettersen

Description

@torepettersen

Hi,

Thanks for your amzing work on Elixir Desktop, so far it seems really promising 😊
I now litteraly have a native application running on my computer with Elixir and Phoneix LiveView, which I have been dreaming about.

I ran into some problems when trying to build the installer on EndeavourOS.

First one is that gdk-pixbuf-query-loaders, is located in /usr/bin:

** (MatchError) no match of right hand side value: []
    (desktop_deployment 1.0.0) lib/package/linux.ex:171: Desktop.Deployment.Package.Linux.import_pixbuf_loaders/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:18: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/tore/.local/share/mise/installs/elixir/1.17.3-otp-27/bin/mix:2: (file)

I solved that by replacing:

[loader | _] =
  :filelib.wildcard(~c"#{Path.dirname(libgdk)}/gdk-pixbuf-*/gdk-pixbuf-query-loaders")

with:

[loader | _] =
  :filelib.wildcard(~c"/usr/bin/gdk-pixbuf-query-loaders")

Second one is a bit similar where gtk-query-immodules-3.0 is also located in /usr/bin:

** (MatchError) no match of right hand side value: []
    (desktop_deployment 1.0.0) lib/package/linux.ex:117: Desktop.Deployment.Package.Linux.import_immodules/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:22: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/tore/.local/share/mise/installs/elixir/1.17.3-otp-27/bin/mix:2: (file)

Here I did a similar change, by replacing:

[loader | _] =
  :filelib.wildcard(~c"#{Path.dirname(libgtk)}/libgtk-3-*/gtk-query-immodules-*")

with:

[loader | _] =
  :filelib.wildcard(~c"/usr/bin/gtk-query-immodules-*")

Last one is an error when trying to strip /priv/gio/modules/.keep:

Running: strip -s /home/tore/workspace/hawk/_build/prod/rel/default/lib/hawk-0.1.0/priv/gio/modules/.keep
** (MatchError) no match of right hand side value: {"", 1}
    (desktop_deployment 1.0.0) lib/tooling.ex:124: Desktop.Deployment.Tooling.cmd!/2
    (desktop_deployment 1.0.0) lib/tooling.ex:82: Desktop.Deployment.Tooling.strip_symbols/1
    (desktop_deployment 1.0.0) lib/tooling.ex:51: Desktop.Deployment.Tooling.priv_import!/3
    (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:23: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5

I solve that by filtering the files in import_libgio_modules/2 to only include .so files. So from:

files = wildcard(Path.dirname(libgio), "gio/modules/*")

to:

files = wildcard(Path.dirname(libgio), "gio/modules/*.so")

How could this be solved?

Don't know if you intend to support building on all Linix distros.

But if if you do, then I am curious why gdk-pixbuf-query-loaders and gtk-query-immodules-3.0 isn't just called directly? E.g. System.cmd("gdk-pixbuf-query-loaders", []). Wouln't those executalbes normally by in one of the directories listed in PATH?

And for libgio modules. Could it be a problem to there filter by .so extention that I am not aware of?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions