mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-02 07:11:47 +01:00
144 lines
3.5 KiB
Plaintext
144 lines
3.5 KiB
Plaintext
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
#
|
|
# TODO: Unbundle tree-sitter parsers (https://github.com/lapce/lapce/issues/486)
|
|
#
|
|
pkgname=lapce
|
|
pkgver=0.2.8
|
|
pkgrel=2
|
|
pkgdesc="Lightning-fast and Powerful Code Editor written in Rust"
|
|
url="https://lapce.dev"
|
|
# ppc64le: ring crate fails to build
|
|
# armhf, armv7, x86: wasmer-vm crate fails to build (unsupported platform)
|
|
# riscv64, s390x: blocked by rust/cargo
|
|
arch="aarch64 x86_64" # limited by rust/cargo
|
|
license="Apache-2.0"
|
|
makedepends="
|
|
cargo
|
|
cargo-auditable
|
|
cmd:patchelf
|
|
fontconfig-dev
|
|
freetype-dev
|
|
gtk+3.0-dev
|
|
libgit2-dev
|
|
libssh2-dev
|
|
libxcb-dev
|
|
libxfixes-dev
|
|
libxkbcommon-dev
|
|
openssl-dev>3
|
|
python3
|
|
vulkan-loader-dev
|
|
wayland-dev
|
|
zstd-dev
|
|
"
|
|
subpackages="$pkgname-proxy"
|
|
source="https://github.com/lapce/lapce/archive/v$pkgver/lapce-$pkgver.tar.gz
|
|
libgit2.patch
|
|
$pkgname.desktop
|
|
"
|
|
options="!check" # no tests provided
|
|
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
|
|
|
export LIBSSH2_SYS_USE_PKG_CONFIG=1 # use system libssh2
|
|
|
|
# lang-* features are tree-sitter (TS) parsers. This list omits parsers for some
|
|
# langs that are not commonly used and/or their TS parser is huge and/or are not
|
|
# available on Alpine.
|
|
#
|
|
# NOTE: If you miss some language, please raise your hand in
|
|
# https://github.com/lapce/lapce/issues/486 because bundling tree-sitter
|
|
# parsers is insane.
|
|
_cargo_features="
|
|
lang-bash
|
|
lang-c
|
|
lang-cpp
|
|
lang-css
|
|
lang-dockerfile
|
|
lang-elm
|
|
lang-go
|
|
lang-hare
|
|
lang-hcl
|
|
lang-html
|
|
lang-java
|
|
lang-javascript
|
|
lang-json
|
|
lang-julia
|
|
lang-latex
|
|
lang-lua
|
|
lang-markdown
|
|
lang-nix
|
|
lang-php
|
|
lang-python
|
|
lang-ql
|
|
lang-r
|
|
lang-ruby
|
|
lang-rust
|
|
lang-scheme
|
|
lang-scss
|
|
lang-toml
|
|
lang-typescript
|
|
lang-vue
|
|
lang-wgsl
|
|
lang-yaml
|
|
lang-zig
|
|
"
|
|
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
|
|
sed -i 's/"vendored-openssl"//' ./*/Cargo.toml
|
|
|
|
# Rust target triple.
|
|
local target=$(rustc -vV | sed -n 's/host: //p')
|
|
|
|
# Build against system-provided libzstd.
|
|
mkdir -p .cargo
|
|
cat >> .cargo/config.toml <<-EOF
|
|
[target.$target]
|
|
git2 = { rustc-link-lib = ["git2"] }
|
|
zstd = { rustc-link-lib = ["zstd"] }
|
|
EOF
|
|
|
|
# open64
|
|
cargo update -p getrandom --precise 0.2.10
|
|
|
|
cargo fetch --target="$CTARGET" # update lockfile after patching Cargo.toml
|
|
}
|
|
|
|
build() {
|
|
export RELEASE_TAG_NAME=$pkgver
|
|
# Exclude feature lapce-data/updater.
|
|
cargo auditable build -p lapce-ui --frozen --release --no-default-features \
|
|
--features $(echo $_cargo_features | tr ' ' ',')
|
|
|
|
cargo auditable build -p lapce-proxy --frozen --release
|
|
|
|
# Add missing vulkan dependency.
|
|
patchelf --add-needed libvulkan.so.1 target/release/lapce
|
|
}
|
|
|
|
package() {
|
|
install -D -m755 target/release/lapce -t "$pkgdir"/usr/bin/
|
|
install -D -m755 target/release/lapce-proxy -t "$pkgdir"/usr/bin/
|
|
|
|
install -D -m644 "$srcdir"/$pkgname.desktop -t "$pkgdir"/usr/share/applications/
|
|
install -D -m644 extra/images/logo.svg \
|
|
"$pkgdir"/usr/share/icons/hicolor/scalable/apps/$pkgname.svg
|
|
}
|
|
|
|
proxy() {
|
|
pkgdesc="Remote proxy server for the Lapce editor"
|
|
|
|
amove usr/bin/lapce-proxy
|
|
}
|
|
|
|
sha512sums="
|
|
d0763d1b9003d90a57010d503f73c34d4b80fea731f6a95857aa0797b011578943d9e61ca957df17831570c78d79d459c50a8ef3c73ffb0fdc4eb7ff9a5c134e lapce-0.2.8.tar.gz
|
|
bfadcc15fb05c7b99f761cb925f29e9f9ca13a14be9aa3858570237f2ea265756c92852e20bc68d6c97f2b5d2d17965f96df39333984dda37283ed5873b551dc libgit2.patch
|
|
4daa808a02a3570d322d0d5a5f8a82323400cf20c4e167f9e1388f9f51e933965ce9076a0c7f1849b7888a732d30b1719eceabc6a187059484d0ae2496cb2870 lapce.desktop
|
|
"
|