-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Refactor Mac installer generation #776
Changes from 4 commits
97e79f5
f186d1c
8491b02
e08d2df
2fb6c21
5580022
d1c2ac7
1755cc8
1434328
5e2c01c
cb069d4
2526e1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ PYTHON ?= python | |
DESTDIR ?= | ||
SIGN ?= | ||
PREFIX ?= /usr/local | ||
NO_SYMLINK ?= false | ||
|
||
# Determine EXEEXT | ||
EXEEXT := $(shell $(PYTHON) -c \ | ||
|
@@ -50,7 +51,7 @@ config.gypi: configure | |
fi | ||
|
||
install: all | ||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' | ||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' '$(NO_SYMLINK)' | ||
|
||
uninstall: | ||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' | ||
|
@@ -219,7 +220,7 @@ BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) | |
BINARYTAR=$(BINARYNAME).tar | ||
XZ=$(shell which xz > /dev/null 2>&1; echo $$?) | ||
PKG=out/$(TARNAME).pkg | ||
packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker | ||
packagesbuild=/usr/local/bin/packagesbuild | ||
|
||
PKGSRC=iojs-$(DESTCPU)-$(RAWVER).tgz | ||
ifdef NIGHTLY | ||
|
@@ -252,28 +253,34 @@ release-only: | |
exit 1 ; \ | ||
fi | ||
|
||
pre-pkg: | ||
touch tools/osx-pkg/scripts/iojs-create-node-symlink # empty file for symlink step | ||
touch tools/osx-pkg/scripts/iojs-run-uninstall # empty file for uninstall step | ||
cp LICENSE tools/osx-pkg/strings/LICENSE.txt | ||
cat tools/osx-pkg/osx-pkg.pkgproj | sed -e 's|__iojsversion__|'$(FULLVERSION)'|g' | sed -e 's|introduction.rtf|introduction.out.rtf|g' > tools/osx-pkg/osx-pkg-out.pkgproj | ||
$(foreach dir, \ | ||
$(shell echo tools/osx-pkg/strings/*/), \ | ||
cat $(dir)introduction.rtf | sed -e 's|__iojsversion__|'$(FULLVERSION)'|g' | sed -e 's|__npmversion__|'$(NPMVERSION)'|g' > $(dir)introduction.out.rtf; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you wrap the long lines at 80 columns here? |
||
) | ||
|
||
pkg: $(PKG) | ||
|
||
$(PKG): release-only | ||
$(PKG): release-only pre-pkg | ||
rm -rf $(PKGDIR) | ||
rm -rf out/deps out/Release | ||
$(PYTHON) ./configure --dest-cpu=ia32 --tag=$(TAG) | ||
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)/32 | ||
rm -rf out/deps out/Release | ||
$(PYTHON) ./configure --dest-cpu=x64 --tag=$(TAG) | ||
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR) | ||
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR) NO_SYMLINK=true | ||
SIGN="$(APP_SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh | ||
lipo $(PKGDIR)/32/usr/local/bin/iojs \ | ||
$(PKGDIR)/usr/local/bin/iojs \ | ||
-output $(PKGDIR)/usr/local/bin/iojs-universal \ | ||
-create | ||
mv $(PKGDIR)/usr/local/bin/iojs-universal $(PKGDIR)/usr/local/bin/iojs | ||
rm -rf $(PKGDIR)/32 | ||
cat tools/osx-pkg.pmdoc/index.xml.tmpl | sed -e 's|__iojsversion__|'$(FULLVERSION)'|g' | sed -e 's|__npmversion__|'$(NPMVERSION)'|g' > tools/osx-pkg.pmdoc/index.xml | ||
$(packagemaker) \ | ||
--id "org.nodejs.Node" \ | ||
--doc tools/osx-pkg.pmdoc \ | ||
--out $(PKG) | ||
$(packagesbuild) tools/osx-pkg/osx-pkg-out.pkgproj | ||
SIGN="$(INT_SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh | ||
|
||
$(TARBALL): release-only $(NODE_EXE) doc | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
install_path = None # base target directory (DESTDIR + PREFIX from Makefile) | ||
target_defaults = None | ||
variables = None | ||
no_symlink = False | ||
|
||
def abspath(*args): | ||
path = os.path.join(*args) | ||
|
@@ -132,7 +133,7 @@ def files(action): | |
exeext = '.exe' if is_windows else '' | ||
action(['out/Release/iojs' + exeext], 'bin/iojs' + exeext) | ||
|
||
if not is_windows: | ||
if not is_windows and not no_symlink: | ||
# Install iojs -> node compatibility symlink. | ||
link_target = 'bin/node' | ||
link_path = abspath(install_path, link_target) | ||
|
@@ -186,14 +187,16 @@ def files(action): | |
], 'include/node/') | ||
|
||
def run(args): | ||
global node_prefix, install_path, target_defaults, variables | ||
global node_prefix, install_path, target_defaults, variables, no_symlink | ||
|
||
# chdir to the project's top-level directory | ||
os.chdir(abspath(os.path.dirname(__file__), '..')) | ||
|
||
conf = load_config() | ||
variables = conf['variables'] | ||
target_defaults = conf['target_defaults'] | ||
# argv[4] is a variable representing whether a symlink should be made | ||
no_symlink = True if len(args) > 4 and args[4] == 'true' else False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# argv[2] is a custom install prefix for packagers (think DESTDIR) | ||
# argv[3] is a custom install prefix (think PREFIX) | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## osx-pkg | ||
|
||
### Build | ||
|
||
Prerequisites: | ||
|
||
* Packages: http://s.sudre.free.fr/Software/Packages/about.html | ||
|
||
In the root io.js folder: | ||
|
||
```bash | ||
make pkg | ||
``` | ||
|
||
### Localization | ||
|
||
There are two files that can be localized in the OS X installer: the introduction, and the summary. | ||
|
||
1. Make sure you've installed Packages: http://s.sudre.free.fr/Software/Packages/about.html | ||
2. Duplicate the `strings/en` folder for reference, and rename the folder to the language you are localizing (ex. `fr`, `ru`, etc.) | ||
3. Translate `introduction.rtf` and `summary.rtf`. Do not modify the words `__iojsversion__` or `__npmversion__`, as these are automatically replaced by the build step with the io.js and npm versions, respectively. | ||
4. In the root `io.js` folder, run `make pre-pkg`. This will generate the files needed for Packages. | ||
5. Open `tools/osx-pkg/osx-pkg.pkgproj` in Packages. (Not `osx-pkg-out.pkgproj`, as this is a generated file) | ||
6. In Packages, go to the Presentation tab, and if not already selected, choose "Introduction" from the dropdown on the right-hand side. | ||
![packages preview](https://s3.amazonaws.com/f.cl.ly/items/3q160p2r1X1B3i2N1W42/Screen%20Shot%202015-02-09%20at%207.26.09%20PM.png) | ||
7. Press the "+" at the bottom right. This will add a new language entry. Click on the flag, and choose which language you are localizing. | ||
8. Click on the column next to the flag, and ensure "Relative to Project" is selected. It's a rectangle with the letter "R" inside of it. | ||
9. Click on the last column, which will currently have a dash in it, and press "Choose...". | ||
10. Locate the `introduction.rtf` file you translated, and choose it. Don't worry about the `introduction.out.rtf` file, as this is an autogenerated file, and is dealt with when compiling. | ||
11. In the dropdown that says "Introduction" at the top, choose "Conclusion" and repeat this process for the `conclusion.rtf` file. | ||
12. Save the project, and commit your changes. The generated files are automatically ignored by Git, so you don't have to worry about accidentally committing them in. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor nit: can you wrap the lines in this file at 80 columns? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be added to
.PHONY
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tellnes Good catch. Fixed, thanks!