summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Natalenko2018-09-24 18:18:22 +0200
committerOleksandr Natalenko2018-09-24 18:19:19 +0200
commit5d681c4116af3c7b3faad7cba04ac4d159ca5aa9 (patch)
tree33b5076fa648c1da8e7df62a221247832a62e89b
parente9cddd03e57c63ac3e937b3b4c897ec61ca69637 (diff)
downloadaur-5d681c4116af3c7b3faad7cba04ac4d159ca5aa9.tar.gz
init wine prefix correctly and only once
Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xmicrosip75
3 files changed, 46 insertions, 37 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bdf1d971238..088a0621267 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = microsip
pkgdesc = Open source portable SIP softphone for Windows based on PJSIP stack
pkgver = 3.19.7
- pkgrel = 4
+ pkgrel = 5
url = https://www.microsip.org/
install = microsip.install
arch = x86_64
@@ -17,7 +17,7 @@ pkgbase = microsip
source = microsip.desktop
source = microsip.reg
sha256sums = 3ccf07e88d727681eb338aeb3420b324b5bf614e672bf60e3705137b43fd09bd
- sha256sums = 63175e29172a06ab6f2474fc03a1c464ef2e6367d0c704e17d437cc4a9ca69d0
+ sha256sums = f91197468bac3113f199092b46d4d4d1362437845218258b143bbe21612acb09
sha256sums = d588c2b2e38e12d2be3dfdd9f2a63690293b884c7df240c441e271725b9a2ca2
sha256sums = c97cde99004dbee5cb9b05a7b6bad117e5ec63cb1032fa56efdf07a4b27e3c1d
diff --git a/PKGBUILD b/PKGBUILD
index a9e36c4d485..a224f52ae5c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>
pkgname=microsip
pkgver=3.19.7
-pkgrel=4
+pkgrel=5
pkgdesc="Open source portable SIP softphone for Windows based on PJSIP stack"
arch=(x86_64)
url="https://www.microsip.org/"
@@ -16,7 +16,7 @@ source=("MicroSIP-${pkgver}.zip"::"https://www.microsip.org/downloads/?file=Micr
"${pkgname}.reg")
sha256sums=('3ccf07e88d727681eb338aeb3420b324b5bf614e672bf60e3705137b43fd09bd'
- '63175e29172a06ab6f2474fc03a1c464ef2e6367d0c704e17d437cc4a9ca69d0'
+ 'f91197468bac3113f199092b46d4d4d1362437845218258b143bbe21612acb09'
'd588c2b2e38e12d2be3dfdd9f2a63690293b884c7df240c441e271725b9a2ca2'
'c97cde99004dbee5cb9b05a7b6bad117e5ec63cb1032fa56efdf07a4b27e3c1d')
diff --git a/microsip b/microsip
index c55fc9e0da1..5d7f6e3bcb6 100755
--- a/microsip
+++ b/microsip
@@ -1,8 +1,10 @@
#!/usr/bin/env bash
+__REV=1
__APPNAME=$(basename $0)
__WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local}/wine/${__APPNAME}"
__APPDIR="${__WINEPREFIX}/dosdevices/c:/${__APPNAME}"
+__INSTALLED="${__APPDIR}/.installed.${__REV}"
__APPCFG="${XDG_CONFIG_HOME:-$HOME/.config}/${__APPNAME}"
__APPLOG="${XDG_CACHE_HOME:-$HOME/.cache}/${__APPNAME}"
__REGFILE="${__APPDIR}/${__APPNAME}.reg"
@@ -14,39 +16,46 @@ __symlink() {
ln -sf "$1" "${__APPDIR}/${1##*/}"
}
-mkdir -p "${__APPDIR}"
-
-__symlink "/usr/share/licenses/${__APPNAME}/License.txt"
-__symlink "/usr/share/doc/${__APPNAME}/MicroSIP Website.url"
-__symlink "/usr/share/${__APPNAME}/hangup.wav"
-__symlink "/usr/share/${__APPNAME}/messagein.wav"
-__symlink "/usr/share/${__APPNAME}/messageout.wav"
-__symlink "/usr/share/${__APPNAME}/ringin.wav"
-__symlink "/usr/share/${__APPNAME}/ringin2.wav"
-__symlink "/usr/share/${__APPNAME}/ringout.wav"
-__symlink "/usr/lib/${__APPNAME}/SDL2.dll"
-__symlink "/usr/lib/${__APPNAME}/avcodec-57.dll"
-__symlink "/usr/lib/${__APPNAME}/avformat-57.dll"
-__symlink "/usr/lib/${__APPNAME}/avutil-55.dll"
-__symlink "/usr/lib/${__APPNAME}/microsip.exe"
-__symlink "/usr/lib/${__APPNAME}/swscale-4.dll"
-
-cp "/usr/share/${__APPNAME}/${__APPNAME}.reg" "${__TMPREGFILE}"
-sed -i "s/{DPI}/${__DPIX}/g" "${__TMPREGFILE}"
-iconv -f utf-8 -t utf-16le "${__TMPREGFILE}" >"${__REGFILE}"
-rm -f "${__TMPREGFILE}"
-WINEPREFIX="${__WINEPREFIX}" regedit "${__REGFILE}"
-rm -f "${__REGFILE}"
-
-mkdir -p "${__APPCFG}"
-touch "${__APPCFG}/Contacts.xml"
-touch "${__APPCFG}/microsip.ini"
-__symlink "${__APPCFG}/Contacts.xml"
-__symlink "${__APPCFG}/microsip.ini"
-
-mkdir -p "${__APPLOG}"
-touch "${__APPLOG}/microsip_log.txt"
-__symlink "${__APPLOG}/microsip_log.txt"
+if [[ ! -f "${__INSTALLED}" ]]; then
+ mkdir -p "${__WINEPREFIX}"
+ WINEPREFIX="${__WINEPREFIX}" wineboot -u
+
+ mkdir -p "${__APPDIR}"
+
+ cp "/usr/share/${__APPNAME}/${__APPNAME}.reg" "${__TMPREGFILE}"
+ sed -i "s/{DPI}/${__DPIX}/g" "${__TMPREGFILE}"
+ iconv -f utf-8 -t utf-16le "${__TMPREGFILE}" >"${__REGFILE}"
+ rm -f "${__TMPREGFILE}"
+ WINEPREFIX="${__WINEPREFIX}" regedit "${__REGFILE}"
+ rm -f "${__REGFILE}"
+
+ __symlink "/usr/share/licenses/${__APPNAME}/License.txt"
+ __symlink "/usr/share/doc/${__APPNAME}/MicroSIP Website.url"
+ __symlink "/usr/share/${__APPNAME}/hangup.wav"
+ __symlink "/usr/share/${__APPNAME}/messagein.wav"
+ __symlink "/usr/share/${__APPNAME}/messageout.wav"
+ __symlink "/usr/share/${__APPNAME}/ringin.wav"
+ __symlink "/usr/share/${__APPNAME}/ringin2.wav"
+ __symlink "/usr/share/${__APPNAME}/ringout.wav"
+ __symlink "/usr/lib/${__APPNAME}/SDL2.dll"
+ __symlink "/usr/lib/${__APPNAME}/avcodec-57.dll"
+ __symlink "/usr/lib/${__APPNAME}/avformat-57.dll"
+ __symlink "/usr/lib/${__APPNAME}/avutil-55.dll"
+ __symlink "/usr/lib/${__APPNAME}/microsip.exe"
+ __symlink "/usr/lib/${__APPNAME}/swscale-4.dll"
+
+ mkdir -p "${__APPCFG}"
+ touch "${__APPCFG}/Contacts.xml"
+ touch "${__APPCFG}/microsip.ini"
+ __symlink "${__APPCFG}/Contacts.xml"
+ __symlink "${__APPCFG}/microsip.ini"
+
+ mkdir -p "${__APPLOG}"
+ touch "${__APPLOG}/microsip_log.txt"
+ __symlink "${__APPLOG}/microsip_log.txt"
+
+ touch "${__INSTALLED}"
+fi
WINEPREFIX="${__WINEPREFIX}" wine "${__APPDIR}/microsip.exe"