Skip to content

Commit 602d8ae

Browse files
authored
shpool: darwin support (#497401)
2 parents 34cf985 + e389006 commit 602d8ae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkgs/by-name/sh/shpool/package.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
lib,
3+
stdenv,
34
rustPlatform,
45
fetchFromGitHub,
56
linux-pam,
@@ -18,24 +19,22 @@ rustPlatform.buildRustPackage (finalAttrs: {
1819
hash = "sha256-r1bYcf5SPHbrPgxCvfbZNVhGj/gX8K5ucd8PH0WMgb8=";
1920
};
2021

21-
postPatch = ''
22+
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
2223
substituteInPlace systemd/shpool.service \
2324
--replace-fail '/usr/bin/shpool' "$out/bin/shpool"
2425
'';
2526

2627
cargoHash = "sha256-BeMIasnEFqeoHhNAlj/uBMtMoZvrLjyWDKi0n8BaSnU=";
2728

28-
buildInputs = [
29-
linux-pam
30-
];
29+
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ linux-pam ];
3130

3231
# The majority of tests rely on impure environment
3332
# (such as systemd socket, ssh socket), and some of them
3433
# have race conditions. They don't print their full name,
3534
# tried skipping them but failed
3635
doCheck = false;
3736

38-
postInstall = ''
37+
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
3938
install -Dm444 systemd/shpool.service -t $out/lib/systemd/user
4039
install -Dm444 systemd/shpool.socket -t $out/lib/systemd/user
4140
'';
@@ -51,6 +50,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
5150
license = lib.licenses.asl20;
5251
mainProgram = "shpool";
5352
maintainers = with lib.maintainers; [ aleksana ];
54-
platforms = lib.platforms.linux;
53+
platforms = lib.platforms.linux ++ lib.platforms.darwin;
5554
};
5655
})

0 commit comments

Comments
 (0)