Skip to content
Permalink
Browse files

Write an opam file for each sub-package

  • Loading branch information
sagotch committed Nov 26, 2019
1 parent ba73a0c commit c24d2c4236a31bb855e700b5edaa8fa2f0c6c686
@@ -15,7 +15,7 @@ test/dune
_build/
*.exe
*.bc
geneweb.install
*.install

# Generated from .camlp5 sources
bin/distrib/setup/setup.ml
@@ -77,6 +77,7 @@ CPPO_D=$(API_D) $(GWDB_D)
-e "s/%%%API_PKG%%%/$(API_PKG)/g" \
-e "s/%%%SOSA_PKG%%%/$(SOSA_PKG)/g" \
-e "s/%%%GWDB_PKG%%%/$(GWDB_PKG)/g" \
-e "s/%%%WSERVER_PKG%%%/$(WSERVER_PKG)/g" \
-e "s/%%%DUNE_DIRS_EXCLUDE%%%/$(DUNE_DIRS_EXCLUDE)/g" \
> $@ \
&& echo " Done!"
@@ -1,7 +1,7 @@
(executable
(name bench)
(preprocess (action (run %{bin:cppo} %%%CPPO_D%%% -V OCAML:%{ocaml_version} %{input-file})))
(libraries unix geneweb.wserver %%%SOSA_PKG%%% %%%GWDB_PKG%%% geneweb benchmark)
(libraries unix %%%WSERVER_PKG%%% %%%SOSA_PKG%%% %%%GWDB_PKG%%% geneweb benchmark)
)

(alias (name runbench) (action (run ./bench.exe) ) )
@@ -2,52 +2,66 @@

#ifdef API
(executable
(package geneweb-bin)
(name marshal_dico_place)
(public_name marshal_dico_place)
(libraries unix %%%GWDB_PKG%%% geneweb geneweb.wserver)
(libraries unix %%%GWDB_PKG%%% geneweb %%%WSERVER_PKG%%%)
(modules marshal_dico_place)
)
#else
(dirs :standard \ dico_place)
#endif

(include_subdirs unqualified)

(executables
(public_names connex gwb2ged gwd gwdiff gwu setup update_nldb)
(modules connex gwb2ged gwdiff gwd gwu setup update_nldb)
(libraries unix str %%%GWDB_PKG%%% %%%SOSA_PKG%%% geneweb.wserver geneweb)
)

(executables
(public_names gwtp)
(modules gwtp httpEnv iolight)
(libraries unix geneweb.wserver %%%GWDB_PKG%%% %%%SOSA_PKG%%% geneweb)
)
#ifdef GWDB1

(executable
(package geneweb-bin)
(public_name consang)
(modules consang)
(preprocess (action (run %{bin:cppo} %%%CPPO_D%%% %{input-file})))
(libraries unix geneweb.wserver %%%GWDB_PKG%%% %%%SOSA_PKG%%% geneweb)
(libraries unix %%%WSERVER_PKG%%% %%%GWDB_PKG%%% %%%SOSA_PKG%%% geneweb)
)

(library
(name db1link)
(wrapped false)
(libraries unix geneweb.wserver geneweb.gwdb1_internal geneweb.gwdb1 geneweb)
(libraries unix %%%WSERVER_PKG%%% %%%GWDB_PKG%%% geneweb)
(modules db1link)
)

(executable
(package geneweb-bin)
(public_name gwc)
(modules gwc)
(preprocess (action (run %{bin:cppo} %%%CPPO_D%%% %{input-file})))
(libraries unix geneweb.wserver %%%GWDB_PKG%%% geneweb db1link)
(libraries unix %%%WSERVER_PKG%%% %%%GWDB_PKG%%% geneweb db1link)
)

(executable
(package geneweb-bin)
(public_name ged2gwb)
(modules ged2gwb utf8List)
(libraries unix str camlp5.gramlib geneweb.wserver %%%GWDB_PKG%%% geneweb)
(libraries unix str camlp5.gramlib %%%WSERVER_PKG%%% %%%GWDB_PKG%%% geneweb)
)

#else

(dirs %{dirs} \ consang \ db1link \ ged2gwb)

#endif

(include_subdirs unqualified)

(executables
(package geneweb-bin)
(public_names connex gwb2ged gwd gwdiff gwu setup update_nldb)
(modules connex gwb2ged gwdiff gwd gwu setup update_nldb)
(libraries unix str %%%GWDB_PKG%%% %%%SOSA_PKG%%% %%%WSERVER_PKG%%% geneweb)
)

(executables
(package geneweb-bin)
(public_names gwtp)
(modules gwtp httpEnv iolight)
(libraries unix %%%WSERVER_PKG%%% %%%GWDB_PKG%%% %%%SOSA_PKG%%% geneweb)
)
@@ -17,38 +17,39 @@ API_PKG=
GWDB_D=
GWDB_PKG=
SOSA_PKG=
WSERVER_PKG=geneweb-wserver
DUNE_DIRS_EXCLUDE=

