Re: Add devel/rust-analyzer

2024-01-19 Thread Sebastien Marie
Edd Barrett  writes:

> Hi,
>
>> I am unsure to properly understand here. You need rust,-src and rustfmt
>> to build the port now ?
>
> You're right, that's bogus. Fixed.
>
>> post-build:
>>  cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/asciidoctor \
>>  docs/user/manual.adoc
>
> Fixed, and using -safe.
>
>> Please install both manual.html and manual.adoc. AsciiDoc format is
>> readable in a terminal.
>
> Fixed.
>
> Diff to previous. OK?

ok semarie@

Thanks.

> diff -urNa /tmp/rust-analyzer/Makefile ./Makefile
> --- /tmp/rust-analyzer/Makefile   Fri Jan 19 11:16:07 2024
> +++ ./MakefileFri Jan 19 15:48:07 2024
> @@ -14,9 +14,9 @@
>  
>  RUN_DEPENDS =lang/rust,-src \
>   lang/rust,-rustfmt
> -BUILD_DEPENDS =  ${RUN_DEPENDS} \
> - textproc/ruby-rouge \
> +BUILD_DEPENDS =  textproc/ruby-rouge \
>   textproc/asciidoctor
> +TEST_DEPENDS =   lang/rust,-rustfmt
>  
>  WANTLIB += ${MODCARGO_WANTLIB} m
>  
> @@ -34,12 +34,14 @@
>  
>  # generate manual.html
>  post-build:
> - asciidoctor ${WRKSRC}/docs/user/manual.adoc
> + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
> + ${LOCALBASE}/bin/asciidoctor --safe docs/user/manual.adoc
>  
>  DOCDIR = ${PREFIX}/share/doc/rust-analyzer
>  post-install:
>   ${INSTALL_DATA_DIR} ${DOCDIR}
>   ${INSTALL_DATA} ${WRKSRC}/docs/user/manual.html ${DOCDIR}
> + ${INSTALL_DATA} ${WRKSRC}/docs/user/manual.adoc ${DOCDIR}
>  
>  .include "crates.inc"
>  
> diff -urNa /tmp/rust-analyzer/pkg/PLIST ./pkg/PLIST
> --- /tmp/rust-analyzer/pkg/PLIST  Fri Jan 19 11:13:23 2024
> +++ ./pkg/PLIST   Fri Jan 19 15:16:31 2024
> @@ -1,3 +1,4 @@
>  @bin bin/rust-analyzer
>  share/doc/rust-analyzer/
> +share/doc/rust-analyzer/manual.adoc
>  share/doc/rust-analyzer/manual.html

-- 
Sebastien Marie



Re: Add devel/rust-analyzer

2024-01-19 Thread Edd Barrett
Hi,

> I am unsure to properly understand here. You need rust,-src and rustfmt
> to build the port now ?

You're right, that's bogus. Fixed.

> post-build:
>   cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/asciidoctor \
>   docs/user/manual.adoc

Fixed, and using -safe.

> Please install both manual.html and manual.adoc. AsciiDoc format is
> readable in a terminal.

Fixed.

Diff to previous. OK?

diff -urNa /tmp/rust-analyzer/Makefile ./Makefile
--- /tmp/rust-analyzer/Makefile Fri Jan 19 11:16:07 2024
+++ ./Makefile  Fri Jan 19 15:48:07 2024
@@ -14,9 +14,9 @@
 
 RUN_DEPENDS =  lang/rust,-src \
lang/rust,-rustfmt
-BUILD_DEPENDS =${RUN_DEPENDS} \
-   textproc/ruby-rouge \
+BUILD_DEPENDS =textproc/ruby-rouge \
textproc/asciidoctor
+TEST_DEPENDS = lang/rust,-rustfmt
 
 WANTLIB += ${MODCARGO_WANTLIB} m
 
@@ -34,12 +34,14 @@
 
 # generate manual.html
 post-build:
-   asciidoctor ${WRKSRC}/docs/user/manual.adoc
+   cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+   ${LOCALBASE}/bin/asciidoctor --safe docs/user/manual.adoc
 
 DOCDIR =   ${PREFIX}/share/doc/rust-analyzer
 post-install:
