|
| 1 | +# Template file for 'zed' |
| 2 | +pkgname=zed |
| 3 | +version=0.233.7 |
| 4 | +revision=1 |
| 5 | +archs="x86_64* aarch64*" |
| 6 | +build_style=cargo |
| 7 | +make_check_args="--workspace" |
| 8 | +hostmakedepends="pkg-config cmake gettext perl libzstd-devel bzip2-devel protobuf lld" |
| 9 | +makedepends="gettext-devel elfutils-devel alsa-lib-devel fontconfig-devel glib-devel libva-devel libxcb-devel libxkbcommon-devel libzstd-devel openssl-devel wayland-devel vulkan-loader sqlite-devel libX11-devel libgit2-1.9-devel" |
| 10 | +short_desc="High-performance, multiplayer code editor" |
| 11 | +maintainer="JudahJL <judahlegy@gmail.com>" |
| 12 | +license="GPL-3.0-or-later" |
| 13 | +homepage="https://zed.dev/" |
| 14 | +distfiles="https://github.com/zed-industries/zed/archive/refs/tags/v${version}.tar.gz" |
| 15 | +checksum=2428185c9a6981433e83ed4e979fed4370c73e6439b6352f291e5a9540378678 |
| 16 | +make_check=ci-skip # too slow and memory-intensive for build environment(OS killed test process and tests on average used ~50 Gb of memory locally) |
| 17 | +# https://github.com/void-linux/void-packages/actions/runs/24108190211/job/70336496775 for reference |
| 18 | + |
| 19 | +pre_build() { |
| 20 | + echo -n stable > crates/zed/RELEASE_CHANNEL |
| 21 | + export RELEASE_VERSION="${version}" |
| 22 | + export ZED_UPDATE_EXPLANATION="Please use 'xbps-install -Su' to update." |
| 23 | + export ZED_BUNDLE=true |
| 24 | + |
| 25 | + if [[ "$XBPS_TARGET_MACHINE" == "aarch64" ]]; then |
| 26 | + export RUSTFLAGS="${RUSTFLAGS:-} -C link-arg=-fuse-ld=lld -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib" |
| 27 | + else |
| 28 | + export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib" |
| 29 | + fi |
| 30 | + |
| 31 | + if [ "$CROSS_BUILD" ]; then |
| 32 | + export PKG_CONFIG_ALLOW_CROSS=1 |
| 33 | + |
| 34 | + # workaround the cc-rs mixing CFLAGS for host and target. |
| 35 | + # https://github.com/rust-lang/cc-rs/issues/1469 |
| 36 | + export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \ |
| 37 | + CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \ |
| 38 | + LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \ |
| 39 | + CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \ |
| 40 | + CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \ |
| 41 | + LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \ |
| 42 | + CFLAGS="" CXXFLAGS="" LDFLAGS="" |
| 43 | + fi |
| 44 | +} |
| 45 | + |
| 46 | +do_build() { |
| 47 | + : ${make_cmd:=cargo auditable} |
| 48 | + : ${make_verbose:=-v} |
| 49 | + |
| 50 | + ${make_cmd} build ${XBPS_VERBOSE+${make_verbose}} --release --locked --target ${RUST_TARGET} \ |
| 51 | + ${configure_args} ${make_build_args} --package cli |
| 52 | + |
| 53 | + ${make_cmd} build ${XBPS_VERBOSE+${make_verbose}} --release --locked --target ${RUST_TARGET} \ |
| 54 | + ${configure_args} ${make_build_args} --package zed |
| 55 | + |
| 56 | + # TODO: https://github.com/zed-industries/zed/blob/c372f246a0790da012dddbe3935ee2758a3a9c3b/script/bundle-linux#L87-L88 seperately build remote_server. will include it later. |
| 57 | + #${make_cmd} build ${XBPS_VERBOSE+${make_verbose}} --release --locked --target ${RUST_TARGET} \ |
| 58 | + #${configure_args} ${make_build_args} --package remote_server |
| 59 | +} |
| 60 | + |
| 61 | +do_install() { |
| 62 | + vbin "target/${RUST_TARGET}/release/cli" zed-cli |
| 63 | + vinstall "target/${RUST_TARGET}/release/zed" 755 usr/libexec zed-editor |
| 64 | + # TODO 1: confirm install location of remote_server |
| 65 | + # vinstall "target/${RUST_TARGET}/release/remote_server" 755 usr/libexec |
| 66 | + |
| 67 | + export APP_NAME="Zed" |
| 68 | + export APP_CLI="zed-cli" |
| 69 | + export APP_ICON="zed" |
| 70 | + export APP_ARGS="%U" |
| 71 | + export DO_STARTUP_NOTIFY="true" |
| 72 | + |
| 73 | + envsubst < "crates/zed/resources/zed.desktop.in" > "dev.zed.Zed.desktop" |
| 74 | + vinstall "dev.zed.Zed.desktop" 644 usr/share/applications |
| 75 | + |
| 76 | + vinstall "crates/zed/resources/app-icon.png" 644 usr/share/icons/hicolor/512x512/apps zed.png |
| 77 | + vinstall "crates/zed/resources/app-icon@2x.png" 644 usr/share/icons/hicolor/1024x1024/apps zed.png |
| 78 | +} |
0 commit comments