Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poc zed package template #49019

Closed
wants to merge 3 commits into from
Closed

Conversation

aryalaadi
Copy link
Contributor

proof of concept void package template for the zed text editor

Testing the changes

  • I tested the changes in this PR: briefly

zed poc package template
build_style=cargo
makedepends=" alsa-lib-devel fontconfig-devel wayland-devel libxkbcommon-devel openssl-devel"
depends="alsa-lib fontconfig wayland libxkbcommon libxkbcommon-x11 openssl"
short_desc="Zed is a high-performance, multiplayer code editor."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
short_desc="Zed is a high-performance, multiplayer code editor."
short_desc="High-performance, multiplayer code editor"

@classabbyamp classabbyamp added the new-package This PR adds a new package label Mar 2, 2024
@aryalaadi
Copy link
Contributor Author

aryalaadi commented Mar 3, 2024

Caused by:
  process didn't exit successfully: `/builddir/zed-0.124.8/target/release/build/live_kit_server-3b7b5b64e66f40d0/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at crates/live_kit_server/build.rs:4:10:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: Could not make proto path relative: protocol/livekit_room.proto: No such file or directory\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

cant figure out how to get past this
zed builds perfectly fine when i run cargo build directly

@aryalaadi aryalaadi marked this pull request as draft March 3, 2024 18:28
@dmarto
Copy link
Contributor

dmarto commented Mar 3, 2024

You need to handle (i.e download) the git submodule, as they are not included in the sources.

https://github.com/zed-industries/zed/blob/main/.gitmodules

AFAIK, there is not a set way/approach for it in void, different pkgs deal differently - some ask upstream for "hydrated" sources, other add them as distfiles, etc..

Hope that helps :)

@aryalaadi
Copy link
Contributor Author

aryalaadi commented Mar 4, 2024 via email

@ahesford
Copy link
Member

ahesford commented Mar 4, 2024

I figured do_fetch() to clone the git repository instead

That is not permissible.

@aryalaadi
Copy link
Contributor Author

so how would i go about adding livekit as a distfile?

@aryalaadi
Copy link
Contributor Author

ok ive managed to get the package to build after i created the full source archive myself
(ive requested the upstream to provide the archive on every release) with something like this

pkgname=zed
version=0.124.8
revision=1
build_style=cargo
hostmakedepends="pkg-config python3 cargo"
makedepends="alsa-lib-devel libzstd-devel fontconfig-devel wayland-devel libxkbcommon-devel openssl-devel"
depends="alsa-lib libzstd fontconfig wayland libxkbcommon libxkbcommon-x11 openssl"
short_desc="High-performance, multiplayer code editor"
maintainer="aryalaadi <aryalaadi123@gmail.com>"
license="GPL-3.0"
homepage="https://github.com/zed-industries/zed"
distfiles="http://localhost:8000/zed.tar.gz"
checksum=a45d80c9c68e8aa232490ea3bfe00712e8e296d606ed37d83f1875a693e46654

but after it was done compiling i got this error

error: found a virtual manifest at `/builddir/zed-0.124.8/Cargo.toml` instead of a package manifest
=> ERROR: zed-0.124.8_1: do_install: '${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" --offline --locked ${configure_args} ${make_install_args}' exited with 101
=> ERROR:   in do_install() at common/build-style/cargo.sh:22

any idea on what could be causing this?

@someone13574
Copy link
Contributor

ok ive managed to get the package to build after i created the full source archive myself (ive requested the upstream to provide the archive on every release) with something like this

pkgname=zed
version=0.124.8
revision=1
build_style=cargo
hostmakedepends="pkg-config python3 cargo"
makedepends="alsa-lib-devel libzstd-devel fontconfig-devel wayland-devel libxkbcommon-devel openssl-devel"
depends="alsa-lib libzstd fontconfig wayland libxkbcommon libxkbcommon-x11 openssl"
short_desc="High-performance, multiplayer code editor"
maintainer="aryalaadi <aryalaadi123@gmail.com>"
license="GPL-3.0"
homepage="https://github.com/zed-industries/zed"
distfiles="http://localhost:8000/zed.tar.gz"
checksum=a45d80c9c68e8aa232490ea3bfe00712e8e296d606ed37d83f1875a693e46654

but after it was done compiling i got this error

error: found a virtual manifest at `/builddir/zed-0.124.8/Cargo.toml` instead of a package manifest
=> ERROR: zed-0.124.8_1: do_install: '${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" --offline --locked ${configure_args} ${make_install_args}' exited with 101
=> ERROR:   in do_install() at common/build-style/cargo.sh:22

any idea on what could be causing this?

Here's a working template I made:

# Template file for 'zed'
pkgname=zed
version=0.132.4
revision=1
build_style=cargo
make_install_args="--path crates/zed"
hostmakedepends="pkg-config"
makedepends="alsa-lib-devel fontconfig-devel libxcb-devel libxkbcommon-devel libzstd-devel openssl-devel wayland-devel libgit2-devel"
short_desc="High-performance, multiplayer code editor"
maintainer="Owen Law <owenlaw222@gmail.com>"
license="AGPL-3.0-or-later, GPL-3.0-or-later, Apache-2.0"
homepage="https://zed.dev/"
_protocol=1.1.2
distfiles="https://github.com/zed-industries/zed/archive/refs/tags/v${version}.tar.gz
 https://github.com/livekit/protocol/archive/refs/tags/v${_protocol}.tar.gz>protocol-v${_protocol}.tar.gz"
checksum="e9b0d3079b331114f2dbfb99a23cf7af79d67b9ca9ae94b128953a7654e39cb2
 9e3dac3be15f896a6602a4fac12c91286e3b97834ef3e17e3aa69fc592d80761"

skip_extraction="protocol-v${_protocol}.tar.gz"

post_extract() {
        vsrcextract -C crates/live_kit_server/protocol "protocol-v${_protocol}.tar.gz"
        vlicense LICENSE-AGPL
}

@aryalaadi
Copy link
Contributor Author

aryalaadi commented May 1, 2024 via email

@someone13574
Copy link
Contributor

Given that upstream for Linux isn’t stable (or even in beta for that matter), I don’t think a PR is needed at the moment as it will go nowhere.

@Vaelatern
Copy link
Member

Vaelatern commented May 14, 2024

I'm personally interested in this. It so happens the latest zed dropped the gitmodules, so that's cool. I may finish this work.

@someone13574
Copy link
Contributor

I'm personally interested in this. It so happens the latest zed dropped the gitmodules, so that's cool. I may finish this work.

Feel free to take the template I made above. All you really need to do is update the version number, cut out the protocol stuff, and update the hashes.

@Vaelatern
Copy link
Member

#50476 is pretty far along. I'm going to wait for that to merge. Closing this, thank you for the initial legwork!

@Vaelatern Vaelatern closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package This PR adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants