mate-desktop / mozo

Menu editor for MATE using the freedesktop.org menu specification
http://www.mate-desktop.org
GNU Lesser General Public License v2.1
28 stars 12 forks source link

Meson #55

Closed yetist closed 5 years ago

raveit65 commented 5 years ago

Same problem like in all other PRs with porting intltool to gettext. Tarball ships wrong builder files for languages after ./autogen.sh && make && make distcheck

[rave@mother mozo-dist]$ ls -l mozo-1.23.0/po/
insgesamt 1080
-rw-rw-r-- 1 rave rave  1389 14. Mai 09:46 af.gmo
-rw-rw-r-- 1 rave rave  2163 14. Mai 09:46 af.po
-rw-rw-r-- 1 rave rave  1685 14. Mai 09:46 am.gmo
-rw-rw-r-- 1 rave rave  2414 14. Mai 09:46 am.po
-rw-rw-r-- 1 rave rave  1405 14. Mai 09:46 an.gmo
-rw-rw-r-- 1 rave rave  2150 14. Mai 09:46 an.po
-rw-rw-r-- 1 rave rave  1688 14. Mai 09:46 ar.gmo
-rw-rw-r-- 1 rave rave  2495 14. Mai 09:46 ar.po
-rw-rw-r-- 1 rave rave  2059 14. Mai 09:46 as.gmo
-rw-rw-r-- 1 rave rave  2804 14. Mai 09:46 as.po
-rw-rw-r-- 1 rave rave  1414 14. Mai 09:46 ast.gmo
-rw-rw-r-- 1 rave rave  2242 14. Mai 09:46 ast.po
-rw-rw-r-- 1 rave rave   593 14. Mai 09:46 az.gmo
-rw-rw-r-- 1 rave rave  1887 14. Mai 09:46 az.po
-rw-rw-r-- 1 rave rave  1774 14. Mai 09:46 be.gmo
-rw-rw-r-- 1 rave rave  2569 14. Mai 09:46 be.po
<cut>
-rw-rw-r-- 1 rave rave  1477 14. Mai 09:46 vi.gmo
-rw-rw-r-- 1 rave rave  2222 14. Mai 09:46 vi.po
-rw-rw-r-- 1 rave rave   579 14. Mai 09:46 wa.gmo
-rw-rw-r-- 1 rave rave  1878 14. Mai 09:46 wa.po
-rw-rw-r-- 1 rave rave   621 14. Mai 09:46 xh.gmo
-rw-rw-r-- 1 rave rave  1893 14. Mai 09:46 xh.po
-rw-rw-r-- 1 rave rave   561 14. Mai 09:46 yi.gmo
-rw-rw-r-- 1 rave rave  1882 14. Mai 09:46 yi.po
-rw-rw-r-- 1 rave rave   606 14. Mai 09:46 yo.gmo
-rw-rw-r-- 1 rave rave  1900 14. Mai 09:46 yo.po
-rw-rw-r-- 1 rave rave  1384 14. Mai 09:46 zh_CN.gmo
-rw-rw-r-- 1 rave rave  2172 14. Mai 09:46 zh_CN.po
-rw-rw-r-- 1 rave rave  1402 14. Mai 09:46 zh_HK.gmo
-rw-rw-r-- 1 rave rave  2196 14. Mai 09:46 zh_HK.po
-rw-rw-r-- 1 rave rave  1393 14. Mai 09:46 zh_TW.gmo
-rw-rw-r-- 1 rave rave  2181 14. Mai 09:46 zh_TW.po
-rw-rw-r-- 1 rave rave   594 14. Mai 09:46 zu.gmo
-rw-rw-r-- 1 rave rave  1888 14. Mai 09:46 zu.po
raveit65 commented 5 years ago
[0/1] /usr/bin/meson --internal uninstall
Deleted: /usr/local/share/applications/mozo.desktop
Deleted: /usr/local/share/man/man1/mozo.1
Deleted: /usr/local/bin/mozo
Deleted: /usr/local/lib64/python3.7/site-packages/config.py
Deleted: /usr/local/lib64/python3.7/site-packages/__init__.py
Deleted: /usr/local/lib64/python3.7/site-packages/MainWindow.py
Deleted: /usr/local/lib64/python3.7/site-packages/MenuEditor.py
Deleted: /usr/local/lib64/python3.7/site-packages/util.py
Deleted: /usr/local/share/icons/hicolor/16x16/apps/mozo.png
Deleted: /usr/local/share/icons/hicolor/22x22/apps/mozo.png
Deleted: /usr/local/share/icons/hicolor/24x24/apps/mozo.png
Deleted: /usr/local/share/icons/hicolor/32x32/apps/mozo.png
Deleted: /usr/local/share/icons/hicolor/48x48/apps/mozo.png
Deleted: /usr/local/share/icons/hicolor/256x256/apps/mozo.png
Deleted: /usr/local/share/mozo/mozo.ui
Deleted: /usr/local/share/mozo
Deleted: /usr/local/share/icons/hicolor/256x256/apps
Deleted: /usr/local/share/icons/hicolor/256x256
Deleted: /usr/local/share/icons/hicolor/48x48/apps
Deleted: /usr/local/share/icons/hicolor/48x48
Deleted: /usr/local/share/icons/hicolor/32x32/apps
Deleted: /usr/local/share/icons/hicolor/32x32
Deleted: /usr/local/share/icons/hicolor/24x24/apps
Deleted: /usr/local/share/icons/hicolor/24x24
Deleted: /usr/local/share/icons/hicolor/22x22/apps
Deleted: /usr/local/share/icons/hicolor/22x22
Deleted: /usr/local/share/icons/hicolor/16x16/apps
Deleted: /usr/local/share/icons/hicolor/16x16
Could not delete /usr/local/share/icons/hicolor: [Errno 39] Directory not empty: '/usr/local/share/icons/hicolor'.
Could not delete /usr/local/share/icons: [Errno 39] Directory not empty: '/usr/local/share/icons'.
Deleted: /usr/local/lib64/python3.7/site-packages
Deleted: /usr/local/lib64/python3.7
Deleted: /usr/local/lib64
Deleted: /usr/local/share/man/man1
Deleted: /usr/local/share/man
Could not delete /usr/local/share/applications: [Errno 39] Directory not empty: '/usr/local/share/applications'.