${INSTALL_DATA_DIR} ${DOCDIR}
${INSTALL_DATA} ${WRKSRC}/docs/user/manual.html ${DOCDIR}
+   ${INSTALL_DATA} ${WRKSRC}/docs/user/manual.adoc ${DOCDIR}
 
 .include "crates.inc"
 
diff -urNa /tmp/rust-analyzer/pkg/PLIST ./pkg/PLIST
--- /tmp/rust-analyzer/pkg/PLISTFri Jan 19 11:13:23 2024
+++ ./pkg/PLIST Fri Jan 19 15:16:31 2024
@@ -1,3 +1,4 @@
 @bin bin/rust-analyzer
 share/doc/rust-analyzer/
+share/doc/rust-analyzer/manual.adoc
 share/doc/rust-analyzer/manual.html

-- 
Best Regards
Edd Barrett

https://www.theunixzoo.co.uk



Re: Add devel/rust-analyzer

2024-01-19 Thread Sebastien Marie
Edd Barrett  writes:

> About the latter, the tests expect "stable" to appear in the output of 
> `rustfmt
> --version`. But that's not so for our package:
>
> ```
> $ rustfmt --version   
> rustfmt 1.7.0-
> ```
>
> I suspect it should return `rustfmt 1.7.0-stable`? CC semarie@

I will take a look at rustfmt.

for now, patching rust-analyzer is fine.

> Anyway, below is a diff showing what I changed, and I've attached a tarball 
> for
> convenience.
>
> Still OK?
>
>
> diff -urNa rust-analyzer.old/Makefile rust-analyzer/Makefile
> --- rust-analyzer.old/MakefileFri Jan 19 10:49:54 2024
> +++ rust-analyzer/MakefileFri Jan 19 11:16:07 2024
> @@ -12,7 +12,11 @@
>  # MIT OR Apache-2.0
>  PERMIT_PACKAGE = Yes
>  
> -RUN_DEPENDS =lang/rust,-src
> +RUN_DEPENDS =lang/rust,-src \
> + lang/rust,-rustfmt
> +BUILD_DEPENDS =  ${RUN_DEPENDS} \
> + textproc/ruby-rouge \
> + textproc/asciidoctor

I am unsure to properly understand here. You need rust,-src and rustfmt
to build the port now ?

You mentionned rustfmt about tests previously.

>  
>  WANTLIB += ${MODCARGO_WANTLIB} m
>  
> @@ -23,6 +27,19 @@
>  SEPARATE_BUILD = Yes
>  
>  CONFIGURE_STYLE =cargo
> +
> +# Make `rust-analyzer --version` print the right thing.
> +# (otherwise it reports itself as version 0.0.0)
> +MAKE_ENV += CFG_RELEASE=${GH_TAGNAME}
> +
> +# generate manual.html
> +post-build:
> + asciidoctor ${WRKSRC}/docs/user/manual.adoc
> +

I would use a slightly different invocation:

post-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/asciidoctor \
docs/user/manual.adoc

it will more constraint the environment seen by asciidoctor (the one
configured in the port, and not the one of the build user).

if possible, I would use `asciidoctor --safe` also, but I didn't check it.

> +DOCDIR = ${PREFIX}/share/doc/rust-analyzer
> +post-install:
> + ${INSTALL_DATA_DIR} ${DOCDIR}
> + ${INSTALL_DATA} ${WRKSRC}/docs/user/manual.html ${DOCDIR}

Please install both manual.html and manual.adoc. AsciiDoc format is
readable in a terminal.

Thanks.
-- 
Sebastien Marie



Re: Add devel/rust-analyzer

2024-01-19 Thread Edd Barrett
Hi,

On Thu, Jan 18, 2024 at 09:44:20AM -, Laurent Cheylus wrote:
> - Add MAKE_ENV += CFG_RELEASE=${GH_TAGNAME} to set version
> - Add post-build to generate HTML doc with asciidoctor
> - Install binary and doc in do-install

Thanks!

