From 880de9943e9467b5c7a214ebda4100fc261570ac Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Fri, 25 Oct 2024 16:42:34 +0200 Subject: [PATCH 1/3] tideways-cli: init at 1.2.2 --- pkgs/by-name/ti/tideways-cli/package.nix | 90 ++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 pkgs/by-name/ti/tideways-cli/package.nix diff --git a/pkgs/by-name/ti/tideways-cli/package.nix b/pkgs/by-name/ti/tideways-cli/package.nix new file mode 100644 index 000000000000..44a64a6ec318 --- /dev/null +++ b/pkgs/by-name/ti/tideways-cli/package.nix @@ -0,0 +1,90 @@ +{ + stdenvNoCC, + lib, + fetchurl, + curl, + common-updater-scripts, + writeShellApplication, + gnugrep, + installShellFiles, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "tideways-cli"; + version = "1.2.2"; + + nativeBuildInputs = [ installShellFiles ]; + + src = + finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system} + or (throw "Unsupported platform for tideways-cli: ${stdenvNoCC.hostPlatform.system}"); + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp tideways $out/bin/tideways + chmod +x $out/bin/tideways + + installShellCompletion --cmd tideways \ + --bash <($out/bin/tideways completion bash) \ + --zsh <($out/bin/tideways completion zsh) \ + --fish <($out/bin/tideways completion fish) + + runHook postInstall + ''; + + passthru = { + sources = { + "x86_64-linux" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_linux_amd64-${finalAttrs.version}.tar.gz"; + hash = "sha256-g06PE464P/A0PDGG7xMa644ztcIRMAU/ueee2IOhiHc="; + }; + "aarch64-linux" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_linux_arm64-${finalAttrs.version}.tar.gz"; + hash = "sha256-nbC9vMXA5vHKxEpINDQJTUqh7YOe0T0x5MbbQg03gk4="; + }; + "x86_64-darwin" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_macos_amd64-${finalAttrs.version}.tar.gz"; + hash = "sha256-RfCTl61r/zfWy/3W+zmrSaAjIWe52POfZnzsmm5loD4="; + }; + "aarch64-darwin" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/cli/${finalAttrs.version}/tideways-cli_macos_arm64-${finalAttrs.version}.tar.gz"; + hash = "sha256-4N4hUvbf8b9BnKUY4YTsB76Z35DmSTyWv6BC+bqJNCI="; + }; + }; + + updateScript = "${ + writeShellApplication { + name = "update-tideways-cli"; + runtimeInputs = [ + curl + gnugrep + common-updater-scripts + ]; + text = '' + 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]+') + + if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then + echo "The new version same as the old version." + exit 0 + fi + + for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do + update-source-version "tideways-cli" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform" + done + ''; + } + }/bin/update-tideways-cli"; + }; + + meta = with lib; { + description = "Tideways Profiler CLI"; + homepage = "https://tideways.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + mainProgram = "tideways"; + license = licenses.unfree; + maintainers = with maintainers; [ shyim ]; + platforms = lib.attrNames finalAttrs.passthru.sources; + }; +}) From b59b8fc07bf551f34dee194f57013e647108567a Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Fri, 25 Oct 2024 16:52:34 +0200 Subject: [PATCH 2/3] tideways-daemon: init at 1.9.18 --- pkgs/by-name/ti/tideways-daemon/package.nix | 75 +++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pkgs/by-name/ti/tideways-daemon/package.nix diff --git a/pkgs/by-name/ti/tideways-daemon/package.nix b/pkgs/by-name/ti/tideways-daemon/package.nix new file mode 100644 index 000000000000..0a76c2dba528 --- /dev/null +++ b/pkgs/by-name/ti/tideways-daemon/package.nix @@ -0,0 +1,75 @@ +{ + stdenvNoCC, + lib, + fetchurl, + curl, + common-updater-scripts, + writeShellApplication, + gnugrep, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "tideways-daemon"; + version = "1.9.18"; + + src = + finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system} + or (throw "Unsupported platform for tideways-cli: ${stdenvNoCC.hostPlatform.system}"); + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp tideways-daemon $out/bin/tideways-daemon + chmod +x $out/bin/tideways-daemon + runHook postInstall + ''; + + passthru = { + sources = { + "x86_64-linux" = fetchurl { + url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_amd64-${finalAttrs.version}.tar.gz"; + hash = "sha256-CFVHD2CfY1yOP621PzkflvapCrIuqY0rtTgm20xW41E="; + }; + "aarch64-linux" = fetchurl { + url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_aarch64-${finalAttrs.version}.tar.gz"; + hash = "sha256-59quxF5rClfw8xd8mT2jU1/DVatrZyJw7Rj6pikKXF0="; + }; + "aarch64-darwin" = fetchurl { + url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_macos_arm64-${finalAttrs.version}.tar.gz"; + hash = "sha256-4h7Vn9s8Y63M1BnzwjcxSV8ydRqhNeJnFvG9Cs1Cq8Q="; + }; + }; + updateScript = "${ + writeShellApplication { + name = "update-tideways-daemon"; + runtimeInputs = [ + curl + gnugrep + common-updater-scripts + ]; + text = '' + 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]+') + + if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then + echo "The new version same as the old version." + exit 0 + fi + + for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do + update-source-version "tideways-daemon" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform" + done + ''; + } + }/bin/update-tideways-daemon"; + }; + + meta = with lib; { + description = "Tideways Daemon"; + homepage = "https://tideways.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + mainProgram = "tideways-daemon"; + license = licenses.unfree; + maintainers = with maintainers; [ shyim ]; + platforms = lib.attrNames finalAttrs.passthru.sources; + }; +}) From c40002e9c86c462a42323cc8f2ae6804c0eca423 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Sat, 26 Oct 2024 11:10:16 +0200 Subject: [PATCH 3/3] php82Extensions.tideways: init at 5.13.0 --- .../php-packages/tideways/default.nix | 90 +++++++++++++++++++ pkgs/top-level/php-packages.nix | 2 + 2 files changed, 92 insertions(+) create mode 100644 pkgs/development/php-packages/tideways/default.nix diff --git a/pkgs/development/php-packages/tideways/default.nix b/pkgs/development/php-packages/tideways/default.nix new file mode 100644 index 000000000000..6649d0194710 --- /dev/null +++ b/pkgs/development/php-packages/tideways/default.nix @@ -0,0 +1,90 @@ +{ + stdenvNoCC, + lib, + fetchurl, + autoPatchelfHook, + php, + writeShellApplication, + curl, + gnugrep, + common-updater-scripts, +}: + +let + soFile = + { + "8.0" = "tideways-php-8.0.so"; + "8.1" = "tideways-php-8.1.so"; + "8.2" = "tideways-php-8.2.so"; + "8.3" = "tideways-php-8.3.so"; + } + .${lib.versions.majorMinor php.version} or (throw "Unsupported PHP version."); +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "tideways-php"; + extensionName = "tideways"; + version = "5.13.0"; + + src = + finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system} + or (throw "Unsupported platform for tideways-php: ${stdenvNoCC.hostPlatform.system}"); + + nativeBuildInputs = lib.optionals stdenvNoCC.isLinux [ + autoPatchelfHook + ]; + + installPhase = '' + runHook preInstall + install -D ${soFile} $out/lib/php/extensions/tideways.so + runHook postInstall + ''; + + passthru = { + sources = { + "x86_64-linux" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-x86_64.tar.gz"; + hash = "sha256-HiH7EjAOqHIYaIRlp/cemhU+QX9Q66ZX8RpX1qcctZ0="; + }; + "aarch64-linux" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-arm64.tar.gz"; + hash = "sha256-kntNr8KMrOBK2ZZT/EMTR7MCuRt3rJAqhpt5B0m5qVM="; + }; + "aarch64-darwin" = fetchurl { + url = "https://s3-eu-west-1.amazonaws.com/tideways/extension/${finalAttrs.version}/tideways-php-${finalAttrs.version}-macos-arm.tar.gz"; + hash = "sha256-zNVBTXKwCRLKmDlEUUUpP7feB/n2fMevEuKZrgdyAkw="; + }; + }; + + updateScript = "${ + writeShellApplication { + name = "update-tideways-probe"; + runtimeInputs = [ + curl + gnugrep + common-updater-scripts + ]; + text = '' + 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]+') + + if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then + echo "The new version same as the old version." + exit 0 + fi + + for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do + update-source-version "php82Extensions.tideways" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform" + done + ''; + } + }/bin/update-tideways-probe"; + }; + + meta = with lib; { + description = "Tideways PHP Probe"; + homepage = "https://tideways.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.unfree; + maintainers = with maintainers; [ shyim ]; + platforms = lib.attrNames finalAttrs.passthru.sources; + }; +}) diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 74e290052b63..db854261d908 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -357,6 +357,8 @@ in { swoole = callPackage ../development/php-packages/swoole { }; + tideways = callPackage ../development/php-packages/tideways { }; + uv = callPackage ../development/php-packages/uv { }; vld = callPackage ../development/php-packages/vld { };