Merge branch 'wip/jtojnar/meson_postinstall' into 'main'

build: Switch to Meson’s gnome.post_install function

See merge request pwithnall/malcontent!148
This commit is contained in:
Philip Withnall 2022-12-30 16:57:12 +00:00
commit 062231804a
4 changed files with 10 additions and 23 deletions

View File

@ -7,7 +7,7 @@ cache:
- _ccache/
variables:
DEBIAN_IMAGE: "registry.freedesktop.org/pwithnall/malcontent/debian-unstable:v3"
DEBIAN_IMAGE: "registry.freedesktop.org/pwithnall/malcontent/debian-unstable:v4"
MESON_TEST_TIMEOUT_MULTIPLIER: 2
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload"

View File

@ -1,6 +1,7 @@
FROM debian:unstable
RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
desktop-file-utils \
gettext \
git \
gtk-doc-tools \
@ -8,6 +9,7 @@ RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
libadwaita-1-dev \
libaccountsservice-dev \
libappstream-dev \
libdbus-1-dev \
libflatpak-dev \
libgirepository1.0-dev \
libglib2.0-dev \
@ -28,7 +30,7 @@ RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
RUN pip3 install meson==0.57.0
RUN pip3 install meson==0.59.4
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}

View File

@ -1,18 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
if not os.environ.get('DESTDIR'):
icon_cache_dir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
if os.path.exists(icon_cache_dir):
print('Updating icon cache…')
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
desktop_database_dir = os.path.join(install_prefix, 'share', 'applications')
if os.path.exists(desktop_database_dir):
print('Updating desktop database…')
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])

View File

@ -1,6 +1,6 @@
project('malcontent', 'c',
version : '0.11.0',
meson_version : '>= 0.57.0',
meson_version : '>= 0.59.0',
license: ['LGPL-2.1-or-later', 'GPL-2.0-or-later'],
default_options : [
'buildtype=debugoptimized',
@ -146,8 +146,11 @@ endif
subdir('malcontent-client')
if get_option('ui').enabled()
subdir('malcontent-control')
gnome.post_install(
gtk_update_icon_cache: true,
update_desktop_database: true,
)
endif
subdir('pam')
subdir('po')
meson.add_install_script('build-aux/meson_post_install.py')