diff options
author | Chocobo1 | 2023-03-12 17:12:16 +0800 |
---|---|---|
committer | Chocobo1 | 2023-03-12 17:16:05 +0800 |
commit | f7a9fb01375466f635267a7f0fefcb3eb683fcbb (patch) | |
tree | 0cf671cfde92d04d62593250f3a285c803351820 | |
download | aur-f7a9fb01375466f635267a7f0fefcb3eb683fcbb.tar.gz |
newpkg: utf8cpp-git 3.2.3.r1.g2ad9957-1
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 56 |
2 files changed, 71 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..eb059a142612 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = utf8cpp-git + pkgdesc = UTF-8 with C++ in a Portable Way + pkgver = 3.2.3.r1.g2ad9957 + pkgrel = 1 + url = https://github.com/nemtrif/utfcpp + arch = any + license = custom:BSL + makedepends = git + makedepends = cmake + provides = utf8cpp=3.2.3.r1.g2ad9957 + conflicts = utf8cpp + source = git+https://github.com/nemtrif/utfcpp.git + sha256sums = SKIP + +pkgname = utf8cpp-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5fa788a6071a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net> + +pkgname=utf8cpp-git +pkgver=3.2.3.r1.g2ad9957 +pkgrel=1 +pkgdesc="UTF-8 with C++ in a Portable Way" +arch=('any') +url="https://github.com/nemtrif/utfcpp" +license=('custom:BSL') +makedepends=('git' 'cmake') +provides=("utf8cpp=$pkgver") +conflicts=('utf8cpp') +source=("git+https://github.com/nemtrif/utfcpp.git") +sha256sums=('SKIP') + + +prepare() { + cd "utfcpp" + + git submodule update --init --recursive +} + +pkgver() { + cd "utfcpp" + + _tag=$(git tag -l --sort -v:refname | grep -P '^v?[\d\.]+$' | head -n1) + _rev=$(git rev-list --count $_tag..HEAD) + _hash=$(git rev-parse --short HEAD) + printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//' +} + +build() { + cd "utfcpp" + + cmake \ + -B "_build" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + ./ + make -C "_build" +} + +check() { + cd "utfcpp" + + make -C "_build" test +} + +package() { + cd "utfcpp" + + make -C "_build" DESTDIR="$pkgdir" install + install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/utf8cpp" +} + |