appflowy: format using nixfmt

This commit is contained in:
Alexis Hildebrandt 2024-07-16 00:05:23 +02:00
parent 0e4dbceba0
commit 4767d29976

View File

@ -1,28 +1,31 @@
{ stdenvNoCC
, lib
, fetchzip
, autoPatchelfHook
, makeWrapper
, copyDesktopItems
, makeDesktopItem
, gtk3
, xdg-user-dirs
, keybinder3
, libnotify
{
stdenvNoCC,
lib,
fetchzip,
autoPatchelfHook,
makeWrapper,
copyDesktopItems,
makeDesktopItem,
gtk3,
xdg-user-dirs,
keybinder3,
libnotify,
}:
let
dist = rec {
x86_64-linux = {
urlSuffix = "linux-x86_64.tar.gz";
hash = "sha256-PVlHPjr6aUkTp9x4MVC8cgebmdaUQXX6eV0/LfAmiJc=";
};
x86_64-darwin = {
urlSuffix = "macos-universal.zip";
hash = "sha256-gx+iMo2611uoR549gpBoHlp2h6zQtugPZnU9qbH6VIQ=";
};
aarch64-darwin = x86_64-darwin;
}."${stdenvNoCC.hostPlatform.system}";
dist =
rec {
x86_64-linux = {
urlSuffix = "linux-x86_64.tar.gz";
hash = "sha256-PVlHPjr6aUkTp9x4MVC8cgebmdaUQXX6eV0/LfAmiJc=";
};
x86_64-darwin = {
urlSuffix = "macos-universal.zip";
hash = "sha256-gx+iMo2611uoR549gpBoHlp2h6zQtugPZnU9qbH6VIQ=";
};
aarch64-darwin = x86_64-darwin;
}
."${stdenvNoCC.hostPlatform.system}";
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "appflowy";
@ -37,9 +40,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
nativeBuildInputs = [
makeWrapper
copyDesktopItems
] ++ lib.optionals stdenvNoCC.isLinux [
autoPatchelfHook
];
] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
buildInputs = [
gtk3
@ -50,37 +51,41 @@ stdenvNoCC.mkDerivation (finalAttrs: {
dontBuild = true;
dontConfigure = true;
installPhase = lib.optionalString stdenvNoCC.isLinux ''
runHook preInstall
installPhase =
lib.optionalString stdenvNoCC.isLinux ''
runHook preInstall
cd AppFlowy/
cd AppFlowy/
mkdir -p $out/{bin,opt}
mkdir -p $out/{bin,opt}
# Copy archive contents to the outpout directory
cp -r ./* $out/opt/
# Copy archive contents to the outpout directory
cp -r ./* $out/opt/
# Copy icon
install -Dm444 data/flutter_assets/assets/images/flowy_logo.svg $out/share/icons/hicolor/scalable/apps/appflowy.svg
# Copy icon
install -Dm444 data/flutter_assets/assets/images/flowy_logo.svg $out/share/icons/hicolor/scalable/apps/appflowy.svg
runHook postInstall
'' + lib.optionalString stdenvNoCC.isDarwin ''
runHook preInstall
runHook postInstall
''
+ lib.optionalString stdenvNoCC.isDarwin ''
runHook preInstall
mkdir -p $out/{Applications,bin}
cp -r ./AppFlowy.app $out/Applications/
mkdir -p $out/{Applications,bin}
cp -r ./AppFlowy.app $out/Applications/
runHook postInstall
'';
runHook postInstall
'';
preFixup = lib.optionalString stdenvNoCC.isLinux ''
# Add missing libraries to appflowy using the ones it comes with
makeWrapper $out/opt/AppFlowy $out/bin/appflowy \
--set LD_LIBRARY_PATH "$out/opt/lib/" \
--prefix PATH : "${lib.makeBinPath [ xdg-user-dirs ]}"
'' + lib.optionalString stdenvNoCC.isDarwin ''
makeWrapper $out/Applications/AppFlowy.app/Contents/MacOS/AppFlowy $out/bin/appflowy
'';
preFixup =
lib.optionalString stdenvNoCC.isLinux ''
# Add missing libraries to appflowy using the ones it comes with
makeWrapper $out/opt/AppFlowy $out/bin/appflowy \
--set LD_LIBRARY_PATH "$out/opt/lib/" \
--prefix PATH : "${lib.makeBinPath [ xdg-user-dirs ]}"
''
+ lib.optionalString stdenvNoCC.isDarwin ''
makeWrapper $out/Applications/AppFlowy.app/Contents/MacOS/AppFlowy $out/bin/appflowy
'';
desktopItems = lib.optionals stdenvNoCC.isLinux [
(makeDesktopItem {