while [[ $# -ne 0 ]]; do
case $1 in
--api)
API_PKG="piqirun.ext redis-sync yojson curl";
API_D="-D API" ;;
--gwdb1)
--gwdb-legacy)
GWDB_D="-D GWDB1" ;
GWDB_PKG="geneweb.gwdb1_internal geneweb.gwdb1" ;;
GWDB_PKG="geneweb-gwdb-legacy geneweb-gwdb-legacy.internal" ;;
--sosa-num)
DUNE_DIRS_EXCLUDE="$DUNE_DIRS_EXCLUDE sosa.array sosa.zarith"
SOSA_PKG="geneweb.sosa-num" ;;
SOSA_PKG="geneweb-sosa-num" ;;
--sosa-zarith)
DUNE_DIRS_EXCLUDE="$DUNE_DIRS_EXCLUDE sosa.array sosa.num"
SOSA_PKG="geneweb.sosa-zarith" ;;
SOSA_PKG="geneweb-sosa-zarith" ;;
*)
echo -e "\\x1b[33m[WARNING]\\x1b[0m Option $1 unknown and ignored.";;
esac
[[ $# -gt 0 ]] && shift
done

if [[ $GWDB_D == "" ]] ; then
echo -e "\\x1b[33m[WARNING]\\x1b[0m GWDB is not set, using gwdb1" ;
echo -e "\\x1b[33m[WARNING]\\x1b[0m GWDB is not set, using --gwdb-legacy" ;
GWDB_D="-D GWDB1" ;
GWDB_PKG="geneweb.gwdb1_internal geneweb.gwdb1" ;
GWDB_PKG="geneweb-gwdb-legacy geneweb-gwdb-legacy.internal" ;
fi ;

if [[ $SOSA_PKG == "" ]] ; then
echo -e "\\x1b[33m[WARNING]\\x1b[0m SOSA is not set, using geneweb.sosa" ;
DUNE_DIRS_EXCLUDE="$DUNE_DIRS_EXCLUDE sosa.num sosa.zarith" ;
SOSA_PKG="geneweb.sosa" ;
SOSA_PKG="geneweb-sosa" ;
fi ;

# Functions that print the checked information
@@ -115,6 +116,7 @@ print_vars() {
echo "GWDB_D=${GWDB_D}"
echo "GWDB_PKG=${GWDB_PKG}"
echo "SOSA_PKG=${SOSA_PKG}"
echo "WSERVER_PKG=${WSERVER_PKG}"
echo "DUNE_DIRS_EXCLUDE=${DUNE_DIRS_EXCLUDE}"
}

@@ -0,0 +1,40 @@
opam-version: "2.0"

name: "geneweb"

synopsis: "Genealogy library and software, API mode enabled"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
[ "./configure" "--api" ]
[ "dune" "build" "-p" name "-j" jobs ]
]

depends: [
"benchmark" { with-test }
"camlp5" { build }
"cppo" { build }
"dune" { >= "1.10" }
"markup"
"ocaml" { >= "4.05" }
"ocurl"
"ounit" { with-test }
"piqi"
"piqilib"
"redis"
"redis-sync"
"stdlib-shims"
"unidecode" { = "0.2.0" }
"yojson"
]

conflict-class: [ "geneweb" ]
@@ -0,0 +1,30 @@
opam-version: "2.0"

synopsis: "Genealogy library and software"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
[ "./configure" ]
[ "dune" "build" "-p" "geneweb" "-j" jobs ]
]

depends: [
"benchmark" { with-test }
"camlp5" { build }
"cppo" { build }
"dune" { >= "1.10" }
"markup"
"ocaml" { >= "4.05" }
"ounit" { with-test }
"stdlib-shims"
"unidecode" { = "0.2.0" }
]
@@ -0,0 +1,17 @@
opam-version: "2.0"

synopsis: "Gwdb module implementation (legacy backend)"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
["dune" "build" "-p" name "-j" jobs]
]
@@ -0,0 +1,21 @@
opam-version: "2.0"

synopsis: "Sosa module implementation using num library"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
["dune" "build" "-p" name "-j" jobs]
]

depends: [
"num"
]
@@ -0,0 +1,21 @@
opam-version: "2.0"

synopsis: "Sosa module implementation using zarith library"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
["dune" "build" "-p" name "-j" jobs]
]

depends: [
"zarith"
]
@@ -0,0 +1,21 @@
opam-version: "2.0"

synopsis: "Sosa module implementation"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
["dune" "build" "-p" name "-j" jobs]
]

depends: [
"dune" { >= "1.10" }
]
@@ -0,0 +1,17 @@
opam-version: "2.0"

synopsis: "Wserver module implementation"

maintainer: [ "Julien Sagot <julien.sagot@geneanet.org>" ]

authors: [ "Daniel de Rauglaudre" ]

homepage: "http://geneweb.org"

dev-repo: "git://github.com/geneweb/geneweb"

bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
["dune" "build" "-p" name "-j" jobs]
]
@@ -14,38 +14,19 @@ bug-reports: "https://github.com/geneweb/geneweb/issues"

build: [
[ "./configure" ]
[ make "exe" ]
]

install: [
[ "./configure" ]
[ make "install" ]
]

remove: [
[ "./configure" ]
[ make "uninstall" ]
[ "dune" "build" "-p" name "-j" jobs ]
]

depends: [
"benchmark" { with-test }
"camlp5" { build }
"cppo" { build }
"dune" { build >= "1.1.1" }
"dune" { >= "1.10" }
"markup"
"ocaml" { >= "4.05" }
"ounit" { with-test }
"stdlib-shims"
"unidecode" { = "0.2.0" }
]

depopts: [
"num"
"ocurl"
"piqi"
"piqilib"
"redis"
"redis-sync"
"yojson"
"zarith"
]
conflict-class: [ "geneweb" ]
@@ -1,6 +1,6 @@
(library
(name gwdb1_internal)
(public_name geneweb.gwdb1_internal)
(public_name geneweb-gwdb-legacy.internal)
(wrapped false)
(libraries geneweb.def geneweb.wserver.mli geneweb.util geneweb.io)
(modules_without_implementation dbdisk)
@@ -17,7 +17,7 @@

(library
(name gwdb1)
(public_name geneweb.gwdb1)
(public_name geneweb-gwdb-legacy)
(libraries gwdb1_internal)
(implements geneweb.gwdb.mli)
(modules gwdb)

0 comments on commit c24d2c4

Please sign in to comment.
You can’t perform that action at this time.