summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2020-12-09 23:24:07 +0800
committerYour Name2020-12-09 23:24:07 +0800
commitb968a7fef1cc75e4cfeb635c8bafa03cd4a405f5 (patch)
tree0f812827b18cfd6644de736eab6494fb221ec6a2
downloadaur-b968a7fef1cc75e4cfeb635c8bafa03cd4a405f5.tar.gz
Pack baidunetdisk-electron
-rw-r--r--.SRCINFO19
-rw-r--r--0001-baidunetdisk-bin-desktop-file.patch11
-rw-r--r--PKGBUILD58
-rw-r--r--baidunetdisk-wrapper.sh2
4 files changed, 90 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ae229eb801fb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = baidunetdisk-electron
+ pkgdesc = Baidu Net Disk - a cloud storage client (Linux Version). Run with system electron.
+ pkgver = 3.5.0
+ pkgrel = 1
+ url = https://pan.baidu.com
+ arch = x86_64
+ license = custom
+ depends = electron9
+ provides = baidunetdisk
+ conflicts = baidunetdisk
+ options = !strip
+ source = 0001-baidunetdisk-bin-desktop-file.patch
+ source = baidunetdisk-wrapper.sh
+ sha256sums = 17bda6036e07916971257f25731130fb1b760b80798fa13273db39268ab9f28c
+ sha256sums = 5cb0d3735cfc52d70b41a916c31e4c4c9212a99152ec81d6c3f629975fec6621
+ source_x86_64 = baidunetdisk-electron-3.5.0.deb::http://wppkg.baidupcs.com/issue/netdisk/Linuxguanjia/3.5.0/baidunetdisk_3.5.0_amd64.deb
+ sha256sums_x86_64 = aed0a95f4162e17d88159ed0736636fa47f49af313d0820647af460df4fd49b6
+
+pkgname = baidunetdisk-electron
diff --git a/0001-baidunetdisk-bin-desktop-file.patch b/0001-baidunetdisk-bin-desktop-file.patch
new file mode 100644
index 000000000000..ec8c1f0ca430
--- /dev/null
+++ b/0001-baidunetdisk-bin-desktop-file.patch
@@ -0,0 +1,11 @@
+--- a/share/applications/baidunetdisk.desktop 2019-06-14 16:29:25.000000000 +0800
++++ b/share/applications/baidunetdisk.desktop 2019-07-23 19:58:15.427322655 +0800
+@@ -1,7 +1,7 @@
+ [Desktop Entry]
+ Name=baidunetdisk
+-Exec=/opt/baidunetdisk/baidunetdisk --no-sandbox %U
++Exec=/usr/bin/baidunetdisk --no-sandbox %U
+ Terminal=false
+ Type=Application
+ Icon=baidunetdisk
+ StartupWMClass=baidunetdisk
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ecb249774759
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Contributor: Ariel AxionL <i at axionl dot me>
+# Contributor: Astro Benzene <universebenzene at sina dot com>
+# Contributor: lilydjwg <lilydjwg at gmail dot com>
+# This PKGBUILD is directly modified from aur/baidunetdisk-bin
+_pkgname=baidunetdisk
+pkgname=baidunetdisk-electron
+pkgver=3.5.0
+pkgrel=1
+#_mainver=${pkgver%.*}
+pkgdesc="Baidu Net Disk - a cloud storage client (Linux Version). Run with system electron."
+arch=('x86_64')
+depends=('electron9')
+provides=("baidunetdisk")
+conflicts=("baidunetdisk")
+url="https://pan.baidu.com"
+license=("custom")
+options=('!strip')
+
+source=("0001-baidunetdisk-bin-desktop-file.patch"
+ "baidunetdisk-wrapper.sh")
+
+#source_x86_64=("${pkgname}-${pkgver}.deb::https://issuecdn.baidupcs.com/issue/netdisk/LinuxGuanjia/${_mainver}/${_pkgname}_linux_${pkgver}.deb")
+source_x86_64=("${pkgname}-${pkgver}.deb::http://wppkg.baidupcs.com/issue/netdisk/Linuxguanjia/${pkgver}/baidunetdisk_${pkgver}_amd64.deb")
+
+sha256sums=('17bda6036e07916971257f25731130fb1b760b80798fa13273db39268ab9f28c'
+ '5cb0d3735cfc52d70b41a916c31e4c4c9212a99152ec81d6c3f629975fec6621')
+sha256sums_x86_64=('aed0a95f4162e17d88159ed0736636fa47f49af313d0820647af460df4fd49b6')
+
+prepare() {
+ bsdtar -xpf "data.tar.xz"
+
+ patch -d "usr" -p1 <"0001-baidunetdisk-bin-desktop-file.patch"
+}
+
+package() {
+ cd "${srcdir}"
+
+ # install application data
+ mv "usr" "${pkgdir}"
+ install -dm755 "${pkgdir}/usr/lib" "${pkgdir}/usr/share/licenses/${_pkgname}"
+ mv "opt/${_pkgname}" "${pkgdir}/usr/lib/${_pkgname}"
+ install -Dm755 "${srcdir}/baidunetdisk-wrapper.sh" "${pkgdir}/usr/bin/baidunetdisk"
+
+ # fix promission
+ chmod 644 "${pkgdir}/usr/lib/${_pkgname}/"*.so
+ find ${pkgdir} -type d -exec chmod 755 {} \;
+
+ # remove unnecessary libs
+ cd "${pkgdir}/usr/lib/${_pkgname}"
+ rm -rf baidunetdisk swiftshader chrome_100_percent.pak libEGL.so locales v8_context_snapshot.bin chrome_200_percent.pak libffmpeg.so libvk_swiftshader.so vk_swiftshader_icd.json chrome-sandbox libGLESv2.so libvulkan.so resources.pak icudtl.dat snapshot_blob.bin
+
+
+ # install license
+ ln -s "/usr/lib/${_pkgname}/LICENSE.electron.txt" \
+ "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.electron.txt"
+ ln -s "/usr/lib/${_pkgname}/LICENSES.chromium.html" \
+ "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSES.chromium.html"
+}
diff --git a/baidunetdisk-wrapper.sh b/baidunetdisk-wrapper.sh
new file mode 100644
index 000000000000..ee73bb57971a
--- /dev/null
+++ b/baidunetdisk-wrapper.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+LD_PRELOAD="/usr/lib/baidunetdisk/libbrowserengine.so:/usr/lib/baidunetdisk/libkernel.so" exec electron9 /usr/lib/baidunetdisk/resources/app.asar "$@"