repology integration and ncspot fixes

This commit is contained in:
Ella-0 2021-04-30 16:06:28 +01:00
parent df548c4eca
commit 999c4bd350
3 changed files with 61 additions and 0 deletions

40
pkgs/ncspot/build.sh Normal file
View file

@ -0,0 +1,40 @@
pkgname=ncspot
pkgver=0.6.0
_clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
}
fetch() {
curl -L "https://github.com/hrkfdn/ncspot/archive/refs/tags/v0.6.0.tar.gz" -o $pkgname-$pkgver.tar.gz
curl -L "https://github.com/sfackler/rust-openssl/archive/refs/tags/openssl-v0.10.34.tar.gz" -o rust-openssl.tar.gz
tar -xf $pkgname-$pkgver.tar.gz
tar -xf rust-openssl.tar.gz
cd $pkgname-$pkgver
mkdir -p .cargo
cargo vendor > .cargo/config
_clear_vendor_checksums openssl-sys
_clear_vendor_checksums openssl
cp -r ../rust-openssl-openssl-v0.10.34/openssl/ vendor/
cp -r ../rust-openssl-openssl-v0.10.34/openssl-sys/ vendor/
sed vendor/openssl/Cargo.toml -i -e 's/0.10.34/0.10.33/g'
sed vendor/openssl/Cargo.toml -i -e 's/0.9.62/0.9.61/g'
sed vendor/openssl-sys/Cargo.toml -i -e 's/0.9.62/0.9.61/g'
}
build() {
cd $pkgname-$pkgver
cargo build --release --no-default-features --features termion_backend,alsa_backend
}
package() {
cd $pkgname-$pkgver
install -Dm 755 target/release/$pkgname $pkgdir/usr/bin/
}
license() {
cd $pkgname-$pkgver
cat LICENSE
# cat COPYING
}

16
repover.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
REPO_VER=$(curl "https://repology.org/project/$1/history" 2>/dev/null | grep "version-newest" | tr '>' ' ' | tr '<' ' ' | awk '{ print $5; }' | head -n1)
REPO_MAJOR=$(echo $REPO_VER | tr '.' ' ' | awk '{ print $1; }')
REPO_MINOR=$(echo $REPO_VER | tr '.' ' ' | awk '{ print $2; }')
REPO_MICRO=$(echo $REPO_VER | tr '.' ' ' | awk '{ print $3; }')
LOCAL_VER=$(cat pkgs/$1/build.sh | grep 'pkgver=' | tr '=' ' ' | awk '{ print $2; }')
LOCAL_MAJOR=$(echo $LOCAL_VER | tr '.' ' ' | awk '{ print $1; }')
LOCAL_MINOR=$(echo $LOCAL_VER | tr '.' ' ' | awk '{ print $2; }')
LOCAL_MICRO=$(echo $LOCAL_VER | tr '.' ' ' | awk '{ print $3; }')
echo "Remote Version:" $REPO_VER >&2
echo "Local Version:" $LOCAL_VER >&2
echo $REPO_VER

5
updatever.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
NVER=$(./repover.sh $1)
TMP=$(mktemp)
sed 's/pkgver=.*/pkgver='$NVER'/g' pkgs/$1/build.sh > $TMP
mv $TMP pkgs/$1/build.sh