Skip to content

Commit

Permalink
feat: move Lean4Packages content to submodules (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Nov 22, 2021
1 parent 069873c commit f40fd7e
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 93 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "Lean4Packages/mathlib3port"]
path = Lean4Packages/mathlib3port
url = [email protected]:leanprover-community/mathlib3port.git
[submodule "Lean4Packages/lean3port"]
path = Lean4Packages/lean3port
url = [email protected]:leanprover-community/lean3port.git
1 change: 1 addition & 0 deletions Lean4Packages/lean3port
Submodule lean3port added at d59a9f
1 change: 0 additions & 1 deletion Lean4Packages/leanbin/Leanbin.lean

This file was deleted.

39 changes: 0 additions & 39 deletions Lean4Packages/leanbin/lakefile.lean

This file was deleted.

1 change: 0 additions & 1 deletion Lean4Packages/leanbin/lean-toolchain

This file was deleted.

1 change: 0 additions & 1 deletion Lean4Packages/mathbin/Mathbin.lean

This file was deleted.

40 changes: 0 additions & 40 deletions Lean4Packages/mathbin/lakefile.lean

This file was deleted.

1 change: 0 additions & 1 deletion Lean4Packages/mathbin/lean-toolchain

This file was deleted.

1 change: 1 addition & 0 deletions Lean4Packages/mathlib3port
Submodule mathlib3port added at b167b3
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ build:

port-lean: init-logs build
LEAN_PATH=$(MATHPORT_LIB):$(MATHLIB4_LIB):$(LEANBIN_LIB) ./build/bin/mathport config.json Leanbin::all >> Logs/mathport.out 2> >(tee -a Logs/mathport.err >&2)
cp lean-toolchain Lean4Packages/leanbin/
cp lean-toolchain Lean4Packages/lean3port/

port-mathbin: port-lean
LEAN_PATH=$(MATHPORT_LIB):$(MATHLIB4_LIB):$(LEANBIN_LIB):$(MATHBIN_LIB) ./build/bin/mathport config.json Leanbin::all Mathbin::all >> Logs/mathport.out 2> >(tee -a Logs/mathport.err >&2)
cp lean-toolchain Lean4Packages/mathbin/
cp lean-toolchain Lean4Packages/mathlib3port/

test-import-leanbin:
cd Test/importLeanbin && rm -rf build lean_packages && lake build
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,20 @@ Mathport is a tool for porting Lean3 projects to Lean4. It consists of two (loos
- "binport", which translates Lean3 `.lean` files to Lean4 `.olean` files
- "synport", which best-effort translates Lean3 `.lean` files to Lean4 `.lean` files

See the `Makefile` for usage (it takes several hours to rebuild the mathlib port),
or the `test-mathport` repository if you'd prefer to use a pre-built artifact.
## Running mathport locally

See the `Makefile` for usage (it takes several hours to rebuild the mathlib port).

## Running with artifacts from continuous integration

To avoid having to run `mathport` locally, we provide downloadable files
containing the `.lean` files and `.olean` files generated from Lean 3 and from mathlib3.

The directory `Lean4Packages` contains subdirectories `lean3port` and `mathlib3port`,
which are in fact git submodules,
each containing a `lakefile.lean` that automatically obtains
the relevant generated `.olean` files from a tarball.

The directory `Test` contains subdirectories `importLeanBin` and `importMathbin`,
each containing a `lakefile.lean` that depends on one of the projects
from the `Lean4Packages` directory.
5 changes: 2 additions & 3 deletions Test/importLeanbin/lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ open Lake DSL System
package importLeanbin where
defaultFacet := PackageFacet.oleans
dependencies := #[{
name := "leanbin",
src := Source.git "https://github.com/leanprover-community/mathport.git" "master",
dir := "Lean4Packages/leanbin"
name := "lean3port",
src := Source.git "https://github.com/leanprover-community/lean3port.git" "master"
}]
5 changes: 2 additions & 3 deletions Test/importMathbin/lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ open Lake DSL System
package importMathbin where
defaultFacet := PackageFacet.oleans
dependencies := #[{
name := "mathbin",
src := Source.git "https://github.com/leanprover-community/mathport.git" "master",
dir := "Lean4Packages/mathbin"
name := "mathlib3port",
src := Source.git "https://github.com/leanprover-community/mathlib3port.git" "master"
}]

0 comments on commit f40fd7e

Please sign in to comment.