Sun Apr 9 07:28:27 2023 UTC ()
ocaml: fix some pkglint


(wiz)
diff -r1.147 -r1.148 pkgsrc/lang/ocaml/Makefile
diff -r1.9 -r1.10 pkgsrc/lang/ocaml/hacks.mk
diff -r1.1 -r1.2 pkgsrc/lang/ocaml/native.mk
diff -r1.1 -r1.2 pkgsrc/lang/ocaml/ocaml.mk

cvs diff -r1.147 -r1.148 pkgsrc/lang/ocaml/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/ocaml/Makefile 2022/10/23 13:09:30 1.147
+++ pkgsrc/lang/ocaml/Makefile 2023/04/09 07:28:27 1.148
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.147 2022/10/23 13:09:30 he Exp $ 1# $NetBSD: Makefile,v 1.148 2023/04/09 07:28:27 wiz Exp $
2 2
3.include "Makefile.common" 3.include "Makefile.common"
4 4
5TEST_PROGRAM= ocamltest 5TEST_PROGRAM= ocamltest
6MAKE_JOBS_SAFE= no 6MAKE_JOBS_SAFE= no
7UNLIMIT_RESOURCES= stacksize 7UNLIMIT_RESOURCES= stacksize
8 8
9USE_TOOLS+= bash 9USE_TOOLS+= bash
10USE_LANGUAGES+= c 10USE_LANGUAGES+= c
11USE_LIBTOOL= yes 11USE_LIBTOOL= yes
12USE_GNU_CONFIGURE_HOST= no 12USE_GNU_CONFIGURE_HOST= no
13 13
14#USE_GCC_RUNTIME= yes 14#USE_GCC_RUNTIME= yes
@@ -17,31 +17,31 @@ USE_GNU_CONFIGURE_HOST= no @@ -17,31 +17,31 @@ USE_GNU_CONFIGURE_HOST= no
17.include "native.mk" 17.include "native.mk"
18 18
19# Options 19# Options
20 20
21.if ${OCAML_USE_OPT_COMPILER} == "yes" 21.if ${OCAML_USE_OPT_COMPILER} == "yes"
22CONFIGURE_ARGS+= --enable-native-compiler 22CONFIGURE_ARGS+= --enable-native-compiler
23BUILD_TARGET= world.opt 23BUILD_TARGET= world.opt
24.else 24.else
25CONFIGURE_ARGS+= --disable-native-compiler 25CONFIGURE_ARGS+= --disable-native-compiler
26BUILD_TARGET= world 26BUILD_TARGET= world
27.endif 27.endif
28 28
29# configure: error: fma does not work, enable emulation with --enable-imprecise-c99-float-ops 29# configure: error: fma does not work, enable emulation with --enable-imprecise-c99-float-ops
30.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || \ 30.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || \
31 !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) 31 ${MACHINE_PLATFORM:MNetBSD-*-earm*}
32CONFIGURE_ARGS+= --enable-imprecise-c99-float-ops 32CONFIGURE_ARGS+= --enable-imprecise-c99-float-ops
33.endif 33.endif
34.if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) && (${OPSYS_VERSION} < 99999) 34.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} && (${OPSYS_VERSION} < 99999)
35# fma(3) was added for powerpc between 9.99.98 and 9.99.99 35# fma(3) was added for powerpc between 9.99.98 and 9.99.99
36CONFIGURE_ARGS+= --enable-imprecise-c99-float-ops 36CONFIGURE_ARGS+= --enable-imprecise-c99-float-ops
37.endif 37.endif
38 38
39# This is needed because ${WRKSRC}/build/partial-install.sh uses 39# This is needed because ${WRKSRC}/build/partial-install.sh uses
40# $PWD as part of its script. However, with /bin/sh on SunOS 40# $PWD as part of its script. However, with /bin/sh on SunOS
41# (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is 41# (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is
42# set before the cd takes place and is then passed down. So the end 42# set before the cd takes place and is then passed down. So the end
43# result is when ./build/partial-install.sh is called, PWD is set 43# result is when ./build/partial-install.sh is called, PWD is set
44# to /usr/pkgsrc/devel/ocaml instead of ${WRKSRC}. /bin/ksh, which 44# to /usr/pkgsrc/devel/ocaml instead of ${WRKSRC}. /bin/ksh, which
45# is what ${SH} is on SunOS, doesn't exhibit this behaviour. 45# is what ${SH} is on SunOS, doesn't exhibit this behaviour.
46.if ${OPSYS} == "SunOS" 46.if ${OPSYS} == "SunOS"
47INSTALL_MAKE_FLAGS+= SHELL=${SH:Q} 47INSTALL_MAKE_FLAGS+= SHELL=${SH:Q}

cvs diff -r1.9 -r1.10 pkgsrc/lang/ocaml/hacks.mk (expand / switch to unified diff)

--- pkgsrc/lang/ocaml/hacks.mk 2020/12/09 10:33:04 1.9
+++ pkgsrc/lang/ocaml/hacks.mk 2023/04/09 07:28:27 1.10
@@ -1,30 +1,30 @@ @@ -1,30 +1,30 @@
1# $NetBSD: hacks.mk,v 1.9 2020/12/09 10:33:04 jaapb Exp $ 1# $NetBSD: hacks.mk,v 1.10 2023/04/09 07:28:27 wiz Exp $
2 2
3.if !defined(OCAML_HACKS_MK) 3.if !defined(OCAML_HACKS_MK)
4OCAML_HACKS_MK= defined 4OCAML_HACKS_MK= defined
5 5
6.include "../../mk/compiler.mk" 6.include "../../mk/compiler.mk"
7 7
8### [Fri Jan 17 18:06:18 JST 2014 : pho] 8### [Fri Jan 17 18:06:18 JST 2014 : pho]
9### The linker that comes with Darwin 9 & prior does not recognize the option 9### The linker that comes with Darwin 9 & prior does not recognize the option
10### "-no_compact_unwind" since compact unwind information is only 10### "-no_compact_unwind" since compact unwind information is only
11### introduced (and made default) as of Darwin 10. Note that this 11### introduced (and made default) as of Darwin 10. Note that this
12### can't be worked around with transformation 12### can't be worked around with transformation
13### "rm:-Wl,-no_compact_unwind" because the linker option is baked 13### "rm:-Wl,-no_compact_unwind" because the linker option is baked
14### into utils/config.ml and will later be used by the OCaml compiler 14### into utils/config.ml and will later be used by the OCaml compiler
15### itself. 15### itself.
16### 16###
17.if !empty(MACHINE_PLATFORM:MDarwin-[0-9].*-*) 17.if ${MACHINE_PLATFORM:MDarwin-[0-9].*-*}
18PKG_HACKS+= no_compact_unwind 18PKG_HACKS+= no_compact_unwind
19SUBST_CLASSES+= no_compact_unwind 19SUBST_CLASSES+= no_compact_unwind
20SUBST_MESSAGE.no_compact_unwind= Removing -no_compact_unwind from linker options 20SUBST_MESSAGE.no_compact_unwind= Removing -no_compact_unwind from linker options
21SUBST_FILES.no_compact_unwind= configure 21SUBST_FILES.no_compact_unwind= configure
22SUBST_SED.no_compact_unwind= -e 's/-Wl,-no_compact_unwind//g' 22SUBST_SED.no_compact_unwind= -e 's/-Wl,-no_compact_unwind//g'
23SUBST_STAGE.no_compact_unwind= pre-configure 23SUBST_STAGE.no_compact_unwind= pre-configure
24.endif 24.endif
25 25
26### [ Wed Oct 7 9:16:42 GMT 2009 : dmcmahill ] 26### [ Wed Oct 7 9:16:42 GMT 2009 : dmcmahill ]
27### On NetBSD/i386, gcc optimisation, at least for version 4.4.1 (lang/gcc44), 27### On NetBSD/i386, gcc optimisation, at least for version 4.4.1 (lang/gcc44),
28### produces a binary which segfaults. The binary is used during part of the 28### produces a binary which segfaults. The binary is used during part of the
29### build process. 29### build process.
30### 30###

cvs diff -r1.1 -r1.2 pkgsrc/lang/ocaml/native.mk (expand / switch to unified diff)

--- pkgsrc/lang/ocaml/native.mk 2022/05/24 18:25:38 1.1
+++ pkgsrc/lang/ocaml/native.mk 2023/04/09 07:28:27 1.2
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1# $NetBSD: native.mk,v 1.1 2022/05/24 18:25:38 jaapb Exp $ 1# $NetBSD: native.mk,v 1.2 2023/04/09 07:28:27 wiz Exp $
2# 2#
3# This Makefile fragment handles the native code compiler options for OCaml. 3# This Makefile fragment handles the native code compiler options for OCaml.
4# It is used by ocaml.mk and the lang/ocaml package. 4# It is used by ocaml.mk and the lang/ocaml package.
5# 5#
6# Build def variables: 6# Build def variables:
7# OCAML_USE_OPT_COMPILER 7# OCAML_USE_OPT_COMPILER
8# if set to yes, will enable optimised (native code) compilation 8# if set to yes, will enable optimised (native code) compilation
9# default value: depends on architecture 9# default value: depends on architecture
10# 10#
11# PLIST variable: 11# PLIST variable:
12# PLIST.ocaml-opt for files only installed when using the optimised compiler 12# PLIST.ocaml-opt for files only installed when using the optimised compiler
13# Set based on OCAML_USE_OPT_COMPILER 13# Set based on OCAML_USE_OPT_COMPILER
14 14
15.if !defined(OCAML_NATIVE_MK) 15.if !defined(OCAML_NATIVE_MK)
16OCAML_NATIVE_MK= # defined 16OCAML_NATIVE_MK= # defined
17 17
18.include "../../mk/bsd.fast.prefs.mk" 18.include "../../mk/bsd.fast.prefs.mk"
19 19
20BUILD_DEFS+= OCAML_USE_OPT_COMPILER 20BUILD_DEFS+= OCAML_USE_OPT_COMPILER
21 21
22_VARGROUPS+= ocaml 22_VARGROUPS+= ocaml
23_DEF_VARS.ocaml= \ 23_DEF_VARS.ocaml= \
24 OCAML_USE_OPT_COMPILER 24 OCAML_USE_OPT_COMPILER
25 25
26# Default value of OCAML_USE_OPT_COMPILER 26# Default value of OCAML_USE_OPT_COMPILER
27.if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "powerpc") || \ 27.if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "powerpc") || \
28 !empty(MACHINE_ARCH:M*arm*) || (${MACHINE_ARCH} == "aarch64") || \ 28 ${MACHINE_ARCH:M*arm*} || (${MACHINE_ARCH} == "aarch64") || \
29 (${MACHINE_ARCH} == "aarch64eb") || (${MACHINE_ARCH} == "x86_64") 29 (${MACHINE_ARCH} == "aarch64eb") || (${MACHINE_ARCH} == "x86_64")
30OCAML_USE_OPT_COMPILER?= yes 30OCAML_USE_OPT_COMPILER?= yes
31.else 31.else
32OCAML_USE_OPT_COMPILER?= no 32OCAML_USE_OPT_COMPILER?= no
33.endif 33.endif
34 34
35# Things that get installed with the opt compiler 35# Things that get installed with the opt compiler
36PLIST_VARS+= ocaml-opt 36PLIST_VARS+= ocaml-opt
37 37
38.if ${OCAML_USE_OPT_COMPILER} == "yes" 38.if ${OCAML_USE_OPT_COMPILER} == "yes"
39# The opt compiler needs the C compiler suite 39# The opt compiler needs the C compiler suite
40USE_LANGUAGES+= c 40USE_LANGUAGES+= c
41PLIST.ocaml-opt= yes 41PLIST.ocaml-opt= yes

cvs diff -r1.1 -r1.2 pkgsrc/lang/ocaml/ocaml.mk (expand / switch to unified diff)

