glfs/general/prog/cbindgen.xml
2023-09-17 12:33:22 -05:00

145 lines
3.8 KiB
XML

<?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;
<!ENTITY cbindgen-download-http "https://github.com/mozilla/cbindgen/archive/v&cbindgen-version;/cbindgen-&cbindgen-version;.tar.gz">
<!ENTITY cbindgen-download-ftp " ">
<!ENTITY cbindgen-md5sum "f3ef70691bc4743b8f76ca6d27847ba4">
<!ENTITY cbindgen-size "216 KB">
<!ENTITY cbindgen-buildsize "121 MB (add 600 MB for tests)">
<!ENTITY cbindgen-time "0.5 SBU (add 0.4 SBU for tests), both on a 4-core machine">
]>
<sect1 id="cbindgen" xreflabel="Cbindgen-&cbindgen-version;">
<?dbhtml filename="cbindgen.html"?>
<title>Cbindgen-&cbindgen-version;</title>
<indexterm zone="cbindgen">
<primary sortas="a-cbindgen">cbindgen</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to Cbindgen</title>
<para>
<application>Cbindgen</application> can be used to generate C bindings for
<application>Rust</application> code.
</para>
&lfs120_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&cbindgen-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&cbindgen-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &cbindgen-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &cbindgen-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &cbindgen-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &cbindgen-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">cbindgen Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="rust"/>
</para>
&build-use-internet;
</sect2>
<sect2 role="installation">
<title>Installation of cbindgen</title>
<para>
Install <application>cbindgen</application> by running the following
commands:
</para>
<screen><userinput>cargo build --release</userinput></screen>
<para>
To test the results, issue: <command>cargo test</command>.
Three tests in <filename>profile.rs</filename> are known to fail.
</para>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>install -Dm755 target/release/cbindgen /usr/bin/</userinput></screen>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Program</segtitle>
<segtitle>Installed Library</segtitle>
<segtitle>Installed Directory</segtitle>
<seglistitem>
<seg>
cbindgen
</seg>
<seg>
none
</seg>
<seg>
none
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="cbindgen-prog">
<term><command>cbindgen</command></term>
<listitem>
<para>
generates C bindings for <application>Rust</application> code
</para>
<indexterm zone="cbindgen cbindgen-prog">
<primary sortas="b-cbindgen">cbindgen</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>