saw-tools: 1.4 -> 1.5, add darwin support (#504316)
This commit is contained in:
@@ -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,10 +29,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
makeWrapper
|
||||
];
|
||||
nativeBuildInputs =
|
||||
lib.optionals stdenv.hostPlatform.isLinux [
|
||||
autoPatchelfHook
|
||||
]
|
||||
++ [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/share
|
||||
@@ -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";
|
||||
};
|
||||
})
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# 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=";
|
||||
};
|
||||
}
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user