pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/mk: Add cargo-binary.mk to handle binary rust packages.



Module Name:	pkgsrc-wip
Committed By:	ng0 <ng0%NetBSD.org@localhost>
Pushed By:	ng0
Date:		Wed Aug 21 10:18:01 2019 +0000
Changeset:	73b7726d6ccab49a7c1ca136025836ee786a0e45

Added Files:
	mk/cargo-binary.mk

Log Message:
wip/mk: Add cargo-binary.mk to handle binary rust packages.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=73b7726d6ccab49a7c1ca136025836ee786a0e45

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mk/cargo-binary.mk | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diffs:
diff --git a/mk/cargo-binary.mk b/mk/cargo-binary.mk
new file mode 100644
index 0000000000..72c9abdab4
--- /dev/null
+++ b/mk/cargo-binary.mk
@@ -0,0 +1,33 @@
+# $NetBSD$
+#
+# Common logic that can be used by packages that build rust binaries.
+#
+# Usage example:
+# TODO
+#
+#
+# TODO:
+# if openssl-* crate is included:
+#    USE_LANGUAGES+= c c++
+#    MAKE_ENV+= OPENSSL_DIR=${BUILDLINK_PREFIX.openssl:Q}
+#    .include "../../security/openssl/buildlink3.mk"
+# endif
+#
+# if PKG_DEVELOPER=yes
+#   make cargo action verbose?
+
+do-build: do-build-cargo-binary
+.PHONY: do-build-cargo-binary
+
+do-build-cargo-binary:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo build --locked --verbose --frozen --release
+
+do-install: install-cargo-binary
+.PHONY: install-cargo-binary
+
+install-cargo-binary:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo install --path . --root ${DESTDIR}${LOCALBASE}
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${RM} ${DESTDIR}${LOCALBASE}/.crates.toml
+
+.include "../../lang/rust/cargo.mk"
+.include "../../lang/rust/buildlink3.mk"


Home | Main Index | Thread Index | Old Index