Skip to content

Commit

Permalink
fix(ci): manually add taglib v2 APKBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Feb 20, 2024
1 parent 4600ee1 commit 51fa0ba
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand All @@ -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 \
Expand Down
55 changes: 55 additions & 0 deletions alpine/taglib/APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributor: Leo <[email protected]>
# Maintainer: Natanael Copa <[email protected]>
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
"

0 comments on commit 51fa0ba

Please sign in to comment.