From edaff20a96f799eb85cb56404b9a4c598e9aecdf Mon Sep 17 00:00:00 2001 From: taotieren Date: Fri, 28 Oct 2022 21:57:51 +0800 Subject: [PATCH 1/2] Add crm-git --- archlinuxcn/crm-git/.gitignore | 2 ++ archlinuxcn/crm-git/PKGBUILD | 47 ++++++++++++++++++++++++++++++++++ archlinuxcn/crm-git/lilac.yaml | 14 ++++++++++ 3 files changed, 63 insertions(+) create mode 100644 archlinuxcn/crm-git/.gitignore create mode 100644 archlinuxcn/crm-git/PKGBUILD create mode 100644 archlinuxcn/crm-git/lilac.yaml diff --git a/archlinuxcn/crm-git/.gitignore b/archlinuxcn/crm-git/.gitignore new file mode 100644 index 000000000000..37bb465dc2db --- /dev/null +++ b/archlinuxcn/crm-git/.gitignore @@ -0,0 +1,2 @@ +* +*.* diff --git a/archlinuxcn/crm-git/PKGBUILD b/archlinuxcn/crm-git/PKGBUILD new file mode 100644 index 000000000000..3efc51c3ae06 --- /dev/null +++ b/archlinuxcn/crm-git/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: taotieren + +pkgname=crm-git +pkgver=0.1.8.r16.g7d4f255 +pkgrel=1 +pkgdesc="crm (Cargo registry manager)" +arch=('any') +url="https://github.com/wtklbm/crm" +license=('MIT' 'Apache-2.0') +provides=(${pkgname%-git}) +conflicts=(${pkgname%-git}) +replaces=() +depends=('cargo') +makedepends=('git' 'rust') +backup=() +options=('!strip') +install= +source=("${pkgname%-git}::git+${url}.git") +sha256sums=('SKIP') + +pkgver() { + cd "${srcdir}/${pkgname%-git}/" + git describe --long --tags | sed 's/v//g;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { +# build crm + cd "${srcdir}/${pkgname%-git}/" + cargo build --release +} + +check() { + cd "${srcdir}/${pkgname%-git}/" + cargo test --release +} + +package() { +# install crm + install -Dm0755 "${srcdir}/${pkgname%-git}/target/release/${pkgname%-git}" "${pkgdir}/usr/share/${pkgname%-git}/${pkgname%-git}" + + install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/${pkgname%-git}" << EOF +#!/bin/env bash +cd /usr/share/${pkgname%-git}/ +./${pkgname%-git} "\$@" +EOF + +} diff --git a/archlinuxcn/crm-git/lilac.yaml b/archlinuxcn/crm-git/lilac.yaml new file mode 100644 index 000000000000..7d98440ddcb7 --- /dev/null +++ b/archlinuxcn/crm-git/lilac.yaml @@ -0,0 +1,14 @@ +maintainers: + - github: taotieren + +build_prefix: extra-x86_64 + +pre_build: vcs_update + +post_build_script: | + git_pkgbuild_commit() + update_aur_repo() + +update_on: + - source: github + github: wtklbm/crm From cd53e77a46aaa64c7d0f02d6fa34c2ece3d299f0 Mon Sep 17 00:00:00 2001 From: taotieren Date: Mon, 31 Oct 2022 16:17:27 +0800 Subject: [PATCH 2/2] Delete .gitignore --- archlinuxcn/crm-git/.gitignore | 2 -- archlinuxcn/crm-git/PKGBUILD | 25 ++++++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 archlinuxcn/crm-git/.gitignore diff --git a/archlinuxcn/crm-git/.gitignore b/archlinuxcn/crm-git/.gitignore deleted file mode 100644 index 37bb465dc2db..000000000000 --- a/archlinuxcn/crm-git/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -*.* diff --git a/archlinuxcn/crm-git/PKGBUILD b/archlinuxcn/crm-git/PKGBUILD index 3efc51c3ae06..93c4e1618282 100644 --- a/archlinuxcn/crm-git/PKGBUILD +++ b/archlinuxcn/crm-git/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: taotieren pkgname=crm-git -pkgver=0.1.8.r16.g7d4f255 +pkgver=0.2.0.r1.gcb4f0ce pkgrel=1 pkgdesc="crm (Cargo registry manager)" arch=('any') @@ -13,7 +13,7 @@ replaces=() depends=('cargo') makedepends=('git' 'rust') backup=() -options=('!strip') +options=('!strip' '!lto') install= source=("${pkgname%-git}::git+${url}.git") sha256sums=('SKIP') @@ -24,24 +24,23 @@ pkgver() { } build() { -# build crm cd "${srcdir}/${pkgname%-git}/" - cargo build --release + + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cargo build --release --all-features } check() { cd "${srcdir}/${pkgname%-git}/" - cargo test --release + + export RUSTUP_TOOLCHAIN=stable + cargo test --all-features } package() { -# install crm - install -Dm0755 "${srcdir}/${pkgname%-git}/target/release/${pkgname%-git}" "${pkgdir}/usr/share/${pkgname%-git}/${pkgname%-git}" - - install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/${pkgname%-git}" << EOF -#!/bin/env bash -cd /usr/share/${pkgname%-git}/ -./${pkgname%-git} "\$@" -EOF + cd "${srcdir}/${pkgname%-git}/" + export RUSTUP_TOOLCHAIN=stable + cargo install --no-track --all-features --root "$pkgdir/usr/" --path . }