diff --git a/pkgs/hayase/default.nix b/pkgs/hayase/default.nix index 7c172e4..88426f1 100644 --- a/pkgs/hayase/default.nix +++ b/pkgs/hayase/default.nix @@ -1,8 +1,5 @@ -{ - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: + pkgs.appimageTools.wrapType2 rec { pname = "hayase"; version = "6.4.67"; @@ -12,22 +9,36 @@ pkgs.appimageTools.wrapType2 rec { hash = "sha256-npUSNtiCKTcAK2nOta225W9+07Rsm235vsiAAAALVFU="; }; - nativeBuildInputs = with pkgs; [ - makeWrapper + makeWrapperArgs = [ + "--add-flags" + "--ozone-platform=wayland" ]; extraInstallCommands = let - contents = pkgs.appimageTools.extractType2 { inherit pname version src; }; + contents = pkgs.appimageTools.extract { inherit pname version src; }; in '' mkdir -p "$out/share/applications" mkdir -p "$out/share/lib/hayase" - cp -r ${contents}/{locales,resources} "$out/share/lib/hayase" - cp -r ${contents}/usr/share/* "$out/share" - cp "${contents}/${pname}.desktop" "$out/share/applications/" - wrapProgram $out/bin/hayase --add-flags "--ozone-platform=wayland" - substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${meta.mainProgram}' + + if [ -d ${contents}/resources ]; then + cp -r ${contents}/resources "$out/share/lib/hayase/" + fi + + if [ -d ${contents}/locales ]; then + cp -r ${contents}/locales "$out/share/lib/hayase/" + fi + + if [ -d ${contents}/usr/share ]; then + cp -r ${contents}/usr/share/* "$out/share/" + fi + + if [ -f ${contents}/*.desktop ]; then + install -Dm444 ${contents}/*.desktop "$out/share/applications/hayase.desktop" + substituteInPlace "$out/share/applications/hayase.desktop" \ + --replace-fail 'Exec=AppRun' 'Exec=hayase' + fi ''; meta = { diff --git a/pkgs/hellium/default.nix b/pkgs/hellium/default.nix index 5b3edb4..e8a546a 100644 --- a/pkgs/hellium/default.nix +++ b/pkgs/hellium/default.nix @@ -14,7 +14,12 @@ pkgs.appimageTools.wrapType2 rec { contents = pkgs.appimageTools.extract { inherit pname version src; }; in '' - install -m 444 -D ${contents}/${pname}.desktop -t $out/share/applications - cp -r ${contents}/usr/share/icons $out/share + if [ -f ${contents}/*.desktop ]; then + install -Dm444 ${contents}/*.desktop -t $out/share/applications + fi + + if [ -d ${contents}/usr/share/icons ]; then + cp -r ${contents}/usr/share/icons $out/share + fi ''; } diff --git a/pkgs/shiru/default.nix b/pkgs/shiru/default.nix index c015015..e556d3d 100644 --- a/pkgs/shiru/default.nix +++ b/pkgs/shiru/default.nix @@ -1,8 +1,5 @@ -{ - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: + pkgs.appimageTools.wrapType2 rec { pname = "shiru"; version = "v6.6.0"; @@ -12,22 +9,31 @@ pkgs.appimageTools.wrapType2 rec { hash = "sha256-Y7R8gKsPm7NmzKXC0C24KqY1s7boWal3w5Lin35eswk="; }; - nativeBuildInputs = with pkgs; [ - makeWrapper - ]; - extraInstallCommands = let - contents = pkgs.appimageTools.extractType2 { inherit pname version src; }; + contents = pkgs.appimageTools.extract { inherit pname version src; }; in '' mkdir -p "$out/share/applications" mkdir -p "$out/share/lib/shiru" - cp -r ${contents}/{locales,resources} "$out/share/lib/shiru" - cp -r ${contents}/usr/share/* "$out/share" - cp "${contents}/${pname}.desktop" "$out/share/applications/" - wrapProgram $out/bin/shiru --add-flags "--ozone-platform=wayland" - substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${meta.mainProgram}' + + if [ -d ${contents}/resources ]; then + cp -r ${contents}/resources "$out/share/lib/shiru/" + fi + + if [ -d ${contents}/locales ]; then + cp -r ${contents}/locales "$out/share/lib/shiru/" + fi + + if [ -d ${contents}/usr/share ]; then + cp -r ${contents}/usr/share/* "$out/share/" + fi + + if [ -f ${contents}/*.desktop ]; then + install -Dm444 ${contents}/*.desktop "$out/share/applications/shiru.desktop" + substituteInPlace "$out/share/applications/shiru.desktop" \ + --replace-fail 'Exec=AppRun' 'Exec=shiru' + fi ''; meta = {