99 lines
1.9 KiB
Nix
99 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
craneLib,
|
|
copyDesktopItems,
|
|
ffmpeg,
|
|
imagemagick,
|
|
libadwaita,
|
|
makeDesktopItem,
|
|
mold-wrapped,
|
|
pkg-config,
|
|
wrapGAppsHook4,
|
|
zenity,
|
|
}:
|
|
let
|
|
cargoToml = lib.importTOML ./Cargo.toml;
|
|
|
|
resFilter = path: type: baseNameOf (dirOf path) == "res";
|
|
in
|
|
craneLib.buildPackage {
|
|
pname = cargoToml.package.name;
|
|
inherit (cargoToml.package) version;
|
|
|
|
src = lib.cleanSourceWith {
|
|
src = ./.;
|
|
name = "source";
|
|
filter =
|
|
path: type:
|
|
lib.any (f: f path type) [
|
|
resFilter
|
|
craneLib.filterCargoSources
|
|
];
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
copyDesktopItems
|
|
imagemagick
|
|
mold-wrapped
|
|
pkg-config
|
|
wrapGAppsHook4
|
|
];
|
|
|
|
buildInputs = [ libadwaita ];
|
|
|
|
RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
|
|
|
|
doCheck = false;
|
|
|
|
postInstall =
|
|
let
|
|
resolutions = [
|
|
"16"
|
|
"32"
|
|
"48"
|
|
"128"
|
|
"256"
|
|
];
|
|
in
|
|
map (
|
|
size:
|
|
let
|
|
dir = "$out/share/icons/hicolor/${size}x${size}/apps";
|
|
in
|
|
''
|
|
mkdir -p ${dir}
|
|
magick res/tyrolienne.png -resize ${size}x ${dir}/net.uku3lig.tyrolienne.png
|
|
''
|
|
) resolutions;
|
|
|
|
preFixup = ''
|
|
gappsWrapperArgs+=(
|
|
--prefix PATH : ${
|
|
lib.makeBinPath [
|
|
ffmpeg
|
|
zenity
|
|
]
|
|
}
|
|
)
|
|
'';
|
|
|
|
desktopItems = [
|
|
(makeDesktopItem {
|
|
name = "net.uku3lig.tyrolienne";
|
|
desktopName = "Tyrolienne";
|
|
type = "Application";
|
|
comment = "Compresses and uploads videos to Zipline";
|
|
exec = "tyrolienne";
|
|
icon = "net.uku3lig.tyrolienne";
|
|
terminal = false;
|
|
})
|
|
];
|
|
|
|
meta = {
|
|
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 ++ lib.platforms.darwin;
|
|
mainProgram = "tyrolienne";
|
|
};
|
|
}
|