[Backport release-26.05] losange: init at 0.10.1 (#530068)

This commit is contained in:
Michael Daniels 2026-06-19 19:58:59 +00:00 committed by GitHub
commit 677fd87dac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 91 additions and 0 deletions

View file

@ -26975,6 +26975,12 @@
githubId = 6064962;
name = "TakWolf";
};
talal = {
email = "noreply@talal.ch";
github = "talal";
githubId = 3526562;
name = "Muhammad Talal Anwar";
};
talhaHavadar = {
email = "havadartalha@gmail.com";
github = "talhaHavadar";

View file

@ -0,0 +1,85 @@
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
# buildInputs
mpv,
libadwaita,
libepoxy,
openssl,
# nativeBuildInputs
makeBinaryWrapper,
pkg-config,
wrapGAppsHook4,
glib,
# Wrapper
nodejs,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "losange";
version = "0.10.1";
__structuredAttrs = true;
strictDeps = true;
src = fetchFromGitHub {
owner = "tymmesyde";
repo = "losange";
tag = "v${finalAttrs.version}";
hash = "sha256-mr54/vnaopLwG9lhFiZJGgxWH/VaGitROVEeV7GSyHM=";
};
cargoHash = "sha256-LJ8EpxEIN8wojSmQ+WVshYRxGFAC9sUk5tnh3I2J408=";
buildInputs = [
mpv
libadwaita
libepoxy
openssl
];
nativeBuildInputs = [
makeBinaryWrapper
pkg-config
wrapGAppsHook4
glib
];
postInstall = ''
install -Dm444 data/xyz.timtimtim.Losange.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
install -Dm444 data/icons/xyz.timtimtim.Losange.svg -t $out/share/icons/hicolor/scalable/apps/
install -Dm444 data/xyz.timtimtim.Losange.desktop -t $out/share/applications/
install -Dm444 data/xyz.timtimtim.Losange.metainfo.xml -t $out/share/metainfo/
# The application fails if '-o' is passed without an argument (e.g. when opened using a launcher)
# therefore we match upstream's shell wrapper to handle empty URL cases.
substituteInPlace $out/share/applications/xyz.timtimtim.Losange.desktop \
--replace-fail "Exec=sh -c \"/usr/bin/losange -o '%u'\"" "Exec=sh -c \"losange -o '%u'\""
'';
# Node.js is required to run `server.js`
# Losange will automatically download the required version of `server.js` at runtime.
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : "${lib.makeBinPath [ nodejs ]}"
)
'';
passthru.updateScript = nix-update-script { };
meta = {
mainProgram = "losange";
description = "Simple Stremio client for GNOME";
homepage = "https://github.com/tymmesyde/Losange";
changelog = "https://github.com/tymmesyde/Losange/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ talal ];
};
})