summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6901c722468eb7e20b43ccb2043b4bb26e8c56ff (plain)
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
# Contributor: charlesneimog <charlesneimog@outlook.com>
# Contributor: Asuka Minato
# Contributor: elementh <hello@lucasmarino.me>
# Contributor: Ash Price <eisleggje@gmail.com>
# Contributor: Adrian Perez <aperez@igalia.com>
#
# WARNING WARNING WARNING WARNING WARNING    
# IMPORTANT: MIGRATION
#                                            If you are coming from the > 0.3.2 BETA please read the instructions:
# 
# 1. Install `anytype-legacy`
# 2. Follow the instructions HERE: https://community.anytype.io/t/anytype-legacy-to-migration-trail-guide/9274 
#    UP to the point 2., BUT NOT 3.
# 3. Now install `anytype-bin` (this package) and now you can follow point 3. and login with the recovery phrase.
# 
# Thanks.
#                                            
pkgname=anytype-electron-bin
pkgver=0.45.32
pkgrel=1
pkgdesc="Operating environment for the new internet. Anytype is a next generation software that breaks down barriers between applications, gives back privacy and data ownership to users."
arch=('x86_64')
url="https://anytype.io/"
license=('custom')
depends=("electron34" bash libsecret hicolor-icon-theme)
makedepends=('asar')
optdepends=('org.freedesktop.secrets: for not having to sign in each time')
provides=('anytype')
conflicts=('anytype'
           'anytype-legacy')
source=(
	"https://github.com/anyproto/anytype-ts/releases/download/v${pkgver}-beta/anytype_${pkgver}-beta_amd64.deb"
)
sha256sums=('02297ec1746f41e80bb247920ed7f7be67cc48d0ea58d8f96f377ec3f93a5b06')

package() {
	bsdtar -xf data.tar.* -C "$pkgdir"
	find "$pkgdir/opt" -type f -not -path '*/resources/*' -delete

	asar extract "$pkgdir/opt/Anytype/resources/app.asar" app.unpacked
	sed -e '/^module\.exports/s,.*,module.exports = isEnvSet ? getFromEnv : false;,' \
		-i app.unpacked/node_modules/electron-is-dev/index.js
	echo 'module.exports = true;' \
		> app.unpacked/node_modules/electron-util/source/is-using-asar.js
	asar pack app.unpacked "$pkgdir/opt/Anytype/resources/app.asar"

	install -Dm755 /dev/stdin "$pkgdir/opt/Anytype/anytype" <<-EOF
	#! /bin/sh
	exec electron34 /opt/Anytype/resources/app.asar "\$@"
	EOF
}