Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new package] sd 1.0.0 #19684

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions mingw-w64-sd/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Maintainer: Maksim Bondarenkov <[email protected]>

_realname=sd
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.0
pkgrel=1
pkgdesc="Intuitive find & replace CLI (sed alternative) (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/chmln/sd'
msys2_references=(
'archlinux: sd'
)
license=('spdx:MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-rust")
options=('!strip' '!lto') # it's done at build stage
source=("https://github.com/chmln/sd/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('2adc1dec0d2c63cbffa94204b212926f2735a59753494fca72c3cfe4001d472f')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"

local _target="${CARCH}-pc-windows-gnu"
if [[ $MINGW_PACKAGE_PREFIX == *-clang-aarch64 ]]; then
_target="${CARCH}-pc-windows-gnullvm"
fi
cargo fetch --locked --target "${_target}"
}

build() {
cd "${srcdir}/${_realname}-${pkgver}"

cargo build --release --frozen
}

check() {
cd "${srcdir}/${_realname}-${pkgver}"

cargo test --release --frozen
}

package() {
cd "${srcdir}/${_realname}-${pkgver}"

cargo install \
--offline \
--no-track \
--frozen \
--path . \
--root "${pkgdir}${MINGW_PREFIX}"

install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
install -Dm644 gen/sd.1 "${pkgdir}${MINGW_PREFIX}/share/man/man1/sd.1"
install -Dm644 gen/completions/sd.bash "${pkgdir}${MINGW_PREFIX}/share/bash-completion/completions/sd"
install -Dm644 gen/completions/_sd "${pkgdir}${MINGW_PREFIX}/share/zsh/site-functions/_sd"
install -Dm644 gen/completions/sd.fish "${pkgdir}${MINGW_PREFIX}/share/fish/vendor_completions.d/sd.fish"
}