Permalink
Browse files

Changes to work with Camomile 0.8.1

  • Loading branch information...
1 parent a708a7d commit 77f9381094b18fa2e57446e9f3b302df93abfc82 @thelema thelema committed Jul 9, 2010
Showing with 27 additions and 1 deletion.
  1. +5 −1 Makefile
  2. +2 −0 README
  3. +20 −0 src/batCamomile-0.8.1.ml
View
@@ -38,7 +38,7 @@ else ifeq ($(BATTERIES_NATIVE), yes)
INSTALL_FILES += $(NATIVE_INSTALL_FILES)
endif
-.PHONY: all clean doc install uninstall reinstall test
+.PHONY: all clean doc install uninstall reinstall test camomile81
all:
test ! -e src/batteries_config.ml || rm src/batteries_config.ml
@@ -85,3 +85,7 @@ test:
release: test
git archive --format=tar --prefix=batteries-$(VERSION)/ HEAD \
| gzip > batteries-$(VERSION).tar.gz
+
+camomile81:
+ mv src/batCamomile.ml batCamomile-0.7.ml
+ mv src/batCamomile-0.8.1.ml batCamomile.ml
View
2 README
@@ -24,6 +24,8 @@ You will need
**** Configuration and installation ****
+NOTE: to use camomile 0.8.1, run [make camomile81] first
+
To install the full version of OCaml Batteries Included, execute
$ make all
View
@@ -0,0 +1,20 @@
+(* Interface to camomile that defaults to CamomileDefaultConfig but
+ tries to use CAMOMILE_BASE from environment to set root *)
+
+let camomile_base = "CAMOMILE_BASE"
+
+(* default to default config dirs if unset *)
+let try_env suff default =
+ try Filename.concat (Sys.getenv camomile_base) suff
+ with Not_found -> default
+
+module CDC = CamomileLibraryDefault.Config
+
+module CamConfig = struct
+ let datadir = try_env "database" CDC.datadir
+ let localedir = try_env "locales" CDC.localedir
+ let charmapdir = try_env "charmaps" CDC.charmapdir
+ let unimapdir = try_env "mappings" CDC.unimapdir
+end
+
+include CamomileLibrary.Make(CamConfig)

0 comments on commit 77f9381

Please sign in to comment.