Unverified Commit 330845ec authored by Austin Seipp's avatar Austin Seipp Committed by GitHub
Browse files

saw-tools: 1.4 -> 1.5, add darwin support (#504316)

parents c05e7209 fd42e736
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -11,16 +11,17 @@
  testers,
}:

let
  sources = import ./sources.nix;
in

stdenv.mkDerivation (finalAttrs: {
  pname = "saw-tools";
  version = "1.4";
  version = "1.5";

  src = fetchurl {
    url = "https://github.com/GaloisInc/saw-script/releases/download/v${finalAttrs.version}/saw-${finalAttrs.version}-ubuntu-22.04-X64-with-solvers.tar.gz";
    hash = "sha256-AjMGOi0Nzl0cjVltjgbqhzBiPpIZbDtS3+SqergeulE=";
  };
  src = fetchurl sources.${stdenv.hostPlatform.system};

  buildInputs = [
  buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
    gmp
    ncurses
    readline
@@ -28,8 +29,11 @@ stdenv.mkDerivation (finalAttrs: {
    zlib
  ];

  nativeBuildInputs = [
  nativeBuildInputs =
    lib.optionals stdenv.hostPlatform.isLinux [
      autoPatchelfHook
    ]
    ++ [
      makeWrapper
    ];

@@ -49,10 +53,14 @@ stdenv.mkDerivation (finalAttrs: {

  meta = {
    description = "Tools for software verification and analysis";
    homepage = "https://saw.galois.com";
    homepage = "https://tools.galois.com/saw";
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
    license = lib.licenses.bsd3;
    platforms = [ "x86_64-linux" ];
    maintainers = [ lib.maintainers.thoughtpolice ];
    platforms = lib.attrNames sources;
    maintainers = with lib.maintainers; [
      thoughtpolice
      thelissimus
    ];
    mainProgram = "saw";
  };
})
+16 −0
Original line number Diff line number Diff line
# Generated by ./update.sh - do not update manually!
# Last updated: 2026-03-28
{
  aarch64-darwin = {
    url = "https://github.com/GaloisInc/saw-script/releases/download/v1.5/saw-1.5-macos-15-ARM64-with-solvers.tar.gz";
    hash = "sha256-1mURJfcnIRhuLrG1Gf4SRXmTzLbztBBRQGcXFFiAWWU=";
  };
  x86_64-darwin = {
    url = "https://github.com/GaloisInc/saw-script/releases/download/v1.5/saw-1.5-macos-15-intel-X64-with-solvers.tar.gz";
    hash = "sha256-f3NofLPR6tarcZg/EjtCv1mSxz5O4nTKeOEoTPeGgf8=";
  };
  x86_64-linux = {
    url = "https://github.com/GaloisInc/saw-script/releases/download/v1.5/saw-1.5-ubuntu-22.04-X64-with-solvers.tar.gz";
    hash = "sha256-k9Qo93d0IXBRe7P+wU20LjFjM+LdHf6Z2S0Nybmh/4E=";
  };
}
+41 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure -p nix

set -euo pipefail

cd "$(readlink -e "$(dirname "${BASH_SOURCE[0]}")")"

version="1.5"

aarch64_darwin_url="https://github.com/GaloisInc/saw-script/releases/download/v${version}/saw-${version}-macos-15-ARM64-with-solvers.tar.gz"
x86_64_darwin_url="https://github.com/GaloisInc/saw-script/releases/download/v${version}/saw-${version}-macos-15-intel-X64-with-solvers.tar.gz"
x86_64_linux_url="https://github.com/GaloisInc/saw-script/releases/download/v${version}/saw-${version}-ubuntu-22.04-X64-with-solvers.tar.gz"

aarch64_darwin_hash=$(nix-prefetch-url "$aarch64_darwin_url")
x86_64_darwin_hash=$(nix-prefetch-url "$x86_64_darwin_url")
x86_64_linux_hash=$(nix-prefetch-url "$x86_64_linux_url")

aarch64_darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$aarch64_darwin_hash")
x86_64_darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$x86_64_darwin_hash")
x86_64_linux_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$x86_64_linux_hash")

sed -i "s/version = \".*\"/version = \"${version}\"/" package.nix

cat >sources.nix <<EOF
# Generated by ./update.sh - do not update manually!
# Last updated: $(date +%F)
{
  aarch64-darwin = {
    url = "$aarch64_darwin_url";
    hash = "$aarch64_darwin_hash";
  };
  x86_64-darwin = {
    url = "$x86_64_darwin_url";
    hash = "$x86_64_darwin_hash";
  };
  x86_64-linux = {
    url = "$x86_64_linux_url";
    hash = "$x86_64_linux_hash";
  };
}
EOF