From 51fa0baac39577b335a3f5c064be81cf9293e9f0 Mon Sep 17 00:00:00 2001 From: sentriz Date: Tue, 20 Feb 2024 17:28:30 +0000 Subject: [PATCH] fix(ci): manually add taglib v2 APKBUILD --- Dockerfile | 16 ++++++++++-- alpine/taglib/APKBUILD | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 alpine/taglib/APKBUILD diff --git a/Dockerfile b/Dockerfile index aeb3728b..158c9dc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,24 @@ +FROM alpine:3.18 AS builder-taglib +WORKDIR /tmp +COPY alpine/taglib/APKBUILD . +RUN apk update && \ + apk add --no-cache abuild && \ + abuild-keygen -a -n && \ + REPODEST=/pkgs abuild -F -r + FROM golang:1.21-alpine AS builder RUN apk add -U --no-cache \ build-base \ ca-certificates \ git \ sqlite \ - taglib-dev \ zlib-dev \ go + +# TODO: delete this block when taglib v2 is on alpine packages +COPY --from=builder-taglib /pkgs/*/*.apk /pkgs/ +RUN apk add --no-cache --allow-untrusted /pkgs/* + WORKDIR /src COPY go.mod . COPY go.sum . @@ -27,7 +39,7 @@ RUN apk add -U --no-cache \ COPY --from=builder \ /usr/lib/libgcc_s.so.1 \ /usr/lib/libstdc++.so.6 \ - /usr/lib/libtag.so.1 \ + /usr/lib/libtag.so.2 \ /usr/lib/ COPY --from=builder \ /src/gonic \ diff --git a/alpine/taglib/APKBUILD b/alpine/taglib/APKBUILD new file mode 100644 index 00000000..c3ebfd65 --- /dev/null +++ b/alpine/taglib/APKBUILD @@ -0,0 +1,55 @@ +# Contributor: Leo +# Maintainer: Natanael Copa +pkgname=taglib2 +pkgver=2.0 +pkgrel=0 +pkgdesc="Library for reading and editing metadata of several popular audio formats" +url="https://taglib.github.io/" +arch="all" +license="LGPL-2.1-only OR MPL-1.1" +makedepends="zlib-dev utfcpp cmake samurai" +checkdepends="cppunit-dev" +subpackages=" + $pkgname-dev + libtag:_lib + libtag_c:_lib + " +source="https://taglib.github.io/releases/taglib-$pkgver.tar.gz" +builddir="$srcdir/taglib-$pkgver" + +# secfixes: +# 1.11.1-r2: +# - CVE-2017-12678 +# - CVE-2018-11439 + +build() { + CFLAGS="$CFLAGS -flto=auto" \ + CXXFLAGS="$CXXFLAGS -flto=auto" \ + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DWITH_ZLIB=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_EXAMPLES=ON \ + -DBUILD_TESTING="$(want_check && echo ON || echo OFF)" \ + -DVISIBILITY_HIDDEN=ON + cmake --build build +} + +check() { + ctest --test-dir build --output-on-failure +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} + +_lib() { + pkgdesc="$pkgdesc ($subpkgname lib)" + + amove usr/lib/$subpkgname.so.* +} + +sha512sums=" +099d02b2eab033f5702a8cb03e70752d7523c6f8c2f3eebdd0bcd939eafbdca3f2a6c82452983904b5822cfa45f2707ed866c3419508df9d43bf5c0b3a476f6c taglib-2.0.tar.gz +"