Skip to content

Commit 285a74e

Browse files
committed
Some tweaks to 605fb33.
1 parent 605fb33 commit 285a74e

File tree

5 files changed

+31
-16
lines changed

5 files changed

+31
-16
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ create-startup-script:
9090
@# This path resolution scheme may depend on BASH semantics.
9191
$(eval ABS_BUILD_DIR=$(shell cd $(BUILD_DIR) ; pwd -P))
9292
@# This is an attempt to put in a safe guard
93-
@# If the above resolution fails to yield an existent path then fall back to the relative path in BUILD_DIR.
93+
@# If the above resolution fails to yield an existing path then fall back to the relative path in BUILD_DIR.
9494
$(eval ABS_BUILD_DIR:=$(shell test -d $(ABS_BUILD_DIR) && echo "$(ABS_BUILD_DIR)" || echo "$(BUILD_DIR)"))
95-
@echo "LINKS_LIB=\"$(ABS_BUILD_DIR)/default/lib\" $(ABS_BUILD_DIR)/default/bin/links.exe \"\$$@\"" >> links
95+
@echo "$(ABS_BUILD_DIR)/default/bin/links.exe \"\$$@\"" >> links
9696
@chmod +x links
9797
ln -fs links linx
9898

@@ -123,6 +123,11 @@ build-release-all: dune dune-project include-db-sources
123123
include-db-sources:
124124
$(eval SOURCES:=$(SOURCES),$(DB_SOURCES))
125125

126+
# Auxiliary rule used by `opam install` to build Links
127+
.PHONY: opam-build-links.opam
128+
opam-build-links.opam: links.opam
129+
$(shell LINKS_BUILT_BY_OPAM=1 dune build -p links)
130+
126131
# Runs the test suite. We reset the variables CAMLRUNPARAM and
127132
# OCAMLRUNPARAM, because some of the tests are sensitive to the
128133
# printing of stack traces.
@@ -176,8 +181,3 @@ opam-release:
176181
dune-release publish -p $(RELEASE_PKGS) distrib
177182
dune-release opam -p $(RELEASE_PKGS) pkg
178183
dune-release opam -p $(RELEASE_PKGS) submit
179-
180-
# Build Links
181-
.PHONY: opam-build-links.opam
182-
opam-build-links.opam: links.opam
183-
$(shell LINKS_BUILT_BY_OPAM=1 dune build -p links)

core/dune

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
findlib menhirLib links.lens calendar)
2121
(preprocess (pps ppx_deriving.std ppx_deriving_yojson)))
2222

23+
24+
;; Generate the Linkspath module.
2325
(rule
2426
(targets linkspath.ml)
25-
(deps (:gen ../gen_linkspath/gen_linkspath.exe))
27+
(deps (:gen ../linkspath/gen_linkspath.exe))
2628
(action (run %{gen} -o %{targets})))
2729

2830
;; Make Query modules available.

links.opam

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ homepage: "https://github.com/links-lang/links"
77
dev-repo: "git+https://github.com/links-lang/links.git"
88
bug-reports: "https://github.com/links-lang/links/issues"
99
license: "GPL-3.0-only"
10-
version: "0.9.7"
1110

1211

1312
build: [
14-
["dune" "exec" "preinstall/preinstall.exe" "--" "-libdir" _:lib]
15-
[make "opam-build-links.opam"]
13+
[ "dune" "exec" "preinstall/preinstall.exe" "--" "-libdir" _:lib ]
14+
[ make "opam-build-links.opam" ]
1615
]
1716

1817
depends: [
File renamed without changes.
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
(** This module builds another ML module, which contains various
2+
computed paths used by the Links runtime. The interface of the
3+
generated module is as follows:
4+
5+
val config : string option (* If `Some fname` then `fname` is the
6+
absolute filename of the default config file. *)
7+
8+
val jslib : string (* Absolute path to the Links JavaScript runtime directory. *)
9+
val examples : string (* Absolute path to the Links examples directory. *)
10+
val stdlib : string (* Absolute path to the Links standard library directory. *)
11+
val prelude : string (* Absolute filename for `prelude.links`. *)
12+
13+
The generated module is meant for inclusion in Links core. *)
14+
115
module C = Configurator.V1
216

317
let check_opam =
4-
Sys.getenv_opt "LINKS_BUILT_BY_OPAM" |> Option.is_some
18+
Option.is_some (Sys.getenv_opt "LINKS_BUILT_BY_OPAM")
519

620
let _ =
7-
let oc = open_out "linkspath.ml" in
21+
let oc = open_out "linkspath.ml" in
822
if check_opam
923
then
10-
(* If Links is built by OPAM*)
24+
(* If Links is built by OPAM *)
1125
let lib_path = input_line (Unix.open_process_in "opam var lib") in
1226
let etc_path = input_line (Unix.open_process_in "opam var etc") in
1327
let share_path = input_line (Unix.open_process_in "opam var share") in
@@ -17,8 +31,8 @@ let _ =
1731
Printf.fprintf oc "let stdlib = \"%s/links/stdlib\"\n" lib_path;
1832
Printf.fprintf oc "let prelude = \"%s/links/prelude.links\"\n" lib_path;
1933
close_out oc
20-
else
21-
(* If Links is complied from source*)
34+
else
35+
(* If Links is complied from source *)
2236
let git_path = input_line (Unix.open_process_in "git rev-parse --show-toplevel") in
2337
Printf.fprintf oc "let config = %s\n" "None";
2438
Printf.fprintf oc "let jslib = \"%s/lib/js\"\n" git_path;

0 commit comments

Comments
 (0)