~alpine/aports

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2

[PATCH] community/prometheus: overhaul APKBUILD

Details
Message ID
<20211224084639.27324-1-sir@cmpwn.com>
DKIM signature
missing
Download raw message
Patch: +12 -22
Upstream made some changes to their build process which I hadn't had
time to address. This updates the build process to be more similar to
what they use upstream.
---
 community/prometheus/APKBUILD | 34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

diff --git a/community/prometheus/APKBUILD b/community/prometheus/APKBUILD
index 07d14f7350..96bbc22f92 100644
--- a/community/prometheus/APKBUILD
+++ b/community/prometheus/APKBUILD
@@ -4,12 +4,11 @@ pkgver=2.32.1
pkgrel=0
pkgdesc="The Prometheus monitoring system and time series database"
url="https://github.com/prometheus/prometheus"
# mips64 and riscv64 blocked by nodejs -> yarn
arch="all !mips64 !riscv64"
arch="all"
license="Apache-2.0"
options="!check" # Broken by integrations we don't care about
install="prometheus.pre-install"
makedepends="go npm yarn bash"
makedepends="go npm bash"
options="!check"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/prometheus/prometheus/archive/v$pkgver.tar.gz
	prometheus.initd
@@ -21,33 +20,24 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/prometheus/prometheus/archiv
#     - CVE-2021-29622

prepare() {
	# Disable linter: https://github.com/prometheus/prometheus/issues/10020
	sed -i web/ui/react-app/package.json -e 's/eslint --fix/true/g'
	cd web/ui
	npm install
	sed -i node_modules/codemirror-promql/package.json -e 's/lezer-generator/npx lezer-generator/g'
}

build() {
	cd "$builddir"/web/ui/react-app
	yarn --frozen-lockfile
	yarn lint
	cd "$builddir"/web/ui
	npm run build
	npm run build:module
	go generate -x -v
	cd "$builddir"
	gofmt -w ./web/ui

	GOLDFLAGS="-X github.com/prometheus/common/version.Version=$pkgver
	        -X github.com/prometheus/common/version.Revision=AlpineLinux
			-X github.com/prometheus/common/version.Branch=master
	        -X github.com/prometheus/common/version.BuildUser=$USER@$HOSTNAME
			-X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
		-X github.com/prometheus/common/version.Revision=AlpineLinux
		-X github.com/prometheus/common/version.Branch=master
		-X github.com/prometheus/common/version.BuildUser=$USER@$HOSTNAME
		-X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
	"

	if [ -n "$LDFLAGS" ]; then
		# LDFLAGS (and only LDFLAGS) should be passed to -extldflags.
		GOLDFLAGS="$GOLDFLAGS -extldflags $LDFLAGS"
	fi

	make assets
	go mod vendor
	go build \
		-trimpath \
@@ -63,7 +53,7 @@ build() {
}

check() {
	go test ./...
	make test
}

package() {
-- 
2.34.1
Details
Message ID
<164036974093.14324.14643147935212203896.gitlab.28799.cb92c3a2ed148881c69eea7dcee6521bd3a1dde3@listserv.local>
In-Reply-To
<20211224084639.27324-1-sir@cmpwn.com> (view parent)
DKIM signature
missing
Download raw message
npm is still missing on riscv64, so it would fail to build there.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28799#note_200945
Details
Message ID
<164042552533.14324.1130629572713042659.gitlab.28799.6222c454c31f44640c618250f451aac4eb66534d@listserv.local>
In-Reply-To
<20211224084639.27324-1-sir@cmpwn.com> (view parent)
DKIM signature
missing
Download raw message
Superseded by !28835

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28799#note_201033
Reply to thread Export thread (mbox)