upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ocaml-num / repos / community-x86_64 / provide-findlib-install-target.patch
blobb25215f27f5e7953279da29c171c78fd5d9c4ede
1 From 12dff1ac0a8cacbda2969b560f021ebb73b16887 Mon Sep 17 00:00:00 2001
2 From: David Allsopp <david.allsopp@metastack.com>
3 Date: Thu, 11 Jan 2018 08:10:10 +0000
4 Subject: [PATCH] Provide findlib-install target (#6)
6 Allows installing the entire library using ocamlfind, in an ocamlfind-managed directory.
7 This differs from the `install` target which performs the old-style installation in the OCaml stdlib directory.
8 ---
9 .gitignore | 1 +
10 Makefile | 10 +++++++++-
11 src/{META => META.in} | 4 +++-
12 src/Makefile | 17 +++++++++++++++--
13 4 files changed, 28 insertions(+), 4 deletions(-)
14 rename src/{META => META.in} (72%)
16 diff --git a/.gitignore b/.gitignore
17 index 6acd3bc..172bf23 100644
18 --- a/.gitignore
19 +++ b/.gitignore
20 @@ -8,3 +8,4 @@
21 *.cmx[as]
22 *.cmti
23 *.annot
24 +src/META
25 diff --git a/Makefile b/Makefile
26 index 6a5d08f..b40e588 100644
27 --- a/Makefile
28 +++ b/Makefile
29 @@ -14,8 +14,16 @@ install:
30 $(MAKE) -C src install
31 $(MAKE) -C toplevel install
33 +findlib-install:
34 + $(MAKE) -C src findlib-install
35 + $(MAKE) -C toplevel install
37 uninstall:
38 $(MAKE) -C src uninstall
39 $(MAKE) -C toplevel uninstall
41 -.PHONY: all test clean install uninstall
42 +findlib-uninstall:
43 + $(MAKE) -C src findlib-uninstall
44 + $(MAKE) -C toplevel uninstall
46 +.PHONY: all test clean install uninstall findlib-install findlib-uninstall
47 diff --git a/src/META b/src/META.in
48 similarity index 72%
49 rename from src/META
50 rename to src/META.in
51 index 66ac170..b5678b7 100644
52 --- a/src/META
53 +++ b/src/META.in
54 @@ -1,6 +1,8 @@
55 # This META is the one provided by findlib when the "num" library was
56 # part of the core OCaml distribution. For backward compatibility,
57 -# it installs into OCaml's standard library directory, not in a subdirectory
58 +# it is installed into OCaml's standard library directory. If the
59 +# directory line below is removed, then it's installed in a
60 +# subdirectory, as normal for a findlib package.
62 requires = "num.core"
63 requires(toploop) = "num.core,num-top"
64 diff --git a/src/Makefile b/src/Makefile
65 index 97dc074..ff271fe 100644
66 --- a/src/Makefile
67 +++ b/src/Makefile
68 @@ -80,21 +80,34 @@ endif
69 ifeq "$(NATDYNLINK)" "true"
70 TOINSTALL+=nums.cmxs
71 endif
72 +ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
73 TOINSTALL_STUBS=dllnums.$(SO)
74 +else
75 +TOINSTALL_STUBS=
76 +endif
78 install:
79 + cp META.in META
80 $(OCAMLFIND) install num META
81 + rm -f META
82 $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR)
83 ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
84 $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs
85 endif
87 -uninstall:
88 +findlib-install:
89 + grep -Fv '^' META.in > META
90 + $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS)
91 + rm -f META
93 +findlib-uninstall:
94 + $(OCAMLFIND) remove num
96 +uninstall: findlib-uninstall
97 cd $(STDLIBDIR) && rm -f $(TOINSTALL)
98 ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
99 cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS)
100 endif
101 - $(OCAMLFIND) remove num
103 clean:
104 rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO)
106 2.16.1