mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 19:14:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
97 lines
2.1 KiB
Nix
97 lines
2.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, darwin
|
|
, just
|
|
, pkg-config
|
|
, wrapGAppsHook4
|
|
, cairo
|
|
, dbus
|
|
, gdk-pixbuf
|
|
, glib
|
|
, graphene
|
|
, gtk4
|
|
, libadwaita
|
|
, librclone
|
|
, pango
|
|
, rclone
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "celeste";
|
|
version = "0.8.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "hwittenborn";
|
|
repo = "celeste";
|
|
rev = "v${version}";
|
|
hash = "sha256-Yj2PvAlAkwLaSE27KnzEmiRAD5K/YVGbF4+N3uhDVT8=";
|
|
};
|
|
|
|
cargoHash = "sha256-nlYkFgm5r6nAbJvtrXW2VxzVYq1GrSs8bzHYWOglL1c=";
|
|
|
|
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
|
|
'';
|
|
|
|
RUSTC_BOOTSTRAP = 1;
|
|
|
|
nativeBuildInputs = [
|
|
just
|
|
pkg-config
|
|
rustPlatform.bindgenHook
|
|
wrapGAppsHook4
|
|
];
|
|
|
|
buildInputs = [
|
|
cairo
|
|
dbus
|
|
gdk-pixbuf
|
|
glib
|
|
graphene
|
|
gtk4
|
|
libadwaita
|
|
librclone
|
|
pango
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Foundation
|
|
darwin.apple_sdk.frameworks.Security
|
|
];
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isDarwin [
|
|
"-Wno-error=incompatible-function-pointer-types"
|
|
]);
|
|
|
|
preFixup = ''
|
|
gappsWrapperArgs+=(
|
|
--prefix PATH : "${lib.makeBinPath [ rclone ]}"
|
|
)
|
|
'';
|
|
|
|
postInstall = ''
|
|
just install
|
|
'';
|
|
|
|
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";
|
|
homepage = "https://github.com/hwittenborn/celeste";
|
|
license = lib.licenses.gpl3Only;
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
|
};
|
|
}
|