diff options
author | Daniel Peukert | 2021-12-12 15:06:09 +0100 |
---|---|---|
committer | Daniel Peukert | 2021-12-12 15:06:09 +0100 |
commit | 63d3c8fdbcc1b85ba51e282fe263ed12ef3d6bf7 (patch) | |
tree | e6e3904c72a7d5bb52d25002dca0f8fce31cea18 | |
parent | 08cc545c9469a341dc7a8cb9c33a2e0e1e1bbc5a (diff) | |
download | aur-63d3c8fdbcc1b85ba51e282fe263ed12ef3d6bf7.tar.gz |
Devendor weatherspect
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | devendor.diff | 193 |
3 files changed, 215 insertions, 12 deletions
@@ -1,17 +1,21 @@ pkgbase = weatherspect pkgdesc = A virtual weather environment in ASCII pkgver = 2.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/AnotherFoxGuy/weatherspect arch = any license = GPL2 depends = perl + depends = perl-compass-points + depends = perl-json depends = perl-term-animation - source = weatherspect-2.0-1::https://github.com/AnotherFoxGuy/weatherspect/raw/2.0/weatherspect - source = weatherspect-2.0-1.diff::https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff + source = weatherspect-2.0-2::https://github.com/AnotherFoxGuy/weatherspect/raw/2.0/weatherspect + source = weatherspect-2.0-2.diff::https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff + source = devendor.diff source = weatherspect.1 - sha256sums = e4ddd43d566a98b1d2ec136bf613f22f689ef2938479e23ca0082b84ebd6247c - sha256sums = b8685b9d4e9552d538b68aa31400d0970d4e4ffa0eeda981d9fde32210a2ba5a - sha256sums = 8b0d7bb995e44190cc005ec3b604f147dcb233744a262cbbf9a9ad8f9214ab0c + sha512sums = 39c277f933f9764df11ff6267bbf3dbd322a1fa83404190417c5e022dae0bf1b8f5d35b363759da5a2aaa1959c61f3f50315c8cf72abe7965aafb7190b5e7c60 + sha512sums = 8102f7f325d5979ff78f721507aa0e7623a990fa73d311eebb3ba394945d42819ae91e7af5952fbf34373bff49da4e97afbe84a17b5e3e0f0159f9ea825cb686 + sha512sums = 10e416693897551d3ab11b81f0a4d2d9df71957dd4b8abd780d9a09473d7fa7846867178760f95c5502c5fac3ee4089185ccf0edf8b1c937f17ffec32b530ca3 + sha512sums = 494dcc31151912ae6965a6c7f6323f1c3fbfa01f1eadc72838e605917ab6a4df4aba95aab2a891070eb928817b35240eecfa3d6a4fc285ff8a4e729044968caa pkgname = weatherspect @@ -1,26 +1,32 @@ -# Maintainer: Daniel Peukert <dan.peukert@gmail.com> +# Maintainer: Daniel Peukert <daniel@peukert.cc> # Contributor: Kevin MacMartin <prurigro at gmail dot com> # Contributor: Lara Maia <lara@craft.net.br> # Contributor: archlinux.info:tdy pkgname='weatherspect' pkgver='2.0' -pkgrel='1' +pkgrel='2' pkgdesc='A virtual weather environment in ASCII' arch=('any') url="https://github.com/AnotherFoxGuy/$pkgname" license=('GPL2') -depends=('perl' 'perl-term-animation') +depends=('perl' 'perl-compass-points' 'perl-json' 'perl-term-animation') source=( "$pkgname-$pkgver-$pkgrel::$url/raw/$pkgver/$pkgname" "$pkgname-$pkgver-$pkgrel.diff::$url/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff" + 'devendor.diff' "$pkgname.1" ) -sha256sums=('e4ddd43d566a98b1d2ec136bf613f22f689ef2938479e23ca0082b84ebd6247c' - 'b8685b9d4e9552d538b68aa31400d0970d4e4ffa0eeda981d9fde32210a2ba5a' - '8b0d7bb995e44190cc005ec3b604f147dcb233744a262cbbf9a9ad8f9214ab0c') +sha512sums=('39c277f933f9764df11ff6267bbf3dbd322a1fa83404190417c5e022dae0bf1b8f5d35b363759da5a2aaa1959c61f3f50315c8cf72abe7965aafb7190b5e7c60' + '8102f7f325d5979ff78f721507aa0e7623a990fa73d311eebb3ba394945d42819ae91e7af5952fbf34373bff49da4e97afbe84a17b5e3e0f0159f9ea825cb686' + '10e416693897551d3ab11b81f0a4d2d9df71957dd4b8abd780d9a09473d7fa7846867178760f95c5502c5fac3ee4089185ccf0edf8b1c937f17ffec32b530ca3' + '494dcc31151912ae6965a6c7f6323f1c3fbfa01f1eadc72838e605917ab6a4df4aba95aab2a891070eb928817b35240eecfa3d6a4fc285ff8a4e729044968caa') prepare() { cd "$srcdir/" + + # Devendor perl-compass-points + patch --follow-symlinks --forward -p1 "$pkgname-$pkgver-$pkgrel" < 'devendor.diff' + # https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58 patch --follow-symlinks --forward -p1 "$pkgname-$pkgver-$pkgrel" < "$pkgname-$pkgver-$pkgrel.diff" } diff --git a/devendor.diff b/devendor.diff new file mode 100644 index 000000000000..3d2a66dfa84a --- /dev/null +++ b/devendor.diff @@ -0,0 +1,193 @@ +diff --git a/weatherspect b/weatherspect +index 1e98fe7..76f615b 100644 +--- a/weatherspect ++++ b/weatherspect +@@ -44,6 +44,8 @@ + ############################################################################# + + use Term::Animation 2.5; ++use Compass::Points; ++use JSON; + + use Curses; + use Data::Dumper; +@@ -5227,179 +5229,3 @@ Copyright (C) 2018 Edgar (Edgar@AnotherFoxGuy). All rights reserved. Use is su + 1; + + } +- +- +-# From http://search.cpan.org/~janus/Compass-Points-0.02/lib/Compass/Points.pm +-BEGIN{ +-package Compass::Points; +- +-use strict; +-use warnings; +- +-our $VERSION = "0.02"; +- +-our @FIELDS = qw( abbr name ); +-our @NAMES = ( +- [ N => "North" ], +- [ NbE => "North by east" ], +- [ NNE => "North-northeast" ], +- [ NEbN => "Northeast by north" ], +- [ NE => "Northeast" ], +- [ NEbE => "Northeast by east" ], +- [ ENE => "East-northeast" ], +- [ EbN => "East by north" ], +- [ E => "East" ], +- [ EbS => "East by south" ], +- [ ESE => "East-southeast" ], +- [ SEbE => "Southeast by east" ], +- [ SE => "Southeast" ], +- [ SEbS => "Southeast by south" ], +- [ SSE => "South-southeast" ], +- [ SbE => "South by east" ], +- [ S => "South" ], +- [ SbW => "South by west" ], +- [ SSW => "South-southwest" ], +- [ SWbS => "Southwest by south" ], +- [ SW => "Southwest" ], +- [ SWbW => "Southwest by west" ], +- [ WSW => "West-southwest" ], +- [ WbS => "West by south" ], +- [ W => "West" ], +- [ WbN => "West by north" ], +- [ WNW => "West-northwest" ], +- [ NWbW => "Northwest by west" ], +- [ NW => "Northwest" ], +- [ NWbN => "Northwest by north" ], +- [ NNW => "North-northwest" ], +- [ NbW => "North by west" ], +-); +-our @GROUP; # separate groups to assign different degree values +-our @INDEX; # index per group +-our @MAP; # mapping for easy access +- +-for my $n ( 0 .. 3 ) { +- my $slice = 360 / ( 2 ** ( 2 + $n ) ); # 90, 45, 22.5, 11.25 +- my $mod = 2 ** ( 3 - $n ); # 8, 4, 2, 1 +- my @offs = grep $_ % $mod == 0, 0 .. $#NAMES; # 0,8,16,24 0,4,8,12,... +- +- $GROUP[ $n ] = bless( [], __PACKAGE__ ); +- +- for my $m ( 0 .. $#offs ) { +- my @entry = @{ $NAMES[ $offs[ $m ] ] }; +- +- for my $key ( map lc, @entry ) { +- $key =~ s![^a-z]!!g; +- +- $INDEX[ $n ]{ $key } = \@entry; +- } +- +- $entry[ 2 ] = $m * $slice; +- +- $GROUP[ $n ][ $m ] = \@entry; +- } +- +- $MAP[ $_ ] = $n for @MAP .. $#offs; +-} +- +-sub new +-{ +- my $class = shift; +- my $number = shift || 16; +- +- $number = @{ $GROUP[ $#GROUP ] } +- if $number > @{ $GROUP[ $#GROUP ] }; +- +- return $GROUP[ $MAP[ $number - 1 ] ]; +-} +- +-for my $offset ( 0 .. $#FIELDS ) { +- my $deg2sub = "deg2$FIELDS[ $offset ]"; +- my $sub2deg = "$FIELDS[ $offset ]2deg"; +- +- no strict qw( refs ); +- +- *$deg2sub = sub { +- my $self = shift; +- my $deg = abs( shift || 0 ); +- +- $deg -= 360 while $deg > 360; +- +- my $slice = 360 / @$self; +- my $index = ( $deg + $slice / 2 ) / $slice; +- +- return $self->[ $index ][ $offset ]; +- }; +- +- *$sub2deg = sub { +- my $self = shift; +- my $key = lc( shift || "" ); +- my $index = $INDEX[ $MAP[ @$self - 1 ] ]; +- +- $key =~ s![^a-z]!!g; +- +- return exists( $index->{ $key } ) +- ? $index->{ $key }[ 2 ] +- : undef +- ; +- }; +-} +- +-1; +- +-=head1 NAME +- +-Compass::Points - Convert between compass point names, abbreviations and values +- +-=head1 SYNOPSIS +- +- use Compass::Points; +- my $points = Compass::Points->new(); +- my $deg = $points->abbr2deg( "NNE" ); +- +-=head1 DESCRIPTION +- +-This module converts compass point names and abbreviations to degrees +-and vice versa. +-It supports four different compass point systems: 4, 8, 16 and 32. +-The default is 16 and can be used for wind compass usage. +- +-=head1 METHODS +- +-=head2 new( [ $points ] ) +- +-Returns a Compass::Points object for the number of points (defaults to 16). +- +-=head2 deg2abbr( $degree ) +- +-Takes a degree value and returns the corresponding abbreviation for the +-matching wind name. +- +-=head2 deg2name( $degree ) +- +-Same as deg2abbr() but returns the full wind name. +- +-=head2 abbr2deg( $abbreviation ) +- +-Given a wind name abbreviation returns the degree of the points object. +- +-=head2 name2deg( $name ) +- +-Same as abbr2deg() but takes full wind names. +- +-=head1 SEE ALSO +- +-L<http://en.wikipedia.org/wiki/Points_of_the_compass> +- +-=head1 AUTHOR +- +-Simon Bertrang, E<lt>janus@cpan.orgE<gt> +- +-=head1 COPYRIGHT AND LICENSE +- +-Copyright (C) 2014 by Simon Bertrang +- +-This library is free software; you can redistribute it and/or modify +-it under the same terms as Perl itself. +- +-=cut +-} |