Skip to content

Commit

Permalink
Add an NSIS script for building a win32 installer. Closes #522.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jul 23, 2011
1 parent 57459ec commit ad954fc
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
######################################################################

export CFG_SRC_DIR
export CFG_BUILD_DIR
export CFG_VERSION
export CFG_LLVM_ROOT
export CFG_ENABLE_MINGW_CROSS
Expand Down
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,15 @@ probe_need CFG_PERL perl
probe_need CFG_PYTHON python
probe_need CFG_CURL curl

probe CFG_GIT git
probe CFG_GIT git
probe CFG_CLANG clang++
probe CFG_GCC gcc
probe CFG_LLVM_CONFIG llvm-config
probe CFG_VALGRIND valgrind
probe CFG_MAKEINFO makeinfo
probe CFG_TEXI2PDF texi2pdf
probe CFG_TEX tex
probe CFG_MAKENSIS makensis

if [ -z "$CFG_CLANG" -a -z "$CFG_GCC" ]
then
Expand Down
21 changes: 19 additions & 2 deletions mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
# Distribution
######################################################################


PKG_NAME := rust
PKG_VER = $(shell date +"%Y-%m-%d")-snap
PKG_DIR = $(PKG_NAME)-$(PKG_VER)
PKG_TAR = $(PKG_DIR).tar.gz

ifdef CFG_MAKENSIS
PKG_NSI = $(S)src/etc/pkg/rust.nsi
PKG_EXE = $(PKG_DIR)-install.exe
endif

PKG_3RDPARTY := rt/valgrind.h rt/memcheck.h \
rt/isaac/rand.h rt/isaac/standard.h \
rt/uthash/uthash.h rt/uthash/utlist.h \
Expand All @@ -29,9 +35,20 @@ PKG_FILES = \
$(ALL_TEST_INPUTS) \
$(GENERATED)

dist: $(PKG_TAR)
dist: $(PKG_TAR) $(PKG_EXE)

nsis-dist: $(PKG_EXE)

lic.txt: $(S)LICENSE.txt
@$(call E, crlf: $@)
@$(Q)perl -pe 's@\n@\r\n@go' <$< >$@

$(PKG_EXE): $(PKG_NSI) $(PKG_FILES) $(DOCS) $(SREQ3) lic.txt
@$(call E, makensis: $@)
$(Q)makensis -NOCD -V1 "-XOutFile $@" "-XLicenseData lic.txt" $<
$(Q)rm -f lic.txt

$(PKG_TAR): $(GENERATED)
$(PKG_TAR): $(PKG_FILES)
@$(call E, making dist dir)
$(Q)rm -Rf dist
$(Q)mkdir -p dist/$(PKG_DIR)
Expand Down
39 changes: 39 additions & 0 deletions src/etc/pkg/rust.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- shell-script -*-
# (not really, but syntax is similar)
#
# This is a NSIS win32 installer script the Rust toolchain.
#

Name "Rust"
ShowInstDetails "show"
ShowUninstDetails "show"
SetCompressor "lzma"
LicenseForceSelection checkbox

Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles


Section "Compiler"
SetOutPath $INSTDIR
File /oname=rustc.exe stage3\rustc.exe
File /oname=rustllvm.dll stage3\rustllvm.dll
File /oname=rustrt.dll stage3\rustrt.dll
File /oname=std.dll stage3\std.dll

SetOutPath $INSTDIR\lib
File /oname=rustrt.dll stage3\lib\rustrt.dll
File /oname=std.dll stage3\lib\std.dll
File /oname=main.o stage3\lib\main.o
File /oname=glue.o stage3\lib\glue.o
SectionEnd

Section "Documentation"
SetOutPath $INSTDIR\doc
File /nonfatal /oname=rust.html doc\rust.html
File /nonfatal /oname=rust.pdf doc\rust.pdf
SectionEnd

0 comments on commit ad954fc

Please sign in to comment.