summaryrefslogtreecommitdiff
path: root/devel/ocaml-cmdliner/patches/patch-Makefile
blob: ccf5a40d11d630ea2768f504a37d13f5b078ae33 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$NetBSD: patch-Makefile,v 1.4 2022/05/02 18:12:13 jaapb Exp $

PREFIX, LIBDIR and DOCDIR set by the package Makefile
Use BSD_INSTALL_*

--- Makefile.orig	2022-02-06 14:17:34.000000000 +0000
+++ Makefile
@@ -12,9 +12,9 @@
 
 -include $(shell ocamlc -where)/Makefile.config
 
-PREFIX=/usr
-LIBDIR=$(DESTDIR)$(PREFIX)/lib/ocaml/cmdliner
-DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/cmdliner
+#PREFIX=/usr
+#LIBDIR=$(DESTDIR)$(PREFIX)/lib/ocaml/cmdliner
+#DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/cmdliner
 NATIVE=$(shell ocamlopt -version > /dev/null 2>&1 && echo true)
 # EXT_LIB     by default value of OCaml's Makefile.config
 # NATDYNLINK  by default value of OCaml's Makefile.config
@@ -40,9 +40,9 @@ all: $(BUILD-TARGETS)
 install: $(INSTALL-TARGETS)
 
 install-doc:
-	$(INSTALL) -d $(DOCDIR)/odoc-pages
-	$(INSTALL) CHANGES.md LICENSE.md README.md $(DOCDIR)
-	$(INSTALL) doc/index.mld doc/cli.mld doc/examples.mld doc/tutorial.mld \
+	$(BSD_INSTALL_DATA_DIR) -d $(DOCDIR)/odoc-pages
+	$(BSD_INSTALL_DATA) CHANGES.md LICENSE.md README.md $(DOCDIR)
+	$(BSD_INSTALL_DATA) doc/index.mld doc/cli.mld doc/examples.mld doc/tutorial.mld \
 	           doc/tool_man.mld $(DOCDIR)/odoc-pages
 
 clean:
@@ -61,18 +61,18 @@ create-libdir:
 	$(INSTALL) -d $(LIBDIR)
 
 install-common: create-libdir
-	$(INSTALL) pkg/META $(BASE).mli $(BASE).cmi $(BASE).cmti $(LIBDIR)
-	$(INSTALL) cmdliner.opam $(LIBDIR)/opam
+	$(BSD_INSTALL_DATA) pkg/META $(BASE).mli $(BASE).cmi $(BASE).cmti $(LIBDIR)
+	$(BSD_INSTALL_DATA) cmdliner.opam $(LIBDIR)/opam
 
 install-byte: create-libdir
-	$(INSTALL) $(BASE).cma $(LIBDIR)
+	$(BSD_INSTALL_DATA) $(BASE).cma $(LIBDIR)
 
 install-native: create-libdir
-	$(INSTALL) $(BASE).cmxa $(BASE)$(EXT_LIB) $(wildcard $(B)/cmdliner*.cmx) \
+	$(BSD_INSTALL_DATA) $(BASE).cmxa $(BASE)$(EXT_LIB) $(wildcard $(B)/cmdliner*.cmx) \
   $(LIBDIR)
 
 install-native-dynlink: create-libdir
-	$(INSTALL) $(BASE).cmxs $(LIBDIR)
+	$(BSD_INSTALL_DATA) $(BASE).cmxs $(LIBDIR)
 
 .PHONY: all install install-doc clean build-byte build-native \
 	build-native-dynlink create-libdir install-common install-byte \