-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathget-dependencies.sh
More file actions
189 lines (172 loc) · 6.05 KB
/
Copy pathget-dependencies.sh
File metadata and controls
189 lines (172 loc) · 6.05 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/sh
set -ex
ARCH=$(uname -m)
BUILD_DIR=/tmp/deadbeef-build
SRC_DIR=$BUILD_DIR/deadbeef
INSTALL_DIR=$BUILD_DIR/install
echo "Installing package dependencies..."
echo "---------------------------------------------------------------"
pacman -Syu --noconfirm \
alsa-lib \
autoconf \
automake \
clang \
faac \
faad2 \
ffmpeg \
flac \
git \
gtk3 \
intltool \
jansson \
lame \
libdispatch \
libtool \
libxss \
make \
mpg123 \
musepack-tools \
opus-tools \
pipewire \
pipewire-jack \
pulseaudio \
vorbis-tools \
wavpack \
wget \
yasm
echo "Installing debloated packages..."
echo "---------------------------------------------------------------"
get-debloated-pkgs --add-common --prefer-nano ! gdk-pixbuf ! librsvg glycin-mini
pacman -Rsndd --noconfirm mesa # gtk3 app doesn't need mesa
# If the application needs to be manually built that has to be done down here
echo "Building deadbeef..."
echo "---------------------------------------------------------------"
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
git clone https://github.com/DeaDBeeF-Player/deadbeef.git "$SRC_DIR"
# Build ffmpeg 4.4 statically
FFMPEG_INSTALL_DIR=$BUILD_DIR/ffmpeg-static
if [ ! -d "$FFMPEG_INSTALL_DIR"/lib ]; then
FFMPEG_BUILD_DIR="$BUILD_DIR/ffmpeg-4.4"
wget -q https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz -O "$BUILD_DIR"/ffmpeg-4.4.tar.xz
tar xf "$BUILD_DIR"/ffmpeg-4.4.tar.xz -C "$BUILD_DIR" && (
cd "$FFMPEG_BUILD_DIR"
./configure \
--prefix="$FFMPEG_INSTALL_DIR" \
--enable-pic \
--enable-static \
--disable-shared \
--enable-gpl \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--disable-avdevice \
--disable-ffmpeg \
--disable-postproc \
--disable-swresample \
--disable-avfilter \
--disable-swscale \
--disable-swscale-alpha \
--disable-vdpau \
--disable-videotoolbox \
--disable-dxva2 \
--disable-vaapi \
--disable-hwaccels \
--disable-encoders \
--disable-muxers \
--disable-indevs \
--disable-outdevs \
--disable-devices \
--disable-filters \
--disable-bsfs \
--disable-bzlib \
--disable-protocols \
--disable-libopus \
--disable-decoders \
--disable-demuxers \
--disable-parsers \
--enable-decoder=wmapro \
--enable-decoder=wmavoice \
--enable-parser=ac3 \
--enable-demuxer=ac3 \
--enable-decoder=ac3 \
--enable-demuxer=eac3 \
--enable-decoder=eac3 \
--enable-decoder=amrnb \
--enable-demuxer=asf \
--enable-demuxer=oma \
--enable-demuxer=amr \
--enable-demuxer=tak \
--enable-decoder=tak \
--enable-decoder=dsd_lsbf \
--enable-decoder=dsd_lsbf_planar \
--enable-decoder=dsd_msbf \
--enable-decoder=dsd_msbf_planar \
--enable-demuxer=dsf \
--enable-demuxer=iff \
--enable-version3 \
--disable-asm \
--enable-protocol=file \
--enable-protocol=http
make -j"$(nproc)"
make install
)
fi
# Build deadbeef
case $ARCH in
x86_64) STATIC_DEPS_ARCH="x86-64" ;;
aarch64) STATIC_DEPS_ARCH="aarch64" ;;
*) STATIC_DEPS_ARCH="$ARCH" ;;
esac
STATIC_DEPS=$SRC_DIR/static-deps/lib-$STATIC_DEPS_ARCH
CONFIGURE_FLAGS=--build=$ARCH-unknown-linux-gnu
(
cd "$SRC_DIR"
if [ "$DEVEL_RELEASE" = true ]; then
echo "Building nightly release..."
DEADBEEF_VERSION=$(git rev-parse --short HEAD)
else
echo "Building stable release..."
git fetch --tags
TAG=$(git tag --sort=-v:refname | grep -vi 'rc\|alpha' | grep -v '^v0\.' | head -1)
git checkout "$TAG"
DEADBEEF_VERSION="$TAG"
fi
git submodule update --init --recursive
echo "$DEADBEEF_VERSION" > ~/version
echo "m4_define([DEADBEEF_VERSION], [$DEADBEEF_VERSION])" > ./build_data/version.m4
# Download static-deps for headers only
STATICDEPS_URL="http://sourceforge.net/projects/deadbeef/files/staticdeps/ddb-static-deps-latest.tar.bz2/download"
mkdir -p static-deps
wget "$STATICDEPS_URL" -O "$BUILD_DIR/ddb-static-deps.tar.bz2"
tar jxf "$BUILD_DIR/ddb-static-deps.tar.bz2" -C static-deps
# Remove static libs from static-deps (incompatible glibc symbol versions)
find static-deps -name "*.a" -delete
export CFLAGS="\
-I$FFMPEG_INSTALL_DIR/include \
-I$STATIC_DEPS/include \
-Wno-error=incompatible-pointer-types-discards-qualifiers \
-Wno-error=implicit-int \
-Wno-error=int-conversion"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L$STATIC_DEPS/lib"
export PKG_CONFIG_PATH="$FFMPEG_INSTALL_DIR/lib/pkgconfig"
./autogen.sh
./configure CC=clang CXX=clang++ $CONFIGURE_FLAGS --disable-gtk2 --prefix=/usr
make -j"$(nproc)"
make install DESTDIR="$INSTALL_DIR"
)
# Move into AppDir structure
mkdir -p ./AppDir/bin/plugins
cp -v "$INSTALL_DIR"/usr/bin/deadbeef ./AppDir/bin
cp -vr "$INSTALL_DIR"/usr/lib/deadbeef/* ./AppDir/bin/plugins
cp -vr "$INSTALL_DIR"/usr/share ./AppDir/bin
# aarch64 has no libs here
cp -v "$STATIC_DEPS"/lib/libBlocks*.so* ./AppDir/bin || :
cp -v "$STATIC_DEPS"/lib/libdispatch.so* ./AppDir/bin || :
cp -v "$STATIC_DEPS"/lib/libcurl.so* ./AppDir/bin || :
cp -v "$STATIC_DEPS"/lib/libmbed* ./AppDir/bin || :
# Portable mode marker (triggers /proc/self/exe plugin detection)
cp -v "$INSTALL_DIR"/usr/share/icons/hicolor/48x48/apps/deadbeef.png ./AppDir/bin
find ./AppDir/bin -type f -name '*.so*' -exec strip {} \;
chmod +x ./AppDir/bin/deadbeef