chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / lo / localsend / package.nix
blob46715ac5e8494d3d0d604946be97b5c2bfcce373
2   lib,
3   stdenv,
4   fetchurl,
5   fetchFromGitHub,
6   flutter324,
7   makeDesktopItem,
8   nixosTests,
9   pkg-config,
10   libayatana-appindicator,
11   undmg,
12   makeBinaryWrapper,
15 let
16   pname = "localsend";
17   version = "1.15.4";
19   linux = flutter324.buildFlutterApplication rec {
20     inherit pname;
21     version = "1.15.4-unstable-2024-09-25";
23     src = fetchFromGitHub {
24       owner = pname;
25       repo = pname;
26       rev = "61f3ffdb8dd8b1116ced2e7b585f2f6662ce7d5f";
27       hash = "sha256-s7cR5ty8bygOCzHbLwNTBNlhlQ+2y25/ijlNqWYrqVw=";
28     };
30     sourceRoot = "${src.name}/app";
32     pubspecLock = lib.importJSON ./pubspec.lock.json;
34     gitHashes = {
35       "permission_handler_windows" = "sha256-+TP3neqlQRZnW6BxHaXr2EbmdITIx1Yo7AEn5iwAhwM=";
36     };
38     nativeBuildInputs = [ pkg-config ];
40     buildInputs = [ libayatana-appindicator ];
42     postInstall = ''
43       for s in 32 128 256 512; do
44         d=$out/share/icons/hicolor/''${s}x''${s}/apps
45         mkdir -p $d
46         ln -s $out/app/data/flutter_assets/assets/img/logo-''${s}.png $d/localsend.png
47       done
48       mkdir -p $out/share/applications
49       cp $desktopItem/share/applications/*.desktop $out/share/applications
50       substituteInPlace $out/share/applications/*.desktop --subst-var out
51     '';
53     desktopItem = makeDesktopItem {
54       name = "LocalSend";
55       exec = "@out@/bin/localsend_app";
56       icon = "localsend";
57       desktopName = "LocalSend";
58       startupWMClass = "localsend_app";
59       genericName = "An open source cross-platform alternative to AirDrop";
60       categories = [ "Network" ];
61     };
63     passthru = {
64       updateScript = ./update.sh;
65       tests.localsend = nixosTests.localsend;
66     };
68     meta = metaCommon // {
69       mainProgram = "localsend_app";
70     };
71   };
73   darwin = stdenv.mkDerivation {
74     inherit pname version;
76     src = fetchurl {
77       url = "https://github.com/localsend/localsend/releases/download/v${version}/LocalSend-${version}.dmg";
78       hash = "sha256-ZU2aXZNKo01TnXNH0e+r0l4J5HIILmGam3T4+6GaeA4=";
79     };
81     nativeBuildInputs = [
82       undmg
83       makeBinaryWrapper
84     ];
86     sourceRoot = ".";
88     installPhase = ''
89       mkdir -p $out/Applications
90       cp -r *.app $out/Applications
91       makeBinaryWrapper $out/Applications/LocalSend.app/Contents/MacOS/LocalSend $out/bin/localsend
92     '';
94     meta = metaCommon // {
95       sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
96       platforms = [
97         "x86_64-darwin"
98         "aarch64-darwin"
99       ];
100     };
101   };
103   metaCommon = {
104     description = "Open source cross-platform alternative to AirDrop";
105     homepage = "https://localsend.org/";
106     license = lib.licenses.mit;
107     mainProgram = "localsend";
108     maintainers = with lib.maintainers; [
109       sikmir
110       linsui
111       pandapip1
112     ];
113   };
115 if stdenv.hostPlatform.isDarwin then darwin else linux