blob: 6d13e480285e7a144933d3605c4e1de00b611d6f (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Marcell Pardavi <marcell.pardavi@gmail.com>
pkgname=zed-git
_pkgname=${pkgname%-git}
pkgver=0.163.0.r27.g6ab4b46
pkgrel=1
pkgdesc='A high-performance, multiplayer code editor from the creators of Atom and Tree-sitter'
arch=(x86_64)
url=https://zed.dev
_url="https://github.com/zed-industries/$_pkgname"
license=(GPL-3.0-or-later AGPL-3.0-or-later Apache-2.0)
depends=(alsa-lib libasound.so
curl libcurl.so
fontconfig
gcc-libs # libgcc_s.so libstdc++.so
glibc # libc.so libm.so
# libgit2 libgit2.so
# libxau libXau.so
libxcb # libxcb.so libxcb-xkb.so
# libxdmcp libXdmcp.so
libxkbcommon # libxkbcommon.so
libxkbcommon-x11 # libxkbcommon-x11.so
'nodejs>=18'
openssl libcrypto.so libssl.so
sqlite
vulkan-driver
vulkan-icd-loader
vulkan-tools
wayland
zlib libz.so
zstd libzstd.so)
makedepends=(cargo
clang
cmake
git
protobuf
vulkan-headers
vulkan-validation-layers)
optdepends=('clang: improved C/C++ language support'
'eslint: improved Javascript language support'
'pyright: improved Python language support'
'rust-analyzer: improved Rust language support')
replaces=(zed-editor-git)
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$pkgname::git+$_url.git")
sha256sums=('SKIP')
_binname=zeditor
_appid=dev.zed.Zed-Git
prepare() {
cd "$pkgname"
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
export DO_STARTUP_NOTIFY="true"
export APP_ICON="zed"
export APP_NAME="Zed"
export APP_CLI="$_binname"
export APP_ID="$_appid"
export APP_ARGS="%U"
envsubst < "crates/zed/resources/zed.desktop.in" > $_appid.desktop
./script/generate-licenses
}
pkgver() {
cd "$pkgname"
local lasttag="$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-pre$' | head -1)"
echo -n "$(sed 's/^v//;s/-pre$//' <<< "$lasttag")"
echo -n ".r$(git rev-list "$(git merge-base HEAD "$lasttag")..HEAD" --count)"
echo -n ".g$(git log --pretty=format:'%h' --abbrev=7 -n1 HEAD)"
}
_srcenv() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
CFLAGS+=' -ffat-lto-objects'
CXXFLAGS+=' -ffat-lto-objects'
RUSTFLAGS+=" --remap-path-prefix $PWD=/"
}
build() {
_srcenv
export ZED_UPDATE_EXPLANATION='Updates are handled by pacman'
export RELEASE_VERSION="$pkgver"
export PROTOC=/usr/bin/protoc
export PROTOC_INCLUDE=/usr/include
cargo build --release --frozen --package zed --package cli
}
# Tests assume access to vulkan video drivers, Wayland window creation,
# detecting system keymaps, etc. Until there is something sensical for
# a package to test in the suite, just skip it by default.
check() {
_srcenv
# cargo test --frozen --all-features
}
package() {
cd "$pkgname"
install -Dm0755 target/release/cli "$pkgdir/usr/bin/$_binname"
install -Dm0755 target/release/zed "$pkgdir/usr/lib/zed/zed-editor"
install -Dm0644 -t "$pkgdir/usr/share/applications/" "$_appid.desktop"
install -Dm0644 crates/zed/resources/app-icon.png "$pkgdir/usr/share/icons/$_pkgname.png"
}
|