2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
2024-01-25 14:12:00 +00:00
|
|
|
, flutter313
|
2024-01-02 11:29:13 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
, pkg-config
|
|
|
|
, libayatana-appindicator
|
|
|
|
, undmg
|
|
|
|
}:
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "localsend";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.13.1";
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
linux = flutter313.buildFlutterApplication {
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-GJHCKNtKvwQAG3AUkhk0G4k/qsmLOUQAyyi9Id7NJh8=";
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
sourceRoot = "source/app";
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
|
|
|
|
|
|
|
gitHashes = {
|
|
|
|
"permission_handler_windows" = "sha256-a7bN7/A65xsvnQGXUvZCfKGtslbNWEwTWR8fAIjMwS0=";
|
|
|
|
"tray_manager" = "sha256-eF14JGf5jclsKdXfCE7Rcvp72iuWd9wuSZ8Bej17tjg=";
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ libayatana-appindicator ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
for s in 32 128 256 512; do
|
|
|
|
d=$out/share/icons/hicolor/''${s}x''${s}/apps
|
|
|
|
mkdir -p $d
|
|
|
|
ln -s $out/app/data/flutter_assets/assets/img/logo-''${s}.png $d/localsend.png
|
|
|
|
done
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp $desktopItem/share/applications/*.desktop $out/share/applications
|
|
|
|
substituteInPlace $out/share/applications/*.desktop --subst-var out
|
|
|
|
'';
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "LocalSend";
|
|
|
|
exec = "@out@/bin/localsend_app";
|
|
|
|
icon = "localsend";
|
|
|
|
desktopName = "LocalSend";
|
2024-01-25 14:12:00 +00:00
|
|
|
startupWMClass = "localsend_app";
|
2024-01-02 11:29:13 +00:00
|
|
|
genericName = "An open source cross-platform alternative to AirDrop";
|
|
|
|
categories = [ "Network" ];
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = meta // {
|
|
|
|
mainProgram = "localsend_app";
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
darwin = stdenv.mkDerivation {
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/localsend/localsend/releases/download/v${version}/LocalSend-${version}.dmg";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-YCy6NlmEPsOFtIZ27mOYDnMPd1tj3YO2bwNDdM3K/uY=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ undmg ];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r *.app $out/Applications
|
|
|
|
'';
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
meta = meta // {
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
platforms = [ "x86_64-darwin" "aarch64-darwin" ];
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An open source cross-platform alternative to AirDrop";
|
|
|
|
homepage = "https://localsend.org/";
|
|
|
|
license = licenses.mit;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "localsend";
|
2024-01-25 14:12:00 +00:00
|
|
|
maintainers = with maintainers; [ sikmir linsui ];
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwin
|
|
|
|
else linux
|