iglunix/pkgs/ncspot/build.sh

55 lines
1.7 KiB
Bash
Raw Normal View History

2021-04-30 15:06:28 +00:00
pkgname=ncspot
2021-05-31 14:23:08 +00:00
pkgver=0.7.3
2021-04-30 15:06:28 +00:00
_clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
}
fetch() {
2021-05-31 14:23:08 +00:00
curl -L "https://github.com/hrkfdn/ncspot/archive/refs/tags/v$pkgver.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
2021-04-30 16:01:23 +00:00
curl -L "https://github.com/Ella-0/ncurses-rs/archive/refs/heads/master.tar.gz" -o ncurses.tar.gz
curl -L "https://github.com/Ella-0/pancurses/archive/refs/heads/master.tar.gz" -o pancurses.tar.gz
tar -xf ncurses.tar.gz
mv ncurses-rs-master ncurses
tar -xf pancurses.tar.gz
mv pancurses-master pancurses
2021-04-30 15:06:28 +00:00
tar -xf $pkgname-$pkgver.tar.gz
tar -xf rust-openssl.tar.gz
2021-04-30 16:01:23 +00:00
cp ../cursive_ptr.patch .
2021-04-30 15:06:28 +00:00
cd $pkgname-$pkgver
mkdir -p .cargo
cargo vendor > .cargo/config
2021-05-31 14:23:08 +00:00
# _clear_vendor_checksums openssl-sys
# _clear_vendor_checksums openssl
2021-04-30 16:01:23 +00:00
_clear_vendor_checksums ncurses
_clear_vendor_checksums pancurses
_clear_vendor_checksums cursive
2021-05-31 14:23:08 +00:00
# cp -r ../rust-openssl-openssl-v0.10.34/openssl/ vendor/
# cp -r ../rust-openssl-openssl-v0.10.34/openssl-sys/ vendor/
2021-04-30 16:01:23 +00:00
cp -r ../ncurses/ vendor/
cp -r ../pancurses/ vendor/
2021-05-31 14:23:08 +00:00
# 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'
2021-04-30 16:01:23 +00:00
sed vendor/ncurses/Cargo.toml -i -e 's/5.100.0/5.101.0/g'
patch -p1 < ../cursive_ptr.patch
2021-04-30 15:06:28 +00:00
}
build() {
cd $pkgname-$pkgver
2021-04-30 16:01:23 +00:00
cargo build --release --no-default-features --features cursive/pancurses-backend,alsa_backend
2021-04-30 15:06:28 +00:00
}
package() {
cd $pkgname-$pkgver
install -Dm 755 target/release/$pkgname $pkgdir/usr/bin/
}
license() {
cd $pkgname-$pkgver
cat LICENSE
# cat COPYING
}