Skip to content

Instantly share code, notes, and snippets.

@lmartinez-mirror
Last active August 4, 2022 15:23
Show Gist options
  • Save lmartinez-mirror/2c30e8ca613206bf1093950574fd4296 to your computer and use it in GitHub Desktop.
Save lmartinez-mirror/2c30e8ca613206bf1093950574fd4296 to your computer and use it in GitHub Desktop.
google-crc32c PKGBUILD patch
diff --git a/PKGBUILD b/PKGBUILD
index ce7f715..ec9a05b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,34 +1,33 @@
# Maintainer: Morteza NourelahiAlamdari <m@0t1.me>
+# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
pkgname=google-crc32c
pkgver=1.1.2
-pkgrel=2
+pkgrel=3
pkgdesc="CRC32C implementation with support for CPU-specific acceleration instructions"
-arch=('i686' 'x86_64')
-url="https://github.com/google/crc32c/"
-license=('BSD 3-Clause')
+arch=('x86_64')
+url="https://github.com/google/crc32c"
+license=('BSD')
+depends=('gcc-libs')
makedepends=('cmake')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/google/crc32c/archive/$pkgver.tar.gz")
+provides=('libcrc32c.so')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('ac07840513072b7fcebda6e821068aa04889018f24e10e46181068fb214d7e56')
-prepare() {
- mv "crc32c-$pkgver" "$pkgname-$pkgver"
-}
-
build() {
- cd "$pkgname-$pkgver"
- cmake \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_SHARED_LIBS=yes \
- -DCRC32C_BUILD_TESTS=OFF \
- -DCRC32C_BUILD_BENCHMARKS=OFF \
- -DCMAKE_INSTALL_PREFIX="$pkgdir/usr/local" \
- -DCRC32C_USE_GLOG=OFF \
- -S . -B cmake-out
- cmake --build cmake-out -- -j ${NCPU:-4}
+ cmake \
+ -B build \
+ -S "crc32c-$pkgver" \
+ -DCMAKE_BUILD_TYPE=None \
+ -DBUILD_SHARED_LIBS=ON \
+ -DCRC32C_BUILD_TESTS=OFF \
+ -DCRC32C_BUILD_BENCHMARKS=OFF \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCRC32C_USE_GLOG=OFF
+ make -C build
}
package() {
- cd "$pkgname-$pkgver"
- cmake --build cmake-out --target install -- -j ${NCPU:-4}
+ make -C build install DESTDIR="$pkgdir"
+ install -Dm644 "crc32c-$pkgver/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment