Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Oct 9, 2024
1 parent 73c634d commit a3d229f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion .versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
RELEASE_VERSION=0
TAGLIB_VERSION="2.0.2"
TAGLIB_SHA="e3de03501ff66221d1f1f971022b248d5b38ba06"
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ FROM --platform=$BUILDPLATFORM crazymax/osxcross:11.3-debian AS osxcross
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx

FROM --platform=$BUILDPLATFORM debian:bookworm AS base
ARG TAGLIB_VERSION=2.0.2
ARG TAGLIB_SHA=e3de03501ff66221d1f1f971022b248d5b38ba06

RUN apt-get update && apt-get install -y clang lld cmake git
# copy xx scripts to your build stage
COPY --from=xx / /
Expand All @@ -10,8 +13,6 @@ ARG TARGETPLATFORM
# Set working directory

FROM --platform=$BUILDPLATFORM base AS source
ARG TAGLIB_VERSION=2.0.2
ARG TAGLIB_SHA=e3de03501ff66221d1f1f971022b248d5b38ba06
RUN cd / && \
git clone https://github.com/taglib/taglib.git taglib-src && \
cd taglib-src && \
Expand All @@ -21,10 +22,7 @@ RUN cd / && \
find . -name .git | xargs rm -rf

FROM --platform=$BUILDPLATFORM base AS build

RUN xx-apt install -y binutils gcc g++ libc6-dev zlib1g-dev

ARG TAGLIB_VERSION
ENV TABLIB_BUILD_OPTS="-DCMAKE_BUILD_TYPE=Release -DWITH_MP4=ON -DWITH_ASF=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF"

COPY --from=source /taglib-src /taglib-src
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
include .versions

RELEASE_VERSION=0

build:
docker build \
--platform "linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,darwin/amd64,darwin/arm64" \
--build-arg TAGLIB_VERSION=${TAGLIB_VERSION} \
--build-arg TAGLIB_SHA=${TAGLIB_SHA} \
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
--output "./dist" \
--target "artifact" .
.PHONY: build

# --platform "linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,darwin/arm64,darwin/amd64,windows/amd64,windows/386" \
dist: build
./make-dist.sh
./make-dist.sh ${RELEASE_VERSION}
.PHONY: dist

update:
Expand Down
1 change: 1 addition & 0 deletions make-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

source .versions
RELEASE_VERSION=$1

cd dist

Expand Down

0 comments on commit a3d229f

Please sign in to comment.