nixpkgs-suyu/pkgs/applications/video/losslesscut-bin/appimage.nix
Artturin 1a634cc057 treewide: remove unecessary XDG_DATA_DIRS from appimage wrapType2
they're unnecessary since https://github.com/NixOS/nixpkgs/pull/161739/files

which links the schemas to their correct fhs locations and adds
gsettings-desktop-schemas and hicolor-icon-theme to appimage fhs
2022-05-15 05:19:23 +03:00

44 lines
1.3 KiB
Nix

{ appimageTools, lib, fetchurl, version, sha256 }:
let
pname = "losslesscut";
nameRepo = "lossless-cut";
nameCamel = "LosslessCut";
name = "${pname}-${version}";
nameSource = "${nameCamel}-linux.AppImage";
nameExecutable = "losslesscut";
owner = "mifi";
src = fetchurl {
url = "https://github.com/${owner}/${nameRepo}/releases/download/v${version}/${nameSource}";
name = nameSource;
inherit sha256;
};
extracted = appimageTools.extractType2 {
inherit name src;
};
in appimageTools.wrapType2 {
inherit name src;
profile = ''
export LC_ALL=C.UTF-8
'';
extraPkgs = ps: appimageTools.defaultFhsEnvArgs.multiPkgs ps;
extraInstallCommands = ''
mv $out/bin/{${name},${nameExecutable}}
(
mkdir -p $out/share
cd ${extracted}/usr
find share -mindepth 1 -type d -exec mkdir -p $out/{} \;
find share -mindepth 1 -type f,l -exec ln -s $PWD/{} $out/{} \;
)
ln -s ${extracted}/${nameExecutable}.png $out/share/icons/${nameExecutable}.png
mkdir $out/share/applications
cp ${extracted}/${nameExecutable}.desktop $out/share/applications
substituteInPlace $out/share/applications/${nameExecutable}.desktop \
--replace AppRun ${nameExecutable}
'';
meta.platforms = with lib.platforms; [ "x86_64-linux" ];
}