Skip to content

Commits on Source 13

# -*-conf-unix-*-
*.cmi
*.cmo
*.cma
*.cmx
*.cmxa
*.cmxs
*.annot
.depend.ocaml
*.com
*.exe
*.native
META
examples/csvtool
csv.godiva
doc
# Generated by OASIS or ocamlbuild:
API.odocl
AUTHORS.txt
README.txt
_build/
myocamlbuild.ml
setup.data
setup.log
setup.ml
src/csv.mllib
API.docdir
# Tarball
*.tar.gz
_build
TODO
.merlin
*.install
data/
packages
S src
S src/lwt
S tests
S examples
B _build/**
B _build/src
B _build/src/lwt
B _build/tests
B _build/examples
PKG lwt
OPAM_PKGS="oasis base-bytes"
export OPAMYES=1
if [ -f "$HOME/.opam/config" ]; then
......@@ -15,8 +12,8 @@ if [ -n "${OPAM_SWITCH}" ]; then
fi
eval `opam config env`
opam install $OPAM_PKGS
export OCAMLRUNPARAM=b
make
make test
opam pin -y add csv .
opam pin -y add csv-lwt .
......@@ -11,10 +11,10 @@ addons:
script: bash -ex .travis-ci.sh
env:
- OPAM_SWITCH=system
- OPAM_SWITCH=3.12.1
- OPAM_SWITCH=4.01.0
- OPAM_SWITCH=4.02.2
- OPAM_SWITCH=4.03.0
- OPAM_SWITCH=4.04.0
- OPAM_SWITCH=4.06.1
- OPAM_SWITCH=4.07.0
cache:
directories:
- $HOME/.opam
2.2 2018-11-04
--------------
- Compile the pre-processing script. This makes possible to install
the package using a compiler with the `-static` flag. (#25)
2.1 2018-07-11
--------------
- Improve the documentation of `Csv.Rows.load` and `of_in_obj`.
- Slightly improve tests.
- Use Dune (the new name for Jbuilder).
2.0 2017-09-02
--------------
- Split the package into `csv` and `csv-lwt`.
- Port to `jbuilder` and `topkg`.
(* OASIS_START *)
(* DO NOT EDIT (digest: aeed0b6f112359d79bc311b45f9c68e2) *)
(* DO NOT EDIT (digest: 2bb15a412fdfea27826f8a0baabfde4a) *)
This is the INSTALL file for the csv distribution.
This package uses OASIS to generate its build system. See section OASIS for
......@@ -9,8 +10,11 @@ Dependencies
============
In order to compile this package, you will need:
* ocaml for all, doc API
* ocaml (>= 4.00.1) for all, doc API
* findlib
* bytes for library csv, library csv_lwt
* lwt for library csv_lwt, executable test_lwt
Installing
==========
......
......@@ -17,8 +17,7 @@ License.
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
# GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
......@@ -29,7 +28,7 @@ License.
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
## Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -131,8 +130,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
# GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
......@@ -451,7 +449,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
## NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
......@@ -474,9 +472,9 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
# END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
# How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
......
PKGNAME = $(shell oasis query name)
PKGVERSION = $(shell oasis query version)
PKG_TARBALL = $(PKGNAME)-$(PKGVERSION).tar.gz
PKGVERSION = $(shell git describe --always --dirty)
DISTFILES = LICENSE.txt INSTALL.txt README.md _oasis \
_tags Makefile setup.ml _oasis_remove_.ml csv.install \
$(filter-out %~, $(wildcard src/*) $(wildcard examples/*) $(wildcard tests/*))
WEB = san@math.umons.ac.be:~/public_html/software/
WEB = shell.forge.ocamlcore.org:/home/groups/csv/htdocs
build:
dune build @install examples/example.exe -j 4
.PHONY: all byte native configure doc test install uninstall reinstall \
upload-doc
tests: build
dune runtest --force
all byte native: configure
ocaml setup.ml -build
install uninstall clean:
dune $@
configure: setup.ml
ocaml $< -configure --enable-tests
setup.ml: _oasis
oasis setup -setup-update dynamic
test doc install uninstall reinstall: all
ocaml setup.ml -$@
doc: build
sed -e 's/%%VERSION%%/$(PKGVERSION)/' src/csv.mli \
> _build/default/src/csv.mli
dune build @doc
echo '.def { background: #f0f0f0; }' >> _build/default/_doc/odoc.css
upload-doc: doc
scp -C -p -r _build/API.docdir $(WEB)
scp -C -p -r _build/default/_doc/csv/ $(WEB)
scp -C -p -r _build/default/_doc/csv-lwt/ $(WEB)
scp -C -p _build/default/_doc/odoc.css $(WEB)
csvtool: all
./csvtool.native pastecol 1-3 2,1,2 \
csvtool: build
dune exec csvtool pastecol 1-3 2,1,2 \
tests/testcsv9.csv tests/testcsv9.csv
opam csv.install: _oasis
oasis2opam --local
# "Force" a tag to be defined for each released tarball
dist tar: setup.ml opam
@ if [ -z "$(PKGNAME)" ]; then echo "PKGNAME not defined"; exit 1; fi
@ if [ -z "$(PKGVERSION)" ]; then \
echo "PKGVERSION not defined"; exit 1; fi
mkdir $(PKGNAME)-$(PKGVERSION)
cp -r --parents $(DISTFILES) $(PKGNAME)-$(PKGVERSION)/
# Generate a setup.ml independent of oasis
cd $(PKGNAME)-$(PKGVERSION) && oasis setup
tar -zcvf $(PKG_TARBALL) $(PKGNAME)-$(PKGVERSION)
$(RM) -rf $(PKGNAME)-$(PKGVERSION)
web: doc
$(MAKE) -C doc $@
.PHONY: clean distclean
clean::
ocaml setup.ml -clean
$(RM) $(PKG_TARBALL) setup.data
distclean:
ocaml setup.ml -distclean
$(RM) $(wildcard *.ba[0-9] *.bak *~ *.odocl)
example:
dune exec examples/example.exe
submit:
dune-release distrib
dune-release publish distrib
dune-release opam pkg -p csv
dune-release opam pkg -p csv-lwt
# Perform the subtitution that dune-release does not
# (until opam2, https://discuss.ocaml.org/t/sync-versions-of-several-packages-coming-from-a-single-repo/808/5)
sed -e 's/\(^ *"csv"\) */\1 {= "$(PKGVERSION)"}/' --in-place \
_build/csv-lwt.$(PKGVERSION)/opam
# until we have https://github.com/ocaml/opam-publish/issues/38
[ -d packages ] ||(echo "ERROR: Make a symbolic link packages → \
opam-repo/packages"; exit 1)
cp -r _build/csv.* packages/csv/
cp -r _build/csv-lwt.* packages/csv-lwt/
cd packages && git add csv csv-lwt
# CONDUIT_TLS=native dune-release opam submit -n csv -n csv-lwt
.PHONY: build tests install uninstall doc upload-doc clean csvtool example submit
......@@ -12,20 +12,24 @@ well as some convenience functions to manipulate such data.
Compile & install
-----------------
The easiest way to install this library is to use
[OPAM](http://opam.ocaml.org/):
The easiest way to install this library is to use [OPAM][]:
opam install csv
If you prefer to compile by hand, run
for the standard version and
ocaml setup.ml -configure
ocaml setup.ml -build
ocaml setup.ml -install
opam install csv-lwt
for the LWT one. If you prefer to compile and install by hand,
make sure you have [dune][] and run
dune build @install
dune install csv
dune install csv-lwt
[OPAM]: https://opam.ocaml.org/
[dune]: https://github.com/ocaml/dune
Note that This package uses [oasis](https://github.com/ocaml/oasis) to
generate its configure, build and install scripts. However, you only
need `oasis` if you want to compile the development version.
Uninstall
---------
......@@ -33,7 +37,19 @@ Uninstall
With OPAM:
opam remove csv
opam remove csv-lwt
Manually (from the source directory):
ocaml setup.ml -uninstall
dune uninstall csv
dune uninstall csv-lwt
Documentation
-------------
The documentation for the `Csv` (resp. `Csv_lwt`) module can be
found [online](https://math.umons.ac.be/anum/software/csv/)
(resp. [here](https://math.umons.ac.be/anum/software/csv-lwt/)) or in
[csv.mli](src/csv.mli) (resp. [csv_lwt.mli](lwt/csv_lwt.mli)).
Also see the [examples](examples/).
# -*-conf-*-
OASISFormat: 0.4
Name: csv
Version: 1.5
Synopsis: A pure OCaml library to read and write CSV files.
Description: This is a pure OCaml library to read and write CSV files,
including all extensions used by Excele.g. quotes, newlines,
8 bit characters in fields, \"0 etc. A special representation of rows
of CSV files with a header is provided. The library comes with a handy
command line tool called csvtool for handling CSV files from shell scripts.
Authors: Richard Jones, Christophe Troestler
Maintainers: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Categories: http://database, http://science
License: LGPL-2.1 with OCaml linking exception
Homepage: https://github.com/Chris00/ocaml-csv
Plugins: META (0.4), StdFiles (0.4)
Library csv
Path: src
BuildTools: ocamlbuild
Modules: Csv
BuildDepends: bytes
Document API
Title: API reference for Csv
Type: OCamlbuild (0.4)
InstallDir: $docdir/api
BuildTools: ocamldoc, ocamlbuild
XOCamlbuildPath: .
XOCamlbuildLibraries: csv
# Examples
Executable csvtool
Path: examples/
MainIs: csvtool.ml
BuildDepends: csv
CompiledObject: best
BuildTools: ocamlbuild
Install: true
Executable example
Build$: flag(tests)
Path: examples/
MainIs: example.ml
BuildDepends: csv
CompiledObject: best
BuildTools: ocamlbuild
Install: false
# Testing
Executable test
Build$: flag(tests)
Path: tests/
MainIs: test.ml
BuildDepends: csv
CompiledObject: best
BuildTools: ocamlbuild
Install: false
Test conformity
WorkingDirectory: tests/
Command: $test
Run: true
Executable test_header
Build$: flag(tests)
Path: tests/
MainIs: test_header.ml
BuildDepends: csv
CompiledObject: best
BuildTools: ocamlbuild
Install: false
Test header
Command: $test_header
Run: true
Executable test_write
Build$: flag(tests)
Path: tests/
MainIs: test_write.ml
BuildDepends: csv
CompiledObject: best
BuildTools: ocamlbuild
Install: false
Test write
WorkingDirectory: tests/
Command: $test_write
Run: true
SourceRepository master
Type: git
Location: https://github.com/Chris00/ocaml-csv.git
Browser: https://github.com/Chris00/ocaml-csv
open Printf
let () =
let dir = Sys.argv.(1) in
(try Sys.chdir dir
with _ -> eprintf "Cannot change directory to %s\n%!" dir);
exit (Sys.command "ocaml setup.ml -uninstall")
# OASIS_START
# OASIS_STOP
true: annot, safe_string
true: warn(A-4@8-29-33-40-41-42-44-45-48)
(executables
(names pp)
(libraries str unix))
(* Generate interfaces for standard IO and Lwt. *)
let ( / ) = Filename.concat
let read_all fname =
(* Avoid Bytes for backward compatibility. *)
let fh = open_in fname in
let len = in_channel_length fh in
let b = Buffer.create len in
Buffer.add_channel b fh len;
Buffer.contents b
let write fname txts =
(try Unix.chmod fname 0o666; Unix.unlink fname with _ -> ());
let fh = open_out fname in
List.iter (fun txt -> output_string fh txt) txts;
close_out fh;
(try Unix.chmod fname 0o466
with Unix.Unix_error(e, _, _) ->
prerr_endline("Warning: chmod " ^ fname ^ ": " ^ Unix.error_message e))
let substitute fname_in tr =
let txt = read_all fname_in in
let txt = List.fold_left (fun t (re, s) ->
let repl = Str.global_replace (Str.regexp re) s in
(* Replace twice to perform the substitution in macro args *)
repl(repl t)) txt tr in
[Printf.sprintf "#1 %S\n" fname_in; txt]
let balanced_braces4 =
let b = "\\([^()]\\|(" in
let e = ")\\)*" in
String.concat "" ["\\([^(),]\\|("; b; b; b; "[^()]*"; e; e; e; e]
let sub_std = [
" +LWT_t", "";
("IF_LWT(\\(" ^ balanced_braces4 ^"\\),\\(" ^ balanced_braces4 ^ "\\))",
"(* \\1 *)\\6");
("TRY_WITH(\\(" ^ balanced_braces4 ^"\\),\\(" ^ balanced_braces4 ^ "\\))",
"try \\1 with \\6");
(* Payload surrounded by braces to avoid absorbing "in" in \2 *)
("let%lwt \\([a-z][a-zA-Z_]*\\) = (\\(" ^ balanced_braces4 ^ "\\)) in",
"let \\1 = \\2 in");
";%lwt", ";";
"return\\b", "";
]
let sub_lwt = [
" +LWT_t", " Lwt.t";
("IF_LWT(\\(" ^ balanced_braces4 ^"\\),\\(" ^ balanced_braces4 ^ "\\))",
" \\1(* \\6 *)");
("TRY_WITH(\\(" ^ balanced_braces4 ^"\\),\\(" ^ balanced_braces4 ^ "\\))",
"Lwt.catch (fun () -> \\1) (function \\6 | exn -> Lwt.fail exn)");
("let%lwt \\([a-z][a-zA-Z_]*\\) = (\\(" ^ balanced_braces4 ^ "\\)) in",
"(\\2) >>= fun \\1 -> ");
";%lwt", " >>= fun () -> ";
"raise", "Lwt.fail";
]
let () =
let pp = "src" / "csv.pp.ml" in
let csv_std = substitute pp sub_std in
let csv_mem = substitute ("src" / "csv_memory.ml") [] in
if Sys.file_exists "src" then
write ("src" / "csv.ml") (csv_std @ csv_mem);
if Sys.file_exists "lwt" then
write ("lwt" / "csv_lwt.ml") (substitute pp sub_lwt);
if Sys.file_exists "tests" then (
let test = "tests" / "test.pp.ml" in
write ("tests" / "test.ml") (substitute test sub_std);
write ("tests" / "test_lwt.ml") (substitute test sub_lwt)
)
opam-version: "2.0"
maintainer: "Christophe Troestler <Christophe.Troestler@umons.ac.be>"
authors: ["Richard Jones"
"Christophe Troestler"]
tags: ["csv" "database" "science"]
license: "LGPL-2.1 with OCaml linking exception"
homepage: "https://github.com/Chris00/ocaml-csv"
dev-repo: "git+https://github.com/Chris00/ocaml-csv.git"
bug-reports: "https://github.com/Chris00/ocaml-csv/issues"
doc: "https://Chris00.github.io/ocaml-csv/doc"
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.03.0"}
"csv"
"dune" {build}
"base-bytes"
"base-unix"
"lwt"
]
synopsis: "A pure OCaml library to read and write CSV files, LWT version"
description: """
This is a pure OCaml library to read and write CSV files, including
all extensions used by Excel — e.g. quotes, newlines, 8 bit characters
in fields, \"0 etc. A special representation of rows of CSV files with
a header is provided. The library comes with a handy command line tool
called csvtool for handling CSV files from shell scripts. This
version can be used with the monadic concurrency library LWT."""
etc: [
"setup.ml"
"setup.data"
"setup.log"
"_oasis_remove_.ml"
]
opam-version: "1.2"
name: "csv"
version: "1.5"
opam-version: "2.0"
maintainer: "Christophe Troestler <Christophe.Troestler@umons.ac.be>"
authors: [ "Richard Jones"
"Christophe Troestler" ]
tags: ["csv" "database" "science"]
license: "LGPL-2.1 with OCaml linking exception"
homepage: "https://github.com/Chris00/ocaml-csv"
dev-repo: "https://github.com/Chris00/ocaml-csv.git"
dev-repo: "git+https://github.com/Chris00/ocaml-csv.git"
bug-reports: "https://github.com/Chris00/ocaml-csv/issues"
tags: [ "database" "science" ]
doc: "https://Chris00.github.io/ocaml-csv/doc"
build: [
["oasis" "setup"]
["ocaml" "setup.ml" "-configure" "--prefix" prefix]
["ocaml" "setup.ml" "-build"]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
install: ["ocaml" "setup.ml" "-install"]
remove: [
["ocaml" "%{etc}%/csv/_oasis_remove_.ml" "%{etc}%/csv"]
]
build-test: [
["oasis" "setup"]
["ocaml" "setup.ml" "-configure" "--enable-tests"]
["ocaml" "setup.ml" "-build"]
["ocaml" "setup.ml" "-test"]
]
build-doc: [ "ocaml" "setup.ml" "-doc" ]
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"base-bytes"
"oasis" {build & >= "0.4"}
"ocamlbuild" {build}
"ocamlfind" {build & >= "1.5"}
"base-unix"
]
synopsis: "A pure OCaml library to read and write CSV files"
description: """
This is a pure OCaml library to read and write CSV files, including
all extensions used by Excel — e.g. quotes, newlines, 8 bit characters
in fields, \"0 etc. A special representation of rows of CSV files with
a header is provided. The library comes with a handy command line tool
called csvtool for handling CSV files from shell scripts."""
Building ocaml-csv for Debian
-----------------------------
Patching upstream sources
-------------------------
The quilt series is generated from the Git repository, using
dom-{apply,save}-patches, from the dh-ocaml (>= 0.5) package. Please
refer to the appendix about Git in the Debian OCaml Packaging Policy
(from the same package).
-- Stéphane Glondu <glondu@debian.org>, Tue, 3 Nov 2009 16:56:00 +0100
ocaml-csv (1.5-2) UNRELEASED; urgency=medium
ocaml-csv (2.2-1) UNRELEASED; urgency=medium
* Updated Homepage (closes: #855067, LP: #1582565). Thanks to Joshua Bayfield for the patch.
[ Stéphane Glondu ]
* New upstream release
* Update Vcs-*
* Bump debhelper compat level to 12
* Bump Standards-Version to 4.4.0
[ Ralf Treinen ]
* Updated Homepage (closes: #855067, LP: #1582565). Thanks to Joshua
Bayfield for the patch.
-- Ralf Treinen <treinen@debian.org> Tue, 14 Feb 2017 11:42:18 +0100
-- Stéphane Glondu <glondu@debian.org> Sat, 03 Aug 2019 10:40:22 +0200
ocaml-csv (1.5-1) unstable; urgency=medium
......