Skip to content

Commit

Permalink
cargo PG: make default configure & build the default
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusCalhoun-Lopez committed Apr 27, 2018
1 parent e3bd4e3 commit ab5c006
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
29 changes: 19 additions & 10 deletions _resources/port1.0/group/cargo-1.0.tcl
Expand Up @@ -62,12 +62,13 @@
# baz author/baz branch abcdef12345678...commit...abcdef12345678 fedcba654321...
#

options cargo.home cargo.crates cargo.crates_github
options cargo.home cargo.crates cargo.crates_github cargo.direct_call

default cargo.home {${workpath}/.home/.cargo}
default cargo.crates {}
default cargo.crates_github {}
default universal_variant yes
default cargo.direct_call no

option_proc cargo.crates handle_cargo_crates
proc handle_cargo_crates {option action {value ""}} {
Expand Down Expand Up @@ -108,6 +109,23 @@ proc handle_cargo_crates_github {option action {value ""}} {
}
}

option_proc cargo.direct_call handle_cargo_direct_call
proc handle_cargo_direct_call {option action {value ""}} {
if {${action} eq "set" && ${value}} {
global build.jobs

use_configure no

build.cmd cargo build
build.target
build.pre_args --release --frozen -v -j${build.jobs}
build.args

# restore destroot.cmd
default destroot.cmd {[portbuild::build_getmaketype]}
}
}

# MacPorts use the name i386 for 32-bit Intel architecture
# Cargo and Rust use the name i686
proc cargo.translate_arch_name {arch} {
Expand Down Expand Up @@ -313,13 +331,4 @@ proc universal_setup {args} {
}
}

use_configure no

build.cmd cargo build
build.target
build.pre_args --release --frozen -v -j${build.jobs}
build.args
build.env-append RUSTFLAGS="-C linker=${configure.cc}"

# restore destroot.cmd
default destroot.cmd {[portbuild::build_getmaketype]}
5 changes: 0 additions & 5 deletions devel/mesalink/Portfile
Expand Up @@ -80,11 +80,6 @@ use_configure yes

configure.args-append --enable-rusthost=\$CARGO_BUILD_TARGET

build.cmd make
build.target all
build.pre_args
build.args

# Release 0.6.1 is broken as it does not contain Cargo.lock
# https://github.com/mesalock-linux/mesalink/issues/10
livecheck.version 0.6.1
2 changes: 2 additions & 0 deletions textproc/ripgrep/Portfile
Expand Up @@ -67,6 +67,8 @@ depends_build-append \
port:asciidoc \
port:docbook-xsl

cargo.direct_call yes

# muniversal build requires Makefile
# OUTDIR contains a checksum, so it is not know until late in the build process and may
# change with a change in the cargo PortGroup
Expand Down

0 comments on commit ab5c006

Please sign in to comment.