summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lin2022-03-14 19:13:40 -0500
committerAndrew Lin2022-03-14 19:25:17 -0500
commit1e4daeb42b993891025991d567824ce27b79eb46 (patch)
tree54205f6a1a2357c00f5c03dbfcaa089ac0ff8a8d
parent1aa853ad61d0ed4143a60eb670d72b8846fb4795 (diff)
downloadaur-1e4daeb42b993891025991d567824ce27b79eb46.tar.gz
Fix and clean up a few minor packaging issues
- Manually extract sources to separate directory to avoid polluting package with unrelated files when copying over files from $srcdir to $pkgdir - Move some static files created in PKGBUILD out to separate files (openmpt launch script, bash completion script, x-mptm.xml) - Other miscellaneous style changes This bumps pkgrel up to 2 for the above changes. Theis package should be functionally equivalent otherwise.
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD50
-rwxr-xr-xopenmpt3
-rw-r--r--openmpt-bash-completion8
-rw-r--r--x-mptm.xml5
5 files changed, 55 insertions, 24 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0161cdfeec4a..9d0728043a2b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openmpt
pkgdesc = Open-source audio module tracker
pkgver = 1.30.03.00
- pkgrel = 1
+ pkgrel = 2
url = https://openmpt.org/
arch = i686
arch = x86_64
@@ -11,9 +11,16 @@ pkgbase = openmpt
depends = wine
optdepends = bash-completion: tab completion support
optdepends = ccache: for Wine native host support
- source_i686 = https://download.openmpt.org/archive/openmpt/1.30/OpenMPT-1.30.03.00-portable-x86.zip
+ noextract = openmpt-1.30.03.00.zip
+ source = openmpt
+ source = openmpt-bash-completion
+ source = x-mptm.xml
+ sha256sums = 8b3da74d09640985e324441e459d0ac43f956dd95b89e0003b0ad2df46742685
+ sha256sums = 602639496997a74fab0914b1cff519dff207524ba0adf516ecc55466a4e83253
+ sha256sums = 44065d91a46203dae1378d6d99e70d882d28f66e3a584236242937856a9a8d56
+ source_i686 = openmpt-1.30.03.00.zip::https://download.openmpt.org/archive/openmpt/1.30/OpenMPT-1.30.03.00-portable-x86.zip
sha256sums_i686 = cd58328f677ab226ee825a8500b085ece7e37d4359a666b488f6d02fbd7b94e7
- source_x86_64 = https://download.openmpt.org/archive/openmpt/1.30/OpenMPT-1.30.03.00-portable-amd64.zip
+ source_x86_64 = openmpt-1.30.03.00.zip::https://download.openmpt.org/archive/openmpt/1.30/OpenMPT-1.30.03.00-portable-amd64.zip
sha256sums_x86_64 = 0c247f6a69262e075adb970d5073a2b356f9fd308225d0918ccd5eb5926ef2c2
pkgname = openmpt
diff --git a/PKGBUILD b/PKGBUILD
index bdf6ccd2c1ca..7726d207bc31 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Simon Thorpe <simon at hivetechnology dot com dot au>
pkgname=openmpt
pkgver=1.30.03.00
-pkgrel=1
+pkgrel=2
pkgdesc="Open-source audio module tracker"
arch=('i686' 'x86_64')
url="https://openmpt.org/"
@@ -13,37 +13,45 @@ optdepends=(
'bash-completion: tab completion support'
'ccache: for Wine native host support'
)
-source_i686=("https://download.openmpt.org/archive/openmpt/$(echo $pkgver | grep -Po '^\d+.\d+')/OpenMPT-$pkgver-portable-x86.zip")
-source_x86_64=("https://download.openmpt.org/archive/openmpt/$(echo $pkgver | grep -Po '^\d+.\d+')/OpenMPT-$pkgver-portable-amd64.zip")
+source=(
+ 'openmpt'
+ 'openmpt-bash-completion'
+ 'x-mptm.xml'
+)
+source_i686=("$pkgname-$pkgver.zip::https://download.openmpt.org/archive/openmpt/$(echo $pkgver | grep -Po '^\d+.\d+')/OpenMPT-$pkgver-portable-x86.zip")
+source_x86_64=("$pkgname-$pkgver.zip::https://download.openmpt.org/archive/openmpt/$(echo $pkgver | grep -Po '^\d+.\d+')/OpenMPT-$pkgver-portable-amd64.zip")
+noextract=("$pkgname-$pkgver.zip")
+sha256sums=(
+ '8b3da74d09640985e324441e459d0ac43f956dd95b89e0003b0ad2df46742685'
+ '602639496997a74fab0914b1cff519dff207524ba0adf516ecc55466a4e83253'
+ '44065d91a46203dae1378d6d99e70d882d28f66e3a584236242937856a9a8d56'
+)
sha256sums_i686=('cd58328f677ab226ee825a8500b085ece7e37d4359a666b488f6d02fbd7b94e7')
sha256sums_x86_64=('0c247f6a69262e075adb970d5073a2b356f9fd308225d0918ccd5eb5926ef2c2')
-prepare(){
- convert "$srcdir/OpenMPT File Icon.ico" "$srcdir/icon.png"
+prepare() {
+ cd "$srcdir"
+ mkdir -p "$pkgname-$pkgver"
+ unzip -o -d "$pkgname-$pkgver" "$pkgname-$pkgver.zip"
+
+ convert "$pkgname-$pkgver/OpenMPT File Icon.ico" "icon.png"
gendesk -n -f --pkgname "$pkgname" --pkgdesc "$pkgdesc" \
--name='OpenMPT' \
--mimetype='audio/x-mod;audio/x-s3m;audio/x-xm;audio/x-it;audio/x-mptm' \
--categories 'Audio;Sequencer;Midi;AudioVideoEditing;Music;AudioVideo;'
}
-package(){
- mkdir -p $pkgdir/usr/share
- mkdir -p $pkgdir/usr/bin
- mkdir -p $pkgdir/usr/share/bash-completion/completions
- cp -R $srcdir $pkgdir/usr/share/openmpt
+package() {
+ mkdir -p "$pkgdir/usr/share"
+ cp -r "$srcdir/$pkgname-$pkgver" "$pkgdir/usr/share/openmpt"
# Since OpenMPT 1.29, portable installations are identified by the presence of the "OpenMPT.portable" file.
# That file is removed here to keep existing installations configured properly.
- rm $pkgdir/usr/share/openmpt/OpenMPT.portable
- echo -e '#!/bin/bash\n[[ "$1" == "" ]] && wine /usr/share/openmpt/OpenMPT.exe\n[[ "$1" != "" ]] && wine /usr/share/openmpt/OpenMPT.exe "$(winepath -w "$1")"' >$pkgdir/usr/bin/openmpt
- chmod +x $pkgdir/usr/bin/openmpt
+ rm "$pkgdir/usr/share/openmpt/OpenMPT.portable"
+ install -Dm755 "$srcdir/openmpt" "$pkgdir/usr/bin/openmpt"
install -Dm644 "$srcdir/icon-2.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
- install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
-
- mkdir -p $pkgdir/usr/share/mime/application
- echo -e '<?xml version="1.0" encoding="utf-8"?><mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="audio/x-mptm"><glob pattern="*.mptm"/><comment>OpenMPT Module</comment></mime-type>' >"$pkgdir/usr/share/mime/application/x-mptm.xml"
-
- # This list of supported file extensions was taken from the features page of the website. There is probably a more complete list somewhere.
- echo "_openmpt() { local cur prev words cword split; _init_completion -s || return; _filedir '@(669|AMF|AMS|DBM|DIGI|DMF|DSM|FAR|GDM|ICE|ST26|IMF|IT|ITP|J2B|M15|STK|MDL|MED|MO3|MOD|MPTM|MT2|MTM|OKT|PLM|PSM|PTM|S3M|STM|ULT|UMX|WOW|XM)'; } && complete -F _openmpt openmpt" >$pkgdir/usr/share/bash-completion/completions/openmpt
+ install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
+ install -Dm644 "$srcdir/x-mptm.xml" "$pkgdir/usr/share/mime/application/x-mptm.xml"
+ install -Dm644 "$srcdir/openmpt-bash-completion" "$pkgdir/usr/share/bash-completion/completions/openmpt"
}
-# vim:set ts=2 sw=2 et:
+# vim:set ts=2 sts=2 sw=2 et:
diff --git a/openmpt b/openmpt
new file mode 100755
index 000000000000..33ed46a2ab24
--- /dev/null
+++ b/openmpt
@@ -0,0 +1,3 @@
+#!/bin/bash
+[[ "$1" == "" ]] && wine /usr/share/openmpt/OpenMPT.exe
+[[ "$1" != "" ]] && wine /usr/share/openmpt/OpenMPT.exe "$(winepath -w "$1")"
diff --git a/openmpt-bash-completion b/openmpt-bash-completion
new file mode 100644
index 000000000000..f95d919a5089
--- /dev/null
+++ b/openmpt-bash-completion
@@ -0,0 +1,8 @@
+_openmpt() {
+ local cur prev words cword split
+ _init_completion -s || return
+ # This list of supported file extensions was taken from the features page of the website. There is probably a more complete list somewhere.
+ _filedir '@(669|amf|ams|dbm|digi|dmf|dsm|far|gdm|ice|st26|imf|it|itp|j2b|m15|stk|mdl|med|mo3|mod|mptm|mt2|mtm|okt|plm|psm|ptm|s3m|stm|ult|umx|wow|xm)'
+}
+
+complete -F _openmpt openmpt
diff --git a/x-mptm.xml b/x-mptm.xml
new file mode 100644
index 000000000000..86396e324f69
--- /dev/null
+++ b/x-mptm.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="audio/x-mptm">
+ <glob pattern="*.mptm"/>
+ <comment>OpenMPT Module</comment>
+</mime-type>