aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-11-20 01:14:12 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-11-20 01:14:12 +0100
commit4f70db97a040b35f125484ce8885766ca5807dd4 (patch)
tree30274f4a57e4a149127125fb6df626dd1d9f9cf0 /gnu/packages/patches
parent2d546858b139e5fcf2cbdf9958a17fd98803ac4c (diff)
parent9acfe275adf1bc27483ba58c6d86a84ba20aa08f (diff)
downloadguix-4f70db97a040b35f125484ce8885766ca5807dd4.tar
guix-4f70db97a040b35f125484ce8885766ca5807dd4.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/clamav-config-llvm-libs.patch14
-rw-r--r--gnu/packages/patches/clamav-system-tomsfastmath.patch102
-rw-r--r--gnu/packages/patches/emacs-realgud-fix-configure-ac.patch27
-rw-r--r--gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch246
-rw-r--r--gnu/packages/patches/tomsfastmath-constness.patch76
5 files changed, 421 insertions, 44 deletions
diff --git a/gnu/packages/patches/clamav-config-llvm-libs.patch b/gnu/packages/patches/clamav-config-llvm-libs.patch
new file mode 100644
index 0000000000..054264ee2e
--- /dev/null
+++ b/gnu/packages/patches/clamav-config-llvm-libs.patch
@@ -0,0 +1,14 @@
+Our llvm does not contain a single top-level library, so consult llvm-config
+for the libraries that need to be linked against.
+
+--- clamav-0.100.2/libclamav/c++/configure.ac 2018-09-19 14:29:07.000000000 -0500
++++ clamav-0.100.2/libclamav/c++/configure.ac 2018-10-06 21:45:09.377249158 -0500
+@@ -105,7 +105,7 @@
+
+ if test "x$llvm_linking" = "xdynamic"; then
+ AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
+- AC_SUBST(LLVMCONFIG_LIBS, [-lLLVM-$llvmver])
++ AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs $llvmcomp`])
+ AC_SUBST(LLVMCONFIG_LIBFILES, [])
+ else
+ if test $llvmver_test -ge 350; then
diff --git a/gnu/packages/patches/clamav-system-tomsfastmath.patch b/gnu/packages/patches/clamav-system-tomsfastmath.patch
new file mode 100644
index 0000000000..07ab79f3f7
--- /dev/null
+++ b/gnu/packages/patches/clamav-system-tomsfastmath.patch
@@ -0,0 +1,102 @@
+From 756ff89526b5ffaa7a4f49b1bbecf2ecbd6f85f9 Mon Sep 17 00:00:00 2001
+From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Date: Wed, 11 Mar 2015 20:03:15 +0100
+Subject: add support for system tomsfastmath
+
+Patch-Name: add-support-for-system-tomsfastmath.patch
+---
+ configure.ac | 2 ++
+ libclamav/Makefile.am | 10 ++++++++--
+ libclamav/bignum.h | 6 +++++-
+ libclamav/xdp.c | 2 +-
+ m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++
+ 5 files changed, 28 insertions(+), 4 deletions(-)
+ create mode 100644 m4/reorganization/libs/tomsfastmath.m4
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -82,6 +82,7 @@ m4_include([m4/reorganization/libs/xml.m
+ m4_include([m4/reorganization/libs/openssl.m4])
+ m4_include([m4/reorganization/libs/json.m4])
+ m4_include([m4/reorganization/libs/pcre.m4])
++m4_include([m4/reorganization/libs/tomsfastmath.m4])
+
+ AM_MAINTAINER_MODE
+ m4_include([m4/reorganization/libs/libz.m4])
+@@ -285,6 +286,7 @@ else
+ fi
+ CL_MSG_STATUS([yara ],[$enable_yara],[$enable_yara])
+ CL_MSG_STATUS([fts ],[yes],[$lfs_fts_msg])
++CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
+
+
+ # Yep, downgrading the compiler avoids the bug too:
+--- a/libclamav/Makefile.am
++++ b/libclamav/Makefile.am
+@@ -496,8 +496,10 @@ libclamav_la_SOURCES += yara_arena.c \
+ yara_clam.h
+ endif
+
+-libclamav_la_SOURCES += bignum.h\
+- bignum_fast.h\
++libclamav_la_SOURCES += bignum.h
++
++if !SYSTEM_TOMSFASTMATH
++libclamav_la_SOURCES += bignum_fast.h\
+ tomsfastmath/addsub/fp_add.c\
+ tomsfastmath/addsub/fp_add_d.c\
+ tomsfastmath/addsub/fp_addmod.c\
+@@ -579,6 +581,10 @@ libclamav_la_SOURCES += bignum.h\
+ tomsfastmath/sqr/fp_sqr_comba_generic.c\
+ tomsfastmath/sqr/fp_sqr_comba_small_set.c\
+ tomsfastmath/sqr/fp_sqrmod.c
++else
++libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
++libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
++endif
+
+ .PHONY: version.h.tmp
+ version.c: version.h
+--- a/libclamav/bignum.h
++++ b/libclamav/bignum.h
+@@ -1,9 +1,13 @@
+ #ifndef BIGNUM_H_
+ #define BIGNUM_H_
+
++#if HAVE_SYSTEM_TOMSFASTMATH
++#include <tfm.h>
++#else
+ #define TFM_CHECK
+-
+ #include "bignum_fast.h"
++#endif
++
+ typedef fp_int mp_int;
+ #define mp_cmp fp_cmp
+ #define mp_toradix_n(a,b,c,d) fp_toradix_n(a,b,c,d)
+--- a/libclamav/xdp.c
++++ b/libclamav/xdp.c
+@@ -57,7 +57,7 @@
+ #include "scanners.h"
+ #include "conv.h"
+ #include "xdp.h"
+-#include "bignum_fast.h"
++#include "bignum.h"
+ #include "filetypes.h"
+
+ static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
+--- /dev/null
++++ b/m4/reorganization/libs/tomsfastmath.m4
+@@ -0,0 +1,12 @@
++dnl Check for system tomsfastmath
++PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
++
++AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = "xyes"])
++
++if test "x$have_system_tomsfastmath" = "xyes"; then
++ AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
++ tomsfastmath_msg="External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS"
++else
++ AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system-wide tomsfastmath library])
++ tomsfastmath_msg="Internal"
++fi
diff --git a/gnu/packages/patches/emacs-realgud-fix-configure-ac.patch b/gnu/packages/patches/emacs-realgud-fix-configure-ac.patch
new file mode 100644
index 0000000000..8165857c87
--- /dev/null
+++ b/gnu/packages/patches/emacs-realgud-fix-configure-ac.patch
@@ -0,0 +1,27 @@
+From a293690f29407ac54a218d6d20c2142e1a0319d1 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 31 Oct 2018 00:08:34 -0400
+Subject: [PATCH] configure.ac: Fix NO_CHECK_EMACS_PACKAGES elisp.
+
+Remove the extraneous trailing parenthesis.
+---
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index de0d932..69bcea7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,8 +25,7 @@ AC_MSG_NOTICE("Checking prerequiste packages")
+ $EMACS -batch -q --no-site-file -eval \
+ '(dolist (package
+ (quote (cl-lib loc-changes load-relative test-simple)))
+- (require package))
+- )'
++ (require package))'
+ fi
+ if test $? -ne 0 ; then
+ AC_MSG_ERROR([Can't continue until above error is corrected.])
+--
+2.19.0
+
diff --git a/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch b/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch
index 2056b42356..fd9a4c9401 100644
--- a/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch
+++ b/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch
@@ -1,16 +1,28 @@
-From 26cac62fe0154cf65c06faaee10805531e9dade8 Mon Sep 17 00:00:00 2001
+From bc3b353cb2f26cf10aa5c5caebddf6d3d5b1e318 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
-Date: Wed, 14 Dec 2016 14:14:59 +0100
+Date: Fri, 21 Sep 2018 22:31:29 +0200
Subject: [PATCH] fix camlp4 in another directory
---
- Makefile | 11 ++++++-----
- configure | 13 ++++++++++++-
- myocamlbuild.ml | 2 +-
- 3 files changed, 19 insertions(+), 7 deletions(-)
+ Makefile | 11 ++++++-----
+ configure | 13 ++++++++++++-
+ tests/Makefile | 2 +-
+ tests/camlp4-comments/Makefile | 2 +-
+ tests/camlp4-exclude-file/Makefile | 2 +-
+ tests/camlp4-exclude/Makefile | 2 +-
+ tests/camlp4-instrument-fast/Makefile | 2 +-
+ tests/camlp4-instrument/Makefile | 2 +-
+ tests/combine-expr/Makefile | 2 +-
+ tests/ppx-comments/Makefile | 2 +-
+ tests/ppx-exclude-file/Makefile | 2 +-
+ tests/ppx-exclude/Makefile | 2 +-
+ tests/ppx-instrument-fast/Makefile | 2 +-
+ tests/ppx-instrument/Makefile | 2 +-
+ tests/report/Makefile | 2 +-
+ 15 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile
-index 4a8ce17..d94a6d5 100644
+index b0980ee..6697922 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ PATH_BUILD=$(PATH_BASE)/_build
@@ -19,12 +31,12 @@ index 4a8ce17..d94a6d5 100644
PATH_TESTS=$(PATH_BASE)/tests
-PATH_INSTALL=$(PATH_OCAML_PREFIX)/lib/ocaml/bisect
+PATH_INSTALL=$(PREFIX)/lib/ocaml/bisect
-
-
+
+
# DEFINITIONS
@@ -33,7 +33,8 @@ PATH_INSTALL=$(PATH_OCAML_PREFIX)/lib/ocaml/bisect
PROJECT_NAME=bisect
- OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild
+ OCAMLBUILD=ocamlbuild
OCAMLBUILD_ENV=WARNINGS=$(WARNINGS) PATH_OCAML_PREFIX=$(PATH_OCAML_PREFIX)
-OCAMLBUILD_FLAGS=-classic-display -no-links
+CAMLP4_INCLUDE=$(shell test -z $(CAMLP4_LIBDIR) || echo "-cflags -I,$(CAMLP4_LIBDIR)")
@@ -33,22 +45,22 @@ index 4a8ce17..d94a6d5 100644
MODULES_MLPACK=$(PROJECT_NAME).mlpack
MODULES_MLPACK_PP=$(PROJECT_NAME)_pp.mlpack
@@ -80,11 +81,11 @@ veryclean: clean
- rm -f $(PATH_OCAMLDOC)/*.html $(PATH_OCAMLDOC)/*.css
-
+ rm -f $(PATH_OCAMLDOC)/*.html $(PATH_OCAMLDOC)/*.css
+
install: FORCE
- cp $(PATH_BUILD)/src/report/report.byte $(PATH_OCAML_PREFIX)/bin/bisect-report; \
+ cp $(PATH_BUILD)/src/report/report.byte $(PREFIX)/bin/bisect-report; \
- if [ "$(PPX)" = "TRUE" ]; then \
+ if [ "$(PPX)" = "TRUE" ]; then \
- cp $(PATH_BUILD)/src/syntax/bisect_ppx.byte $(PATH_OCAML_PREFIX)/bin; \
+ cp $(PATH_BUILD)/src/syntax/bisect_ppx.byte $(PREFIX)/bin; \
- fi; \
-- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \
-+ (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PREFIX)/bin/bisect-report.opt || true); \
- if [ -x "$(PATH_OCAMLFIND)" ]; then \
- $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \
- $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \
+ fi; \
+- (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \
++ (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PREFIX)/bin/bisect-report.opt || true); \
+ if [ -x "$(PATH_OCAMLFIND)" ]; then \
+ $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \
+ $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \
diff --git a/configure b/configure
-index bb7ebf4..61a3095 100755
+index bb7ebf4..43ef46b 100755
--- a/configure
+++ b/configure
@@ -21,7 +21,9 @@
@@ -79,47 +91,193 @@ index bb7ebf4..61a3095 100755
ppx='TRUE';;
*)
- echo "usage: $0 [-ocaml-prefix <path>] [-ocamlfind <path>] [-no-native-dynlink] [-devel]";
-+ echo "usage: $0 [-prefix <path>] [-ocaml-prefix <path>] [-ocamlfind <path>] [-no-native-dynlink] [-devel]";
++ echo "usage: $0 [-prefix <path>] [-ocaml-prefix <path>] [-camlp4-prefix <path>] [-ocamlfind <path>] [-no-native-dynlink] [-devel]";
exit 1;;
esac
shift
@@ -57,6 +63,9 @@ if [ "$no_camlp4" = "TRUE" -a "$ppx" = "FALSE" ]; then
exit 1
fi
-
+
+# prefix default value
+test -z $prefix && prefix=$ocaml_prefix
+
# make options
make_quiet=`make -f - <<EOF
default: gnumake
-@@ -67,11 +76,13 @@ EOF`
+@@ -66,7 +75,9 @@ EOF`
+
# file creation
echo "# timestamp: `date`" > Makefile.config
++echo "PREFIX=$prefix" >> Makefile.config
echo "PATH_OCAML_PREFIX=$ocaml_prefix" >> Makefile.config
+echo "PATH_CAMLP4_PREFIX=$camlp4_prefix" >> Makefile.config
echo "PATH_OCAMLFIND=$ocamlfind" >> Makefile.config
echo "NATIVE_DYNLINK=$native_dynlink" >> Makefile.config
echo "WARNINGS=$devel" >> Makefile.config
- echo "NO_CAMLP4=$no_camlp4" >> Makefile.config
- echo "PPX=$ppx" >> Makefile.config
- echo "MAKE_QUIET=$make_quiet" >> Makefile.config
-+echo "PREFIX=$prefix" >> Makefile.config
- echo "" >> Makefile.config
- echo 'Makefile.config successfully created'
-diff --git a/myocamlbuild.ml b/myocamlbuild.ml
-index 8aa25fd..09a7d48 100644
---- a/myocamlbuild.ml
-+++ b/myocamlbuild.ml
-@@ -70,7 +70,7 @@ let () =
- | After_rules ->
- let camlp4of =
- try
-- let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
-+ let path_bin = Filename.concat (Sys.getenv "PATH_CAMLP4_PREFIX") "bin" in
- Filename.concat path_bin "camlp4of"
- with _ -> "camlp4of" in
- flag ["ocaml"; "compile"; "pp_camlp4of"] (S[A"-pp"; A camlp4of]);
---
-2.7.4
+diff --git a/tests/Makefile b/tests/Makefile
+index 1aba27f..9642323 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -41,7 +41,7 @@ one: FORCE
+ else \
+ echo "Running tests for '$(NAME)'..." | tee -a _log; \
+ (cd $(NAME) && \
+- $(MAKE) PATH_OCAML_BIN=$(PATH_OCAML_PREFIX)/bin \
++ $(MAKE) PATH_OCAML_BIN=$(PATH_OCAML_PREFIX)/bin PATH_CAMLP4_PREFIX=$(PATH_CAMLP4_PREFIX) \
+ COMPILER=ocamlc EXECUTABLE=bytecode RUN=./ LIB_EXT=cma EXE_SUFFIX='' \
+ REPORT=../../_build/src/report/report.byte && \
+ cd ..) || echo '*** error' >> _log; \
+diff --git a/tests/camlp4-comments/Makefile b/tests/camlp4-comments/Makefile
+index 33fca72..a918118 100644
+--- a/tests/camlp4-comments/Makefile
++++ b/tests/camlp4-comments/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cmp
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cmp
+diff --git a/tests/camlp4-exclude-file/Makefile b/tests/camlp4-exclude-file/Makefile
+index ab13983..e2520fa 100644
+--- a/tests/camlp4-exclude-file/Makefile
++++ b/tests/camlp4-exclude-file/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cmp
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude-file exclusions -o $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude-file exclusions -o $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cmp
+diff --git a/tests/camlp4-exclude/Makefile b/tests/camlp4-exclude/Makefile
+index 18aada4..d71a7bc 100644
+--- a/tests/camlp4-exclude/Makefile
++++ b/tests/camlp4-exclude/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cmp
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude 'f.*' -o $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude 'f.*' -o $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cmp
+diff --git a/tests/camlp4-instrument-fast/Makefile b/tests/camlp4-instrument-fast/Makefile
+index f60767f..8506e38 100644
+--- a/tests/camlp4-instrument-fast/Makefile
++++ b/tests/camlp4-instrument-fast/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cmp
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo -mode fast $$file -o $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo -mode fast $$file -o $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cmp
+diff --git a/tests/camlp4-instrument/Makefile b/tests/camlp4-instrument/Makefile
+index 33fca72..a918118 100644
+--- a/tests/camlp4-instrument/Makefile
++++ b/tests/camlp4-instrument/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cmp
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cmp
+diff --git a/tests/combine-expr/Makefile b/tests/combine-expr/Makefile
+index 46ae9eb..e8e2af2 100644
+--- a/tests/combine-expr/Makefile
++++ b/tests/combine-expr/Makefile
+@@ -1,4 +1,4 @@
+-COMPILE_FLAGS=-I ../../_build -pp '$(PATH_OCAML_BIN)/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS)
++COMPILE_FLAGS=-I ../../_build -pp '$(PATH_CAMLP4_PREFIX)/bin/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS)
+
+ default: clean compile run report
+
+diff --git a/tests/ppx-comments/Makefile b/tests/ppx-comments/Makefile
+index f8c645a..667526f 100644
+--- a/tests/ppx-comments/Makefile
++++ b/tests/ppx-comments/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cm*
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cm*
+diff --git a/tests/ppx-exclude-file/Makefile b/tests/ppx-exclude-file/Makefile
+index a575a77..0dd1a20 100644
+--- a/tests/ppx-exclude-file/Makefile
++++ b/tests/ppx-exclude-file/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cm*
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -exclude-file exclusions' -dsource $$file 2> $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -exclude-file exclusions' -dsource $$file 2> $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cm*
+diff --git a/tests/ppx-exclude/Makefile b/tests/ppx-exclude/Makefile
+index a517af4..f502a42 100644
+--- a/tests/ppx-exclude/Makefile
++++ b/tests/ppx-exclude/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cm*
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx "../../_build/src/syntax/bisect_ppx.byte -exclude 'f.*'" -dsource $$file 2> $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx "../../_build/src/syntax/bisect_ppx.byte -exclude 'f.*'" -dsource $$file 2> $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cm*
+diff --git a/tests/ppx-instrument-fast/Makefile b/tests/ppx-instrument-fast/Makefile
+index da78bb6..1195988 100644
+--- a/tests/ppx-instrument-fast/Makefile
++++ b/tests/ppx-instrument-fast/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cm*
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -mode fast' -dsource $$file 2> $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -mode fast' -dsource $$file 2> $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cm*
+diff --git a/tests/ppx-instrument/Makefile b/tests/ppx-instrument/Makefile
+index f8c645a..667526f 100644
+--- a/tests/ppx-instrument/Makefile
++++ b/tests/ppx-instrument/Makefile
+@@ -2,7 +2,7 @@ default:
+ @rm -fr *.result *.cm*
+ @for file in *.ml; do \
+ echo " testing '$$file' ..."; \
+- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \
++ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \
+ diff -q $$file.reference $$file.result || exit 1; \
+ done
+ @rm -fr *.result *.cm*
+diff --git a/tests/report/Makefile b/tests/report/Makefile
+index a7ffe44..a968bf9 100644
+--- a/tests/report/Makefile
++++ b/tests/report/Makefile
+@@ -1,4 +1,4 @@
+-COMPILE_FLAGS=-I ../../_build -pp '$(PATH_OCAML_BIN)/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS)
++COMPILE_FLAGS=-I ../../_build -pp '$(PATH_CAMLP4_PREFIX)/bin/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS)
+ XMLLINT=$(shell which xmllint)
+
+ default: clean compile run report
+--
+2.18.0
diff --git a/gnu/packages/patches/tomsfastmath-constness.patch b/gnu/packages/patches/tomsfastmath-constness.patch
new file mode 100644
index 0000000000..7c6ab5bbec
--- /dev/null
+++ b/gnu/packages/patches/tomsfastmath-constness.patch
@@ -0,0 +1,76 @@
+From dac089515901d6bf315cd15a6e744b8d2c02c1cb Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Sat, 31 Oct 2015 22:48:07 +0100
+Subject: [PATCH] tfm: make a few functions static
+
+clamav expects them to be static and it does not seem bad to do so.
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+---
+ src/bin/fp_read_radix.c | 2 +-
+ src/bin/fp_read_signed_bin.c | 2 +-
+ src/bin/fp_read_unsigned_bin.c | 2 +-
+ src/headers/tfm.h | 6 +++---
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/bin/fp_read_radix.c b/src/bin/fp_read_radix.c
+index 0b5e826..431afa0 100644
+--- a/src/bin/fp_read_radix.c
++++ b/src/bin/fp_read_radix.c
+@@ -9,7 +9,7 @@
+ */
+ #include <tfm_private.h>
+
+-int fp_read_radix(fp_int *a, char *str, int radix)
++int fp_read_radix(fp_int *a, const char *str, int radix)
+ {
+ int y, neg;
+ char ch;
+diff --git a/src/bin/fp_read_signed_bin.c b/src/bin/fp_read_signed_bin.c
+index e2b8003..6467d19 100644
+--- a/src/bin/fp_read_signed_bin.c
++++ b/src/bin/fp_read_signed_bin.c
+@@ -9,7 +9,7 @@
+ */
+ #include <tfm_private.h>
+
+-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c)
++void fp_read_signed_bin(fp_int *a, const unsigned char *b, int c)
+ {
+ /* read magnitude */
+ fp_read_unsigned_bin (a, b + 1, c - 1);
+diff --git a/src/bin/fp_read_unsigned_bin.c b/src/bin/fp_read_unsigned_bin.c
+index 3ee64c0..2ee89cb 100644
+--- a/src/bin/fp_read_unsigned_bin.c
++++ b/src/bin/fp_read_unsigned_bin.c
+@@ -9,7 +9,7 @@
+ */
+ #include <tfm_private.h>
+
+-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c)
++void fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c)
+ {
+ /* zero the int */
+ fp_zero (a);
+diff --git a/src/headers/tfm.h b/src/headers/tfm.h
+index af87b56..f406388 100644
+--- a/src/headers/tfm.h
++++ b/src/headers/tfm.h
+@@ -467,14 +467,14 @@ int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback
+ int fp_count_bits(fp_int *a);
+
+ int fp_unsigned_bin_size(fp_int *a);
+-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c);
++void fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c);
+ void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
+
+ int fp_signed_bin_size(fp_int *a);
+-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c);
++void fp_read_signed_bin(fp_int *a, const unsigned char *b, int c);
+ void fp_to_signed_bin(fp_int *a, unsigned char *b);
+
+-int fp_read_radix(fp_int *a, char *str, int radix);
++int fp_read_radix(fp_int *a, const char *str, int radix);
+
+ int fp_radix_size(fp_int *a, int radix, int *size);
+ int fp_toradix(fp_int *a, char *str, int radix);