forked from MateusRodCosta/bign-handheld-thumbnailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This simplifies the installation of necessary data files for the thumbnailer to work, working around this long-standing RFE: rust-lang/cargo#2729 Ideally, meson would also be used to compile the binary instead of Cargo, but meson doesn't easily support external crates: mesonbuild/meson#2173
- Loading branch information
Showing
3 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
bign-handheld-thumbnailer.thumbnailer → bign-handheld-thumbnailer.thumbnailer.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[Thumbnailer Entry] | ||
TryExec=/usr/bin/bign-handheld-thumbnailer | ||
Exec=/usr/bin/bign-handheld-thumbnailer -s %s %i %o | ||
TryExec=@bindir@/bign-handheld-thumbnailer | ||
Exec=@bindir@/bign-handheld-thumbnailer -s %s %i %o | ||
MimeType=application/x-nintendo-ds-rom;application/x-ctr-cia;application/x-ctr-smdh;application/x-ctr-3dsx;application/x-nintendo-3ds-executable;application/x-ctr-cxi;application/x-ctr-cci;application/x-nintendo-3ds-rom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
project('bign-handheld-thumbnailer', 'rust', | ||
version: '1.0.0', | ||
license: 'GPL-2.0-or-later', | ||
meson_version: '>= 0.64.0') | ||
|
||
gnome = import('gnome') | ||
|
||
prefix = get_option('prefix') | ||
bindir = prefix / get_option('bindir') | ||
thumbnailers_dir = prefix / get_option('datadir') / 'thumbnailers' | ||
|
||
cargo_bin = find_program('cargo') | ||
cargo_opt = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ] | ||
cargo_opt += [ '--target-dir', meson.project_build_root() / 'src' ] | ||
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ] | ||
|
||
if get_option('buildtype') == 'release' | ||
cargo_opt += [ '--release' ] | ||
rust_target = 'release' | ||
else | ||
rust_target = 'debug' | ||
endif | ||
|
||
cargo_build = custom_target( | ||
'cargo-build', | ||
build_by_default: true, | ||
build_always_stale: true, | ||
output: meson.project_name(), | ||
console: true, | ||
install: true, | ||
install_dir: get_option('bindir'), | ||
command: [ | ||
'env', cargo_env, | ||
cargo_bin, 'build', | ||
cargo_opt, '&&', 'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@', | ||
] | ||
) | ||
|
||
configure_file(input : meson.project_name() + '.thumbnailer.in', | ||
output : meson.project_name() + '.thumbnailer', | ||
configuration : {'bindir' : bindir}, | ||
install_dir : thumbnailers_dir) | ||
|
||
install_data( | ||
'bign-handheld-thumbnailer-3ds.xml', | ||
install_dir: get_option('datadir') / 'mime/packages', | ||
) | ||
|
||
gnome.post_install( | ||
update_mime_database: true | ||
) |