diff --git a/spack-environment/packages.yaml b/spack-environment/packages.yaml
index 094d6a593d1105d1b3bebe9e7cb4b36a6bb5b4e8..4f11f333f50431551d2d55cae4ef1743c40ca7ce 100644
--- a/spack-environment/packages.yaml
+++ b/spack-environment/packages.yaml
@@ -417,11 +417,19 @@ packages:
     require:
     - '@6.7.2'
     - +opengl
+  rivet:
+    require:
+    - '@4.0.2'
+    - hepmc=3
   root:
     require:
     - '@6.32.08'
     - cxxstd=20 +fftw +fortran +gdml +http -ipo +mlp +python +root7 +tmva +tmva-sofie +vc +xrootd +ssl
     - any_of: [+opengl +webgui +x, -opengl -webgui -x]
+  sherpa:
+    require:
+    - '@3.0.1'
+    - cxxstd=20 +analysis ~blackhat ~cms +gzip +hepmc3 +hepmc3root +ipo +lhapdf +lhole +mpi ~openloops +pythia +python ~recola +rivet +root ~ufo
   simsipm:
     require:
     - '@2.1.0'
diff --git a/spack-environment/xl/spack.yaml b/spack-environment/xl/spack.yaml
index 210cee2a561542bc2588b8967b4ffd589e5bc7c9..380d5f038b8171fb8ba9ba0a33ee9cd154620e3c 100644
--- a/spack-environment/xl/spack.yaml
+++ b/spack-environment/xl/spack.yaml
@@ -105,7 +105,9 @@ spack:
   - py-vector
   - py-wurlitzer
   - py-yapf
+  - rivet
   - root +opengl +webgui +x
+  - sherpa
   - simsipm
   - snakemake
   - spdlog
diff --git a/spack.sh b/spack.sh
index fcf9dabead0830d16b7eddb500a8c11ad7ca7812..48c0c213b5d5dccf6d793d26d9ea1407a5f01e6e 100644
--- a/spack.sh
+++ b/spack.sh
@@ -33,6 +33,7 @@ b2a86fcaba3397e912eec32a7059e26ab234cef7
 d5c0ace993d2b495de549e6694081b8e9baf2cfb
 0db3b36874457e065fb49ec469a40e72d6c011a0
 f2f13964fbb0d29a74f605e31b20f724d88cc024
+0ce38ed1092aefeccb31ffed8e23e8d3ef58a4b1
 ---
 ## Optional hash table with comma-separated file list
 read -r -d '' SPACK_CHERRYPICKS_FILES <<- \
@@ -67,3 +68,4 @@ read -r -d '' SPACK_CHERRYPICKS_FILES <<- \
 ## d5c0ace993d2b495de549e6694081b8e9baf2cfb: simsipm: add a new version and a variant for setting the C++ standard
 ## 0db3b36874457e065fb49ec469a40e72d6c011a0: sherpa: fix AutotoolsBuilder install signature
 ## f2f13964fbb0d29a74f605e31b20f724d88cc024: sherpa: support cxxstd=20 when=@3:
+## 0ce38ed1092aefeccb31ffed8e23e8d3ef58a4b1: rivet: patch to fix missing headers