Opened 2 months ago

Last modified 4 days ago

#69919 new enhancement

Nautilus upgrade + extra new ports tracker-3.0,tracker-miners and glib2 fix to include gio-launch-desktop bin.

Reported by: christophecvr (christophecvr) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.99
Keywords: gnome nautilus Cc: cooljeanius (Eric Gallager), christophecvr (christophecvr)
Port: nautilus tracker-3.0 tracker-miner glib2 nautilus-python

Description

I tried the current nautilus into macports. But the versions self was already a buggy one. So upgrade to the last (gtk3 compatible) version 3.38.2 was required. To do this upgrade I first needed to make two new ports one tracker-3.0 and one tracker-miners who were together in the tracker one version. The tracker one is still avbl for older packages who might need them cause there is no conflict between the tracker and tracker3 versions. They are using other libs,bins,docs and settings.
The added ports can be found on my github :
https://github.com/christophecvr/macports-ports/tree/cvrworkx11 it is branch cvrworkx11.
port tracker-3.0 https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/tracker-3.0
port tracker-miners https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/tracker-miners

Adapted glib2 port to include gio-launch-desktop into build of generic(x11) version.
port glib2 https://github.com/christophecvr/macports-ports/tree/cvrworkx11/devel/glib2
for this last one if the mp maintainers want, I can already make a patch in my master fork and send a pull request for it.

On the tracker-3.0 and tracker-miners some fine tunings need to be done. First the ports are only tested by me and I'm working on macos-10.13.6 intel (macbookpro mid 2010). But universall support is generally disabled by me since this is not required for 10.13 intel. There is one patch who needs a little change. But by me the both ports building fine working fine. Also it is the first ports I made self.

Then I updated the nautilus port to build 3.38.2 version. I added a couple of patches. Add dconf-editor as a depend since there are a couple of nautilus settings which can only be done with the editor. (unless you use dconf in terminal pretty hard way to do ) .
updated nautilus port:
https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/nautilus

Nautilus now runs fine.

  • executing a script file on a selected item OK (for that the glib2 needed the gio-launch-desktop)
  • select and copy files ok (you can not copy between finder and nautilus)
  • Opening a file with a gnome text editor such as gedit ok.(gedit is added as a depend in port now)
  • Identifying of media type such as mp4 or dvd iso or ... works ok (work of tracker3)
  • and not all is fully tested yet but nautilus is already a nice and very ussefull extra on my mac.

Now some extra's nautilus can also run by sudo user. But You well need to make one change to you're mac and that is adding :

Defaults	always_set_home

to file /private/etc/sudoers

That is required other wise the nautilus settings for sudo will be set into you're personal home dir and not into /var/root dir when you use sudo nautilus. The result is that when using nautilus back as regular user you're settings will become inaccessible.

What is the benefit of running nautilus as sudo user:

  • Yes first know what you do !!
  • Copy files to from directories owned by root (system)
  • Edit server setting files with gedit nice and easy.
  • runnning scripts on files in system directory's or also some files in /opt/local/...

I made this enhancement ticket. So maybe some more persons would like to test it on other macos versions. Also i'm sure that there are some things in the new ports who can be improved.

What I well can do is send already a pull request for the glib2 little change concerning the gio-launch-desktop.

Change History (9)

comment:1 Changed 5 weeks ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:2 Changed 4 weeks ago by christophecvr (christophecvr)

Some news now I also added the nautilus-python to this project. Added port nautilus-python. The version I used is 1.2.3 which is the last who runs with nautilus < 4.0 (nautilus 4.0 runs with gtk-4.0). It is patched to compile with clang (the duplicated symbol error solved by using extern to pointer declarations in second module). Adapted the wrong search of python.so to python.dylib. The plugin module self has well so extension since nautilus searches for that. Set the version of python to 3.12. Patched the source to solve deprecated python stuff since python 3.11. So it is ready for higher python versions then 3.12 in future. Solved a wrong * char declaration which is since python 3 and higher * const char.
It does build clean just one warning which is also present in linux builds an needs to be solved upstream.
Does work perfect. Now we can add extra menu items with actions to the nautilus menu.
Works can be found on my git hub macports fork cvrworkx11 branch.
In the mean time a very important patch to glib2 is passed as push request to glib2 and glib2-devel.
In glib2-devel it has been tested and passed all checks but still not merged ???
https://github.com/macports/macports-ports/pull/24009

Further the extra ports added or modified are :
Modified :
-nautilus https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/nautilus upgrade to 3.38.2 (last gtk 3.0 ver)

Added:
-port tracker-3.0 https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/tracker-3.0
-port tracker-miners https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/tracker-miners
-port nautilus-python https://github.com/christophecvr/macports-ports/tree/cvrworkx11/gnome/nautilus-python

comment:3 Changed 4 weeks ago by christophecvr (christophecvr)

