aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2022-10-10 18:53:47 +0800
committerXi Ruoyao <xry111@xry111.site>2022-10-10 18:53:47 +0800
commit2020a0a18049976a5c36de3c367b89372de5671c (patch)
tree6808cb5f89ecfbd407d00c903046e2d0954684b4
parentf11dfd84f0cfe21b2aae7dd1f4c6742b81187eb8 (diff)
chapter08: add rust-bindgen
-rw-r--r--chapter08/chapter08.xml1
-rw-r--r--chapter08/rust-bindgen.xml101
-rw-r--r--packages.ent8
3 files changed, 110 insertions, 0 deletions
diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml
index cae1102dd..5febe1cc0 100644
--- a/chapter08/chapter08.xml
+++ b/chapter08/chapter08.xml
@@ -64,6 +64,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libffi.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="llvm.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="rustc.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="rust-bindgen.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kmod.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libelf.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
diff --git a/chapter08/rust-bindgen.xml b/chapter08/rust-bindgen.xml
new file mode 100644
index 000000000..c437e3a4e
--- /dev/null
+++ b/chapter08/rust-bindgen.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % general-entities SYSTEM "../general.ent">
+ %general-entities;
+]>
+
+<sect1 id="ch-system-rust-bindgen" role="wrap">
+ <?dbhtml filename="rust-bindgen.html"?>
+
+ <sect1info condition="script">
+ <productname>rust-bindgen</productname>
+ <productnumber>&rust-bindgen-version;</productnumber>
+ <address>&rust-bindgen-url;</address>
+ </sect1info>
+
+ <title>Rust-bindgen-&rust-bindgen-version;</title>
+
+ <indexterm zone="ch-system-rust-bindgen">
+ <primary sortas="a-rust-bindgen">rust-bindgen</primary>
+ </indexterm>
+
+ <sect2 role="package">
+ <title/>
+
+ <para>Rust-bindgen automatically generates Rust FFI bindings to C and
+ C++ libraries.</para>
+
+ <segmentedlist>
+ <segtitle>&buildtime;</segtitle>
+ <segtitle>&diskspace;</segtitle>
+
+ <seglistitem>
+ <seg>&rust-bindgen-fin-sbu;</seg>
+ <seg>&rust-bindgen-fin-du;</seg>
+ </seglistitem>
+ </segmentedlist>
+
+ </sect2>
+
+ <sect2 role="installation">
+ <title>Installation of Rust-bindgen</title>
+
+ <para>Build rust-bindgen with:</para>
+
+<screen><userinput remap="configure">cargo build --release</userinput></screen>
+
+ <variablelist>
+ <title>The meaning of the build option:</title>
+
+ <varlistentry>
+ <term><parameter>--release</parameter></term>
+ <listitem>
+ <para>Build this package with optimization suitable for stable
+ release. The default (<option>--debug</option>) will produce
+ unoptimized binary.</para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ <para>The testsuite needs <command>rustup</command> which is beyond the
+ scope of LFS.</para>
+
+ <para>Install the package:</para>
+
+<screen><userinput remap="install">install -vm755 target/release/bindgen /usr/bin</userinput></screen>
+
+ </sect2>
+
+ <sect2 id="contents-rust-bindgen" role="content">
+ <title>Contents of Rust-bindgen</title>
+
+ <segmentedlist>
+ <segtitle>Installed programs</segtitle>
+
+ <seglistitem>
+ <seg>bindgen</seg>
+ </seglistitem>
+ </segmentedlist>
+ <variablelist>
+ <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+ <?dbfo list-presentation="list"?>
+ <?dbhtml list-presentation="table"?>
+
+ <varlistentry id="bindgen">
+ <term><command>bindgen</command></term>
+ <listitem>
+ <para>generates Rust bindings from C/C++ headers</para>
+ <indexterm zone="ch-system-rust-bindgen bindgen">
+ <primary sortas="b-bindgen">bindgen</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </sect2>
+
+</sect1>
+
diff --git a/packages.ent b/packages.ent
index 9310d7dfd..a4ddd10ca 100644
--- a/packages.ent
+++ b/packages.ent
@@ -646,6 +646,14 @@
<!ENTITY rustc-final-sbu "21 SBU">
<!ENTITY rustc-final-du "10,000 MB">
+<!ENTITY rust-bindgen-version "0.60.1-lfs-1">
+<!ENTITY rust-bindgen-size "7,524 KB">
+<!ENTITY rust-bindgen-url "https://linuxfromscratch.org/~xry111/rust-bindgen/rust-bindgen-&rust-bindgen-version;.tar.xz">
+<!ENTITY rust-bindgen-md5 "6ade6ad51b8a5463c29ada3ddc6f23f6">
+<!ENTITY rust-bindgen-home "https://rust-lang.github.io/rust-bindgen/">
+<!ENTITY rust-bindgen-fin-du "237 MB">
+<!ENTITY rust-bindgen-fin-sbu "1.9 SBU">
+
<!ENTITY sed-version "4.8">
<!ENTITY sed-size "1,317 KB">
<!ENTITY sed-url "&gnu;sed/sed-&sed-version;.tar.xz">