diff options
author | selpats | 2022-03-19 23:06:30 +0400 |
---|---|---|
committer | selpats | 2022-03-19 23:06:30 +0400 |
commit | 24193ca81d7ed41165a9de0c2472bdf674c25203 (patch) | |
tree | ed69546aa4cf343a56fde7231ae91b1ea9329c91 | |
parent | bfa15c50b2d9d726ffc674aacb6e4549dc2e828e (diff) | |
download | aur-24193ca81d7ed41165a9de0c2472bdf674c25203.tar.gz |
fix
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | binary-path.patch | 26 | ||||
-rw-r--r-- | binary_path.patch | 11 |
5 files changed, 69 insertions, 31 deletions
@@ -1,12 +1,16 @@ pkgbase = mpv-discord-git pkgdesc = A cross-platform Discord Rich Presence integration for mpv pkgver = 1.6.1.r0.g861bfe5 - pkgrel = 1 + pkgrel = 2 url = https://github.com/tnychn/mpv-discord - arch = any + arch = x86_64 license = MIT + depends = mpv depends = luajit - source = git+https://github.com/tnychn/mpv-discord.git + depends = go>=1.15 + source = mpv-discord::git+https://github.com/tnychn/mpv-discord.git + source = binary-path.patch sha256sums = SKIP + sha256sums = 11d99f7c9781eeffe1bf6419ed65a985ac1ce19bf813ffe6ef63e38f53951667 pkgname = mpv-discord-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..7334925ab911 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* +!.gitignore +!.SRCINFO +!PKGBUILD +!*.patch @@ -1,31 +1,45 @@ # Maintainer: selpast <selpast@pm.me> +# Maintainer: mochaaP <aur@mochaa.ws> + _pkgbase=mpv-discord pkgname=$_pkgbase-git pkgver=1.6.1.r0.g861bfe5 -pkgrel=1 +pkgrel=2 pkgdesc='A cross-platform Discord Rich Presence integration for mpv' -url='https://github.com/tnychn/mpv-discord' -arch=('any') -license=(MIT) -depends=(luajit) -source=(git+${url}.git) -sha256sums=(SKIP) +url="https://github.com/tnychn/${_pkgbase}" +arch=($CARCH) +license=('MIT') +depends=('mpv' 'luajit' 'go>=1.15') +source=(${_pkgbase}::git+${url}.git + 'binary-path.patch') +sha256sums=('SKIP' + '11d99f7c9781eeffe1bf6419ed65a985ac1ce19bf813ffe6ef63e38f53951667') pkgver() { - cd $_pkgbase + cd ${srcdir}/${_pkgbase} git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { - cd $srcdir/$_pkgbase/script-opts - patch --forward --input="${srcdir}/../binary_path.patch" + cd ${srcdir} + patch -p1 -d ${_pkgbase} < binary-path.patch + mkdir -p build/ +} + +build() { + cd ${srcdir}/${_pkgbase}/${_pkgbase} + + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -o build/$_pkgbase . } package() { - cd $srcdir/$_pkgbase - mkdir -p $pkgdir/etc/mpv/scripts/ - mkdir -p $pkgdir/etc/mpv/script-opts/ - mkdir -p $pkgdir/usr/lib/mpv-discord/ - install -Dm644 "scripts/discord.lua" "${pkgdir}/etc/mpv/scripts/" - install -Dm644 "script-opts/discord.conf" "${pkgdir}/etc/mpv/script-opts/" - install -Dm644 "bin/linux/mpv-discord" "${pkgdir}/usr/lib/mpv-discord/" + cd ${srcdir}/${_pkgbase} + + install -Dm644 scripts/discord.lua "$pkgdir"/usr/share/mpv/scripts/discord.lua + install -Dm644 script-opts/discord.conf "$pkgdir"/usr/share/doc/$_pkgbase/discord.conf + install -Dm755 $_pkgbase/build/$_pkgbase "$pkgdir"/usr/lib/$_pkgbase/$_pkgbase } diff --git a/binary-path.patch b/binary-path.patch new file mode 100644 index 000000000000..6e078bf9e7c6 --- /dev/null +++ b/binary-path.patch @@ -0,0 +1,26 @@ +diff --git a/script-opts/discord.conf b/script-opts/discord.conf +index d69c102..f867bd5 100644 +--- a/script-opts/discord.conf ++++ b/script-opts/discord.conf +@@ -1,7 +1,7 @@ + key=D + active=yes + client_id=737663962677510245 +-binary_path= ++binary_path=/usr/lib/mpv-discord/mpv-discord + socket_path=/tmp/mpvsocket + use_static_socket_path=yes + autohide_threshold=0 +diff --git a/scripts/discord.lua b/scripts/discord.lua +index e7d5046..5046a08 100644 +--- a/scripts/discord.lua ++++ b/scripts/discord.lua +@@ -6,7 +6,7 @@ + key = "D", + active = true, + client_id = "737663962677510245", +- binary_path = "", ++ binary_path = "/usr/lib/mpv-discord/mpv-discord", + socket_path = "/tmp/mpvsocket", + use_static_socket_path = true, + autohide_threshold = 0, diff --git a/binary_path.patch b/binary_path.patch deleted file mode 100644 index 3cac3c5c86ec..000000000000 --- a/binary_path.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- discord.conf 2022-03-09 14:21:59.949510578 +0400 -+++ discord.conf 2022-03-09 14:27:07.542841948 +0400 -@@ -1,7 +1,7 @@ - key=D - active=yes - client_id=737663962677510245 --binary_path= -+binary_path=/usr/lib/mpv-discord/mpv-discord - socket_path=/tmp/mpvsocket - use_static_socket_path=yes - autohide_threshold=0 |