Skip to content

Commit

Permalink
use external OPAM repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nekketsuuu committed Mar 13, 2018
1 parent 9c67b32 commit 91d36f2
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 26 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "external/camlpdf"]
path = external/camlpdf
url = https://github.com/gfngfn/camlpdf
[submodule "backend/external/otfm"]
path = external/otfm
url = https://github.com/gfngfn/otfm.git
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,18 @@ SRCROOT=src
BACKEND=src/backend
FRONTEND=src/frontend
CHARDECODER=src/chardecoder
EXTERNAL=external
OCB_FLAGS = -cflags -unsafe-string -cflag -w -cflag -3 \
-use-ocamlfind -use-menhir \
-I $(SRCROOT)/ -I $(FRONTEND)/ -I $(BACKEND)/ -I $(CHARDECODER)/ \
-I $(EXTERNAL)/otfm/src/ -I $(EXTERNAL)/camlpdf/ \
-pkgs "str,ppx_deriving.show,core_kernel,result,uutf,batteries, \
menhirLib,yojson,camlimages,camlimages.jpeg" \
-tag thread -yaccflags "--table --explain" \
-lflags "flatestubs.c rijndael-alg-fst.c stubs-aes.c sha2.c stubs-sha2.c"
-pkgs "str,ppx_deriving.show,core_kernel,uutf,batteries, \
menhirLib,yojson,camlimages,camlimages.jpeg,otfm,camlpdf" \
-tag thread -yaccflags "--table --explain"
TARGET=satysfi
OCB = ocamlbuild $(OCB_FLAGS)
BINDIR=$(PREFIX)/bin

all:
[ -d .git ] && git submodule update -i || echo "Skip git submodule update -i"
mkdir -p _build/
cp $(EXTERNAL)/camlpdf/*.c _build/
cp $(EXTERNAL)/camlpdf/*.h _build/
$(OCB) main.native
mv main.native $(TARGET)

Expand Down
20 changes: 15 additions & 5 deletions README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

本ソフトウェアは2017年度IPA未踏事業の1プロジェクトとして支援のもと開発されました。(概要は[こちら](https://www.ipa.go.jp/jinzai/mitou/2017/gaiyou_t-4.html)

## Homebrew を使ったインストール方法 (Macユーザ向け)
## Homebrew を使ったインストール方法 (Mac ユーザ向け)

Homebrewのフォーミュラが用意されています
Homebrew のフォーミュラが用意されています

```sh
$ brew install --HEAD nyuichi/satysfi/satysfi
Expand All @@ -33,6 +33,13 @@ $ brew install --HEAD nyuichi/satysfi/satysfi
* [opam](https://opam.ocaml.org/) 1.2 (インストール手順は[こちら](https://opam.ocaml.org/doc/Install.html)。)
* ocaml 4.06.0 (OPAM からインストールします)

また,ビルドには外部 OPAM リポジトリの追加が必要です。これは以下のコマンドでできます。

```sh
opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

#### 準備例(Ubuntu)

```sh
Expand All @@ -45,6 +52,8 @@ wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh

opam switch 4.06.0
eval `opam config env`

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

Expand All @@ -63,21 +72,22 @@ opam init

opam switch 4.06.0
eval `opam config env`

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

### ビルド

まず,このレポジトリとサブモジュールを clone します。その後 OPAM を使って SATySFi をビルドします。
まず,このリポジトリとサブモジュールを clone します。その後 OPAM を使って SATySFi をビルドします。

```sh
# clone
git clone https://github.com/gfngfn/SATySFi.git
cd SATySFi
git submodule update --init --recursive

# Issue #46: core_kernel を正しくビルドするために 1.0+beta18 を避ける
opam pin add -y jbuilder 1.0+beta17
opam pin add jbuilder 1.0+beta17
# build
opam pin add satysfi .
opam install satysfi
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Here is a list of minimally required softwares.
* [opam](https://opam.ocaml.org/) 1.2 (Installation instructions are [here](https://opam.ocaml.org/doc/Install.html).)
* ocaml 4.06.0 (installed by OPAM)

Also, we must add an external OPAM repo to build. This can be done by the following command.

```sh
opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

#### Example (Ubuntu)

```sh
Expand All @@ -44,6 +51,8 @@ wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh

opam switch 4.06.0
eval `opam config env`

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

Expand All @@ -62,6 +71,8 @@ opam init

opam switch 4.06.0
eval `opam config env`

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update
```

Expand All @@ -73,10 +84,9 @@ First, clone this repository and submodules. Then build SATySFi using OPAM.
# clone
git clone https://github.com/gfngfn/SATySFi.git
cd SATySFi
git submodule update --init --recursive

# Issue #46: avoid 1.0+beta18 to build core_kernel correctly.
opam pin add -y jbuilder 1.0+beta17
opam pin add jbuilder 1.0+beta17
# build
opam pin add satysfi .
opam install satysfi
Expand Down
1 change: 0 additions & 1 deletion external/camlpdf
Submodule camlpdf deleted from d82d2d
1 change: 0 additions & 1 deletion external/otfm
Submodule otfm deleted from 398d20
6 changes: 4 additions & 2 deletions opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ install: [
remove: [
[make "-f" "Makefile" "uninstall" "PREFIX=%{prefix}%"]
]
# Packages whose version suffix is "+satysfi" are distributed on satysfi-external-repo.
depends: [
"batteries"
# Issue #46: we temporarily pin camlimages to avoid Graphics-related problems.
# See https://github.com/ocaml/dune/issues/563 for details.
"camlimages" {< "5.0.0"}
"camlpdf" {= "2.2.1+satysfi"}
"core_kernel" {>= "v0.10.0"}
"depext"
"menhir"
"ocamlbuild" {build}
"ocamlfind"
"ocamlfind" {build}
"otfm" {= "0.3.0+satysfi"}
"ppx_deriving"
"result"
"uutf"
"yojson"
]
Expand Down

0 comments on commit 91d36f2

Please sign in to comment.