Package: hol-light / 20230128-1

default-hollight-dir Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Hendrik Tews <hendrik@askra.de>
Date: Wed, 12 Feb 2020 05:41:25 +0100
Subject: configure default HOL Light source directory

---
 hol.ml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/hol.ml b/hol.ml
index 5af34f7..e319bd2 100644
--- a/hol.ml
+++ b/hol.ml
@@ -11,10 +11,18 @@
 
 let hol_version = "2.20++";;
 
+let debian_hol_light_dir = "/usr/share/hol-light";;
+
 #directory "+compiler-libs";;
 
 let hol_dir = ref
-  (try Sys.getenv "HOLLIGHT_DIR" with Not_found -> Sys.getcwd());;
+  (try Sys.getenv "HOLLIGHT_DIR"
+   with Not_found ->
+     try
+       if Sys.is_directory debian_hol_light_dir
+       then debian_hol_light_dir
+       else raise (Sys_error "")
+     with Sys_error _ -> Sys.getcwd());;
 
 (* ------------------------------------------------------------------------- *)
 (* Should eventually change to "ref(Filename.temp_dir_name)".                *)