package satyrographos

  1. Overview
  2. Docs
A naive package manager for SATySFi

Install

Dune Dependency

Authors

Maintainers

Sources

v0.0.1.5.tar.gz
md5=98ed1796c908c3522d985818878a0368
sha512=5cc32c8d39975914946e5f427157e7e001c0f1abe6840cd7f7374e9770b0953f979c39eba68fceb1ba7e96d747fec954575c01c5f898be452c866622b9529a81

Description

Satyrographos is a naive package manager for SATySFi.

Satyrographos is distributed under the LGPL-3.0 license.

Published: 15 Feb 2019

README

Satyrographos

日本語版 README はこちら

A naive package manager for SATySFi.

WARNING: Command line interfaces, except for the satyrographos install, are EXPERIMENTAL and subject to change and removal.

It composes files under directories ~/.opam/<ocaml-version>/share/satysfi/<package> installed by OPAM and copies them into directory ~/.satysfi/dist. It also sets up environments so that SATySFi can use system fonts. See Section Install System Fonts below.

Satyrographos simplifies installation of SATySFi. For example, @zr-tex8r’s make-satysfi.sh will be like this.

#!/bin/bash
set -eux

sudo apt -y update
sudo apt -y install build-essential git m4 unzip curl ruby

yes '' | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)

opam init --auto-setup --comp 4.06.0 --disable-sandboxing
eval $(opam env)
opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam repository add satyrographos https://github.com/na4zagin3/satyrographos-repo.git
opam update

# opam pin add https://github.com/na4zagin3/satyrographos.git # run this line if you want to try the latest Satyrographos

opam install -y satysfi
opam install -y satyrographos

satyrographos install

To use the latest version of Satyrographos, pin the repository like this:

opam pin add https://github.com/na4zagin3/satyrographos.git

Install System Fonts

This feature is still experimental and its interface and/or behaviour may be changed later.

If your machine is using Fontconfig, i.e., using Mac or Linux Desktop Environment, Satyrographos can set up SATySFi to utilise your existing system fonts.

Satyrographos offers the -system-font-prefix <system-font-name-prefix> option of gathering system fonts to enable them for use with names prefixed with <system-font-name-prefix> with SATySFi.

For example, the following command installs system fonts with the prefix system:.

$ satyrographos install -system-font-prefix 'system:'

Then you can use the system fonts, for example, Arial as system:Arial. (Technically, a font will have a SATySFi name which consists of the given prefix and the font's PostScript name. This behavior may be changed in the near future.)

@require: stdjabook

let-inline ctx \set-non-cjk-font name it =
  let ctx =
    ctx |> set-font Latin (name, 1., 0.)
        |> set-font OtherScript (name, 1., 0.)
  in
  read-inline ctx it

let-inline ctx \set-cjk-font name it =
  let ctx =
    ctx |> set-font HanIdeographic (name, 1., 0.)
        |> set-font Kana (name, 1., 0.)
  in
  read-inline ctx it
in

document (|
  title = {System Fonts};
  author = {\@na4zagin3};
  show-title = true;
  show-toc = false;
|) '<
  +p {
    ABCDabcd
    \set-non-cjk-font(`system:Tahoma-Bold`){ABCDabcd}
  }
  +p {
    あいうえお漢字
    \set-cjk-font(`system:HiraKakuStd-W8`){あいうえお漢字}
  }
>

How Does It Work?

Satyrographos links all files under ~/.opam/<ocaml-version>/share/satysfi/<package> and ~/.satyrographos/packages/<package> into ~/.satysfi/dist.

Satyrographos also does duplication detection and hash file merging, satyrographos install behaves as

$ cp -r "$(opam var share)"/share/satysfi/*/* ~/.satysfi/dist
$ cp -r ~/.satyrographos/packages/*/* ~/.satysfi/dist

With -system-font-prefix <system-font-name-prefix>, Satyrograph query system fonts with fc-list and installs those fonts too.

Register Libraries

You can add a new library for SATySFi as an OPAM library or a directory under ~/.satyrographos.

In this section, we are going to register a new library great-package like this.

- ~/src/
  - great-package/
    - hash/
      - fonts.satysfi-hash
    - fonts/
      - interesting-font.ttf
    - packages/
      - your-great.package.satyh

OPAM Package

Create a new package which installs the file into %{share}%/satysfi/great-package/packages/your-great-package.satyh.

Examples:

  • SATySFi-fonts-theano: https://github.com/na4zagin3/SATySFi-fonts-theano

  • SATySFi-grcnum: https://github.com/na4zagin3/SATySFi-grcnum

Local Directory (EXPERIMENTAL)

Register your local library with satyrographos pin add <local-dir>.

$ satyrographos pin add ~/src/great-package
$ satyrographos install

Supported Versions

SATySFi Satyrographos
v0.0.3 series latest

Dependencies (10)

  1. yojson
  2. uri >= "2.0.0" & < "3.0.0"
  3. ppx_jane < "v0.12"
  4. ppx_deriving
  5. json-derivers
  6. fileutils
  7. dune
  8. core < "v0.12"
  9. cmdliner
  10. ocaml >= "4.06.0"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.