mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Add meson build support #392

Closed zhuyaliang closed 9 months ago

zhuyaliang commented 10 months ago

test meson

meson setup _build --prefix=/usr

ninja -C _build

DESTDIR=/tmp/meson_dir meson install -C _build

test make

 ./autogen.sh --prefix=/usr

make

make install DESTDIR=/tmp/make_dir

Compare Build Results

[test@localhost mate-power-manager]$ find /tmp/make_dir/ | wc -l
3285
[test@localhost mate-power-manager]$ find /tmp/meson_dir/ | wc -l
3285
raveit65 commented 10 months ago

Can we split out the debian Ci build fix in a single commit, please? This is not related to meson build. Or push it directly to master, it's tested here ;-)

zhuyaliang commented 10 months ago

@raveit65 #393

raveit65 commented 10 months ago

Some warnings with meson setup command.

data/meson.build:7: WARNING: Project targets '>=0.46.0' but uses feature introduced in '0.50.0': install arg inconfigure_file.
Configuring org.mate.power-manager.gschema.xml.in using configuration
data/meson.build:20: WARNING: Project targets '>=0.46.0' but uses feature introduced in '0.50.0': install arg in configure_file.
raveit65 commented 10 months ago

Meson install gives me an error.

[124/149] Generating policy/org.mate.power.policy with a custom command
ninja: build stopped: subcommand failed.
Could not rebuild /media/Data/Programme/Linux/Mate-Desktop/git-version/github-matedesktop/mate-power-manager-dist/_build
zhuyaliang commented 10 months ago

@raveit65 Please test again

raveit65 commented 10 months ago

Do you see this warning or is this fedora related?

WARNING: find_library('libm') starting in "lib" only works by accident and is not portable
Library libm found: YES

I get an install warning.

Compiling GSchema
No schema files found: doing nothing.

It isn't compiled:

[rave@mother mate-power-manager-dist]$ ls -la /tmp/meson_dir/share/glib-2.0/schemas/
total 20
drwxr-xr-x 2 rave rave    60 Oct 23 14:59 .
drwxr-xr-x 3 rave rave    60 Oct 23 14:59 ..
-rw-r--r-- 1 rave rave 19166 Oct 23 14:57 org.mate.power-manager.gschema.xml.in

Should be look like this:

[rave@mother mate-power-manager-dist]$ ls -la /tmp/make_dir/share/glib-2.0/schemas/
total 28
drwxr-xr-x 2 root root    80 Oct 23 14:54 .
drwxr-xr-x 3 root root    60 Oct 23 14:54 ..
-rw-r--r-- 1 root root  5501 Oct 23 14:54 gschemas.compiled
-rw-r--r-- 1 root root 19166 Oct 23 14:54 org.mate.power-manager.gschema.xml
raveit65 commented 10 months ago

Can you please rebase with master to get debian build working.

raveit65 commented 10 months ago

Not sure if this is a problem. icon-cache isn't updated in

[rave@mother mate-power-manager-dist]$ ls -la /tmp/meson_dir/share/mate-power-manager/icons/hicolor/
total 0
drwxr-xr-x 12 rave rave 240 Oct 23 14:59 .
drwxr-xr-x  3 rave rave  60 Oct 23 14:59 ..
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 128x128
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 16x16
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 22x22
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 24x24
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 256x256
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 32x32
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 48x48
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 64x64
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 96x96
drwxr-xr-x  4 rave rave  80 Oct 23 14:59 scalable
[rave@mother mate-power-manager-dist]$ ls -la /tmp/make_dir/share/mate-power-manager/icons/hicolor/
total 8
drwxr-xr-x 12 root root  260 Oct 23 14:54 .
drwxr-xr-x  3 root root   60 Oct 23 14:54 ..
drwxr-xr-x  4 root root   80 Oct 23 14:54 128x128
drwxr-xr-x  4 root root   80 Oct 23 14:54 16x16
drwxr-xr-x  4 root root   80 Oct 23 14:54 22x22
drwxr-xr-x  4 root root   80 Oct 23 14:54 24x24
drwxr-xr-x  4 root root   80 Oct 23 14:54 256x256
drwxr-xr-x  4 root root   80 Oct 23 14:54 32x32
drwxr-xr-x  4 root root   80 Oct 23 14:54 48x48
drwxr-xr-x  4 root root   80 Oct 23 14:54 64x64
drwxr-xr-x  4 root root   80 Oct 23 14:54 96x96
-rw-r--r--  1 root root 7936 Oct 23 14:54 icon-theme.cache
drwxr-xr-x  4 root root   80 Oct 23 14:54 scalable
[rave@mother mate-power-manager-dist]$
zhuyaliang commented 10 months ago

@raveit65 Please test again Update cache when DESTDIR is not set

[mate@mouse mate-power-manager]$ cat meson_post_install.sh 
#!/bin/sh
if [ -z $MESON_INSTALL_PREFIX ]; then
    echo 'This is meant to be ran from Meson only!'
    exit 1
fi

if [ -z $DESTDIR ]; then
    echo 'Compiling GSchema'
    glib-compile-schemas "$MESON_INSTALL_PREFIX/share/glib-2.0/schemas"
    echo 'Updating icon cache'
    gtk-update-icon-cache -qtf "$MESON_INSTALL_PREFIX/share/icons/hicolor"
    gtk-update-icon-cache -qtf "$MESON_INSTALL_PREFIX/share/mate-power-manager/icons/hicolor"
    echo 'Updating desktop database'
    update-desktop-database -q "$MESON_INSTALL_PREFIX/share/applications"
fi
lukefromdc commented 9 months ago

Is this ready to go or should we wait for another review?