Uninstall finished.

Deleted: 33
Failed: 3

Remember that files created by custom scripts have not been removed.
[rave@mother mozo-dist]$ ls -l /usr/local/share/icons/hicolor
insgesamt 4
-rw-r--r-- 1 root root 236 14. Mai 10:10 icon-theme.cache
[rave@mother mozo-dist]$ ls -l /usr/local/share/applications
insgesamt 4
-rw-r--r-- 1 root root 13 14. Mai 10:10 mimeinfo.cache
yetist commented 5 years ago

Please review and test #56 first.

raveit65 commented 5 years ago

Uninstall works now . I did a a rebase against master locally.

lukefromdc commented 5 years ago

Ater updating Meson from Debian Experimental, I got two errors in Debian, one of them new:

One almost always exists with python in Debian, even with autotools: the need to rename "site-packages" to "dist-packages" . The new and additional problem was that the files that go into dist-packages went to the toplevel directory and not into a Mozo file.

Trying to run Mozo from that configuration netted

Traceback (most recent call last):
  File "/usr/bin/mozo", line 22, in <module>
    from Mozo.MainWindow import MainWindow
ModuleNotFoundError: No module named 'Mozo'

This is the error I get anytime the python files went to the wrong place,

When I repacked the .deb, moving the "dist-packages" file into a directory named Mozo and installed it, Mozo then worked normally

