add(main): new package gomp

This commit is contained in:
T-Dynamos 2022-12-31 10:21:52 +05:30 committed by xtkoba
parent beec2b9fba
commit 18187d88a1
2 changed files with 44 additions and 0 deletions

32
packages/gomp/build.sh Normal file
View File

@ -0,0 +1,32 @@
TERMUX_PKG_HOMEPAGE=https://aditya-k2.github.io/gomp/
TERMUX_PKG_DESCRIPTION="MPD client inspired by ncmpcpp with builtin cover-art view and LastFM integration"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
_COMMIT=0c0cbbf950c84f44092dbeb70d3ae2c095b79b9e
TERMUX_PKG_VERSION=2022.12.30
TERMUX_PKG_SRCURL=git+https://github.com/aditya-K2/gomp
TERMUX_PKG_GIT_BRANCH=master
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_DEPENDS="mpd"
termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT
local version="$(git log -1 --format=%cs | sed 's/-/./g')"
if [ "$version" != "$TERMUX_PKG_VERSION" ]; then
echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\""
echo " is different from what is expected to be: \"$version\""
return 1
fi
}
termux_step_make() {
termux_setup_golang
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go build -o gomp
}
termux_step_make_install() {
install -Dm700 gomp $TERMUX_PREFIX/bin/
}

View File

@ -0,0 +1,12 @@
diff '--color=auto' -uNr gomp/config/config.go gomp.mod/config/config.go
--- gomp/config/config.go 2022-12-31 13:10:30.535490729 +0530
+++ gomp.mod/config/config.go 2022-12-31 13:11:37.414400547 +0530
@@ -113,7 +113,7 @@
func ParseMPDConfig() {
uwconf := ConfigDir + "/mpd/mpd.conf"
- swconf := "/etc/mpd.conf"
+ swconf := "@TERMUX_PREFIX@/etc/mpd.conf"
set_defaults := func(path string) {
m := conf.GenerateMap(path)
if val, ok := m["music_directory"]; ok {