Skip to content

Commit b42ab4c

Browse files
committed
Mac build script
1 parent ce8e691 commit b42ab4c

28 files changed

Lines changed: 171 additions & 92 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#[profile.release]
2-
#lto = true
3-
41
[workspace]
52
members = [
63
"cozo-core",

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.2.0

build-release-mac.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@
22

33
set -e
44

5-
VERSION=$(cat ./Cargo.toml | grep -E "^version" | grep -Eo '[0-9.]+')
6-
ARCH=$(uname -m)
5+
VERSION=$(cat ./VERSION)
76

8-
rm -fr release
9-
mkdir release
7+
#rm -fr release
8+
mkdir -p release
109

11-
cargo build --release
12-
cargo build --release --manifest-path=cozo-lib-c/Cargo.toml
13-
cargo build --release --manifest-path=cozo-lib-java/Cargo.toml
10+
for TARGET in x86_64-apple-darwin aarch64-apple-darwin; do
11+
# standalone, c, java, nodejs
12+
CARGO_PROFILE_RELEASE_LTO=fat cargo build --release -p cozoserver -p cozo_c -p cozo_java -p cozo-node -F compact -F storage-rocksdb --target $TARGET
13+
cp target/$TARGET/release/cozoserver release/cozoserver-$VERSION-$TARGET # standalone
14+
cp target/$TARGET/release/libcozo_c.a release/libcozo_c-$VERSION-$TARGET.a # c static
15+
cp target/$TARGET/release/libcozo_c.dylib release/libcozo_c-$VERSION-$TARGET.dylib # c dynamic
16+
cp target/$TARGET/release/libcozo_java.dylib release/libcozo_java-$VERSION-$TARGET.dylib # java
17+
cp target/$TARGET/release/libcozo_node.dylib release/libcozo_node-$VERSION-$TARGET.dylib # nodejs
1418

15-
cp target/release/cozoserver release/cozoserver-${VERSION}-mac-${ARCH}
16-
cp target/release/libcozo_c.a release/libcozo_c-${VERSION}-mac-${ARCH}.a
17-
cp target/release/libcozo_c.dylib release/libcozo_c-${VERSION}-mac-${ARCH}.dylib
18-
cp target/release/libcozo_java.dylib release/libcozo_java-${VERSION}-mac-${ARCH}.dylib
19-
strip release/cozoserver-${VERSION}-mac-${ARCH}
19+
# python
20+
cd cozo-lib-python
21+
CARGO_PROFILE_RELEASE_LTO=fat PYO3_NO_PYTHON=1 maturin build -F compact -F storage-rocksdb --release --strip --target $TARGET
22+
cd ..
23+
done
2024

21-
gzip release/*
25+
# copy python
26+
cp target/wheels/*.whl release/
27+
28+
# swift
29+
cd cozo-lib-swift
30+
CARGO_PROFILE_RELEASE_LTO=fat ./build-rust.sh
31+
cd ..
32+
33+
# WASM
34+
cd cozo-lib-wasm
35+
CARGO_PROFILE_RELEASE_LTO=fat ./build.sh
36+
cd ..

cozo-core/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cozo"
3-
version = "0.1.7"
3+
version = "0.2.0"
44
edition = "2021"
55
description = "A general-purpose, transactional, relational database that uses Datalog and focuses on graph data and algorithms"
66
authors = ["Ziyang Hu"]
@@ -9,12 +9,9 @@ homepage = "https://github.com/cozodb/cozo"
99
repository = "https://github.com/cozodb/cozo"
1010
documentation = "https://cozodb.github.io/current/manual"
1111
exclude = [
12-
"docs/*",
1312
"tests/*",
1413
]
1514

16-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
17-
1815
[features]
1916
#! # Features
2017

cozo-lib-c/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cozo_c"
3-
version = "0.1.3"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MPL-2.0"
66
homepage = "https://github.com/cozodb/cozo"
@@ -42,7 +42,7 @@ nothread = ["cozo/nothread"]
4242
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
4343

4444
[dependencies]
45-
cozo = { version = "0.1.2", path = "../cozo-core", default_features = false }
45+
cozo = { version = "0.2.0", path = "../cozo-core", default_features = false }
4646
lazy_static = "1.4.0"
4747

4848
[build-dependencies]

cozo-lib-java/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cozo_java"
3-
version = "0.1.3"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MPL-2.0"
66
homepage = "https://github.com/cozodb/cozo"
@@ -21,5 +21,5 @@ io-uring = ["cozo/io-uring"]
2121
[dependencies]
2222
jni = "0.20.0"
2323
# , features = ["compact"]
24-
cozo = { version = "0.1.3", path = "../cozo-core", default_features = false, features = ["compact"] }
24+
cozo = { version = "0.2.0", path = "../cozo-core", default_features = false, features = ["compact"] }
2525
lazy_static = "1.4.0"

cozo-lib-nodejs/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[package]
22
name = "cozo-node"
3-
version = "0.1.6"
3+
version = "0.2.0"
44
description = "Cozo database for NodeJS"
55
authors = ["Ziyang Hu"]
6-
license = "MIT/Apache-2.0/BSD-3-Clause"
6+
license = "MPL-2.0"
7+
homepage = "https://github.com/cozodb/cozo"
8+
repository = "https://github.com/cozodb/cozo"
9+
documentation = "https://cozodb.github.io/current/manual"
710
edition = "2021"
811
exclude = ["index.node"]
912

@@ -41,7 +44,7 @@ nothread = ["cozo/nothread"]
4144
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
4245

4346
[dependencies]
44-
cozo = { version = "0.1.7", path = "../cozo-core", default-features = false }
47+
cozo = { version = "0.2.0", path = "../cozo-core", default-features = false }
4548
lazy_static = "1.4.0"
4649

4750
[dependencies.neon]

cozo-lib-nodejs/LICENSE.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

cozo-lib-nodejs/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* Copyright 2022, The Cozo Project Authors.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
5+
* If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*/
8+
19
const binary = require('@mapbox/node-pre-gyp');
210
const path = require('path');
311
const binding_path = binary.find(path.resolve(path.join(__dirname, './package.json')));

0 commit comments

Comments
 (0)