mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-12 14:07:42 +00:00
nix: install multicall binaries in postInstall
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69646b6afeb1d9dda8d16e00f6f39b8046ff
This commit is contained in:
parent
a59e207e76
commit
a94ef7f5b4
1 changed files with 23 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
craneLib,
|
||||
versionCheckHook,
|
||||
}: let
|
||||
pname = "stash";
|
||||
version = (builtins.fromTOML (builtins.readFile ../Cargo.toml)).package.version;
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
|
||||
(s + /Cargo.lock)
|
||||
(s + /Cargo.toml)
|
||||
(s + /build.rs)
|
||||
];
|
||||
};
|
||||
|
||||
|
|
@ -28,11 +30,32 @@ in
|
|||
|
||||
strictDeps = true;
|
||||
|
||||
# Whether cargo's target directory should be copied as an output
|
||||
doInstallCargoArtifacts = true;
|
||||
|
||||
# Install Systemd service for Stash into $out/share.
|
||||
# This can be used to use Stash in 'systemd.packages'
|
||||
postInstall = ''
|
||||
mkdir -p $out
|
||||
install -Dm755 ${../vendor/stash.service} $out/share/stash.service
|
||||
|
||||
# Since Crane doesn't have a good way of enforcing that our symlinks
|
||||
# generated by the build wrapper are correctly linked, we should link
|
||||
# them *manually*.
|
||||
for bin in stash-copy stash-paste wl-copy wl-paste; do
|
||||
ln -sf $out/bin/stash $out/bin/$bin
|
||||
done
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [versionCheckHook];
|
||||
doInstallCheck = true;
|
||||
|
||||
# After the version check, let's see if all binaries are linked correctly.
|
||||
# We could probably add a check phase to the versions of each.
|
||||
postInstallCheck = ''
|
||||
for bin in stash stash-copy stash-paste wl-copy wl-paste; do
|
||||
[ -x "$out/bin/$bin" ] || { echo "$bin missing"; exit 1; }
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue