Commit 2c2f262088

2c2f26208856a7b79b31a8c92196b20b053b7fa7

parent: 14947a0691

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-11 16:28 UTC

updates pkgbuild

Layout: unified · split

PKGBUILD +33 −12
@@ -1,29 +1,43 @@
11# Maintainer: Wraient <rushikeshwastaken@gmail.com>
22pkgname='curd'
3pkgver='r86.2ccc8b0'
4pkgrel=1
3pkgver=r92.d2c2c15
4pkgrel=5
55pkgdesc="Watch anime in cli with Anilist Tracking, Discord RPC, Intro Outro Skipping, etc."
66arch=("x86_64")
77url="https://github.com/Wraient/curd"
88license=('GPL')
99depends=('python' 'mpv' 'socat')
10makedepends=('python-pip')
11source=("https://raw.githubusercontent.com/Wraient/curd/refs/heads/main/curd.py")
10makedepends=('git' 'python-pip')
11source=("git+$url.git")
1212sha256sums=('SKIP')
1313
14pkgver() {
15 cd "$srcdir/$pkgname"
16 # Use the number of commits and the short hash as the version number
17 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
18}
19
20build() {
21 # No compilation needed for a Python script
22 return 0
23}
24
1425package() {
15 # Create the directory for the virtual environment
16 install -dm755 "$pkgdir/usr/share/curd"
26 # Create the directory for the virtual environment and script
27 install -dm755 "$pkgdir/usr/share/$pkgname"
1728
18 # Create a virtual environment
19 python -m venv "$pkgdir/usr/share/curd/venv"
29 # Check if the virtual environment already exists, if not, create it
30 if [ ! -d "$pkgdir/usr/share/$pkgname/venv" ]; then
31 python -m venv "$pkgdir/usr/share/$pkgname/venv"
32 fi
2033
21 # Install pypresence in the virtual environment
22 "$pkgdir/usr/share/curd/venv/bin/pip" install pypresence requests
34 # Install or update packages in the virtual environment
35 "$pkgdir/usr/share/$pkgname/venv/bin/pip" install --upgrade pypresence requests
2336
2437 # Install the Python script
25 install -Dm755 "$srcdir/curd.py" "$pkgdir/usr/bin/curd.py"
38 install -Dm755 "$srcdir/$pkgname/curd.py" "$pkgdir/usr/share/$pkgname/curd.py"
2639
40 install -Dm755 /dev/null "$pkgdir/usr/bin/curd"
2741 # Create the run script
2842 cat << 'EOF' > "$pkgdir/usr/bin/curd"
2943#!/bin/bash
@@ -31,11 +45,17 @@ package() {
3145# Path to the virtual environment
3246VENV_DIR="/usr/share/curd/venv"
3347
48# Check if the virtual environment exists, create if not
49if [ ! -d "$VENV_DIR" ]; then
50 python -m venv "$VENV_DIR"
51 "$VENV_DIR/bin/pip" install pypresence requests
52fi
53
3454# Activate the virtual environment
3555source "$VENV_DIR/bin/activate"
3656
3757# Run the Python script
38python /usr/bin/curd.py
58python /usr/share/curd/curd.py "$@"
3959
4060# Deactivate the virtual environment after running
4161deactivate
@@ -44,3 +64,4 @@ EOF
4464 # Make the run script executable
4565 chmod +x "$pkgdir/usr/bin/curd"
4666}
67