diff options
author | Max Harmathy | 2019-09-23 15:50:35 +0200 |
---|---|---|
committer | Max Harmathy | 2019-10-29 08:51:45 +0100 |
commit | 933d4652a617bc4c5de6be57fa79e939bce03c8e (patch) | |
tree | ce66f80e53836a782e442a0d25e807abf6c2c2e2 | |
parent | 21eff3e9b10ad2737f49d8fd15731f854854ced2 (diff) | |
download | aur-933d4652a617bc4c5de6be57fa79e939bce03c8e.tar.gz |
Remove dependency to Sys::CpuAffinity
The dependency to Sys::CpuAffinity module was introduced to upstream
for performance reasons. However this module isn't packaged for Arch
yet. This patch can be dropped, when perl-sys-cpuaffinity is available.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | remove-sys-cpuaffinity-dep.patch | 26 |
3 files changed, 36 insertions, 2 deletions
@@ -16,7 +16,9 @@ pkgbase = pristine-tar depends = xz conflicts = pristine-tar-git source = http://ftp.debian.org/debian/pool/main/p/pristine-tar/pristine-tar_1.47.tar.xz + source = remove-sys-cpuaffinity-dep.patch sha256sums = 97e5ddcc3e59f7956c9ace6b73beebb8854411c2978a9c106c806696a509a2a1 + sha256sums = 0c7a2f1c941c7f3b9acb7219822ffda62df8beea5059f8ccc403a43d6cb83b52 pkgname = pristine-tar @@ -20,12 +20,18 @@ depends=( ) conflicts=('pristine-tar-git') checkdepends=('shunit2' 'diffoscope') -source=(http://ftp.debian.org/debian/pool/main/p/${pkgname}/${pkgname}_${pkgver}.tar.xz) -sha256sums=('97e5ddcc3e59f7956c9ace6b73beebb8854411c2978a9c106c806696a509a2a1') +source=( + http://ftp.debian.org/debian/pool/main/p/${pkgname}/${pkgname}_${pkgver}.tar.xz + remove-sys-cpuaffinity-dep.patch +) +sha256sums=('97e5ddcc3e59f7956c9ace6b73beebb8854411c2978a9c106c806696a509a2a1' + '0c7a2f1c941c7f3b9acb7219822ffda62df8beea5059f8ccc403a43d6cb83b52') build() { cd "$srcdir/$pkgname-$pkgver" + patch -p1 < "$startdir/remove-sys-cpuaffinity-dep.patch" + export PATH=/usr/bin/core_perl:$PATH perl Makefile.PL diff --git a/remove-sys-cpuaffinity-dep.patch b/remove-sys-cpuaffinity-dep.patch new file mode 100644 index 000000000000..f4cb22066c2b --- /dev/null +++ b/remove-sys-cpuaffinity-dep.patch @@ -0,0 +1,26 @@ +--- a/pristine-xz ++++ b/pristine-xz +@@ -80,7 +80,6 @@ use Pristine::Tar::Delta; + use Pristine::Tar::Formats; + use File::Basename qw/basename/; + use IO::Handle; +-use Sys::CpuAffinity; + + my @supported_xz_programs = qw(xz pixz); + +@@ -255,12 +254,9 @@ sub predict_xz_args { + # xz writes sizes in block headers if and only if run with multiple threads + # (even when --block-size or --block-list is specified) + if ($xz->{summary}->{size_in_blocks} eq 'yes') { +- # All -T values >1 produce the same output. +- # 0 behaves the same as 1 on single core systems. +- # Use as many threads as we have CPU affinities, with a minimum of 2. +- my @affinities = Sys::CpuAffinity::getAffinity($$); +- my $threads = @affinities > 2 ? @affinities : 2; +- push @$common, "-T$threads"; ++ # Note: All values >1 produce the same output. ++ # Careful, 0 behaves the same as 1 on single core systems. ++ push @$common, '-T2' + } + } + my $possible_args = []; |