Skip to content

Instantly share code, notes, and snippets.

@therealromster
Created June 13, 2017 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealromster/3d2180ca15d10fc89e323da679cd6440 to your computer and use it in GitHub Desktop.
Save therealromster/3d2180ca15d10fc89e323da679cd6440 to your computer and use it in GitHub Desktop.
cargo
$ cat ~/docker/crux/crux-3.3/ports/romster/cargo/Pkgfile
# Description: Rust package manager.
# URL: http://crates.io/
# Packager: Danny Rawlins, crux at romster dot me
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: git rust
name=cargo
version=0.18.0
release=1
source=(https://static.rust-lang.org/dist/2017-04-27/cargo-0.18.0-x86_64-unknown-linux-gnu.tar.gz)
build() {
[ ! -e '/usr/bin/cargo' ] && PKGMK_CARGO+=' --cargo=$SRC/cargo-0.18.0-x86_64-unknown-linux-gnu/cargo/bin/cargo'
cd $PKGMK_SOURCE_DIR
if cd $name; then
git pull --rebase https://github.com/rust-lang/cargo.git $version
else
git clone https://github.com/rust-lang/cargo.git $name
cd $name
git checkout $version
fi
cd $PKGMK_SOURCE_DIR
if cd rust-installer; then
git pull --rebase https://github.com/rust-lang/rust-installer.git master
else
git clone https://github.com/rust-lang/rust-installer.git rust-installer
fi
cp -r $PKGMK_SOURCE_DIR/$name $SRC
cp -r $PKGMK_SOURCE_DIR/rust-installer $SRC
cd $SRC/$name
git submodule init
git config submodule.src/rust-installer.url $SRC/rust-installer
git submodule update
sed 's|share/doc|share/licenses|g' -i Makefile.in
./configure $PKGMK_CARGO \
--prefix=/usr \
--release-channel=stable \
--enable-optimize
make
make DESTDIR=$PKG install
install -d $PKG/usr/share/bash-completion/completions
mv $PKG/usr/etc/bash_completion.d/cargo \
$PKG/usr/share/bash-completion/completions/cargo
rm $PKG/usr/lib/rustlib/{install.log,manifest-cargo,uninstall.sh}
rm -r $PKG/usr/share/doc
rmdir $PKG/usr/etc/bash_completion.d $PKG/usr/etc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment