mibi88 / MibiMdEditor

MibiMdEditor is a small Markdown editor written in Vala using GTK4
GNU General Public License v2.0
14 stars 3 forks source link

Build errors in Arch Linux #9

Open ogarcia opened 1 year ago

ogarcia commented 1 year ago

I'm trying to build v.0.4-b1 and I give this ld error on meson compile command:

$ meson compile
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja
[12/12] Linking target src/mibimdeditor
FAILED: src/mibimdeditor 
cc  -o src/mibimdeditor src/mibimdeditor.p/meson-generated_.._.._mibimdeditor-resources.c.o src/mibimdeditor.p/meson-generated_ui_window.c.o src/mibimdeditor.p/meson-generated_main.c.o src/mibimdeditor.p/meson-generated_ui_preferencesswitch.c.o src/mibimdeditor.p/meson-generated_ui_script_properties.c.o src/mibimdeditor.p/meson-generated_ui_preferences.c.o src/mibimdeditor.p/meson-generated_application.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group /usr/lib/libglib-2.0.so /usr/lib/libgobject-2.0.so /usr/lib/libgtk-4.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libharfbuzz.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so /usr/lib/libgraphene-1.0.so /usr/lib/libgio-2.0.so /usr/lib/libwebkitgtk-6.0.so /usr/lib/libsoup-3.0.so -Wl,--export-dynamic /usr/lib/libgmodule-2.0.so -pthread /usr/lib/libjavascriptcoregtk-6.0.so /usr/lib/libgtksourceview-5.so /usr/lib/libadwaita-1.so -Wl,--end-group
/usr/bin/ld: /usr/lib/libwebkitgtk-6.0.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libadwaita-1.so: undefined reference to `fmod@GLIBC_2.38'
/usr/bin/ld: /usr/lib/libgbm.so.1: undefined reference to `__isoc23_strtoll@GLIBC_2.38'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I set this depends:

depends=('gtk4' 'gtksourceview5' 'libadwaita' 'webkitgtk-6.0')
makedepends=('cmake' 'meson' 'vala')
mibi88 commented 1 year ago

I set this depends:

depends=('gtk4' 'gtksourceview5' 'libadwaita' 'webkitgtk-6.0')
makedepends=('cmake' 'meson' 'vala')

Where did you added them? Does it works if you try to compile it like it is on the main branch, by running the following commands?

$ meson setup bin
$ cd bin
$ meson compile
# meson install
ogarcia commented 1 year ago

Yes. The meson setup bin command works correctly but then the meson compile command is the one that gave me the error I mentioned above, but you must have made some changes and now it works without problems.

The list of dependencies was to let you know that I have installed those dependencies in a clean installation of the system.

Now what fails me is the meson install (I run it as follows to install it in another directory meson install -C build --destdir pkg):

$ meson install -C build --destdir pkg
ninja: Entering directory `/home/vagrant/build'
ninja: no work to do.
Installing data/io.github.mibi88.MibiMdEditor.desktop to /home/vagrant/build/pkg/usr/share/applications
Installing data/io.github.mibi88.MibiMdEditor.appdata.xml to /home/vagrant/build/pkg/usr/share/appdata
Installing src/mibimdeditor to /home/vagrant/build/pkg/usr/bin
Installing po/fr/LC_MESSAGES/MibiMdEditor.mo to /home/vagrant/build/pkg/usr/share/locale/fr/LC_MESSAGES
Installing po/de/LC_MESSAGES/MibiMdEditor.mo to /home/vagrant/build/pkg/usr/share/locale/de/LC_MESSAGES
Installing /home/vagrant/MibiMdEditor/data/io.github.mibi88.MibiMdEditor.gschema.xml to /home/vagrant/build/pkg/usr/share/glib-2.0/schemas
Installing /home/vagrant/MibiMdEditor/data/icons/hicolor/scalable/apps/io.github.mibi88.MibiMdEditor.svg to /home/vagrant/build/pkg/usr/share/icons/hicolor/scalable/apps
Installing /home/vagrant/MibiMdEditor/data/icons/hicolor/symbolic/apps/io.github.mibi88.MibiMdEditor-symbolic.svg to /home/vagrant/build/pkg/usr/share/icons/hicolor/symbolic/apps
Running custom install script '/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas'
Failed to create file “/usr/share/glib-2.0/schemas/gschemas.compiled.VGZD91”: Permission denied
FAILED: install script '/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas' exit code 1, stopped

Is it possible that it is forced not to use destdir in the schema creation script?

mibi88 commented 1 year ago
Failed to create file “/usr/share/glib-2.0/schemas/gschemas.compiled.VGZD91”: Permission denied

You need to be root to install it, because you didn't had the permission to install files in /usr/share.

When I wrote the commands in my previous comment I wrote # meson install because you need to be root.

Try $ sudo meson install -C build --destdir pkg.

ogarcia commented 1 year ago

You need to be root to install it, because you didn't had the permission to install files in /usr/share.

So if you do it this way it is impossible to package. Note that package systems work in temporary directories (hence the use of destdir) when creating packages.

mibi88 commented 1 year ago

I think the problem is that I'm using the prefix option in some paths, but I really have no idea for the moment how to fix that. I don't have a lot of time this week, and I want to make MibiMdEditor translatable, so I'll see how I can fix it later.

If you want you can also try to fix it, and make a pull request if you fixed it.

ogarcia commented 1 year ago

If you want you can also try to fix it, and make a pull request if you fixed it.

Sorry, but I don't have enough meson/gtk knowledge to send you a merge request.

No problem, as soon as you can take a look at it I'll make you the Arch Linux package.

mibi88 commented 1 year ago

No problem, as soon as you can take a look at it I'll make you the Arch Linux package.

Thanks!

ogarcia commented 1 year ago

In case it helps, in other packages I have built using meson says this when them goes to install:

Skipping custom install script because DESTDIR is set '/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas'
Skipping custom install script because DESTDIR is set '/usr/bin/gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor'
Skipping custom install script because DESTDIR is set '/usr/bin/update-desktop-database -q /usr/share/applications'

Perhaps this configuration file has the answer? https://github.com/Nokse22/ascii-draw/blob/master/data/meson.build

mibi88 commented 1 year ago

I think I found the problem, I'll check if it works now, and if it does I'll commit and push it on github

EDIT: It's not working...