aboutsummaryrefslogtreecommitdiff
path: root/devel/py-maturin/Makefile
blob: d4026f6a185ea13e32300baeb37a1461399c6877 (plain) (blame)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# $FreeBSD$

PORTNAME=	maturin
DISTVERSIONPREFIX=	v
DISTVERSION=	0.8.3
PORTREVISION=	3
CATEGORIES=	devel python
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

MAINTAINER=	kai@FreeBSD.org
COMMENT=	Build and publish crates with pyo3, rust-cpython and cffi bindings

LICENSE=	APACHE20 MIT
LICENSE_COMB=	dual
LICENSE_FILE_APACHE20=	${WRKSRC}/license-apache
LICENSE_FILE_MIT=	${WRKSRC}/license-mit

# Although the port builds fine on some 32-bit architectures (e.g. i386) it
# doesn't support creating 32-bit Python wheels for FreeBSD.  Thus save build
# time and skip the port at a early stage.
NOT_FOR_ARCHS=		armv6 armv7 i386 mips powerpc
NOT_FOR_ARCHS_REASON=	the creation of 32-bit Python wheels is not supported for FreeBSD

BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}toml>=0.10.0:textproc/py-toml@${PY_FLAVOR}
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}toml>=0.10.0:textproc/py-toml@${PY_FLAVOR}

USES=		cargo python:3.5+
USE_GITHUB=	yes
GH_ACCOUNT=	PyO3
USE_PYTHON=	autoplist concurrent distutils

