diff --git a/.gitignore b/.gitignore index 244c3ee..f42fdfe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,5 @@ __pycache__/ *.py[cod] *$py.class -# Files created by setuptools -build/ -dist/ -*.egg-info/ +/build/ +/install/ diff --git a/README.textile b/README.textile index 98c9d12..ea0a822 100644 --- a/README.textile +++ b/README.textile @@ -12,62 +12,42 @@ Dependencies: * "GTK":http://www.gtk.org 3 (>= 3.22) ("python-gobject":https://live.gnome.org/PyGObject) * "Avahi":http://www.avahi.org (optional) * "python-keyring":http://pypi.python.org/pypi/keyring (optional) -* "python-setuptools":https://pypi.python.org/pypi/setuptools (building) +* "meson":https://mesonbuild.com/ and "ninja":https://ninja-build.org/ (building) Additionally a "MPD":http://www.musicpd.org server (version >= 0.21.0) is required at runtime. + h2. Building -Build the application with _setuptools_: +Build the application with _meson_ and _ninja_: -bc. $ python3 setup.py build +bc. $ meson build +$ ninja -C build h2. Running/Testing -For testing the application and running it without (system-wide) installation, donwload/clone the code, build it as described above and then use _setuptools_ to install it for the current user: +For testing the application and running it without (system-wide) installation, +donwload/clone the code, build it with the @--prefix@ option and install it +with @ninja@: -bc. $ python3 setup.py develop --user +bc. $ meson --prefix $(pwd)/install build +$ ninja -C build +$ ninja -C build install -After that you can run it with +After that you can run it with _meson’s_ @devenv@ command: -bc. $ ~/.local/bin/mcg - -or if _~/.local/bin/_ is on your PATH - -bc. $ mcg +bc. $ meson devenv -C build src/mcg h2. Installing -Install the application system-wide with _setuptools_: +Install the application system-wide with _meson_ (after building): -bc. # python3 setup.py install +bc. $ ninja -C build install -Note: _On Linux using the distribution’s package manager is the preferred way of installing applications system-wide._ - - -h2. Packaging - -Create a distribution package with _setuptools_: - -bc. $ python3 setup.py sdist - - -h2. Cover/image configuration - -Since MPD itself does not provide the cover/image/album art binaries, yet, _mcg_ has to look for them itself. In order to find the images a base folder has to be configured on the Connection tab as “Image Directory”. This value can either be a local (absolute) folder (e. g. /home/user/music/) or an http URL (e. g. http://localhost/music/). _mcg_ then adds the (relative) folder of the audio file to this paths and tries different names for the actual file: - -# the album name -# “cover” -# “folder” - -The following file extensions are used: - -# png -# jpg - -The first combination that results in an existing file is used as cover image. If no matching file exists, _mcg_ will try to traverse the directory for any image file as fallback—this is done for local paths only though, not for http URLs. +Note: _On Linux using the distribution’s package manager is the preferred way +of installing applications system-wide._ h2. Screenshots diff --git a/data/icons/mcg.svg b/data/icons/hicolor/scalable/apps/xyz.suruatoel.mcg.svg similarity index 100% rename from data/icons/mcg.svg rename to data/icons/hicolor/scalable/apps/xyz.suruatoel.mcg.svg diff --git a/data/icons/meson.build b/data/icons/meson.build new file mode 100644 index 0000000..20bdb7c --- /dev/null +++ b/data/icons/meson.build @@ -0,0 +1,7 @@ +application_id = 'xyz.suruatoel.mcg' + +scalable_dir = join_paths('hicolor', 'scalable', 'apps') +install_data( + join_paths(scalable_dir, ('@0@.svg').format(application_id)), + install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir) +) diff --git a/data/mcg.desktop b/data/mcg.desktop index 81a2717..2b6067e 100644 --- a/data/mcg.desktop +++ b/data/mcg.desktop @@ -4,7 +4,7 @@ Name=CoverGrid (mcg) Comment=CoverGrid for the Music Player Daemon Keywords=mpd; Type=Application -Icon=mcg.svg +Icon=xyz.suruatoel.mcg Exec=mcg Categories=AudioVideo; StartupNotify=true diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..4de86c0 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,34 @@ +i18n = import('i18n') + +desktop_file = i18n.merge_file( + input: 'mcg.desktop', + output: 'mcg.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) + +desktop_utils = find_program('desktop-file-validate', required: false) +if desktop_utils.found() + test('Validate desktop file', desktop_utils, + args: [desktop_file] + ) +endif + +gnome = import('gnome') +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) + +gnome.compile_resources('mcg', + 'xyz.suruatoel.mcg.gresource.xml', + gresource_bundle: true, + install: true, + install_dir: pkgdatadir, +) + +install_data('xyz.suruatoel.mcg.gschema.xml', + install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') +) +gnome.compile_schemas(depend_files: files('xyz.suruatoel.mcg.gschema.xml')) + +subdir('icons') diff --git a/data/ui/info-dialog.ui b/data/ui/info-dialog.ui index 7fef32c..924c75f 100644 --- a/data/ui/info-dialog.ui +++ b/data/ui/info-dialog.ui @@ -13,7 +13,7 @@ 3.0.2 CoverGrid is a client for the Music Player Daemon, focusing on albums instead of single tracks. http://www.suruatoel.xyz/codes/mcg - + xyz.suruatoel.mcg gpl-3-0 diff --git a/data/ui/window.ui b/data/ui/window.ui index 1fb9a36..5e24217 100644 --- a/data/ui/window.ui +++ b/data/ui/window.ui @@ -4,7 +4,7 @@