Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
5ecf116b
Commit
5ecf116b
authored
Nov 29, 2014
by
Tyler Neely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the cargo auto-compiliation. maybe this will be added later as an optional feature.
parent
f2b6d109
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
3 additions
and
79 deletions
+3
-79
.gitmodules
.gitmodules
+0
-3
Cargo.toml
Cargo.toml
+0
-4
README.md
README.md
+1
-1
Cargo.toml
rocksdb-sys/Cargo.toml
+0
-13
build.rs
rocksdb-sys/build.rs
+0
-55
rocksdb
rocksdb-sys/rocksdb
+0
-1
ffi.rs
src/ffi.rs
+0
-0
lib.rs
src/lib.rs
+2
-2
No files found.
.gitmodules
View file @
5ecf116b
[submodule "rocksdb-sys/rocksdb"]
path = rocksdb-sys/rocksdb
url = https://github.com/facebook/rocksdb
Cargo.toml
View file @
5ecf116b
...
...
@@ -3,7 +3,3 @@
name
=
"rocksdb"
version
=
"0.0.1"
authors
=
[
"Tyler Neely <t@jujit.su>"
]
[dependencies.rocksdb-sys]
path
=
"rocksdb-sys"
version
=
"*"
README.md
View file @
5ecf116b
...
...
@@ -2,12 +2,12 @@ rust-rocksdb
============
### running
Install RocksDB. rust-rocksdb has been tested with version 3.8.1 on linux and windows.
###### Cargo.toml
```
rust
[
dependencies
.rocksdb
]
git
=
"https://github.com/spacejam/rust-rocksdb"
```
RocksDB 3.8.1 will be pulled in and compiled automatically.
###### Code
```
rust
extern
crate
rocksdb
;
...
...
rocksdb-sys/Cargo.toml
deleted
100644 → 0
View file @
f2b6d109
[package]
name
=
"rocksdb-sys"
version
=
"0.0.1"
authors
=
[]
links
=
"rocksdb"
build
=
"build.rs"
[build-dependencies.pkg-config]
git
=
"https://github.com/alexcrichton/pkg-config-rs"
[lib]
name
=
"rocksdb-sys"
path
=
"lib.rs"
rocksdb-sys/build.rs
deleted
100644 → 0
View file @
f2b6d109
extern
crate
"pkg-config"
as
pkg_config
;
use
std
::
os
;
use
std
::
io
::{
mod
,
fs
,
Command
};
use
std
::
io
::
process
::
InheritFd
;
//TODO windows support
fn
main
()
{
// Next, fall back and try to use pkg-config if its available.
match
pkg_config
::
find_library
(
"librocksdb"
)
{
Ok
(())
=>
return
,
Err
(
..
)
=>
{}
}
let
src
=
os
::
getcwd
()
.unwrap
();
let
dst
=
Path
::
new
(
os
::
getenv
(
"OUT_DIR"
)
.unwrap
());
let
_
=
fs
::
mkdir
(
&
dst
.join
(
"build"
),
io
::
USER_DIR
);
println!
(
"cwd: {}"
,
src
.join
(
"rocksdb"
)
.as_str
());
run
(
Command
::
new
(
make
())
.arg
(
"shared_lib"
)
.arg
(
format!
(
"-j{}"
,
os
::
getenv
(
"NUM_JOBS"
)
.unwrap
()))
.cwd
(
&
src
.join
(
"rocksdb"
)));
// Don't run `make install` because apparently it's a little buggy on mingw
// for windows.
fs
::
mkdir_recursive
(
&
dst
.join
(
"lib/pkgconfig"
),
io
::
USER_DIR
)
.unwrap
();
let
target
=
os
::
getenv
(
"TARGET"
)
.unwrap
();
if
target
.contains
(
"apple"
)
{
fs
::
rename
(
&
src
.join
(
"rocksdb/librocksdb.dylib"
),
&
dst
.join
(
"lib/librocksdb.dylib"
))
.unwrap
();
}
else
{
fs
::
rename
(
&
src
.join
(
"rocksdb/librocksdb.so"
),
&
dst
.join
(
"lib/librocksdb.so"
))
.unwrap
();
}
println!
(
"cargo:rustc-flags=-L {}/lib -l rocksdb:dylib"
,
dst
.display
());
println!
(
"cargo:root={}"
,
dst
.display
());
println!
(
"cargo:include={}/include"
,
src
.join
(
"rocksdb"
)
.display
());
}
fn
run
(
cmd
:
&
mut
Command
)
{
println!
(
"running: {}"
,
cmd
);
assert
!
(
cmd
.stdout
(
InheritFd
(
1
))
.stderr
(
InheritFd
(
2
))
.status
()
.unwrap
()
.success
());
}
fn
make
()
->
&
'static
str
{
if
cfg!
(
target_os
=
"freebsd"
)
{
"gmake"
}
else
{
"make"
}
}
rocksdb
@
32572214
Subproject commit 325722149925b8dfdfcdf96531b2ae114b736b32
rocksdb-sys/lib
.rs
→
src/ffi
.rs
View file @
5ecf116b
File moved
src/lib.rs
View file @
5ecf116b
...
...
@@ -2,10 +2,10 @@
#
!
[
crate_type
=
"lib"
]
#
!
[
allow
(
dead_code
)]
extern
crate
"rocksdb-sys"
as
rocksdb_ffi
;
pub
use
ffi
as
rocksdb_ffi
;
pub
use
rocksdb
::{
RocksDB
,
RocksDBResult
,
};
pub
mod
rocksdb
;
pub
mod
ffi
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment