nixpkgs/pkgs/by-name/ce/celeste/package.nix

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

97 lines
2.1 KiB
Nix
Raw Normal View History

2023-02-10 00:54:30 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
2024-07-02 08:58:25 +00:00
, darwin
, just
2023-02-10 00:54:30 +00:00
, pkg-config
, wrapGAppsHook4
, cairo
, dbus
2023-02-10 00:54:30 +00:00
, gdk-pixbuf
, glib
, graphene
, gtk4
, libadwaita
, librclone
, pango
, rclone
}:
rustPlatform.buildRustPackage rec {
2023-02-10 00:54:30 +00:00
pname = "celeste";
2024-06-28 00:16:39 +00:00
version = "0.8.3";
2023-02-10 00:54:30 +00:00
src = fetchFromGitHub {
owner = "hwittenborn";
repo = "celeste";
rev = "v${version}";
2024-06-28 00:16:39 +00:00
hash = "sha256-Yj2PvAlAkwLaSE27KnzEmiRAD5K/YVGbF4+N3uhDVT8=";
2023-02-10 00:54:30 +00:00
};
2024-06-28 00:16:39 +00:00
cargoHash = "sha256-nlYkFgm5r6nAbJvtrXW2VxzVYq1GrSs8bzHYWOglL1c=";
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
'';
RUSTC_BOOTSTRAP = 1;
nativeBuildInputs = [
just
2023-02-10 00:54:30 +00:00
pkg-config
rustPlatform.bindgenHook
wrapGAppsHook4
];
buildInputs = [
cairo
dbus
2023-02-10 00:54:30 +00:00
gdk-pixbuf
glib
graphene
gtk4
libadwaita
librclone
pango
2024-07-02 08:58:25 +00:00
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.Security
2023-02-10 00:54:30 +00:00
];
2024-07-02 08:58:25 +00:00
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isDarwin [
"-Wno-error=incompatible-function-pointer-types"
]);
2023-02-10 00:54:30 +00:00
preFixup = ''
gappsWrapperArgs+=(
--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";
mainProgram = "celeste";
2023-02-10 00:54:30 +00:00
homepage = "https://github.com/hwittenborn/celeste";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ dotlambda ];
};
}