I've looked at Laurent's openbsd-wip port and incorporated the bits we missed,
albeit with tweaks:

 - convert `do-install` to a `post-install` without the explicit binary install
   step.

 - remove this from `post-build`:
```
${MODCARGO_CARGO_RUN} test \
--manifest-path ${MODCARGO_CARGOTOML} \
--offline \
--release \
--verbose \
-p ide-assists \
-p ide-diagnostics \
-p rust-analyzer \
-- sourcegen_
```

As far as I can see, that runs a test, which we already have an implicit
target for.

While here, also fix the tests:
 - Don't invoke `rustfmt` via `rustup`.
 - Workaround `rustfmt` version quirk.

About the latter, the tests expect "stable" to appear in the output of `rustfmt
--version`. But that's not so for our package:

```
$ rustfmt --version   
rustfmt 1.7.0-
```

I suspect it should return `rustfmt 1.7.0-stable`? CC semarie@

Anyway, below is a diff showing what I changed, and I've attached a tarball for
convenience.

Still OK?


diff -urNa rust-analyzer.old/Makefile rust-analyzer/Makefile
--- rust-analyzer.old/Makefile  Fri Jan 19 10:49:54 2024
+++ rust-analyzer/Makefile  Fri Jan 19 11:16:07 2024
@@ -12,7 +12,11 @@
 # MIT OR Apache-2.0
 PERMIT_PACKAGE =   Yes
 
-RUN_DEPENDS =  lang/rust,-src
+RUN_DEPENDS =  lang/rust,-src \
+   lang/rust,-rustfmt
+BUILD_DEPENDS =${RUN_DEPENDS} \
+   textproc/ruby-rouge \
+   textproc/asciidoctor
 
 WANTLIB += ${MODCARGO_WANTLIB} m
 
@@ -23,6 +27,19 @@
 SEPARATE_BUILD =   Yes
 
 CONFIGURE_STYLE =  cargo
+
+# Make `rust-analyzer --version` print the right thing.
+# (otherwise it reports itself as version 0.0.0)
+MAKE_ENV += CFG_RELEASE=${GH_TAGNAME}
+
+# generate manual.html
+post-build:
+   asciidoctor ${WRKSRC}/docs/user/manual.adoc
+
+DOCDIR =   ${PREFIX}/share/doc/rust-analyzer
+post-install:
+   ${INSTALL_DATA_DIR} ${DOCDIR}
+   ${INSTALL_DATA} ${WRKSRC}/docs/user/manual.html ${DOCDIR}
 
 .include "crates.inc"
 
diff -urNa 
rust-analyzer.old/patches/patch-crates_rust-analyzer_tests_slow-tests_tidy_rs 
rust-analyzer/patches/patch-crates_rust-analyzer_tests_slow-tests_tidy_rs
--- 
rust-analyzer.old/patches/patch-crates_rust-analyzer_tests_slow-tests_tidy_rs   
Thu Jan  1 01:00:00 1970
+++ rust-analyzer/patches/patch-crates_rust-analyzer_tests_slow-tests_tidy_rs   
Fri Jan 19 13:48:06 2024
@@ -0,0 +1,31 @@
+Don't use rustup. Work around OpenBSD rustfmt bug.
+
+Index: crates/rust-analyzer/tests/slow-tests/tidy.rs
+--- crates/rust-analyzer/tests/slow-tests/tidy.rs.orig
 crates/rust-analyzer/tests/slow-tests/tidy.rs
