On Sun, Feb 18, 2018 at 12:21:43PM +0100, Klemens Nanni wrote:
> On Sun, Feb 18, 2018 at 09:18:25AM +0100, Sebastien Marie wrote:
> > On Sun, Feb 18, 2018 at 01:33:39AM +0100, Klemens Nanni wrote:
> > > Simple update shipping lots of (breaking) changes, see
> > > https://github.com/BurntSushi/ripgrep/releases/tag/0.8.0 for changelog.
> > >
> > > Add asciidoc as missing BDEP as well as lang/rust in order to pin the
> > > minimally required version.
> >
> > Could you point to me the requirement of asciidoc ? I don't have it on
> > any build host and the build seems fine. Additionally I don't find any
> > "a2x" invocation in ripgrep or rust code source neither.
> ripgrep builds fine without asciidoc as it gracefully skips generating
> the manual page:
>
> $ fgrep -n a2x `make show=WRKSRC`/build.rs
hep. sorry to missed it.
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/textproc/ripgrep/Makefile,v
> retrieving revision 1.7
> diff -u -p -r1.7 Makefile
> --- Makefile 30 Jan 2018 03:27:54 -0000 1.7
> +++ Makefile 18 Feb 2018 11:18:35 -0000
> @@ -4,7 +4,7 @@ COMMENT = line oriented search tool usi
>
> GH_ACCOUNT = BurntSushi
> GH_PROJECT = ripgrep
> -GH_TAGNAME = 0.7.1
> +GH_TAGNAME = 0.8.0
>
> CATEGORIES = textproc sysutils
>
> @@ -16,60 +16,72 @@ WANTLIB += c pthread
> SEPARATE_BUILD = Yes
>
> MODULES = devel/cargo
> +BUILD_DEPENDS = lang/rust>=1.20 \
> + textproc/asciidoc
lang/rust isn't necessary as it is automatically added in BUILD_DEPENDS
when you have devel/cargo in MODULES.
(without your diff)
$ make show=BUILD_DEPENDS
devel/cargo-generate-vendor lang/rust
so just adding textproc/asciidoc in BUILD_DEPENDS is enough.
> +MAKE_ENV = RUSTFLAGS="-C debuginfo=0"
[...]
> Index: patches/patch-Cargo_toml
> ===================================================================
> RCS file: /cvs/ports/textproc/ripgrep/patches/patch-Cargo_toml,v
> retrieving revision 1.3
> diff -u -p -r1.3 patch-Cargo_toml
> --- patches/patch-Cargo_toml 1 Nov 2017 20:27:22 -0000 1.3
> +++ patches/patch-Cargo_toml 18 Feb 2018 11:18:35 -0000
> @@ -3,7 +3,7 @@ Don't use debug on release.
> Index: Cargo.toml
> --- Cargo.toml.orig
> +++ Cargo.toml
> -@@ -60,4 +60,4 @@ simd-accel = [
> +@@ -75,4 +75,4 @@ simd-accel = [
> ]
>
> [profile.release]
The patch hasn't been removed. And after testing, passing RUSTFLAGS in
MAKE_ENV is ineffective.
Your RUSTFLAGS setting is overrided by cargo.port.mk. But the module was
designed in a way that RUSTFLAGS is a user parameter (not sure it was a
good thing: the purpose was to pass RUSTFLAGS from command-line to test
things). But as it, it shouldn't be set directly (module variable should
have MODxxx name). So some changes in cargo.port.mk would be necessary.
The following diff takes care of that:
- use MODCARGO_RUSTFLAGS as port variable to set RUSTFLAGS in cargo
invocation
- while here, correct (a bit) the license detection (bug reported by
kpcyrd <kpcyrd AT rxv.cc> some time ago).
With it, adding
MODCARGO_RUSTFLAGS += -C debuginfo=0
to ripgrep's Makefile, makes RUSTFLAGS variable correctly setted and
passed to cargo.
Please note, I am still unsure if strip(1) is need in post-install.
Thanks.
--
Sebastien Marie
Index: cargo.port.mk
===================================================================
RCS file: /cvs/ports/devel/cargo/cargo.port.mk,v
retrieving revision 1.6
diff -u -p -r1.6 cargo.port.mk
--- cargo.port.mk 31 Jul 2017 13:16:08 -0000 1.6
+++ cargo.port.mk 18 Feb 2018 18:03:35 -0000
@@ -13,6 +13,9 @@ MODCARGO_FEATURES ?=
# Used to override a dependency with newer version.
MODCARGO_CRATES_UPDATE ?=
+# RUSTFLAGS variable to pass to cargo.
+MODCARGO_RUSTFLAGS ?=
+
# Name of the local directory for vendoring crates.
MODCARGO_VENDOR_DIR ?= ${WRKSRC}/modcargo-crates
@@ -126,7 +129,7 @@ MODCARGO_ENV += \
CARGO_TARGET_DIR=${MODCARGO_TARGET_DIR} \
RUSTC=${LOCALBASE}/bin/rustc \
RUSTDOC=${LOCALBASE}/bin/rustdoc \
- RUSTFLAGS="${RUSTFLAGS}"
+ RUSTFLAGS="${MODCARGO_RUSTFLAGS}"
# Helper to shorten cargo calls.
MODCARGO_CARGO_RUN = \
@@ -211,7 +214,7 @@ modcargo-gen-crates: extract
# modcargo-gen-crates-licenses will try to grab license information from
downloaded crates.
modcargo-gen-crates-licenses: configure
@find ${WRKSRC}/modcargo-crates -name 'Cargo.toml' -maxdepth 2 \
- -exec grep -H '^license' {} \; \
+ -exec grep -H '^[ ]*license' {} \; \
| sed \
-e 's|^${WRKSRC}/modcargo-crates/|MODCARGO_CRATES += |' \
-e 's|/Cargo.toml:license.*= *"| # |' \