diff --git a/extism.cabal b/extism.cabal
--- a/extism.cabal
+++ b/extism.cabal
@@ -1,6 +1,6 @@
 cabal-version:      3.0
 name:               extism
-version:            1.2.0.0
+version:            1.2.0.1
 license:            BSD-3-Clause
 maintainer:         oss@extism.org
 author:             Extism authors
@@ -9,6 +9,7 @@
 description:        Bindings to Extism, the universal plugin system
 category:           Plugins, WebAssembly
 extra-doc-files: cabal.project README.md CHANGELOG.md
+extra-source-files: scripts/download-or-build.sh
 
 build-type:         Custom
 custom-setup
diff --git a/scripts/download-or-build.sh b/scripts/download-or-build.sh
new file mode 100644
--- /dev/null
+++ b/scripts/download-or-build.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+set -ue
+
+if [ -f "./target/release/libextism_hs.a" ]; then
+  echo "Extism library already installed, remove ./target/release/libextism_hs.a to rebuild it"
+  exit 0
+fi
+
+if ! [ -x "$(command -v extism)" ]; then
+  echo 'Extism CLI is not installed. Building Extism using cargo' >&2
+  cargo build --release
+else
+  VERSION=$(grep 'extism = ".*"' Cargo.toml | awk '{ print $3 }' | sed 's/"//g')
+  extism lib install --prefix ./target/extism --version v$VERSION
+  mkdir -p ./target/release
+  cp ./target/extism/lib/libextism.a ./target/release/libextism_hs.a
+fi
+
