diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-05-31 18:01:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 18:01:11 +0000 |
commit | d6ede66f6a6f0542b58b7a7d50265fa111de1b27 (patch) | |
tree | 26050708156188361a0b16bdc35c1eddfba50b63 /pkgs/development/tools | |
parent | c451d8d636d5f35c7b98763e0ffae98679e53087 (diff) | |
parent | 692517bf851f2d8d999f0ad50f53fa1d2dd5c8f9 (diff) | |
download | nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar.gz nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar.bz2 nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar.lz nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar.xz nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.tar.zst nixpkgs-d6ede66f6a6f0542b58b7a7d50265fa111de1b27.zip |
Merge master into staging-next
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r-- | pkgs/development/tools/build-managers/scala-cli/default.nix | 25 | ||||
-rw-r--r-- | pkgs/development/tools/build-managers/scala-cli/sources.json | 13 | ||||
-rw-r--r-- | pkgs/development/tools/build-managers/scala-cli/update.nix | 37 | ||||
-rw-r--r-- | pkgs/development/tools/replay-io/default.nix | 141 | ||||
-rw-r--r-- | pkgs/development/tools/replay-io/meta.json | 15 | ||||
-rwxr-xr-x | pkgs/development/tools/replay-io/update.sh | 32 |
6 files changed, 247 insertions, 16 deletions
diff --git a/pkgs/development/tools/build-managers/scala-cli/default.nix b/pkgs/development/tools/build-managers/scala-cli/default.nix index 40b230a72c3..1eb6b92cbd4 100644 --- a/pkgs/development/tools/build-managers/scala-cli/default.nix +++ b/pkgs/development/tools/build-managers/scala-cli/default.nix @@ -1,21 +1,14 @@ -{ stdenv, coreutils, lib, installShellFiles, zlib, autoPatchelfHook, fetchurl }: +{ stdenv, coreutils, lib, installShellFiles, zlib, autoPatchelfHook, fetchurl, callPackage }: let - version = "0.1.5"; - assets = { - x86_64-darwin = { - asset = "scala-cli-x86_64-apple-darwin.gz"; - sha256 = "1sczbvvhh1ff8mdb6zj4q3fnrz1qsqmr58jlb1s3fy1wv2p5ywxl"; - }; - x86_64-linux = { - asset = "scala-cli-x86_64-pc-linux.gz"; - sha256 = "1ahvjgcghh1pmgfsajg0b8bf5aaqxdx0f6b6qgljs0xfqm7zs05v"; - }; - }; + pname = "scala-cli"; + sources = builtins.fromJSON (builtins.readFile ./sources.json); + inherit (sources) version assets; + + platforms = builtins.attrNames assets; in stdenv.mkDerivation { - pname = "scala-cli"; - inherit version; + inherit pname version; nativeBuildInputs = [ installShellFiles ] ++ lib.optional stdenv.isLinux autoPatchelfHook; buildInputs = [ coreutils zlib stdenv.cc.cc ]; @@ -27,7 +20,6 @@ stdenv.mkDerivation { url = "https://github.com/Virtuslab/scala-cli/releases/download/v${version}/${asset.asset}"; sha256 = asset.sha256; }; - unpackPhase = '' runHook preUnpack gzip -d < $src > scala-cli @@ -61,6 +53,7 @@ stdenv.mkDerivation { license = licenses.asl20; description = "Command-line tool to interact with the Scala language"; maintainers = [ maintainers.kubukoz ]; - platforms = builtins.attrNames assets; }; + + passthru.updateScript = callPackage ./update.nix { } { inherit platforms pname version; }; } diff --git a/pkgs/development/tools/build-managers/scala-cli/sources.json b/pkgs/development/tools/build-managers/scala-cli/sources.json new file mode 100644 index 00000000000..eaa53705260 --- /dev/null +++ b/pkgs/development/tools/build-managers/scala-cli/sources.json @@ -0,0 +1,13 @@ +{ + "version": "0.1.6", + "assets": { + "x86_64-darwin": { + "asset": "scala-cli-x86_64-apple-darwin.gz", + "sha256": "1wcm47x0w4gdhkqrqjn0qvgnn36c707mz9m260pdnnffja203vyr" + }, + "x86_64-linux": { + "asset": "scala-cli-x86_64-pc-linux.gz", + "sha256": "1jwv67p2r6kxqlz8p2zvk5g5jdswl8cymj822b88lbp78a497kc6" + } + } +} diff --git a/pkgs/development/tools/build-managers/scala-cli/update.nix b/pkgs/development/tools/build-managers/scala-cli/update.nix new file mode 100644 index 00000000000..fd79a1cf3a8 --- /dev/null +++ b/pkgs/development/tools/build-managers/scala-cli/update.nix @@ -0,0 +1,37 @@ +{ lib, curl, writeShellScript, jq, gnused, git, nix, coreutils }: { platforms, pname, version }: + +writeShellScript "${pname}-update-script" '' + set -o errexit + PATH=${lib.makeBinPath [ curl jq gnused git nix coreutils ]} + + latest_version=$(curl -s "https://api.github.com/repos/VirtusLab/scala-cli/releases?per_page=1" | jq ".[0].tag_name" --raw-output | sed 's/^v//') + + if [[ "${version}" = "$latest_version" ]]; then + echo "The new version same as the old version." + exit 0 + fi + + nixpkgs=$(git rev-parse --show-toplevel) + sources_json="$nixpkgs/pkgs/development/tools/build-managers/scala-cli/sources.json" + + platform_assets=() + + for platform in ${lib.concatStringsSep " " platforms}; do + asset=$(jq ".assets.\"$platform\".asset" --raw-output < $sources_json) + release_asset_url="https://github.com/Virtuslab/scala-cli/releases/download/v$latest_version/$asset" + + asset_hash=$(nix-prefetch-url "$release_asset_url") + + asset_object=$(jq --compact-output --null-input \ + --arg asset "$asset" \ + --arg sha256 "$asset_hash" \ + --arg platform "$platform" \ + '{asset: $asset, sha256: $sha256, platform: $platform}') + platform_assets+=($asset_object) + done + + printf '%s\n' "''${platform_assets[@]}" | \ + jq -s "map ( { (.platform): . | del(.platform) }) | add" | \ + jq --arg version $latest_version \ + '{ version: $version, assets: . }' > $sources_json +'' diff --git a/pkgs/development/tools/replay-io/default.nix b/pkgs/development/tools/replay-io/default.nix new file mode 100644 index 00000000000..744736657a7 --- /dev/null +++ b/pkgs/development/tools/replay-io/default.nix @@ -0,0 +1,141 @@ +{ stdenv, lib, fetchurl, fetchFromGitHub, autoPatchelfHook, makeWrapper, libcxx +, libX11, libXt, libXdamage, glib, gtk3, dbus-glib, openssl, nodejs, zlib +, fetchzip }: +let metadata = lib.importJSON ./meta.json; +in rec { + replay-recordreplay = stdenv.mkDerivation rec { + pname = "replay-recordreplay"; + version = builtins.head (builtins.match ".*/linux-recordreplay-(.*).tgz" + metadata.recordreplay.url); + nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = [ stdenv.cc.cc.lib openssl zlib ]; + + src = (fetchzip metadata.recordreplay); + dontBuild = true; + installPhase = '' + runHook preInstall + cp linux-recordreplay.so $out + runHook postInstall + ''; + meta = with lib; { + description = "RecordReplay internal recording library"; + homepage = "https://www.replay.io/"; + license = lib.licenses.unfree; + maintainers = with maintainers; [ phryneas ]; + platforms = [ "x86_64-linux" ]; + }; + }; + + replay-io = stdenv.mkDerivation rec { + pname = "replay-io"; + version = builtins.head + (builtins.match ".*/linux-gecko-(.*).tar.bz2" metadata.replay.url); + srcs = fetchurl metadata.replay; + nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + buildInputs = [ dbus-glib glib gtk3 libX11 libXdamage libXt ]; + installPhase = '' + runHook preInstall + mkdir -p $out/opt/replay-io + cp -r * $out/opt/replay-io + mkdir $out/bin + makeWrapper $out/opt/replay-io/replay \ + $out/bin/replay-io \ + --set "RECORD_REPLAY_DRIVER" "${replay-recordreplay}" + runHook postInstall + ''; + + passthru.updateScript = ./update.sh; + + meta = with lib; { + description = "The Time Travel Debugger for Web Development"; + longDescription = '' + Replay allows you to record and replay web applications with familiar browser dev tools. + You can access the browser DevTools at any point of the recording, adding new logger + statements and inspecting the status of the DOM, variables and the current call stack. + Your recordings can be shared with other users for collaborative debugging. + ''; + homepage = "https://www.replay.io/"; + downloadPage = "https://www.replay.io/"; + mainProgram = "replay-io"; + license = lib.licenses.mpl20; + maintainers = with maintainers; [ phryneas ]; + platforms = [ "x86_64-linux" ]; + }; + }; + + replay-node = stdenv.mkDerivation rec { + pname = "replay-node"; + version = builtins.head + (builtins.match ".*/linux-node-(.*)" metadata.replay-node.url); + nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + buildInputs = [ stdenv.cc.cc.lib ]; + + src = (fetchurl metadata.replay-node); + dontUnpack = true; + dontBuild = true; + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/opt/replay-node + cp $src $out/opt/replay-node/node-unwrapped + chmod +x $out/opt/replay-node/node-unwrapped + + makeWrapper $out/opt/replay-node/node-unwrapped \ + $out/opt/replay-node/node \ + --set "RECORD_REPLAY_DRIVER" "${replay-recordreplay}" + + ln -s $out/opt/replay-node/node $out/bin/replay-node + runHook postInstall + ''; + + meta = with lib; { + description = "Event-driven I/O framework for the V8 JavaScript engine, patched for replay"; + homepage = "https://github.com/RecordReplay/node"; + license = licenses.mit; + maintainers = with maintainers; [ phryneas ]; + platforms = platforms.linux; + mainProgram = "replay-node"; + }; + }; + + replay-node-cli = stdenv.mkDerivation { + pname = "replay-node-cli"; + version = "0.1.7-" + builtins.head + (builtins.match ".*/linux-node-(.*)" metadata.replay-node.url); + src = fetchFromGitHub { + owner = "RecordReplay"; + repo = "replay-node-cli"; + rev = "5269c8b8e7c5c7a9618a68f883d19c11a68be837"; + sha256 = "04d22q3dvs9vxpb9ps64pdxq9ziwgvnzdgsn6p9p0lzjagh0f5n0"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ stdenv.cc.cc.lib nodejs ]; + dontBuild = true; + installPhase = '' + runHook preInstall + mkdir -p $out/opt/replay-node-cli + cp -r * $out/opt/replay-node-cli + makeWrapper $out/opt/replay-node-cli/bin/replay-node \ + $out/bin/replay-node \ + --prefix "PATH" ":" "${nodejs}/bin" \ + --set "RECORD_REPLAY_NODE_DIRECTORY" "${replay-node}/opt/replay-node" + runHook postInstall + ''; + + meta = with lib; { + description = "The Time Travel Debugger for Web Development - Node Command Line"; + longDescription = '' + The Replay Node Command Line allows you to record node applications and debug them + with familiar browser dev tools. + You can access the browser DevTools at any point of the recording, adding new logger + statements and inspecting the status of variables and the current call stack. + Your recordings can be shared with other users for collaborative debugging. + ''; + homepage = "https://www.replay.io/"; + mainProgram = "replay-node"; + license = lib.licenses.bsd3; + maintainers = with maintainers; [ phryneas ]; + platforms = [ "x86_64-linux" ]; + }; + }; +} diff --git a/pkgs/development/tools/replay-io/meta.json b/pkgs/development/tools/replay-io/meta.json new file mode 100644 index 00000000000..1afc5c10dfa --- /dev/null +++ b/pkgs/development/tools/replay-io/meta.json @@ -0,0 +1,15 @@ +{ + "replay": { + "url": "https://static.replay.io/downloads/linux-gecko-20220516-372662e7c79d-a9c63f38ea9b.tar.bz2", + "sha256": "151k0ykd2mn722zk7n902si6llcsrqnhgjb5bs4wgn9rik9advbi" + }, + "recordreplay": { + "url": "https://static.replay.io/downloads/linux-recordreplay-a9c63f38ea9b.tgz", + "sha256": "032x9wiw4jcdkn0wjgr5j3pc4parrdy5n4r8bgmfxsldg5j48hmk", + "stripRoot": false + }, + "replay-node": { + "url": "https://static.replay.io/downloads/linux-node-20220506-096c12cb47eb-a1d05f422dff", + "sha256": "1fbqlx01vp6llbvvz285brmz86jxc989v0cw6s06jk0657g87inq" + } +} diff --git a/pkgs/development/tools/replay-io/update.sh b/pkgs/development/tools/replay-io/update.sh new file mode 100755 index 00000000000..49f68d6677e --- /dev/null +++ b/pkgs/development/tools/replay-io/update.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq gnused + +set -euo pipefail + +# e.g. linux-gecko-20220331-59d0a686993f-ffd8d6280276 +BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay.json | jq .buildId -r) +REVISION=$(echo $BUILD_ID | sed 's/^.*-//') +NODE_BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay-node.json | jq .buildId -r) + +REPLAY_DL=https://static.replay.io/downloads/${BUILD_ID}.tar.bz2 +LIB_DL=https://static.replay.io/downloads/linux-recordreplay-${REVISION}.tgz +NODE_DL=https://static.replay.io/downloads/${NODE_BUILD_ID} + + +cat >"${BASH_SOURCE%/*}/meta.json" <<EOF +{ + "replay": { + "url": "${REPLAY_DL}", + "sha256": "$(nix-prefetch-url --type sha256 "${REPLAY_DL}")" + }, + "recordreplay": { + "url": "${LIB_DL}", + "sha256": "$(nix-prefetch-url --type sha256 --unpack "${LIB_DL}")", + "stripRoot": false + }, + "replay-node": { + "url": "${NODE_DL}", + "sha256": "$(nix-prefetch-url --type sha256 "${NODE_DL}")" + } +} +EOF |