Skip to content

Use rust-installer for installation #970

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/rust-installer"]
path = src/rust-installer
url = https://github.com/rust-lang/rust-installer.git
55 changes: 31 additions & 24 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ else
TARGET_$(1) = $$(TARGET_ROOT)/$(1)
endif
DISTDIR_$(1) = $$(TARGET_$(1))/dist
IMGDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)-image
PKGDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)
BIN_TARGETS_$(1) := $$(BIN_TARGETS:%=$$(TARGET_$(1))/%$$(X))
endef
Expand Down Expand Up @@ -128,6 +129,8 @@ $(DOC_DIR)/%: src/doc/%

# === Distribution

NON_INSTALLED_PREFIXES := README.md,LICENSE-MIT,LICENSE-APACHE,LICENSE-THIRD-PARTY

define DO_DIST_TARGET
dist-$(1): $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz

Expand All @@ -147,34 +150,38 @@ distcheck-$(1): dist-$(1)
--prefix=$$(TARGET_$(1))/distcheck/install --uninstall
[ -f $$(TARGET_$(1))/distcheck/install/bin/cargo$(X) ] && exit 1 || exit 0

$$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz: prepare-manifest-$(1)
tar -czvf $$@ -C $$(@D) $$(PKG_NAME)-$(1)

prepare-manifest-$(1):
prepare-image-$(1):
@[ -f $$(TARGET_$(1))/cargo$$(X) ] || echo 'Please run `make` first'
@[ -f $$(TARGET_$(1))/cargo$$(X) ]
rm -rf $$(PKGDIR_$(1))
mkdir -p $$(PKGDIR_$(1))/bin $$(PKGDIR_$(1))/lib/cargo \
$$(PKGDIR_$(1))/share/man/man1 \
$$(PKGDIR_$(1))/share/doc/cargo \
$$(PKGDIR_$(1))/share/zsh/site-functions \
$$(PKGDIR_$(1))/etc/bash_completion.d
cp $$(TARGET_$(1))/cargo$$(X) $$(PKGDIR_$(1))/bin
cp src/etc/cargo.1 $$(PKGDIR_$(1))/share/man/man1
cp src/etc/_cargo $$(PKGDIR_$(1))/share/zsh/site-functions/_cargo
cp src/etc/cargo.bashcomp.sh $$(PKGDIR_$(1))/etc/bash_completion.d/cargo
#cp $$(BIN_TARGETS_$(1)) $$(PKGDIR_$(1))/lib/cargo
rm -rf $$(IMGDIR_$(1))
mkdir -p $$(IMGDIR_$(1))/bin $$(IMGDIR_$(1))/lib/cargo \
$$(IMGDIR_$(1))/share/man/man1 \
$$(IMGDIR_$(1))/share/doc/cargo \
$$(IMGDIR_$(1))/share/zsh/site-functions \
$$(IMGDIR_$(1))/etc/bash_completion.d
cp $$(TARGET_$(1))/cargo$$(X) $$(IMGDIR_$(1))/bin
cp src/etc/cargo.1 $$(IMGDIR_$(1))/share/man/man1
cp src/etc/_cargo $$(IMGDIR_$(1))/share/zsh/site-functions/_cargo
cp src/etc/cargo.bashcomp.sh $$(IMGDIR_$(1))/etc/bash_completion.d/cargo
cp README.md LICENSE-MIT LICENSE-APACHE LICENSE-THIRD-PARTY \
$$(PKGDIR_$(1))/share/doc/cargo
(cd $$(PKGDIR_$(1)) && find . -type f | sed 's/^\.\///') \
> $$(DISTDIR_$(1))/manifest-$$(PKG_NAME).in
cp src/etc/install.sh $$(PKGDIR_$(1))
$$(IMGDIR_$(1))/share/doc/cargo
cp README.md LICENSE-MIT LICENSE-APACHE LICENSE-THIRD-PARTY \
$$(PKGDIR_$(1))
mv $$(DISTDIR_$(1))/manifest-$$(PKG_NAME).in \
$$(PKGDIR_$(1))/lib/cargo/manifest.in

install-$(1): prepare-manifest-$(1)
$$(IMGDIR_$(1))

$$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz: prepare-image-$(1)
sh src/rust-installer/gen-installer.sh \
--product-name=Cargo \
--verify-bin=cargo \
--rel-manifest-dir=cargo \
--success-message=Cargo-is-ready-to-roll. \
--image-dir=$$(IMGDIR_$(1)) \
--work-dir=./$$(DISTDIR_$(1)) \
--output-dir=./$$(DISTDIR_$(1)) \
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
--package-name=$$(PKG_NAME)-$(1)
rm -Rf $$(IMGDIR_$(1))

install-$(1): $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz
$$(PKGDIR_$(1))/install.sh \
--prefix="$$(CFG_PREFIX)" \
--destdir="$$(DESTDIR)" $$(MAYBE_DISABLE_VERIFY)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Cargo can then be compiled like many other standard unix-like projects:
```sh
git clone https://github.com/rust-lang/cargo
cd cargo
git submodule init
./.travis.install.deps.sh
./configure --local-rust-root=`pwd`/rustc
make
Expand Down
1 change: 1 addition & 0 deletions src/rust-installer
Submodule rust-installer added at 26ee15