Skip to content

Commit f40fd7e

Browse files
authored
feat: move Lean4Packages content to submodules (#47)
1 parent 069873c commit f40fd7e

File tree

13 files changed

+31
-93
lines changed

13 files changed

+31
-93
lines changed

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "Lean4Packages/mathlib3port"]
2+
path = Lean4Packages/mathlib3port
3+
url = [email protected]:leanprover-community/mathlib3port.git
4+
[submodule "Lean4Packages/lean3port"]
5+
path = Lean4Packages/lean3port
6+
url = [email protected]:leanprover-community/lean3port.git

Lean4Packages/lean3port

Submodule lean3port added at d59a9f7

Lean4Packages/leanbin/Leanbin.lean

-1
This file was deleted.

Lean4Packages/leanbin/lakefile.lean

-39
This file was deleted.

Lean4Packages/leanbin/lean-toolchain

-1
This file was deleted.

Lean4Packages/mathbin/Mathbin.lean

-1
This file was deleted.

Lean4Packages/mathbin/lakefile.lean

-40
This file was deleted.

Lean4Packages/mathbin/lean-toolchain

-1
This file was deleted.

Lean4Packages/mathlib3port

Submodule mathlib3port added at b167b3c

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ build:
9090

9191
port-lean: init-logs build
9292
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)
93-
cp lean-toolchain Lean4Packages/leanbin/
93+
cp lean-toolchain Lean4Packages/lean3port/
9494

9595
port-mathbin: port-lean
9696
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)
97-
cp lean-toolchain Lean4Packages/mathbin/
97+
cp lean-toolchain Lean4Packages/mathlib3port/
9898

9999
test-import-leanbin:
100100
cd Test/importLeanbin && rm -rf build lean_packages && lake build

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,20 @@ Mathport is a tool for porting Lean3 projects to Lean4. It consists of two (loos
55
- "binport", which translates Lean3 `.lean` files to Lean4 `.olean` files
66
- "synport", which best-effort translates Lean3 `.lean` files to Lean4 `.lean` files
77

8-
See the `Makefile` for usage (it takes several hours to rebuild the mathlib port),
9-
or the `test-mathport` repository if you'd prefer to use a pre-built artifact.
8+
## Running mathport locally
9+
10+
See the `Makefile` for usage (it takes several hours to rebuild the mathlib port).
11+
12+
## Running with artifacts from continuous integration
13+
14+
To avoid having to run `mathport` locally, we provide downloadable files
15+
containing the `.lean` files and `.olean` files generated from Lean 3 and from mathlib3.
16+
17+
The directory `Lean4Packages` contains subdirectories `lean3port` and `mathlib3port`,
18+
which are in fact git submodules,
19+
each containing a `lakefile.lean` that automatically obtains
20+
the relevant generated `.olean` files from a tarball.
21+
22+
The directory `Test` contains subdirectories `importLeanBin` and `importMathbin`,
23+
each containing a `lakefile.lean` that depends on one of the projects
24+
from the `Lean4Packages` directory.

Test/importLeanbin/lakefile.lean

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ open Lake DSL System
55
package importLeanbin where
66
defaultFacet := PackageFacet.oleans
77
dependencies := #[{
8-
name := "leanbin",
9-
src := Source.git "https://github.com/leanprover-community/mathport.git" "master",
10-
dir := "Lean4Packages/leanbin"
8+
name := "lean3port",
9+
src := Source.git "https://github.com/leanprover-community/lean3port.git" "master"
1110
}]

Test/importMathbin/lakefile.lean

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ open Lake DSL System
55
package importMathbin where
66
defaultFacet := PackageFacet.oleans
77
dependencies := #[{
8-
name := "mathbin",
9-
src := Source.git "https://github.com/leanprover-community/mathport.git" "master",
10-
dir := "Lean4Packages/mathbin"
8+
name := "mathlib3port",
9+
src := Source.git "https://github.com/leanprover-community/mathlib3port.git" "master"
1110
}]

0 commit comments

Comments
 (0)