Closed na4zagin3 closed 5 years ago
What kind of build script is the best?
We can use x-*
fields in OPAM, which may allow the following descriptions.
(* project.opam *)
opam-version: "2.0"
name: "project"
version: "0.1"
build: [ ["satyrographos" "build"] ]
install: ["satyrographos" "install"]
x-satyrographos: {
sources [ [ "fonts/foo.ttc" "./foo.ttc" ] ]
doc [ "something.saty" ]
doc-dependencies [
"satysfi-lib-something" {> "0.0.1"}
]
}
We may also provide a new build file like this:
; Satyrographos file
; I’m now too lazy to invent a new syntax for the file.
(package project
(sources
("fonts/foo.ttc" "./foo.ttc"))
(doc
("something.saty"))
and
(* project.opam *)
opam-version: "2.0"
name: "project"
version: "0.1"
build: [ ["satyrographos" "build"] ]
install: ["satyrographos" "install"]
x-satyrographos-doc-dependencies: [
"satysfi-lib-something" {> "0.0.1"}
]
We can also introduce a new build file which replaces the OPAM file.
; Satyrographos file
; I’m now too lazy to invent a new syntax for the file.
(version 0.0.2)
(library
(name "fonts-theano")
(sources
((hash "fonts.satysfi-hash" "./fonts.satysfi-hash")
(font "TheanoDidot-Regular.otf" "./theano/TheanoDidot-Regular.otf")
(font "TheanoModern-Regular.otf" "./theano/TheanoModern-Regular.otf")
(font "TheanoOldStyle-Regular.otf" "./theano/TheanoOldStyle-Regular.otf")))
(compatibility ((renameFont fonts-theano:TheanoDidot TheanoDidot)
(renameFont fonts-theano:TheanoModern TheanoModern)))
(opam "satysfi-fonts-theano.opam"))
(libraryDoc
(name "fonts-theano-doc")
(build
((satysfi "doc-fonts-theano-ja.saty" "-o" "doc-fonts-theano-ja.pdf")))
(sources
((doc "doc-fonts-theano-ja.pdf" "./doc-fonts-theano-ja.pdf")))
(opam "satysfi-fonts-theano-doc.opam")
(dependencies ((fonts-theano ()))))
build
and install
fields.build
and install
fields.Considering there is demand to eliminate opam dependency, it may be better to invent a new build file format. Cf. https://github.com/amutake/satysfi-docker/issues/1
As currently Satyrographos relies on OPAM to resolve dependency, it may make sense to include opam file name to read/generate.
; Satyrographos file
; I’m now too lazy to invent a new syntax for the file.
(version 1)
(package
(name project)
(version "0.1")
(opam "./project.opam")
(sources
("fonts/foo.ttc" "./foo.ttc"))
(dependencies (...))
(doc
(files "something.saty")
(dependencies
(satysfi-lib-something (> 0.0.1)))))
Need to update the readme with the new build file info.
Readme is updated in #53
Rather than manually copying files, Satyrographos must do that using a build file containing description of a package. Like dune.