tyrolienne: 1.1.0 -> 1.2.0, add darwin support (#477888)

This commit is contained in:
Sandro
2026-01-10 06:56:09 +00:00
committed by GitHub
+31 -15
View File
@@ -1,6 +1,8 @@
{
lib,
stdenv,
rustPlatform,
cargo-bundle,
copyDesktopItems,
fetchFromGitea,
ffmpeg,
@@ -10,27 +12,31 @@
nix-update-script,
pkg-config,
wrapGAppsHook4,
zenity,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tyrolienne";
version = "1.1.0";
version = "1.2.0";
src = fetchFromGitea {
domain = "git.uku3lig.net";
owner = "uku";
repo = "tyrolienne";
tag = finalAttrs.version;
hash = "sha256-LJZxQLATVGEhb0HK8PO3Fe+N+GjJdwX1Z7mOCIwQkqo=";
hash = "sha256-jl1h7L+Ae28A7YFoIsQqxbx2XmxxjUHebD5Xba0cB5o=";
};
cargoHash = "sha256-ax8Akv26XFFxKVstUIAHUDKypzkJOS8mpBDIT3NfBbE=";
cargoHash = "sha256-J/gS8tyy+5ZG1xl4NrYCU26lD0yvsVyRUoOXntCgVSE=";
nativeBuildInputs = [
copyDesktopItems
imagemagick
pkg-config
wrapGAppsHook4
]
++ lib.optionals stdenv.hostPlatform.isLinux [
copyDesktopItems
imagemagick
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cargo-bundle
];
buildInputs = [ libadwaita ];
@@ -38,7 +44,22 @@ rustPlatform.buildRustPackage (finalAttrs: {
# Tests are disabled because there are none, avoids having to recompile everything twice
doCheck = false;
postInstall = ''
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
runHook preInstall
# cargo-bundle expects the binary in target/release
release_target="target/${stdenv.hostPlatform.rust.cargoShortTarget}/release"
mv $release_target/tyrolienne target/release/tyrolienne
export CARGO_BUNDLE_SKIP_BUILD=true
app_path=$(cargo bundle --release | xargs)
mkdir -p $out/Applications
mv $app_path $out/Applications/
runHook postInstall
'';
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
for size in 16 32 48 128 256; do
dir="$out/share/icons/hicolor/''${size}x''${size}/apps"
mkdir -p "$dir"
@@ -46,14 +67,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
done
'';
preFixup = ''
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
gappsWrapperArgs+=(
--prefix PATH : ${
lib.makeBinPath [
ffmpeg
zenity
]
}
--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}
)
'';
@@ -75,7 +91,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
description = "Simple tool to convert, upload, and embed videos to Zipline";
homepage = "https://git.uku3lig.net/uku/tyrolienne";
license = lib.licenses.mpl20;
platforms = lib.platforms.linux;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [ uku3lig ];
mainProgram = "tyrolienne";
};