Skip to content

Commit

Permalink
pixz package
Browse files Browse the repository at this point in the history
The original PKGBUILD was taken from the archlinux
  • Loading branch information
fshp committed Mar 13, 2021
1 parent 97bf817 commit a7058e1
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pixz/0001-support-windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From c3f642ad3458a293054ee4604dbc89d22af7c010 Mon Sep 17 00:00:00 2001
From: Maxim Moseychuk <[email protected]>
Date: Sat, 13 Mar 2021 05:27:15 +0300
Subject: [PATCH] support windows

---
src/cpu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/cpu.c b/src/cpu.c
index c0155ef..710732b 100644
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -1,5 +1,9 @@
-#include <unistd.h>
+#include <stdint.h>
+#include <sysinfoapi.h>

size_t num_threads(void) {
- return sysconf(_SC_NPROCESSORS_ONLN);
+ SYSTEM_INFO systemInfo;
+ GetSystemInfo(&systemInfo);
+
+ return systemInfo.dwNumberOfProcessors;
}
--
2.30.0

40 changes: 40 additions & 0 deletions pixz/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributor: Maxim Moseychuk ("fshp") <[email protected]>

pkgname=pixz
pkgver=1.0.7
pkgrel=2
pkgdesc="Parallel, indexed xz compressor"
arch=('i686' 'x86_64')
url="https://github.com/vasi/pixz"
license=('custom')
depends=('libarchive')
makedepends=('asciidoc' 'libarchive-devel')
source=(https://github.com/vasi/pixz/releases/download/v$pkgver/${pkgname}-$pkgver.tar.gz
0001-support-windows.patch)
sha256sums=('d1b6de1c0399e54cbd18321b8091bbffef6d209ec136d4466f398689f62c3b5f'
'bb8c0b7b7daaa776f84e5b2f7d5f70f283b9f434681973a4b779ffdb842a29a8')

prepare() {
cd ${srcdir}/${pkgname}-$pkgver

patch -p1 -i ${srcdir}/0001-support-windows.patch
}

build() {
cd ${srcdir}/${pkgname}-${pkgver}

manpage=true ./configure \
--prefix=/usr \
--build=${CHOST}

make
}

package() {
cd ${srcdir}/${pkgname}-${pkgver}

make DESTDIR="${pkgdir}" install

install -Dm644 "${srcdir}"/${pkgname}-${pkgver}/LICENSE \
${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

0 comments on commit a7058e1

Please sign in to comment.