tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lang/ocaml fails on old macOS



Hi forks,

lang/ocaml fails on old macOS.


# sw_vers
ProductName:	Mac OS X
ProductVersion:	10.10.5
BuildVersion:	14F2511
# cd /usr/pkgsrc/lang/ocaml
# bmake install
:
: lots of output
:
=> Automatic manual page handling
=> Generating post-install file lists
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocaml-instr-graph'
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocaml-instr-report'
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocamlruni'
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/libasmruni.a'
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/libcamlruni.a'
pkg_create: can't stat `/usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/target_camlheaderi'
=> Checking file-check results for ocaml-4.07.0
ERROR: ************************************************************
ERROR: The following files are in the PLIST but not in /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg:
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocaml-instr-graph
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocaml-instr-report
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/bin/ocamlruni
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/libasmruni.a
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/libcamlruni.a
ERROR:         /usr/pkgsrc/lang/ocaml/work/.destdir/usr/pkg/lib/ocaml/target_camlheaderi
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/lang/ocaml
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/ocaml



This is because clock_gettime(2) is not implemented for macOS before Sierra 10.12.  clock_gettime is required for instrumented_runtime.

A patch for this issue would go something below.


Regards,
  Kogule, Ryo



diff -rud ocaml/Makefile ocaml.new/Makefile
--- ocaml/Makefile	2018-10-15 10:07:36.000000000 +0900
+++ ocaml.new/Makefile	2018-10-15 11:26:34.000000000 +0900
@@ -12,7 +12,8 @@
 
 USE_GCC_RUNTIME=	yes
 
-PLIST_VARS+=	ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime
+PLIST_VARS+=	ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime \
+				instrumented_runtime
 
 .include "options.mk"
 ###
@@ -61,6 +62,12 @@
 PLIST.ocaml-spacetime= yes
 .endif
 
+# clock_gettime(2) is not implemented for macOS before Sierra 10.12, which is
+# required for instrumented_runtime feature.
+.if ${OPSYS} != "Darwin" || ${OS_VERSION:R:R} >= 16
+PLIST.instrumented_runtime=yes
+.endif
+
 # This is needed because ${WRKSRC}/build/partial-install.sh uses
 # $PWD as part of its script.  However, with /bin/sh on SunOS
 # (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is
@@ -80,8 +87,10 @@
 
 PRINT_PLIST_AWK+=	{ gsub(/lib\/ocaml\/${PKGMANDIR:S|/|\\/|}/, "lib/ocaml/$${PKGMANDIR}"); }
 
+.if defined(PLIST.instrumented_runtime)
 REPLACE_BASH+=		tools/ocaml-instr-graph
 REPLACE_AWK+=		tools/ocaml-instr-report
+.endif
 
 do-test:
 	cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all
diff -rud ocaml/PLIST ocaml.new/PLIST
--- ocaml/PLIST	2018-10-15 10:07:36.000000000 +0900
+++ ocaml.new/PLIST	2018-10-15 10:10:52.000000000 +0900
@@ -1,7 +1,7 @@
 @comment $NetBSD: PLIST,v 1.48 2018/09/25 11:39:12 jperkin Exp $
 bin/ocaml
-bin/ocaml-instr-graph
-bin/ocaml-instr-report
+${PLIST.instrumented_runtime}bin/ocaml-instr-graph
+${PLIST.instrumented_runtime}bin/ocaml-instr-report
 bin/ocamlc
 bin/ocamlc.byte
 ${PLIST.ocaml-opt}bin/ocamlc.opt
@@ -38,7 +38,7 @@
 ${PLIST.ocaml-opt}bin/ocamlprof.opt
 bin/ocamlrun
 bin/ocamlrund
-bin/ocamlruni
+${PLIST.instrumented_runtime}bin/ocamlruni
 bin/ocamlyacc
 lib/ocaml/Makefile.config
 lib/ocaml/VERSION
@@ -1300,14 +1300,14 @@
 ${PLIST.ocaml-opt}lib/ocaml/libasmrun_pic.a
 ${PLIST.ocaml-opt}lib/ocaml/libasmrun_shared.so
 ${PLIST.ocaml-opt}lib/ocaml/libasmrund.a
-${PLIST.ocaml-opt}lib/ocaml/libasmruni.a
+${PLIST.instrumented_runtime}${PLIST.ocaml-opt}lib/ocaml/libasmruni.a
 ${PLIST.ocaml-prof}${PLIST.ocaml-opt}lib/ocaml/libasmrunp.a
 ${PLIST.ocaml-opt}lib/ocaml/libbigarray.a
 ${PLIST.ocaml-opt}lib/ocaml/libcamlrun.a
 ${PLIST.ocaml-opt}lib/ocaml/libcamlrun_pic.a
 ${PLIST.ocaml-opt}lib/ocaml/libcamlrun_shared.so
 ${PLIST.ocaml-opt}lib/ocaml/libcamlrund.a
-${PLIST.ocaml-opt}lib/ocaml/libcamlruni.a
+${PLIST.instrumented_runtime}${PLIST.ocaml-opt}lib/ocaml/libcamlruni.a
 ${PLIST.ocaml-opt}lib/ocaml/libcamlstr.a
 ${PLIST.ocaml-spacetime}${PLIST.ocaml-opt}lib/ocaml/libraw_spacetime_lib.a
 ${PLIST.ocaml-opt}lib/ocaml/libthreads.a
@@ -2047,7 +2047,7 @@
 lib/ocaml/sys.ml
 lib/ocaml/sys.mli
 lib/ocaml/target_camlheaderd
-lib/ocaml/target_camlheaderi
+${PLIST.instrumented_runtime}lib/ocaml/target_camlheaderi
 lib/ocaml/thread.mli
 lib/ocaml/threadUnix.mli
 lib/ocaml/threads/condition.cmi



Home | Main Index | Thread Index | Old Index