To avoid losing track of the files, I redirected the install to a directory for a Debian package with

sudo DESTDIR=/home/luke/Desktop/Development/MATE_Development_Work/mozo-gtk3_1.23.0+meson20190515-1luke1_all ninja -C build install

yetist commented 5 years ago

I used new feature of meson 0.50.0, and skip building with meson on debian/ubuntu in travis. I recommend to keep this PR open until debian/ubuntu upgrades meson to version 0.50.0.

raveit65 commented 5 years ago

But it isn't clear when debian will ever update to newer meson. We all know that debian will never use MATE developing packages in all repos. Also, it is possible to build with autotools. Autotools support isn't dropped. So, i don't see any reason why we should wait for one distro. We have the manpower now to port and review to meson, and not when debian thinks to update their deprecated distro.

yetist commented 5 years ago

Please see history of debian's package: https://tracker.debian.org/pkg/meson

[2019-04-17] Accepted meson 0.50.1-1 (source) into experimental (Jussi Pakkanen) (signed by: Martin Pitt)
...
[2019-02-08] meson 0.49.2-1 MIGRATED to testing (Debian testing watch)
...
[2018-08-30] meson 0.47.2-1 MIGRATED to testing (Debian testing watch)

Now the meson-0.50.1 in exp, I think before mate-1.24 release, the meson-0.50.1 will into debian sid, if that not happen, I can change the meson.build to remove new feature of 0.50.0.

raveit65 commented 5 years ago

I don't get this. MATE-1.23/24 will never include to debian testing or stable. So why?

yetist commented 5 years ago

I think now it's OK, only need meson-0.47.0.

yetist commented 5 years ago

@raveit65 @lukefromdc

I made some changes again, now it can:

  1. Build with meson on debian and ubuntu.
  2. ninja uninstall can delete mo files and pyc files.
  3. When run ninja install without DESTDIR environment variable, gtk-update-icon-cache and update-desktop-database will run.
raveit65 commented 5 years ago

I think now it's OK, only need meson-0.47.0.

I am pretty sure debian will update meson in testing before ubuntu-19.10 will be synced from debian repos, which will be happen probably in 1-2 month. So, a lot of work for a few people which use debian-testing/ubuntu-19.10 + MATE from master. @lukefromdc Does this work for you now?

lukefromdc commented 5 years ago

I don't have a problem with it myself, having already updated Meson from Debian Experimental. I am not part of the Debian team though and know nothing of their schedule so can't speak to that. So long as.we stil sipport autotools as well, this won't stop Debian from building Mizo anyway, just from using the faster mesom build system.

On 5/17/2019 at 4:21 AM, "raveit65" notifications@github.com wrote:

I think now it's OK, only need meson-0.47.0.

I am pretty sure debian will update meson in testing before ubuntu- 19.10 will be synced from debian repos, which will be happen probably in 1-2 month. So, a lot of work for a few people which use debian- testing/ubuntu-19.10 + MATE from master. @lukefromdc Does this work for you now?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/mate-desktop/mozo/pull/55#issuecomment- 493367341

raveit65 commented 5 years ago

Terminal output from installation to /usr/local/ dir:

-matedesktop/mozo-dist/post_install.py'
Recording files installed by gettext script...
Compiling python bytecode...
Listing '/usr/local/lib/python3.7/site-packages/Mozo'...
Can't list '/usr/local/lib/python3.7/site-packages/Mozo'
Updating icon cache...
Updating desktop database...
[rave@mother ~]$ ls /usr/local/lib64/python3.7/site-packages/Mozo/
config.py  __init__.py  MainWindow.py  MenuEditor.py  util.py

I would expect that python files will be installed to /usr/local/lib/python3.7/site-packages/, or not?

