aboutsummaryrefslogtreecommitdiff
blob: 8e6b775c590f126a4a5d1cf010d2840ba6dc3b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# cargo-ebuild

[![Build Status](https://travis-ci.org/cardoe/cargo-ebuild.svg?branch=master)](https://travis-ci.org/cardoe/cargo-ebuild)
[![Rust version]( https://img.shields.io/badge/rust-1.26-blue.svg)]()
[![Latest Version](https://img.shields.io/crates/v/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)
[![All downloads](https://img.shields.io/crates/d/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)
[![Downloads of latest version](https://img.shields.io/crates/dv/cargo-ebuild.svg)](https://crates.io/crates/cargo-ebuild)

`cargo ebuild` is a Cargo subcommand that generates an
[ebuild](https://wiki.gentoo.org/wiki/Ebuild) recipe that uses
[cargo.eclass](https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/cargo.eclass)
to build a Cargo based project for [Gentoo](https://gentoo.org/)

## Installation

Install it with Cargo:

```
$ cargo install cargo-ebuild
```

## Usage

You will first need to get the sources to the crate you want to install.
Your best bet is to search for the crate at [crates.io](https://crates.io)
and follow the *Repository* link. This should give you the ability to clone
the repo. Once you have cloned the repo, change into the directory and
ensure that you checkout the tag corresponding to the version you would like
to package. Lastly you will execute the `cargo ebuild` command to generate the
ebuild for that crate.

### Example

```bash
$ git clone https://github.com/cardoe/cargo-ebuild.git
$ cd cargo-ebuild
$ git checkout 0.1.5
$ cargo ebuild
$ cat cargo-ebuild-0.1.5.ebuild
```

```ebuild
# Copyright 2017-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.1.5

EAPI=6

CRATES="
advapi32-sys-0.2.0
aho-corasick-0.6.3
atty-0.2.3
backtrace-0.3.3
backtrace-sys-0.1.16
bitflags-0.7.0
bitflags-0.8.2
cargo-0.21.1
cargo-ebuild-0.1.5
cc-1.0.3
cfg-if-0.1.0
cmake-0.1.22
crates-io-0.10.0
crossbeam-0.2.10
curl-0.4.6
curl-sys-0.3.10
dbghelp-sys-0.2.0
docopt-0.8.1
dtoa-0.4.2
env_logger-0.4.3
error-chain-0.11.0
filetime-0.1.10
flate2-0.2.19
foreign-types-0.2.0
fs2-0.4.2
gcc-0.3.45
gdi32-sys-0.2.0
git2-0.6.4
git2-curl-0.7.0
glob-0.2.11
hex-0.2.0
idna-0.1.1
itoa-0.3.4
jobserver-0.1.8
kernel32-sys-0.2.2
lazy_static-0.2.8
libc-0.2.21
libgit2-sys-0.6.7
libssh2-sys-0.2.5
libz-sys-1.0.13
log-0.3.7
matches-0.1.4
memchr-1.0.2
miniz-sys-0.1.9
miow-0.2.1
net2-0.2.27
num-traits-0.1.40
num_cpus-1.3.0
openssl-0.9.11
openssl-probe-0.1.1
openssl-sys-0.9.11
pkg-config-0.3.9
psapi-sys-0.1.0
quote-0.3.15
rand-0.3.15
redox_syscall-0.1.17
redox_termios-0.1.1
regex-0.2.2
regex-syntax-0.4.1
rustc-demangle-0.1.5
scoped-tls-0.1.0
semver-0.7.0
semver-parser-0.7.0
serde-1.0.16
serde_derive-1.0.16
serde_derive_internals-0.16.0
serde_ignored-0.0.3
serde_json-1.0.5
shell-escape-0.1.3
strsim-0.6.0
syn-0.11.11
synom-0.11.3
tar-0.4.11
tempdir-0.3.5
termcolor-0.3.3
termion-1.5.1
thread_local-0.3.4
time-0.1.36
toml-0.4.5
unicode-bidi-0.2.5
unicode-normalization-0.1.4
unicode-xid-0.0.4
unreachable-1.0.0
url-1.4.0
user32-sys-0.2.0
utf8-ranges-1.0.0
void-1.0.2
winapi-0.2.8
winapi-build-0.1.1
wincolor-0.1.4
ws2_32-sys-0.2.1
"

inherit cargo

DESCRIPTION="Generates an ebuild for a package using the in-tree eclasses."
HOMEPAGE="https://github.com/cardoe/cargo-ebuild"
SRC_URI="$(cargo_crate_uris ${CRATES})"
RESTRICT="mirror"
LICENSE="MIT/Apache-2.0" # Update to proper Gentoo format
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=""
RDEPEND=""
```

## API

API documentation is available at [docs.rs](https://docs.rs/cargo-ebuild/).