Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meson build support #392

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Add meson build support #392

merged 1 commit into from
Oct 24, 2023

Conversation

zhuyaliang
Copy link
Member

@zhuyaliang zhuyaliang commented Oct 16, 2023

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

@zhuyaliang zhuyaliang force-pushed the meson branch 4 times, most recently from 93b7edd to 1bd4210 Compare October 16, 2023 14:38
@raveit65
Copy link
Member

raveit65 commented Oct 16, 2023

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
Copy link
Member Author

@raveit65 #393

@raveit65
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

@raveit65 Please test again

@raveit65
Copy link
Member

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
Copy link
Member

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

@raveit65
Copy link
Member

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
Copy link
Member Author

@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

Copy link
Member

@raveit65 raveit65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
works as expected.

@raveit65 raveit65 requested a review from a team October 23, 2023 20:42
Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds fine, installs fine, seems to uninstall fine. No runtime surprises so looks good to go

@lukefromdc
Copy link
Member

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

@lukefromdc lukefromdc requested a review from a team October 24, 2023 04:07
@raveit65 raveit65 merged commit 9a8cfd7 into master Oct 24, 2023
@raveit65 raveit65 deleted the meson branch October 24, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants