ZettaScript / cargo-arch

cargo subcommand to generate Arch Linux package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cargo-arch - generate Arch Linux packages from information in Cargo.toml

cargo-arch will generate PKGBUILD from information in Cargo.toml. You can add extra information in [package.metadata.arch] sections, options can be found by man PKGBUILD.

Documentation

From crate.io

$ cargo install cargo-arch

From GitHub

$ cargo install --git https://github.com/wdv4758h/cargo-arch

Download Prebuilt Binary

# by curl
$ curl -O -J -L https://github.com/wdv4758h/cargo-arch/releases/download/v0.1.2/cargo-arch-v0.1.2-x86_64-unknown-linux-gnu.tar.gz

# by wget
$ wget https://github.com/wdv4758h/cargo-arch/releases/download/v0.1.2/cargo-arch-v0.1.2-x86_64-unknown-linux-gnu.tar.gz
$ cargo arch --help
cargo-arch 0.1.2
Chiu-Hsiang Hsu <wdv4758h@gmail.com>
Rust Arch Linux package packer

USAGE:
    cargo arch [FLAGS] [OPTIONS]

FLAGS:
    -f, --force        Overwrite existing package
    -h, --help         Prints help information
    -i, --install      Install package after successful build
        --mksrcinfo    Run mksrcinfo
    -s, --syncdeps     Install missing dependencies with pacman
    -V, --version      Prints version information

OPTIONS:
    -b, --build <build>    whether build the source [default: true]  [possible values: true, false]
$ cargo arch
==> Making package: cargo-arch 0.1.2-1 (Sun 06 Jan 2019 10:14:40 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> Extracting sources...
==> Starting pkgver()...
==> Updated version: cargo-arch 0.1.2.r0.gadea8ab-1
==> Removing existing $pkgdir/ directory...
==> Starting build()...
   Compiling proc-macro2 v0.4.24
   Compiling unicode-xid v0.1.0
   Compiling serde v1.0.84
   Compiling unicode-width v0.1.5
   Compiling libc v0.2.15
   Compiling vec_map v0.8.1
   Compiling yaml-rust v0.3.5
   Compiling strsim v0.7.0
   Compiling ansi_term v0.11.0
   Compiling bitflags v1.0.4
   Compiling textwrap v0.10.0
   Compiling atty v0.2.11
   Compiling clap v2.32.0
   Compiling quote v0.6.10
   Compiling syn v0.15.24
   Compiling toml v0.4.10
   Compiling serde_derive v1.0.84
   Compiling cargo-arch v0.1.1 (/home/user/cargo-arch)
    Finished release [optimized] target(s) in 1m 48s
==> Entering fakeroot environment...
==> Starting package()...
  Installing cargo-arch v0.1.2 (/home/user/cargo-arch)
    Finished release [optimized] target(s) in 0.06s
  Installing /home/user/cargo-arch/pkg/cargo-arch/bin/cargo-arch
warning: be sure to add `/home/user/cargo-arch/pkg/cargo-arch/bin` to your PATH to be able to run the installed binaries
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "cargo-arch"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: cargo-arch 0.1.2.r0.gadea8ab-1 (Sun 06 Jan 2019 10:14:41 PM CST)
  • Use "/usr" instead of "/" as install base
  • Change to use serde instead of rustc-serialize
  • Update PKGBUILD template to remove .crates.toml
  • Update toml to use serde API
  • Update clap version
  • support building Arch Linux packages

I've only tested on my x86_64 Linux. Other platforms are built by CI. If they don't work properly, please tell me.

  1. update version in src/arguments.yml
  2. update version in Cargo.toml
  3. update version in Cargo.lock
  4. add git tag

cargo-arch is licensed under the Apache-2.0 License - see the LICENSE file for details

About

cargo subcommand to generate Arch Linux package

License:Apache License 2.0


Languages

Language:Rust 86.0%Language:Shell 11.4%Language:PowerShell 2.6%