+@@ -14,17 +14,17 @@ fn check_code_formatting() {
+ let sh = &Shell::new().unwrap();
+ sh.change_dir(sourcegen::project_root());
+ 
+-let out = cmd!(sh, "rustup run stable rustfmt --version").read().unwrap();
+-if !out.contains("stable") {
+-panic!(
+-"Failed to run rustfmt from toolchain 'stable'. \
+- Please run `rustup component add rustfmt --toolchain stable` 
to install it.",
+-)
++let out = cmd!(sh, "rustfmt --version").read().unwrap();
++// FIXME: OpenBSD's rustfmt doesn't report it's version correctly.
++// At the time of writing, `rustfmt --version` gives `rustfmt 1.7.0-` 
(i.e. missing the
++// `-stable` suffix.
++if !out.contains("rustfmt") {
++panic!("Failed to run rustfmt from toolchain 'stable'.");
+ }
+ 
+-let res = cmd!(sh, "rustup run stable cargo fmt -- --check").run();
++let res = cmd!(sh, "cargo fmt -- --check").run();
+ if res.is_err() {
+-let _ = cmd!(sh, "rustup run stable cargo fmt").run();
++let _ = cmd!(sh, "cargo fmt").run();
+ }
+ res.unwrap()
+ }
diff -urNa rust-analyzer.old/patches/patch-crates_sourcegen_src_lib_rs 
rust-analyzer/patches/patch-crates_sourcegen_src_lib_rs
--- rust-analyzer.old/patches/patch-crates_sourcegen_src_lib_rs Thu Jan  1 
01:00:00 1970
+++ rust-analyzer/patches/patch-crates_sourcegen_src_lib_rs Fri Jan 19 
13:49:54 2024
@@ -0,0 +1,42 @@
+Don't use rustup. Work around OpenBSD rustfmt bug.
+
+Index: crates/sourcegen/src/lib.rs
+--- crates/sourcegen/src/lib.rs.orig
 crates/sourcegen/src/lib.rs
+@@ -133,12 +133,12 @@ impl fmt::Display for Location {
+ }
+ 
+ fn ensure_rustfmt(sh: &Shell) {
+-let version = cmd!(sh, "rustup run stable rustfmt 
--version").read().unwrap_or_default();
+-if !version.contains("stable") {
+-panic!(
+-"Failed to run rustfmt from toolchain 'stable'. \
+- Please run `rustup component add rustfmt --toolchain stable` 
to install it.",
+- 

Re: Add devel/rust-analyzer

2024-01-18 Thread Edd Barrett
On Thu, Jan 18, 2024 at 09:44:20AM -, Laurent Cheylus wrote:
> The RDEP on lang/rust,-src is not optional, rust-analyzer tool needs Rust 
> sources to work properly.

Agreed, but on the other hand, you may not be using the packaged version of
Rust, in which case you'd point RUST_SRC_PATH elsewhere, and the packaged
rust-src would be unused.

Then again, given how difficult rust is to bootstrap on OpenBSD, I doubt anyone
is using their own build of rust, so actually I'm fine with making rust-src a
hard dependency. Also, disk is cheap.

We should probably mention RUST_SRC_PATH in a package README.

-- 
Best Regards
Edd Barrett

https://www.theunixzoo.co.uk



Re: Add devel/rust-analyzer

2024-01-17 Thread Sebastien Marie
Theo Buehler  writes:
>
> And as semarie pointed out crates.inc should be regenerated to include
> the licenses (make modcargo-gen-crates-licenses)
>

a few more comments.

- license is dual Apache 2.0 / MIT

- SEPARATE_BUILD=Yes is supported

- MODCARGO_RUSTFLAGS setting seems unnecessary (it built fine without it)

- do-install is unnecessary when using MODCARGO_INSTALL_TARGET_PATHS = 
crates/rust-analyzer

- MAKE_ENV = ${MODCARGO_ENV} is unnecessary (the default build target
  does it already)


Full diff below, with tb@ fixes incorported.

ok semarie@

Thanks.
-- 
Sebastien Marie


diff -ru rust-analyzer.orig/Makefile rust-analyzer/Makefile
--- rust-analyzer.orig/Makefile Tue Dec 19 12:12:41 2023
+++ rust-analyzer/Makefile  Wed Jan 17 16:20:00 2024
@@ -9,24 +9,20 @@
 
 HOMEPAGE = https://rust-analyzer.github.io/
 
-# Apache 2.0
+# MIT OR Apache-2.0
 PERMIT_PACKAGE =   Yes
 
-RUN_DEPENDS = lang/rust-src
+RUN_DEPENDS =  lang/rust,-src
 
-WANTLIB += c c++abi m pthread util
+WANTLIB += ${MODCARGO_WANTLIB} m
 
 MODULES =  devel/cargo
 
-MODCARGO_CRATES_UPDATE =   cc libc
-MODCARGO_RUSTFLAGS += -L${PREFIX}/lib
+MODCARGO_INSTALL_TARGET_PATHS =crates/rust-analyzer
 
-MAKE_ENV = ${MODCARGO_ENV}
+SEPARATE_BUILD =   Yes
 
 CONFIGURE_STYLE =  cargo
-
-do-install:
-   ${INSTALL_PROGRAM} ${MODCARGO_TARGET_DIR}/release/rust-analyzer 
${PREFIX}/bin/
 
 .include "crates.inc"
 
diff -ru rust-analyzer.orig/crates.inc rust-analyzer/crates.inc
--- rust-analyzer.orig/crates.inc   Tue Dec 19 11:56:06 2023
+++ rust-analyzer/crates.incWed Jan 17 16:15:14 2024
@@ -1,190 +1,189 @@
-# run: make modcargo-gen-crates-licenses
-MODCARGO_CRATES += addr2line   0.19.0
-MODCARGO_CRATES += adler   1.0.2
-MODCARGO_CRATES += always-assert   0.1.3
-MODCARGO_CRATES += anyhow  1.0.75
-MODCARGO_CRATES += arbitrary   1.3.2
-MODCARGO_CRATES += arrayvec0.7.4
-MODCARGO_CRATES += autocfg 1.1.0
-MODCARGO_CRATES += backtrace   0.3.67
-MODCARGO_CRATES += bitflags1.3.2
-MODCARGO_CRATES += bitflags2.4.1
-MODCARGO_CRATES += byteorder   1.4.3
-MODCARGO_CRATES += camino  1.1.4
-MODCARGO_CRATES += cargo-platform  0.1.2
-MODCARGO_CRATES += cargo_metadata  0.18.1
-MODCARGO_CRATES += cc  1.0.79
-MODCARGO_CRATES += cfg-if  1.0.0
-MODCARGO_CRATES += chalk-derive0.95.0
-MODCARGO_CRATES += chalk-ir0.95.0
-MODCARGO_CRATES += chalk-recursive 0.95.0
-MODCARGO_CRATES += chalk-solve 0.95.0
-MODCARGO_CRATES += command-group   2.1.0
-MODCARGO_CRATES += countme 3.0.1
-MODCARGO_CRATES += cov-mark2.0.0-pre.1
-MODCARGO_CRATES += crc32fast   1.3.2
-MODCARGO_CRATES += crossbeam-channel   0.5.8
-MODCARGO_CRATES += crossbeam-deque 0.8.3
-MODCARGO_CRATES += crossbeam-epoch 0.9.15
-MODCARGO_CRATES += crossbeam-utils 0.8.16
-MODCARGO_CRATES += ctrlc   3.4.1
-MODCARGO_CRATES += dashmap 5.5.3
-MODCARGO_CRATES += derive_arbitrary1.3.2
-MODCARGO_CRATES += dissimilar  1.0.7
-MODCARGO_CRATES += dot 0.1.4
-MODCARGO_CRATES += drop_bomb   0.1.5
-MODCARGO_CRATES += either  1.9.0
-MODCARGO_CRATES += ena 0.14.2
-MODCARGO_CRATES += equivalent  1.0.0
-MODCARGO_CRATES += expect-test 1.4.1
-MODCARGO_CRATES += filetime0.2.22
-MODCARGO_CRATES += fixedbitset 0.4.2
-MODCARGO_CRATES += flate2  1.0.26
-MODCARGO_CRATES += form_urlencoded 1.2.0
-MODCARGO_CRATES += fsevent-sys 4.1.0
-MODCARGO_CRATES += fst 0.4.7
-MODCARGO_CRATES += gimli   0.27.3
-MODCARGO_CRATES += hashbrown   0.14.3
-MODCARGO_CRATES += heck0.4.1
-MODCARGO_CRATES += hermit-abi  0.2.6
-MODCARGO_CRATES += home0.5.5
-MODCARGO_CRATES += idna0.4.0
-MODCARGO_CRATES += indexmap2.1.0
-MODCARGO_CRATES += inotify 0.9.6
-MODCARGO_CRATES += inotify-sys 0.1.5
-MODCARGO_CRATES += itertools   0.12.0
-MODCARGO_CRATES += itoa1.0.6
-MODCARGO_CRATES += jod-thread  0.1.2
-MODCARGO_CRATES += kqueue  1.0.7
-MODCARGO_CRATES += kqueue-sys  1.0.3
-MODCARGO_CRATES += la-arena0.3.1
-MODCARGO_CRATES += lazy_static 1.4.0
-MODCARGO_CRATES += libc0.2.150
-MODCARGO_CRATES += libloading  0.8.0
-MODCARGO_CRATES += libmimalloc-sys 0.1.33
-MODCARGO_CRATES += line-index  0.1.1
-MODCARGO_CRATES += lock_api0.4.10
-MODCARGO_CRATES += log 0.4.19
-MODCARGO_CRATES += lsp-server  0.7.4
-MODCARGO_CRATES += lsp-types   0.94.0
-MODCARGO_CRATES += memchr  2.6.4
-MODCARGO_CRATES += memmap2 0.5.10
-MODCARGO_CRATES += memoffset   0.9.0
-MODCARGO_CRATES += mimalloc0.1.37
-MODCARGO_CRATES += miniz_oxide 0.6.2
-MODCARGO_CRATES += miniz_oxide 0.7.1
-MODCARGO_CRATES += mio 0.8.5
-MODCARGO_CRATES += miow   

Re: Add devel/rust-analyzer

2024-01-17 Thread Theo Buehler
On Wed, Jan 17, 2024 at 03:32:01PM +0100, Theo Buehler wrote:
> On Tue, Dec 19, 2023 at 12:14:20PM +0100, Benjamin Stürz wrote:
> > On 12/4/23 02:22, Greg Steuck wrote:
> > > Greg Steuck  writes:
> > > 
> > > > I verified that this works well enough in emacs with eglot. Maybe others
> > > > will find it useful enough to OK? If so, I'd apprecite a bit of extra
> > > > diligence as this is my first rust port.
> > > > 
> > > > rust-src seems important for this port, maybe it should be in 
> > > > RUN_DEPENDS?
> > > 
> > > As reminded by mbhul@, tgz is easier for the initial imports.
> > > 
> > 
> > Updated to the latest version 2023-12-18.
> > Also added lang/rust-src to RUN_DEPENDS.
> > Tested and works with emacs.
> 
> I haven't run tested it, but if it works for Benjamin, gnezdo and edd,
> this is
> 
> ok tb
> 
> to import with the following diff applied on top: the MODCARGO_WANTLIB
> change is required for WANTLIB to be correct on all architectures
> (sparc64 is special). I don't see where the dep on libutil came from.
> 
> The MODCARGO_CRATES_UPDATE for libc and cc was necessary for riscv64 and
> powerpc64 support, but the versions here are way past where that was an
> issue.
> 
> The RDEP on lang/rust,-src (notice the comma) makes sense to me, but
> it is up to you, the users. It's a heavy dep, so if it is kind of
> optional, maybe leave it optional.

And as semarie pointed out crates.inc should be regenerated to include
the licenses (make modcargo-gen-crates-licenses)

> 
> --- Makefile.orig Wed Jan 17 15:18:07 2024
> +++ Makefile  Wed Jan 17 15:28:00 2024
> @@ -12,13 +12,12 @@ HOMEPAGE =https://rust-analyzer.github.io/
>  # Apache 2.0
>  PERMIT_PACKAGE = Yes
>  
> -RUN_DEPENDS = lang/rust-src
> +RUN_DEPENDS = lang/rust,-src
>  
> -WANTLIB += c c++abi m pthread util
> +WANTLIB += ${MODCARGO_WANTLIB} m
>  
>  MODULES =devel/cargo
>  
> -MODCARGO_CRATES_UPDATE = cc libc
>  MODCARGO_RUSTFLAGS += -L${PREFIX}/lib
>  
>  MAKE_ENV =   ${MODCARGO_ENV}
> 



Re: Add devel/rust-analyzer

2024-01-17 Thread Theo Buehler
On Tue, Dec 19, 2023 at 12:14:20PM +0100, Benjamin Stürz wrote:
> On 12/4/23 02:22, Greg Steuck wrote:
> > Greg Steuck  writes:
> > 
> > > I verified that this works well enough in emacs with eglot. Maybe others
> > > will find it useful enough to OK? If so, I'd apprecite a bit of extra
> > > diligence as this is my first rust port.
> > > 
> > > rust-src seems important for this port, maybe it should be in RUN_DEPENDS?
> > 
> > As reminded by mbhul@, tgz is easier for the initial imports.
> > 
> 
> Updated to the latest version 2023-12-18.
> Also added lang/rust-src to RUN_DEPENDS.
> Tested and works with emacs.

I haven't run tested it, but if it works for Benjamin, gnezdo and edd,
this is

ok tb

to import with the following diff applied on top: the MODCARGO_WANTLIB
change is required for WANTLIB to be correct on all architectures
(sparc64 is special). I don't see where the dep on libutil came from.

The MODCARGO_CRATES_UPDATE for libc and cc was necessary for riscv64 and
powerpc64 support, but the versions here are way past where that was an
issue.

The RDEP on lang/rust,-src (notice the comma) makes sense to me, but
it is up to you, the users. It's a heavy dep, so if it is kind of
optional, maybe leave it optional.

--- Makefile.orig   Wed Jan 17 15:18:07 2024
+++ MakefileWed Jan 17 15:28:00 2024
@@ -12,13 +12,12 @@ HOMEPAGE =  https://rust-analyzer.github.io/
 # Apache 2.0
 PERMIT_PACKAGE =   Yes
 
-RUN_DEPENDS = lang/rust-src
+RUN_DEPENDS = lang/rust,-src
 
-WANTLIB += c c++abi m pthread util
+WANTLIB += ${MODCARGO_WANTLIB} m
 
 MODULES =  devel/cargo
 
-MODCARGO_CRATES_UPDATE =   cc libc
 MODCARGO_RUSTFLAGS += -L${PREFIX}/lib
 
 MAKE_ENV = ${MODCARGO_ENV}



Re: Add devel/rust-analyzer

2023-12-19 Thread Benjamin Stürz

On 12/4/23 02:22, Greg Steuck wrote:

Greg Steuck  writes:


I verified that this works well enough in emacs with eglot. Maybe others
will find it useful enough to OK? If so, I'd apprecite a bit of extra
diligence as this is my first rust port.

rust-src seems important for this port, maybe it should be in RUN_DEPENDS?


As reminded by mbhul@, tgz is easier for the initial imports.



Updated to the latest version 2023-12-18.
Also added lang/rust-src to RUN_DEPENDS.
Tested and works with emacs.

rust-analyzer-2023-12-18.tgz
Description: Binary data


Re: Add devel/rust-analyzer

2023-12-03 Thread Benjamin Stürz

On 04.12.23 02:22, Greg Steuck wrote:

Greg Steuck  writes:


I verified that this works well enough in emacs with eglot. Maybe others
will find it useful enough to OK? If so, I'd apprecite a bit of extra
diligence as this is my first rust port.

It works for me.


rust-src seems important for this port, maybe it should be in RUN_DEPENDS?

Yes, rust-analyzer is AFAIK unusable without the source code of Rust.


As reminded by mbhul@, tgz is easier for the initial imports.


Thanks for your port.



Re: Add devel/rust-analyzer

2023-12-03 Thread Greg Steuck
Greg Steuck  writes:

> I verified that this works well enough in emacs with eglot. Maybe others
> will find it useful enough to OK? If so, I'd apprecite a bit of extra
> diligence as this is my first rust port.
>
> rust-src seems important for this port, maybe it should be in RUN_DEPENDS?

As reminded by mbhul@, tgz is easier for the initial imports.



rust-analyzer.tgz
Description: Binary data