Skip to content

Commit

Permalink
localsend: 1.15.4-unstable-2024-10-26 -> 1.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aucub committed Nov 4, 2024
1 parent acdf3fc commit c2a4b49
Show file tree
Hide file tree
Showing 3 changed files with 711 additions and 509 deletions.
71 changes: 65 additions & 6 deletions pkgs/by-name/lo/localsend/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,68 @@
libayatana-appindicator,
undmg,
makeBinaryWrapper,
rustPlatform,
moreutils,
jq,
cargo,
rustc,
fetchzip,
}:

let
pname = "localsend";
version = "1.15.4";
version = "1.16.0";

linux = flutter324.buildFlutterApplication rec {
inherit pname;
version = "1.15.4-unstable-2024-10-26";
inherit pname version;

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "d0e864ddf6ebe1c55188b33f8fdccd534d203c75";
hash = "sha256-qaW9LoRQge4K/CAQwbjNxmlUkQmxvaZyBJdAjXbbTw4=";
rev = "v${version}";
hash = "sha256-0FBHT7hIDVpRVc+a1Y7g35MGzoE66oGf0CvsU1dUqCc=";
};

sourceRoot = "${src.name}/app";

pubspecLock = lib.importJSON ./pubspec.lock.json;

customSourceBuilders = {
rhttp =
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "rhttp";
inherit version src;
inherit (src) passthru;
patches = [ ./rhttp.patch ];
postPatch = ''
sed -i '/chmod +x/d' cargokit/cmake/cargokit.cmake
sed -i '/--no-precompile/d' cargokit/run_build_tool.sh
'';
installPhase = ''
runHook preInstall
chmod +x cargokit/run_build_tool.sh
mkdir $out
cp -a ./* $out/
runHook postInstall
'';
};
};

rhttp-version = "0.9.0";
rhttp-src = fetchzip {
url = "https://pub.dev/api/archives/rhttp-${rhttp-version}.tar.gz";
hash = "sha256-R/epI6ZC3AhcRL7LY/SLxyCLVCAFQSNTEsbqC3JPrgc=";
stripRoot = false;
};
cargoDeps = rustPlatform.fetchCargoTarball rec {
pname = "rhttp";
version = rhttp-version;
src = rhttp-src;
sourceRoot = "${src.name}/rust";
hash = "sha256-Cw/M/YwZbkFhcD1friSdWzgjIodTlw8Il3GOmwrRQH4=";
};

gitHashes = {
permission_handler_windows = "sha256-+TP3neqlQRZnW6BxHaXr2EbmdITIx1Yo7AEn5iwAhwM=";
pasteboard = "sha256-lJA5OWoAHfxORqWMglKzhsL1IFr9YcdAQP/NVOLYB4o=";
Expand All @@ -40,10 +81,24 @@ let
nativeBuildInputs = [
pkg-config
copyDesktopItems
moreutils
jq
cargo
rustc
rustPlatform.cargoSetupHook
];

buildInputs = [ libayatana-appindicator ];

postPatch = ''
cp ${rhttp-src}/rust/Cargo.lock ./Cargo.lock
'';

preBuild = ''
# build_tool hack: add build_tool as an actually resolvable package (the location is relative to the rhttp package directory)
jq '.packages += [.packages.[] | select(.name == "rhttp") | .rootUri += "/cargokit/build_tool" | .name = "build_tool"]' .dart_tool/package_config.json | sponge .dart_tool/package_config.json
'';

postInstall = ''
for s in 32 128 256 512; do
d=$out/share/icons/hicolor/''${s}x''${s}/apps
Expand All @@ -52,6 +107,10 @@ let
done
'';

extraWrapProgramArgs = ''
--prefix LD_LIBRARY_PATH : "$out/app/${pname}/lib"
'';

desktopItems = [
(makeDesktopItem {
name = "LocalSend";
Expand Down Expand Up @@ -79,7 +138,7 @@ let

src = fetchurl {
url = "https://github.com/localsend/localsend/releases/download/v${version}/LocalSend-${version}.dmg";
hash = "sha256-ZU2aXZNKo01TnXNH0e+r0l4J5HIILmGam3T4+6GaeA4=";
hash = "sha256-CPAcVFQwkFx28BlXJw8dEBZHLq+f0DUdEtWGWC2DS8o=";
};

nativeBuildInputs = [
Expand Down
Loading

0 comments on commit c2a4b49

Please sign in to comment.