forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPKGBUILD
93 lines (79 loc) · 3.06 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Maintainer: Alexey Pavlov <[email protected]>
_realname=SDL2_mixer
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.0.4
pkgrel=7
pkgdesc="A simple multi-channel audio mixer (Version 2) (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://libsdl.org/projects/SDL_mixer"
license=("MIT")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-SDL2"
"${MINGW_PACKAGE_PREFIX}-flac"
"${MINGW_PACKAGE_PREFIX}-fluidsynth"
"${MINGW_PACKAGE_PREFIX}-libvorbis"
"${MINGW_PACKAGE_PREFIX}-libmodplug"
"${MINGW_PACKAGE_PREFIX}-mpg123"
"${MINGW_PACKAGE_PREFIX}-opusfile")
options=('staticlibs' 'strip')
source=("$url/release/${_realname}-${pkgver}.zip"
SDL2_mixer-2.0.1-find_lib.mingw.patch
SDL2_mixer-2.0.1-libtool_windres.mingw.patch
0199-Fixed-use-after-free-in-music_fluidsynth.c.patch)
sha256sums=('9affb8c7bf6fbffda0f6906bfb99c0ea50dca9b188ba9e15be90042dc03c5ded'
'8c906b09cb9318b54dac6b63eff49e63fb83bf1fc97219581b720709723ce5c1'
'86fa38c76b834ea28d40c95d4639cf7896f449fe92a4348d21da641106a53132'
'3640f1023825ec6683956e58e980897fa67963b1a10477721ebe5ab09c490cdb')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
patch -Np1 -i ${srcdir}/SDL2_mixer-2.0.1-find_lib.mingw.patch
patch -Np1 -i ${srcdir}/SDL2_mixer-2.0.1-libtool_windres.mingw.patch
patch -Np1 -i ${srcdir}/0199-Fixed-use-after-free-in-music_fluidsynth.c.patch
autoconf
}
build() {
export lt_cv_deplibs_check_method='pass_all'
local -a _common_config
_common_config+=(
--disable-music-ogg-shared
--disable-music-flac-shared
--enable-music-mp3
--disable-music-mp3-mad-gpl
--enable-music-mp3-mpg123
--disable-music-mp3-mpg123-shared
--enable-music-opus
--disable-music-opus-shared
)
[[ -d "${srcdir}/build-${MSYSTEM}-static" ]] && rm -rf "${srcdir}/build-${MSYSTEM}-static"
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"
CPPFLAGS+=" -DFLAC__NO_DLL" \
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--disable-shared \
--enable-static \
"${_common_config[@]}"
make
[[ -d "${srcdir}/build-${MSYSTEM}-shared" ]] && rm -rf "${srcdir}/build-${MSYSTEM}-shared"
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--enable-shared \
--disable-static \
"${_common_config[@]}"
make
}
package() {
cd "${srcdir}/build-${MSYSTEM}-static"
make DESTDIR="${pkgdir}" install
cd "${srcdir}/build-${MSYSTEM}-shared"
make DESTDIR="${pkgdir}" install
install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}