CARGO_CRATES=	addr2line-0.13.0 \
		adler-0.2.3 \
		aes-0.3.2 \
		aes-soft-0.3.3 \
		aesni-0.6.0 \
		aho-corasick-0.7.13 \
		ansi_term-0.11.0 \
		anyhow-1.0.32 \
		atty-0.2.14 \
		autocfg-0.1.7 \
		autocfg-1.0.0 \
		backtrace-0.3.50 \
		base64-0.12.3 \
		bitflags-1.2.1 \
		block-buffer-0.7.3 \
		block-buffer-0.9.0 \
		block-cipher-trait-0.6.2 \
		block-modes-0.3.3 \
		block-padding-0.1.5 \
		bumpalo-3.4.0 \
		byte-tools-0.3.1 \
		byteorder-1.3.4 \
		bytes-0.5.6 \
		bytesize-1.0.1 \
		bzip2-0.3.3 \
		bzip2-sys-0.1.9+1.0.8 \
		cargo_metadata-0.11.1 \
		cbindgen-0.14.3 \
		cc-1.0.58 \
		cfg-if-0.1.10 \
		clap-2.33.3 \
		cloudabi-0.0.3 \
		core-foundation-0.7.0 \
		core-foundation-sys-0.7.0 \
		cpuid-bool-0.1.2 \
		crc32fast-1.2.0 \
		crypto-mac-0.7.0 \
		dbus-0.2.3 \
		digest-0.8.1 \
		digest-0.9.0 \
		dtoa-0.4.6 \
		encoding_rs-0.8.23 \
		env_logger-0.7.1 \
		fake-simd-0.1.2 \
		filetime-0.2.12 \
		flate2-1.0.16 \
		fnv-1.0.7 \
		fuchsia-cprng-0.1.1 \
		fuchsia-zircon-0.3.3 \
		fuchsia-zircon-sys-0.3.3 \
		futures-channel-0.3.5 \
		futures-core-0.3.5 \
		futures-io-0.3.5 \
		futures-macro-0.3.5 \
		futures-sink-0.3.5 \
		futures-task-0.3.5 \
		futures-util-0.3.5 \
		generic-array-0.12.3 \
		generic-array-0.14.4 \
		getrandom-0.1.14 \
		gimli-0.22.0 \
		glob-0.3.0 \
		goblin-0.2.3 \
		h2-0.2.6 \
		hashbrown-0.8.2 \
		heck-0.3.1 \
		hermit-abi-0.1.15 \
		hkdf-0.8.0 \
		hmac-0.7.1 \
		http-0.2.1 \
		http-body-0.3.1 \
		httparse-1.3.4 \
		human-panic-1.0.3 \
		humantime-1.3.0 \
		hyper-0.13.7 \
		hyper-rustls-0.21.0 \
		idna-0.2.0 \
		indexmap-1.5.1 \
		indoc-1.0.2 \
		iovec-0.1.4 \
		ipnet-2.3.0 \
		itoa-0.4.6 \
		js-sys-0.3.44 \
		kernel32-sys-0.2.2 \
		keyring-0.9.0 \
		lazy_static-1.4.0 \
		libc-0.2.74 \
		log-0.4.11 \
		matches-0.1.8 \
		memchr-2.3.3 \
		mime-0.3.16 \
		mime_guess-2.0.3 \
		miniz_oxide-0.4.0 \
		mio-0.6.22 \
		miow-0.2.1 \
		net2-0.2.34 \
		num-0.2.1 \
		num-bigint-0.2.6 \
		num-complex-0.2.4 \
		num-integer-0.1.43 \
		num-iter-0.1.41 \
		num-rational-0.2.4 \
		num-traits-0.2.12 \
		num_cpus-1.13.0 \
		object-0.20.0 \
		once_cell-1.4.0 \
		opaque-debug-0.2.3 \
		opaque-debug-0.3.0 \
		os_type-2.2.0 \
		percent-encoding-2.1.0 \
		pin-project-0.4.23 \
		pin-project-internal-0.4.23 \
		pin-project-lite-0.1.7 \
		pin-utils-0.1.0 \
		pkg-config-0.3.18 \
		plain-0.2.3 \
		platform-info-0.0.1 \
		platforms-0.2.1 \
		podio-0.1.7 \
		ppv-lite86-0.2.8 \
		pretty_env_logger-0.4.0 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro-hack-0.5.18 \
		proc-macro-nested-0.1.6 \
		proc-macro2-1.0.19 \
		quick-error-1.2.3 \
		quote-1.0.7 \
		rand-0.6.5 \
		rand-0.7.3 \
		rand_chacha-0.1.1 \
		rand_chacha-0.2.2 \
		rand_core-0.3.1 \
		rand_core-0.4.2 \
		rand_core-0.5.1 \
		rand_hc-0.1.0 \
		rand_hc-0.2.0 \
		rand_isaac-0.1.1 \
		rand_jitter-0.1.4 \
		rand_os-0.1.3 \
		rand_pcg-0.1.2 \
		rand_xorshift-0.1.1 \
		rdrand-0.4.0 \
		redox_syscall-0.1.57 \
		regex-1.3.9 \
		regex-syntax-0.6.18 \
		remove_dir_all-0.5.3 \
		reqwest-0.10.7 \
		ring-0.16.15 \
		rpassword-4.0.5 \
		rustc-demangle-0.1.16 \
		rustls-0.18.1 \
		ryu-1.0.5 \
		same-file-1.0.6 \
		scroll-0.10.1 \
		scroll_derive-0.10.2 \
		sct-0.6.0 \
		secret-service-1.1.0 \
		security-framework-0.4.4 \
		security-framework-sys-0.4.3 \
		semver-0.10.0 \
		semver-parser-0.7.0 \
		serde-1.0.115 \
		serde_derive-1.0.115 \
		serde_json-1.0.57 \
		serde_urlencoded-0.6.1 \
		sha2-0.8.2 \
		sha2-0.9.1 \
		shlex-0.1.1 \
		slab-0.4.2 \
		socket2-0.3.12 \
		spin-0.5.2 \
		strsim-0.8.0 \
		structopt-0.3.16 \
		structopt-derive-0.4.9 \
		subtle-1.0.0 \
		syn-1.0.38 \
		tar-0.4.29 \
		tempfile-3.1.0 \
		termcolor-1.1.0 \
		textwrap-0.11.0 \
		thiserror-1.0.20 \
		thiserror-impl-1.0.20 \
		thread_local-1.0.1 \
		time-0.1.43 \
		tinyvec-0.3.3 \
		tokio-0.2.22 \
		tokio-rustls-0.14.0 \
		tokio-util-0.3.1 \
		toml-0.5.6 \
		tower-service-0.3.0 \
		tracing-0.1.19 \
		tracing-core-0.1.14 \
		try-lock-0.2.3 \
		typenum-1.12.0 \
		unicase-2.6.0 \
		unicode-bidi-0.3.4 \
		unicode-normalization-0.1.13 \
		unicode-segmentation-1.6.0 \
		unicode-width-0.1.8 \
		unicode-xid-0.2.1 \
		unindent-0.1.6 \
		untrusted-0.7.1 \
		url-2.1.1 \
		uuid-0.8.1 \
		vec_map-0.8.2 \
		version_check-0.9.2 \
		walkdir-2.3.1 \
		want-0.3.0 \
		wasi-0.9.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.67 \
		wasm-bindgen-backend-0.2.67 \
		wasm-bindgen-futures-0.4.17 \
		wasm-bindgen-macro-0.2.67 \
		wasm-bindgen-macro-support-0.2.67 \
		wasm-bindgen-shared-0.2.67 \
		web-sys-0.3.44 \
		webpki-0.21.3 \
		webpki-roots-0.19.0 \
		winapi-0.2.8 \
		winapi-0.3.9 \
		winapi-build-0.1.1 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.5 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		winreg-0.7.0 \
		ws2_32-sys-0.2.1 \
		xattr-0.2.2 \
		zip-0.5.6
CARGO_BUILD=	no
CARGO_INSTALL=	no
CARGO_TARGET_DIR=	${WRKSRC}/target

# The binary is usually built via setup.py which uses different compiler flags.
# That line is patched out there to use the compiler flags from the Ports
# framework instead.  The setup.py is processed in the "do-build" target to
# install the compiled binary.
pre-build:
	${CARGO_CARGO_RUN} build \
		--manifest-path ${CARGO_CARGOTOML} \
		--verbose \
		${CARGO_BUILD_ARGS}

post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/maturin
	# Regenerate .PLIST.pymodtemp to get all installed files from
	# ${STAGEDIR} because the file that is generated in the first place
	# contains only the EGG files as a whole.
	@${FIND} ${STAGEDIR} -type f -o -type l | \
		${SORT} | ${SED} -e 's|${STAGEDIR}||' \
		> ${WRKDIR}/.PLIST.pymodtmp

.include <bsd.port.mk>