flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
6.45k stars 219 forks source link

how to run rnote without installing it #208

Closed omac777 closed 1 year ago

omac777 commented 2 years ago

On Fedora Silverblue 36, I built rnote with meson using the documented steps: https://github.com/flxzt/rnote/blob/main/CONTRIBUTING.md

Here is my Fedora Silverblue 36 status. Please note the mentioned "LayeredPackages" not part of the default base installer image which makes it easy to simply install those packages simply with "rpm-ostree install".

 $ rpm-ostree status
State: idle
Deployments:
● fedora:fedora/36/x86_64/silverblue
                   Version: 36.20220608.0 (2022-06-08T01:52:27Z)
                BaseCommit: 8bff3f6b5e5b3be2cede1e6c87219f34b83cafbf22cada73e7cd1079458139fe
              GPGSignature: Valid signature by 53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4
           LayeredPackages: 'c++-gtk-utils-gtk4-devel' 'gcc-c++' 'ImageMagick-c++-devel' 'qt6-*' adwaita-icon-theme-devel alsa-lib-devel autoconf automake avahi-gobject-devel cairo-gobject-devel chromium clang clapper cmake dbus-devel
                            emacs flatpak-builder gcc gdk-pixbuf2-devel gdk-pixbuf2-xlib-devel gimp glade glib-devel gnome-video-effects gnonlin graphene-devel gst123 gstreamer1-devel gstreamer1-plugins-bad-free-devel
                            gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-free-fluidsynth gstreamer1-plugins-bad-free-wildmidi gstreamer1-plugins-bad-free-zbar gstreamer1-plugins-base-devel gstreamer1-plugins-base-tools
                            gstreamer1-plugins-good-extras gstreamer1-plugins-good-gtk gstreamer1-rtsp-server-devel gstreamer1-svt-av1 gstreamer1-svt-vp9 gstreamer1-vaapi gstreamermm-devel gtk4-devel gtkmm4.0-devel gtkmm4.0-doc
                            ImageMagick ImageMagick-devel ImageMagick-doc libadwaita-devel libgudev-devel libsoup-devel libsoup3-devel libsqlite3x-devel libtoml-devel libxcb-devel lld meld meson mozilla-openh264 openfortivpn
                            openssl1.1-devel poppler-glib-devel python3-jinja2 python3-pygments python3-toml-adapt python3-typogrify qt6-qt3d-examples qt6-qtbase-examples qt6-qtcharts-examples qt6-qtconnectivity-examples
                            qt6-qtdeclarative-examples qt6-qtmultimedia-examples qt6-qtpositioning-examples qt6-qtquick3d-examples qt6-qtwayland-examples remmina svt-av1 tdlib-devel youtube-dl

After that, I did:

meson setup --prefix=/usr _mesonbuild
meson compile -C _mesonbuild

After following the steps to compile with meson, I got the rnote binary, but unaware of how to run it without installing it. How can I run rnote without installing it? I got the following errors when attempting to run it from the rnote/_mesonbuild/ directory.

davidm@carouselYOW 2022-06-20_12:36:34_EDT : ~/photoqt/rnote/_mesonbuild
 $ ./rnote
thread 'main' panicked at 'Could not load gresource file: Error { domain: g-file-error-quark, code: 4, message: "Failed to open file “/usr/share/rnote/resources.gresource”: open() failed: No such file or directory" }', rnote-ui/src/app/mod.rs:70:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
davidm@carouselYOW 2022-06-20_12:36:39_EDT : ~/photoqt/rnote/_mesonbuild
 $ cd ..
davidm@carouselYOW 2022-06-20_12:36:56_EDT : ~/photoqt/rnote
 $ meson install -C _mesonbuild
ninja: Entering directory `/var/home/davidm/photoqt/rnote/_mesonbuild'
ninja: no work to do.
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 153, in run
    return options.run_func(options)
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 771, in run
    installer.do_install(datafilename)
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 550, in do_install
    self.install_targets(d, dm, destdir, fullprefix)
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 700, in install_targets
    file_copied = self.do_copyfile(fname, outname, makedirs=(dm, outdir))
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 417, in do_copyfile
    dirmaker.makedirs(outdir, exist_ok=True)
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 114, in makedirs
    self.makedirs_impl(path, exist_ok=exist_ok)
  File "/usr/lib/python3.10/site-packages/mesonbuild/minstall.py", line 321, in makedirs
    os.makedirs(*args, **kwargs)
  File "/usr/lib64/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/usr/share/rnote'

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

Please note the above meson install error occurs because Fedora Silverblue's '/usr/share/' directory is read-only. I think the install needs to occur either through rpm-ostree in order for it to be installed within the base file system layer containing the /usr/share/ directory. If I were able to install it rather within the user's home directory in its entirety, there would be no issues.

Thank you in advance.

flxzt commented 2 years ago

You need to install the meson project, but you can change the path to a writable directory by changing the --prefix=/path/ parameter.
You could also try building it with the flatpak manifest located in build-aux

numbertumbers commented 2 years ago

You know you can just use the Flathub, right? Why is this issue still open!?

omac777 commented 2 years ago

It's important to understand how to build rnote when we don't want to make flatpaks.

I understand flatpaks are the trend, but I was trying to build it standalone with just cargo in the classical rust-tools only sense, but rnote certainly isn't designed to be built that way.

I did try to build with flatpak build and yes it built correctly and yes it ran correctly.  It's a beautiful app, but more importantly it stands out as a point of reference for other rust developers wanting to build gtk4 apps for Linux. Thank you for all your huge efforts and guidance in that respect.  It's greatly appreciated. On Thursday, June 23, 2022 at 07:57:43 p.m. EDT, numbertumbers @.***> wrote:

You know you can just use the Flathub, right? Why is this issue still open!?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

flxzt commented 1 year ago

Resolved by changing the prefix path for meson.