[rave@mother mozo-dist]$ sudo ninja -C build uninstall
ninja: Entering directory `build'
[0/1] /usr/bin/meson --internal uninstall
Deleted: /usr/local/share/applications/mozo.desktop
<cut>
Deleted: /usr/local/share/icons/hicolor/22x22
Deleted: /usr/local/share/icons/hicolor/16x16/apps
Deleted: /usr/local/share/icons/hicolor/16x16
Could not delete /usr/local/share/icons/hicolor: [Errno 39] Directory not empty: '/usr/local/share/icons/hicolor'.
Could not delete /usr/local/share/icons: [Errno 39] Directory not empty: '/usr/local/share/icons'.
Deleted: /usr/local/lib64/python3.7/site-packages/Mozo
Deleted: /usr/local/lib64/python3.7/site-packages
Deleted: /usr/local/lib64/python3.7
Deleted: /usr/local/lib64
<cut>
Could not delete /usr/local/share/applications: [Errno 39] Directory not empty: '/usr/local/share/applications'.
Could not delete /usr/local/share: [Errno 39] Directory not empty: '/usr/local/share'.
Could not delete LC_MESSAGES/mozo.mo: [Errno 2] No such file or directory: 'LC_MESSAGES/mozo.mo'.
Deleted: /usr/local/share/locale/cs/LC_MESSAGES/mozo.mo
<cut>

Uninstall finished.

Deleted: 141
Failed: 5

A few locale couldn't be removed. Eg.

[rave@mother ~]$ ls /usr/local/share/locale/af/LC_MESSAGES/
mozo.mo

/usr/local/share/applications/mimeinfo.cache is a false positives, immo. Same for /usr/local/share/icons/hicolor/icon-theme.cache`.

I am a bit confused about this message.

Could not delete LC_MESSAGES/mozo.mo: [Errno 2] No such file or directory: 'LC_MESSAGES/mozo.mo'.
lukefromdc commented 5 years ago

site-packages is one of the nasty python issues in Debian. For some reason Debian renames all of these directories dist-packages, sometimes breaking make install in autotools and forcing me to hand-pack Debian packages even to test.

yetist commented 5 years ago

I am a bit confused about this message.

I use the post_install.py to append mo files into meson-logs/install-log.txt file, hope meson can remove mo files when uninstall, but it is not a good way. I can only wait for meson to fix this bug.

raveit65 commented 5 years ago

For me this is Ok to state this as known issue by meson.

raveit65 commented 5 years ago

Why does meson install python files to /usr/lib64 or /usr/local/lib64 ?

[rave@mother mozo-dist]$ sudo ninja -C build install
ninja: Entering directory `build'
[0/1] Installing files.
<cut>
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/build/Mozo/config.py to /usr/lib64/python3.7/site-packages/Mozo
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/Mozo/__init__.py to /usr/lib64/python3.7/site-packages/Mozo
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/Mozo/MainWindow.py to /usr/lib64/python3.7/site-packages/Mozo
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/Mozo/MenuEditor.py to /usr/lib64/python3.7/site-packages/Mozo
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/Mozo/util.py to /usr/lib64/python3.7/site-packages/Mozo
<cut>
Installing /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-
Running custom install script '/usr/bin/env python3 /media/Data-2/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mozo-dist/post_install.py'
Compiling python bytecode...
Listing '/usr/lib/python3.7/site-packages/Mozo'...
Can't list '/usr/lib/python3.7/site-packages/Mozo'
Updating icon cache...
Updating desktop database...

Installation with autotools use /usr/lib/python3.7/site-packages/Mozo/ dir and mozo is a noarch package. See https://koji.fedoraproject.org/koji/rpminfo?rpmID=17556361

PS: i can't remember that is this issue was there before you lower meson requires.

yetist commented 5 years ago

Why does meson install python files to /usr/lib64 or /usr/local/lib64 ?

I use install_sources of python module to install py files, default value of pure is true, but it doesn't seem to work. In the last commit, I set pure to true.

raveit65 commented 5 years ago

This works fine now and i will squash the commit into the other now before merging.