Skip to content

Commit d9fce56

Browse files
musicpod: extract .desktop file, simplify PKGBUILD
Move inline .desktop entry to a separate file remove unnecessary _pkgname/_install_path variables drop chmod lines
1 parent 213dfd6 commit d9fce56

2 files changed

Lines changed: 24 additions & 32 deletions

File tree

archlinuxcn/musicpod/PKGBUILD

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
# This repository is a fork of musicpod-git.
44
# Before executing makepkg, you can set FVM_CACHE_PATH to $HOME/fvm or the path specified by the cachePath field in the $HOME/.config/fvm/.fvmrc file.
55

6-
## options
7-
: ${_install_path:=usr/lib}
8-
9-
_pkgname="musicpod"
10-
pkgname="$_pkgname"
6+
pkgname="musicpod"
117
pkgver=2.15.1
128
pkgrel=1
139
pkgdesc="Music, radio, television and podcast player"
@@ -39,11 +35,11 @@ makedepends=(
3935

4036
options=('!lto')
4137

42-
_pkgsrc="$_pkgname-$pkgver"
38+
_pkgsrc="$pkgname-$pkgver"
4339
_pkgext="tar.gz"
44-
source=("$_pkgsrc.$_pkgext"::"$url/archive/refs/tags/v$pkgver.$_pkgext")
45-
provides=("${_pkgname}")
46-
sha256sums=('ed4ef5567322de535a8b194126d0ddee7bbd422018df50c1f997bc356071581c')
40+
source=("$_pkgsrc.$_pkgext"::"$url/archive/refs/tags/v$pkgver.$_pkgext" "org.feichtmeier.Musicpod.desktop")
41+
sha256sums=('ed4ef5567322de535a8b194126d0ddee7bbd422018df50c1f997bc356071581c'
42+
'2c25d7e7ee10f3e53ac918a39c357c5c338426c0c3b631e63e5ddd525e15fce3')
4743

4844
build() {
4945
export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
@@ -68,43 +64,28 @@ package() {
6864

6965
cd "$_pkgsrc/build/linux/$FLUTTER_ARCH/release/bundle"
7066

71-
install -Dm755 "musicpod" "$pkgdir/$_install_path/$_pkgname/$_pkgname"
72-
cp --reflink=auto -r lib/ "$pkgdir/$_install_path/$_pkgname/"
73-
cp --reflink=auto -r data/ "$pkgdir/$_install_path/$_pkgname/"
67+
install -Dm755 "musicpod" "$pkgdir/usr/lib/$pkgname/$pkgname"
68+
cp --reflink=auto -r lib/ "$pkgdir/usr/lib/$pkgname/"
69+
cp --reflink=auto -r data/ "$pkgdir/usr/lib/$pkgname/"
7470

7571
# runpath
76-
patchelf --set-rpath '$ORIGIN/lib' "$pkgdir/$_install_path/$_pkgname/$_pkgname"
77-
for i in "$pkgdir/$_install_path/$_pkgname/lib"/*.so; do
72+
patchelf --set-rpath '$ORIGIN/lib' "$pkgdir/usr/lib/$pkgname/$pkgname"
73+
for i in "$pkgdir/usr/lib/$pkgname/lib"/*.so; do
7874
[ -z "$(patchelf --print-rpath "$i")" ] && continue
7975
patchelf --set-rpath '$ORIGIN' "$i"
8076
done
8177

8278
# symlink
8379
install -dm755 "${pkgdir}/usr/bin"
84-
ln -sfr "$pkgdir/$_install_path/$_pkgname/$_pkgname" "$pkgdir/usr/bin/${_pkgname}"
80+
ln -sfr "$pkgdir/usr/lib/$pkgname/$pkgname" "$pkgdir/usr/bin/${pkgname}"
8581

8682
# icon
8783
install -Dm644 "$srcdir/$_pkgsrc/snap/gui/$pkgname.png" \
88-
"$pkgdir/usr/share/pixmaps/$_pkgname.png"
84+
"$pkgdir/usr/share/pixmaps/$pkgname.png"
8985

9086
# .desktop file
91-
install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/$_pkgname.desktop" << END
92-
[Desktop Entry]
93-
Type=Application
94-
Name=MusicPod
95-
Comment=$pkgdesc
96-
Keywords=Music;Podcast;Radio;
97-
Exec=$_pkgname %U
98-
MimeType=application/claps;application/mpeg4-iod;application/mpeg4-muxcodetable;application/mxf;application/ogg;application/ram;application/sdp;application/streamingmedia;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-ogg;application/x-streamingmedia;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/amr;audio/amr-wb;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/mpg;audio/ogg;audio/opus;audio/scpls;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-mpg;audio/x-ms-asf;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-wav;audio/x-real-audio;audio/x-realaudio;audio/x-s3m;audio/x-scpls;audio/x-shorten;audio/x-speex;audio/x-tta;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;audio/x-xm;video/3gp;video/3gpp;video/3gpp2;video/divx;video/dv;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/mpeg-system;video/msvideo;video/ogg;video/quicktime;video/vnd.mpegurl;video/vnd.rn-realvideo;video/webm;video/x-avi;video/x-flc;video/x-fli;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-mpeg-system;video/x-mpeg2;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-msvideo;video/x-nsv;video/x-ogm+ogg;video/x-theora;video/x-theora+ogg;x-content/audio-cdda;x-content/audio-player;x-content/video-dvd;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtmp;x-scheme-handler/rtp;x-scheme-handler/rtsp;
99-
Icon=$_pkgname
100-
Terminal=false
101-
Categories=AudioVideo;Audio;
102-
StartupWMClass=musicpod
103-
END
87+
install -Dm644 "$srcdir/org.feichtmeier.Musicpod.desktop" "${pkgdir}/usr/share/applications/org.feichtmeier.Musicpod.desktop"
10488

10589
# license
10690
install -Dm644 "$srcdir/$_pkgsrc/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
107-
108-
# permissions
109-
chmod -R u+rwX,go+rX,go-w "$pkgdir/"
11091
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=MusicPod
4+
Comment=Music, podcast and internet radio player
5+
Keywords=Music;Podcast;Radio;
6+
Exec=musicpod %U
7+
MimeType=application/claps;application/mpeg4-iod;application/mpeg4-muxcodetable;application/mxf;application/ogg;application/ram;application/sdp;application/streamingmedia;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-ogg;application/x-streamingmedia;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/amr;audio/amr-wb;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/mpg;audio/ogg;audio/opus;audio/scpls;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-mpg;audio/x-ms-asf;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-wav;audio/x-real-audio;audio/x-realaudio;audio/x-s3m;audio/x-scpls;audio/x-shorten;audio/x-speex;audio/x-tta;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;audio/x-xm;video/3gp;video/3gpp;video/3gpp2;video/divx;video/dv;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/mpeg-system;video/msvideo;video/ogg;video/quicktime;video/vnd.mpegurl;video/vnd.rn-realvideo;video/webm;video/x-avi;video/x-flc;video/x-fli;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-mpeg-system;video/x-mpeg2;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-msvideo;video/x-nsv;video/x-ogm+ogg;video/x-theora;video/x-theora+ogg;x-content/audio-cdda;x-content/audio-player;x-content/video-dvd;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtmp;x-scheme-handler/rtp;x-scheme-handler/rtsp;
8+
Icon=musicpod
9+
Terminal=false
10+
Categories=AudioVideo;Audio;
11+
StartupWMClass=musicpod

0 commit comments

Comments
 (0)