Update Meson config to build everything and add Flatpak dev manifest
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
.scratch
|
.scratch
|
||||||
|
.flatpak-builder
|
||||||
|
48
build-aux/cafe.avery.Delfin.Devel.yaml
Normal file
48
build-aux/cafe.avery.Delfin.Devel.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
app-id: cafe.avery.Delfin.Devel
|
||||||
|
runtime: org.gnome.Platform
|
||||||
|
runtime-version: "45"
|
||||||
|
sdk: org.gnome.Sdk
|
||||||
|
sdk-extensions:
|
||||||
|
- org.freedesktop.Sdk.Extension.rust-stable
|
||||||
|
- org.freedesktop.Sdk.Extension.llvm16
|
||||||
|
|
||||||
|
command: delfin
|
||||||
|
|
||||||
|
finish-args:
|
||||||
|
- --share=network
|
||||||
|
# X11
|
||||||
|
- --share=ipc
|
||||||
|
- --socket=fallback-x11
|
||||||
|
# Wayland
|
||||||
|
- --socket=wayland
|
||||||
|
# Hardware acceleration
|
||||||
|
- --device=dri
|
||||||
|
# Audio
|
||||||
|
- --socket=pulseaudio
|
||||||
|
|
||||||
|
build-options:
|
||||||
|
append-path: "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm16/bin"
|
||||||
|
prepend-ld-library-path: "/usr/lib/sdk/llvm16/lib"
|
||||||
|
build-args:
|
||||||
|
- "--share=network"
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
|
||||||
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
|
||||||
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold"
|
||||||
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: clang
|
||||||
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold"
|
||||||
|
test-args:
|
||||||
|
- "--socket=x11"
|
||||||
|
- "--share=network"
|
||||||
|
|
||||||
|
modules:
|
||||||
|
- libmpv.yaml
|
||||||
|
- name: delfin
|
||||||
|
buildsystem: meson
|
||||||
|
run-tests: true
|
||||||
|
config-opts:
|
||||||
|
- "-Dprofile=dev"
|
||||||
|
- "-Dflatpak=true"
|
||||||
|
sources:
|
||||||
|
- type: dir
|
||||||
|
path: "../"
|
10
build-aux/dist-vendor
Executable file
10
build-aux/dist-vendor
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export DIST="$1"
|
||||||
|
export SOURCE_ROOT="$2"
|
||||||
|
|
||||||
|
cd "$SOURCE_ROOT" || exit
|
||||||
|
mkdir "$DIST"/.cargo
|
||||||
|
cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' >"$DIST"/.cargo/config
|
||||||
|
# Move vendor into dist tarball directory
|
||||||
|
mv vendor "$DIST"
|
16
build-aux/libmpv.yaml
Normal file
16
build-aux/libmpv.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: libmpv
|
||||||
|
buildsystem: meson
|
||||||
|
config-opts:
|
||||||
|
# Don't build standalone player, just library
|
||||||
|
- "-Dcplayer=false"
|
||||||
|
- "-Dlibmpv=true"
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://github.com/mpv-player/mpv/archive/refs/tags/v0.36.0.tar.gz
|
||||||
|
sha256: 29abc44f8ebee013bb2f9fe14d80b30db19b534c679056e4851ceadf5a5e8bf6
|
||||||
|
modules:
|
||||||
|
- name: libass
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://github.com/libass/libass/releases/download/0.17.1/libass-0.17.1.tar.gz
|
||||||
|
sha256: d653be97198a0543c69111122173c41a99e0b91426f9e17f06a858982c2fb03d
|
@@ -7,4 +7,5 @@ fn main() {
|
|||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
);
|
);
|
||||||
|
println!("cargo:rustc-link-search=/app/lib");
|
||||||
}
|
}
|
||||||
|
27
delfin/meson.build
Normal file
27
delfin/meson.build
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
cargo_options = []
|
||||||
|
|
||||||
|
rust_target = 'debug'
|
||||||
|
|
||||||
|
if get_option('profile') == 'release'
|
||||||
|
cargo_options += ['--release']
|
||||||
|
rust_target = 'release'
|
||||||
|
endif
|
||||||
|
|
||||||
|
cargo_options += ['--target-dir', meson.project_build_root() / 'delfin']
|
||||||
|
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
bindir = prefix / get_option('bindir')
|
||||||
|
|
||||||
|
custom_target(
|
||||||
|
'cargo-build',
|
||||||
|
build_by_default: true,
|
||||||
|
build_always_stale: true,
|
||||||
|
output: meson.project_name(),
|
||||||
|
console: true,
|
||||||
|
command: [
|
||||||
|
cargo, 'build', cargo_options,
|
||||||
|
'&&', 'cp', 'delfin' / rust_target / meson.project_name(), '@OUTPUT@',
|
||||||
|
],
|
||||||
|
install: get_option('flatpak'),
|
||||||
|
install_dir: bindir,
|
||||||
|
)
|
@@ -39,7 +39,7 @@ impl Default for VideoPlayerConfig {
|
|||||||
skip_backwards_amount: VideoPlayerSkipAmount::Ten,
|
skip_backwards_amount: VideoPlayerSkipAmount::Ten,
|
||||||
skip_forwards_amount: VideoPlayerSkipAmount::Thirty,
|
skip_forwards_amount: VideoPlayerSkipAmount::Thirty,
|
||||||
backend: VideoPlayerBackendPreference::Mpv,
|
backend: VideoPlayerBackendPreference::Mpv,
|
||||||
hls_playback: true,
|
hls_playback: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,12 @@ fn main() {
|
|||||||
gst::init().expect("Error initializing GStreamer");
|
gst::init().expect("Error initializing GStreamer");
|
||||||
gstgtk4::plugin_register_static().expect("Error registering GST GTK4 plugin");
|
gstgtk4::plugin_register_static().expect("Error registering GST GTK4 plugin");
|
||||||
|
|
||||||
let app = RelmApp::new("cafe.avery.delfin");
|
let app = if cfg!(debug_assertions) {
|
||||||
|
RelmApp::new("cafe.avery.Delfin.Devel")
|
||||||
|
} else {
|
||||||
|
RelmApp::new("cafe.avery.Delfin")
|
||||||
|
};
|
||||||
|
|
||||||
relm4_icons::initialize_icons();
|
relm4_icons::initialize_icons();
|
||||||
load_css();
|
load_css();
|
||||||
app.with_broker(&APP_BROKER).run::<App>(());
|
app.with_broker(&APP_BROKER).run::<App>(());
|
||||||
|
32
meson.build
Normal file
32
meson.build
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
project(
|
||||||
|
'delfin',
|
||||||
|
'rust',
|
||||||
|
version: '0.1.0',
|
||||||
|
# bad hack to compile libvideo-player-mpv
|
||||||
|
subproject_dir: 'video_player_mpv',
|
||||||
|
)
|
||||||
|
|
||||||
|
base_id = 'cafe.avery.Delfin'
|
||||||
|
|
||||||
|
cargo = find_program('cargo', required: true)
|
||||||
|
|
||||||
|
dependency('gtk4', version: '>= 4.0.0')
|
||||||
|
dependency('libadwaita-1', version: '>= 1.4')
|
||||||
|
dependency('mpv', version: '>= 2.1.0')
|
||||||
|
|
||||||
|
if get_option('profile') == 'dev'
|
||||||
|
app_id = '@0@.@1@'.format(base_id, 'Devel')
|
||||||
|
else
|
||||||
|
app_id = base_id
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('flatpak')
|
||||||
|
meson.add_dist_script(
|
||||||
|
'build-aux/dist-vendor',
|
||||||
|
meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + meson.project_version(),
|
||||||
|
meson.project_source_root()
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
|
subproject('sys')
|
||||||
|
subdir('delfin')
|
12
meson_options.txt
Normal file
12
meson_options.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
option(
|
||||||
|
'profile',
|
||||||
|
type: 'combo',
|
||||||
|
choices: ['dev', 'release'],
|
||||||
|
value: 'dev',
|
||||||
|
)
|
||||||
|
|
||||||
|
option(
|
||||||
|
'flatpak',
|
||||||
|
type: 'boolean',
|
||||||
|
value: false,
|
||||||
|
)
|
@@ -7,4 +7,12 @@ fn main() {
|
|||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
);
|
);
|
||||||
|
println!(
|
||||||
|
"cargo:rustc-link-search={}",
|
||||||
|
std::env::current_dir()
|
||||||
|
.unwrap()
|
||||||
|
.join("../build/video_player_mpv/sys/")
|
||||||
|
.to_str()
|
||||||
|
.unwrap()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
project('video-player-mpv', 'c')
|
project('video-player-mpv', 'c')
|
||||||
|
|
||||||
|
|
||||||
depgtk = dependency('gtk4')
|
depgtk = dependency('gtk4')
|
||||||
depepoxy = dependency('epoxy')
|
depepoxy = dependency('epoxy')
|
||||||
depmpv = dependency('mpv')
|
depmpv = dependency('mpv')
|
||||||
|
Reference in New Issue
Block a user