Now also adapted one example nautilus-python plugin, the open-terminal menu item. It is adapted to last version of the made example but back-patched to work on nautilus < 4 (gtk-3). It works for python >= 3.10 . On mac it will open a standard macos terminal in the selected directory or present background location.

comment:4 Changed 4 weeks ago by christophecvr (christophecvr)

The adapted example will also be installed when this port is installed. I well have one question I could not find which is the variable who contains the python right build binary(or link)

from :

configure.python          ${prefix}/bin/python3.12

so in my port file I added first a new var with

set buildpython     0

Then used this to set the used pyton which can be 3.10,3.11 or 3.12 in code block

variant python310 conflicts python311 python312 description {Use python 3.10} {
    depends_lib-append        port:py310-gobject3
    configure.python          ${prefix}/bin/python3.10
    set buildpython           ${prefix}/bin/python3.10
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.10
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

variant python311 conflicts python310 python312 description {Use python 3.11} {
    depends_lib-append        port:py311-gobject3
    configure.python          ${prefix}/bin/python3.11
    set buildpython           ${prefix}/bin/python3.11
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.11
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

variant python312 conflicts python310 python311 description {Use python 3.12} {
    depends_lib-append        port:py312-gobject3
    configure.python          ${prefix}/bin/python3.12
    set buildpython           ${prefix}/bin/python3.12
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.12
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

So in a post-destroot I did :

post-destroot {
    xinstall -d -m 0755 ${destroot}/opt/local/share/nautilus-python/extensions
    xinstall -m 0644 ${worksrcpath}/examples/open-terminal.py ${destroot}/opt/local/share/nautilus-python/extensions/open-terminal.py
    system "${buildpython} -m compileall ${destroot}/opt/local/share/nautilus-python/extensions/open-terminal.py"
}

It works fine. But Is there not a var who containes the result of configure.python ?

comment:5 Changed 4 weeks ago by christophecvr (christophecvr)

Ok Found the right way to have the right python to compile in post-destroot. (Is very logic I was a bit stupid for that)

post-destroot {
    xinstall -d -m 0755 ${destroot}/opt/local/share/nautilus-python/extensions
    xinstall -m 0644 ${worksrcpath}/examples/open-terminal.py ${destroot}/opt/local/share/nautilus-python/extensions/open-terminal.py
    system "${configure.python} -m compileall ${destroot}/opt/local/share/nautilus-python/extensions/open-terminal.py"
}

comment:6 Changed 4 weeks ago by christophecvr (christophecvr)

In the mean time the gio-launch-desktop appinfo patch is merged to macports-ports master git on glib2-devel port. So if you use glib2-devel instead of glib2 it will be included in glib2-devel x11 (generic) build. Further I adapted the open-terminal.py plugin to work with python >= 3.10 . Gtk3 or Gtk4 so it should be ready the day we merge to Gtk4 (nautilus >= 4.x) . It will also be installed automatically when nautilus-python is installed. I added also a own made plugin Quit-Nautilus.py. Now the user can Terminate all his nautilus sessions out of right click menu. This item is missing cause we do not have a dash applet with x11 applications. This plugin is also installed automatically when nautilus-python is installed.

comment:7 Changed 4 weeks ago by christophecvr (christophecvr)

Cc: christophecvr added
Port: nautilus-python added

comment:8 Changed 6 days ago by christophecvr (christophecvr)

Now also added renewed python plugin for nautilus. You can open file here using an interactif menu. plugin is : https://github.com/christophecvr/macports-ports/blob/cvrworkx11/gnome/nautilus-python/files/new-file-here.py

It is installed automatically when nautilus-python is installed.

comment:9 Changed 4 days ago by christophecvr (christophecvr)

Not very much persons seems to test this enhancement: But if a macports gnome dev is following this :

I think it becomes time to send some ports to macports. After all these are new ports except:

The Glib2 enhancement which is already in glib2-devel macports-port master branch. The nautilus port which is updated but need the new tracker-miners and tracker-3.0 port.

I could made a nautilus-devel port if wanted, but think that the current nautilus port is not very much used since the version is pretty buggy and nautilus is not very useful there.

But the updated nautilus now can again execute scripts on selected files and maps. The (the right click) menu can now be adapted with python plugins who can perform action on selected items or background if nautilus-python (new-port) is installed.

Further one more question ,

Did some of the devs ever tried to make a glib2 version who supports x11(xorg-server) and quartz backend togheter ?

When I looked more close to the issue looks that it should be possible if a new header file which combines the :

gosxappinfo.m
# and
gdesktopappinfo.h

In one file and use that it (could ??) be possible to build a glib2 who can be used with x11 or quartz backend. This would solve a lot and be very good for for example the ticket :

https://trac.macports.org/ticket/60511

@cooljeanius do you still follow this ?

Note: See TracTickets for help on using tickets.