Skip to content

Commit d774cc7

Browse files
authored
tideways-cli: init at 1.2.2 (#351192)
2 parents c3f9d32 + c40002e commit d774cc7

File tree

4 files changed

+257
-0
lines changed

4 files changed

+257
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
stdenvNoCC,
3+
lib,
4+
fetchurl,
5+
curl,
6+
common-updater-scripts,
7+
writeShellApplication,
8+
gnugrep,
9+
installShellFiles,
10+
}:
11+
12+
stdenvNoCC.mkDerivation (finalAttrs: {
13+
pname = "tideways-cli";
14+
version = "1.2.2";
15+
16+
nativeBuildInputs = [ installShellFiles ];
17+
18+
src =
19+
finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system}
20+
or (throw "Unsupported platform for tideways-cli: ${stdenvNoCC.hostPlatform.system}");
21+
22+
installPhase = ''
23+
runHook preInstall
24+
25+
mkdir -p $out/bin
26+
cp tideways $out/bin/tideways
27+
chmod +x $out/bin/tideways
28+
29+
installShellCompletion --cmd tideways \
30+
--bash <($out/bin/tideways completion bash) \
31+
--zsh <($out/bin/tideways completion zsh) \
32+
--fish <($out/bin/tideways completion fish)
33+
34+
runHook postInstall
35+
'';
36+
37+
passthru = {
38+
sources = {
39+
"x86_64-linux" = fetchurl {
40+
url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_linux_amd64-${finalAttrs.version}.tar.gz";
41+
hash = "sha256-g06PE464P/A0PDGG7xMa644ztcIRMAU/ueee2IOhiHc=";
42+
};
43+
"aarch64-linux" = fetchurl {
44+
url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_linux_arm64-${finalAttrs.version}.tar.gz";
45+
hash = "sha256-nbC9vMXA5vHKxEpINDQJTUqh7YOe0T0x5MbbQg03gk4=";
46+
};
47+
"x86_64-darwin" = fetchurl {
48+
url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_macos_amd64-${finalAttrs.version}.tar.gz";
49+
hash = "sha256-RfCTl61r/zfWy/3W+zmrSaAjIWe52POfZnzsmm5loD4=";
50+
};
51+
"aarch64-darwin" = fetchurl {
52+
url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_macos_arm64-${finalAttrs.version}.tar.gz";
53+
hash = "sha256-4N4hUvbf8b9BnKUY4YTsB76Z35DmSTyWv6BC+bqJNCI=";
54+
};
55+
};
56+
57+
updateScript = "${
58+
writeShellApplication {
59+
name = "update-tideways-cli";
60+
runtimeInputs = [
61+
curl
62+
gnugrep
63+
common-updater-scripts
64+
];
65+
text = ''
66+
NEW_VERSION=$(curl --fail -L -s https://tideways.com/profiler/downloads | grep -E 'https://tideways.s3.amazonaws.com/cli/([0-9]+\.[0-9]+\.[0-9]+)/tideways-cli_linux_amd64-\1.tar.gz' | grep -oP 'cli/\K[0-9]+\.[0-9]+\.[0-9]+')
67+
68+
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
69+
echo "The new version same as the old version."
70+
exit 0
71+
fi
72+
73+
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
74+
update-source-version "tideways-cli" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
75+
done
76+
'';
77+
}
78+
}/bin/update-tideways-cli";
79+
};
80+
81+
meta = with lib; {
82+
description = "Tideways Profiler CLI";
83+
homepage = "https://tideways.com/";
84+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
85+
mainProgram = "tideways";
86+
license = licenses.unfree;
87+
maintainers = with maintainers; [ shyim ];
88+
platforms = lib.attrNames finalAttrs.passthru.sources;
89+
};
90+
})
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
stdenvNoCC,
3+
lib,
4+
fetchurl,
5+
curl,
6+
common-updater-scripts,
7+
writeShellApplication,
8+
gnugrep,
9+
}:
10+
11+
stdenvNoCC.mkDerivation (finalAttrs: {
12+
pname = "tideways-daemon";
13+
version = "1.9.18";
14+
15+
src =
16+
finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system}
17+
or (throw "Unsupported platform for tideways-cli: ${stdenvNoCC.hostPlatform.system}");
18+
19+
installPhase = ''
20+
runHook preInstall
21+
mkdir -p $out/bin
22+
cp tideways-daemon $out/bin/tideways-daemon
23+
chmod +x $out/bin/tideways-daemon
24+
runHook postInstall
25+
'';
26+
27+
passthru = {
28+
sources = {
29+
"x86_64-linux" = fetchurl {
30+
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_amd64-${finalAttrs.version}.tar.gz";
31+
hash = "sha256-CFVHD2CfY1yOP621PzkflvapCrIuqY0rtTgm20xW41E=";
32+
};
33+
"aarch64-linux" = fetchurl {
34+
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_aarch64-${finalAttrs.version}.tar.gz";
35+
hash = "sha256-59quxF5rClfw8xd8mT2jU1/DVatrZyJw7Rj6pikKXF0=";
36+
};
37+
"aarch64-darwin" = fetchurl {
38+
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_macos_arm64-${finalAttrs.version}.tar.gz";
39+
hash = "sha256-4h7Vn9s8Y63M1BnzwjcxSV8ydRqhNeJnFvG9Cs1Cq8Q=";
40+
};
41+
};
42+
updateScript = "${
43+
writeShellApplication {
44+
name = "update-tideways-daemon";
45+
runtimeInputs = [
46+
curl
47+
gnugrep
48+
common-updater-scripts
49+
];
50+
text = ''
51+
NEW_VERSION=$(curl --fail -L -s https://tideways.com/profiler/downloads | grep -E 'https://tideways.s3.amazonaws.com/daemon/([0-9]+\.[0-9]+\.[0-9]+)/tideways-daemon_linux_amd64-\1.tar.gz' | grep -oP 'daemon/\K[0-9]+\.[0-9]+\.[0-9]+')
52+
53+
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
54+
echo "The new version same as the old version."
55+
exit 0
56+
fi
57+
58+
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
59+
update-source-version "tideways-daemon" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
60+
done
61+
'';
62+
}
63+
}/bin/update-tideways-daemon";
64+
};
65+
66+
meta = with lib; {
67+
description = "Tideways Daemon";
68+
homepage = "https://tideways.com/";
69+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
70+
mainProgram = "tideways-daemon";
71+
license = licenses.unfree;
72+
maintainers = with maintainers; [ shyim ];
73+
platforms = lib.attrNames finalAttrs.passthru.sources;
74+
};
75+
})
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
stdenvNoCC,
3+
lib,
4+
fetchurl,
5+
autoPatchelfHook,
6+
php,
7+
writeShellApplication,
8+
curl,
9+
gnugrep,
10+
common-updater-scripts,
11+
}:
12+
13+
let
14+
soFile =
15+
{
16+
"8.0" = "tideways-php-8.0.so";
17+
"8.1" = "tideways-php-8.1.so";
18+
"8.2" = "tideways-php-8.2.so";
19+
"8.3" = "tideways-php-8.3.so";
20+
}
21+
.${lib.versions.majorMinor php.version} or (throw "Unsupported PHP version.");
22+
in
23+
stdenvNoCC.mkDerivation (finalAttrs: {
24+
pname = "tideways-php";
25+
extensionName = "tideways";
26+
version = "5.13.0";
27+
28+
src =
29+
finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system}
30+
or (throw "Unsupported platform for tideways-php: ${stdenvNoCC.hostPlatform.system}");
31+
32+
nativeBuildInputs = lib.optionals stdenvNoCC.isLinux [
33+
autoPatchelfHook
34+
];
35+
36+
installPhase = ''
37+
runHook preInstall
38+
install -D ${soFile} $out/lib/php/extensions/tideways.so
39+
runHook postInstall
40+
'';
41+
42+
passthru = {
43+
sources = {
44+
"x86_64-linux" = fetchurl {
45+
url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-x86_64.tar.gz";
46+
hash = "sha256-HiH7EjAOqHIYaIRlp/cemhU+QX9Q66ZX8RpX1qcctZ0=";
47+
};
48+
"aarch64-linux" = fetchurl {
49+
url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-arm64.tar.gz";
50+
hash = "sha256-kntNr8KMrOBK2ZZT/EMTR7MCuRt3rJAqhpt5B0m5qVM=";
51+
};
52+
"aarch64-darwin" = fetchurl {
53+
url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-macos-arm.tar.gz";
54+
hash = "sha256-zNVBTXKwCRLKmDlEUUUpP7feB/n2fMevEuKZrgdyAkw=";
55+
};
56+
};
57+
58+
updateScript = "${
59+
writeShellApplication {
60+
name = "update-tideways-probe";
61+
runtimeInputs = [
62+
curl
63+
gnugrep
64+
common-updater-scripts
65+
];
66+
text = ''
67+
NEW_VERSION=$(curl --fail -L https://tideways.com/profiler/downloads | grep -E 'https://tideways.s3.amazonaws.com/extension/[0-9]+\.[0-9]+\.[0-9]+/tideways-php-[0-9]+\.[0-9]+\.[0-9]+-x86_64.tar.gz' | grep -oP 'extension/\K[0-9]+\.[0-9]+\.[0-9]+')
68+
69+
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
70+
echo "The new version same as the old version."
71+
exit 0
72+
fi
73+
74+
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
75+
update-source-version "php82Extensions.tideways" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
76+
done
77+
'';
78+
}
79+
}/bin/update-tideways-probe";
80+
};
81+
82+
meta = with lib; {
83+
description = "Tideways PHP Probe";
84+
homepage = "https://tideways.com/";
85+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
86+
license = licenses.unfree;
87+
maintainers = with maintainers; [ shyim ];
88+
platforms = lib.attrNames finalAttrs.passthru.sources;
89+
};
90+
})

pkgs/top-level/php-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ in {
357357

358358
swoole = callPackage ../development/php-packages/swoole { };
359359

360+
tideways = callPackage ../development/php-packages/tideways { };
361+
360362
uv = callPackage ../development/php-packages/uv { };
361363

362364
vld = callPackage ../development/php-packages/vld { };

0 commit comments

Comments
 (0)