nixpkgs/pkgs/applications/networking/sync/celeste/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
2.0 KiB
Nix
Raw Normal View History

2023-02-10 00:54:30 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, substituteAll
, just
2023-02-10 00:54:30 +00:00
, pkg-config
, wrapGAppsHook4
, cairo
, gdk-pixbuf
, glib
, graphene
, gtk3
, gtk4
, libadwaita
, libappindicator-gtk3
, librclone
, pango
, rclone
}:
rustPlatform.buildRustPackage rec {
2023-02-10 00:54:30 +00:00
pname = "celeste";
version = "0.7.0";
2023-02-10 00:54:30 +00:00
src = fetchFromGitHub {
owner = "hwittenborn";
repo = "celeste";
rev = "v${version}";
hash = "sha256-fqPAQCbuPnFyn3wioWDETmcXu53808nvnlEzcdUevI4=";
2023-02-10 00:54:30 +00:00
};
cargoHash = "sha256-mVl7CsCX7HMlGC2EIKEfHnPNjmrexjsrpDK/Uq/GwpY=";
2023-02-10 00:54:30 +00:00
postPatch = ''
pushd $cargoDepsCopy/librclone-sys
oldHash=$(sha256sum build.rs | cut -d " " -f 1)
patch -p2 < ${./librclone-path.patch}
substituteInPlace build.rs \
--subst-var-by librclone ${librclone}
substituteInPlace .cargo-checksum.json \
--replace $oldHash $(sha256sum build.rs | cut -d " " -f 1)
popd
substituteInPlace justfile \
--replace "{{ env_var('DESTDIR') }}/usr" "${placeholder "out"}"
# buildRustPackage takes care of installing the binary
sed -i "#/bin/celeste#d" justfile
2023-02-10 00:54:30 +00:00
'';
# Cargo.lock is outdated
preConfigure = ''
cargo update --offline
'';
RUSTC_BOOTSTRAP = 1;
nativeBuildInputs = [
just
2023-02-10 00:54:30 +00:00
pkg-config
rustPlatform.bindgenHook
wrapGAppsHook4
];
buildInputs = [
cairo
gdk-pixbuf
glib
graphene
gtk3
gtk4
libadwaita
librclone
pango
];
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libappindicator-gtk3 ]}"
--prefix PATH : "${lib.makeBinPath [ rclone ]}"
)
'';
postInstall = ''
just install
'';
2023-02-10 00:54:30 +00:00
meta = {
changelog = "https://github.com/hwittenborn/celeste/blob/${src.rev}/CHANGELOG.md";
description = "GUI file synchronization client that can sync with any cloud provider";
homepage = "https://github.com/hwittenborn/celeste";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ dotlambda ];
};
}