--- pkgsrc/lang/ocaml/ocaml.mk 2022/05/24 18:25:38 1.1
+++ pkgsrc/lang/ocaml/ocaml.mk 2023/04/09 07:28:27 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: ocaml.mk,v 1.1 2022/05/24 18:25:38 jaapb Exp $ 1# $NetBSD: ocaml.mk,v 1.2 2023/04/09 07:28:27 wiz Exp $
2# 2#
3# This Makefile fragment handles the common variables used by OCaml packages. 3# This Makefile fragment handles the common variables used by OCaml packages.
4# It should be included by every package that uses OCaml. 4# It should be included by every package that uses OCaml.
5# 5#
6# Package-settable variables: 6# Package-settable variables:
7# OCAML_USE_FINDLIB 7# OCAML_USE_FINDLIB
8# package uses findlib infrastructure 8# package uses findlib infrastructure
9# OCAML_FINDLIB_DIRS 9# OCAML_FINDLIB_DIRS
10# directories under OCAML_SITELIBDIR that this package installs into 10# directories under OCAML_SITELIBDIR that this package installs into
11# OCAML_FINDLIB_REGISTER 11# OCAML_FINDLIB_REGISTER
12# register findlib directories into OCaml ld.conf 12# register findlib directories into OCaml ld.conf
13# OCAML_USE_OASIS [implies OCAML_USE_FINDLIB] 13# OCAML_USE_OASIS [implies OCAML_USE_FINDLIB]
14# package uses oasis infrastructure 14# package uses oasis infrastructure
@@ -99,31 +99,31 @@ OASIS_BUILD_ARGS?= # empty @@ -99,31 +99,31 @@ OASIS_BUILD_ARGS?= # empty
99.include "../../devel/ocaml-oasis/buildlink3.mk" 99.include "../../devel/ocaml-oasis/buildlink3.mk"
100OCAML_USE_OASIS= yes 100OCAML_USE_OASIS= yes
101.endif 101.endif
102 102
103# 103#
104# Configure stuff for OASIS 104# Configure stuff for OASIS
105# 105#
106.if ${OCAML_USE_OASIS} == "yes" 106.if ${OCAML_USE_OASIS} == "yes"
107OCAML_USE_FINDLIB= yes 107OCAML_USE_FINDLIB= yes
108HAS_CONFIGURE= yes 108HAS_CONFIGURE= yes
109CONFIGURE_ARGS+= --destdir "${DESTDIR}" 109CONFIGURE_ARGS+= --destdir "${DESTDIR}"
110CONFIGURE_ARGS+= --prefix "${PREFIX}" 110CONFIGURE_ARGS+= --prefix "${PREFIX}"
111# Force use of native code compiler according to setting 111# Force use of native code compiler according to setting
112.if ${OCAML_USE_OPT_COMPILER} == "yes" 112. if ${OCAML_USE_OPT_COMPILER} == "yes"
113CONFIGURE_ARGS+= --override is_native true 113CONFIGURE_ARGS+= --override is_native true
114.else 114. else
115CONFIGURE_ARGS+= --override is_native false 115CONFIGURE_ARGS+= --override is_native false
116.endif 116. endif
117.endif 117.endif
118 118
119# Configure stuff for DUNE 119# Configure stuff for DUNE
120.if ${OCAML_USE_DUNE} == "yes" 120.if ${OCAML_USE_DUNE} == "yes"
121.include "../../devel/ocaml-dune/buildlink3.mk" 121.include "../../devel/ocaml-dune/buildlink3.mk"
122OCAML_USE_OPAM?= yes 122OCAML_USE_OPAM?= yes
123OPAM_INSTALL_DIR?= _build/default 123OPAM_INSTALL_DIR?= _build/default
124.else 124.else
125OCAML_USE_OPAM?= no 125OCAML_USE_OPAM?= no
126.endif 126.endif
127 127
128# Configure stuff for OPAM 128# Configure stuff for OPAM
129.if ${OCAML_USE_OPAM} == "yes" 129.if ${OCAML_USE_OPAM} == "yes"
@@ -159,34 +159,34 @@ OCAML_FINDLIB_DIRS?= ${PKGBASE:S/^ocaml- @@ -159,34 +159,34 @@ OCAML_FINDLIB_DIRS?= ${PKGBASE:S/^ocaml-
159OCAML_FINDLIB_REGISTER?= yes 159OCAML_FINDLIB_REGISTER?= yes
160.endif 160.endif
161 161
162# 162#
163# Compiler stuff 163# Compiler stuff
164# 164#
165 165
166# 166#
167# OASIS targets 167# OASIS targets
168# 168#
169.if ${OCAML_USE_OASIS} == "yes" 169.if ${OCAML_USE_OASIS} == "yes"
170# OASIS uses ocamlbuild 170# OASIS uses ocamlbuild
171.include "../../devel/ocamlbuild/buildlink3.mk" 171.include "../../devel/ocamlbuild/buildlink3.mk"
172.if ${OCAML_USE_OASIS_DYNRUN} == "yes" 172. if ${OCAML_USE_OASIS_DYNRUN} == "yes"
173pre-configure: 173pre-configure:
174 ${RUN} cd ${WRKSRC} && ocamlfind ocamlc -linkpkg -package oasis.dynrun -o setup setup.ml && ${RM} setup.cmo setup.cmi 174 ${RUN} cd ${WRKSRC} && ocamlfind ocamlc -linkpkg -package oasis.dynrun -o setup setup.ml && ${RM} setup.cmo setup.cmi
175 175
176OASIS_EXEC= ./setup 176OASIS_EXEC= ./setup
177.else 177. else
178OASIS_EXEC= ocaml setup.ml 178OASIS_EXEC= ocaml setup.ml
179.endif 179. endif
180 180
181# Redefine configure target 181# Redefine configure target
182do-configure: 182do-configure:
183 ${RUN} cd ${WRKSRC} && \ 183 ${RUN} cd ${WRKSRC} && \
184 ${SETENV} ${CONFIGURE_ENV} ${OASIS_EXEC} -configure ${CONFIGURE_ARGS} 184 ${SETENV} ${CONFIGURE_ENV} ${OASIS_EXEC} -configure ${CONFIGURE_ARGS}
185 185
186# Redefine build target 186# Redefine build target
187do-build: 187do-build:
188 ${RUN} ${_ULIMIT_CMD} cd ${WRKSRC} && \ 188 ${RUN} ${_ULIMIT_CMD} cd ${WRKSRC} && \
189 ${SETENV} ${MAKE_ENV} ${OASIS_EXEC} -build ${OASIS_BUILD_ARGS} 189 ${SETENV} ${MAKE_ENV} ${OASIS_EXEC} -build ${OASIS_BUILD_ARGS}
190 190
191# Redefine install target 191# Redefine install target
192do-install: 192do-install:
@@ -223,31 +223,31 @@ do-install: @@ -223,31 +223,31 @@ do-install:
223 -stublibsdir ${PREFIX}/${OCAML_SITELIBDIR}/stublibs \ 223 -stublibsdir ${PREFIX}/${OCAML_SITELIBDIR}/stublibs \
224 -bindir ${PREFIX}/bin \ 224 -bindir ${PREFIX}/bin \
225 ${OPAM_INSTALL_DIR}/$$i.install; \ 225 ${OPAM_INSTALL_DIR}/$$i.install; \
226 done 226 done
227 227
228.endif # ${OCAML_USE_OPAM} == "yes" 228.endif # ${OCAML_USE_OPAM} == "yes"
229 229
230# 230#
231# dune targets 231# dune targets
232# 232#
233.if ${OCAML_USE_DUNE} == "yes" 233.if ${OCAML_USE_DUNE} == "yes"
234 234
235do-build: 235do-build:
236.if !empty(DUNE_BUILD_PACKAGES) 236. if !empty(DUNE_BUILD_PACKAGES)
237 ${RUN} ${_ULIMIT_CMD} \ 237 ${RUN} ${_ULIMIT_CMD} \
238 cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ 238 cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
239 dune build -j ${MAKE_JOBS:U1} \ 239 dune build -j ${MAKE_JOBS:U1} \
240 ${DUNE_BUILD_FLAGS} -p ${DUNE_BUILD_PACKAGES:ts,} \ 240 ${DUNE_BUILD_FLAGS} -p ${DUNE_BUILD_PACKAGES:ts,} \
241 ${DUNE_BUILD_TARGETS} 241 ${DUNE_BUILD_TARGETS}
242.else 242. else
243 ${RUN} ${_ULIMIT_CMD} \ 243 ${RUN} ${_ULIMIT_CMD} \
244 cd ${WRKSRC} && dune build --profile release -j ${MAKE_JOBS:U1} \ 244 cd ${WRKSRC} && dune build --profile release -j ${MAKE_JOBS:U1} \
245 ${DUNE_BUILD_FLAGS} ${DUNE_BUILD_TARGETS} 245 ${DUNE_BUILD_FLAGS} ${DUNE_BUILD_TARGETS}
246.endif 246. endif
247 247
248.endif # ${OCAML_USE_DUNE} == "yes" 248.endif # ${OCAML_USE_DUNE} == "yes"
249 249
250# Add dependency on ocaml. 250# Add dependency on ocaml.
251.include "../../lang/ocaml/buildlink3.mk" 251.include "../../lang/ocaml/buildlink3.mk"
252 252
253.endif # OCAML_MK 253.endif # OCAML_MK