@@ -530,8 +530,7 @@ BINARYTAR=$(BINARYNAME).tar |
530 | 530 | XZ=$(shell which xz > /dev/null 2>&1; echo $$?) |
531 | 531 | XZ_COMPRESSION ?= 9e |
532 | 532 | PKG=$(TARNAME).pkg |
533 | | -PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker |
534 | | -PKGDIR=out/dist-osx |
| 533 | +MACOSOUTDIR=out/macos |
535 | 534 |
|
536 | 535 | release-only: |
537 | 536 | @if [ "$(DISTTYPE)" != "nightly" ] && [ "$(DISTTYPE)" != "next-nightly" ] && \ |
@@ -561,24 +560,53 @@ release-only: |
561 | 560 | fi |
562 | 561 |
|
563 | 562 | $(PKG): release-only |
564 | | - $(RM) -r $(PKGDIR) |
565 | | - $(RM) -r out/deps out/Release |
| 563 | + $(RM) -r $(MACOSOUTDIR) |
| 564 | + mkdir -p $(MACOSOUTDIR)/installer/productbuild |
| 565 | + cat tools/macos-installer/productbuild/distribution.xml.tmpl \ |
| 566 | + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ |
| 567 | + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ |
| 568 | + >$(MACOSOUTDIR)/installer/productbuild/distribution.xml ; \ |
| 569 | + |
| 570 | + @for dirname in tools/macos-installer/productbuild/Resources/*/; do \ |
| 571 | + lang=$$(basename $$dirname) ; \ |
| 572 | + mkdir -p $(MACOSOUTDIR)/installer/productbuild/Resources/$$lang ; \ |
| 573 | + printf "Found localization directory $$dirname\n" ; \ |
| 574 | + cat $$dirname/welcome.html.tmpl \ |
| 575 | + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ |
| 576 | + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ |
| 577 | + >$(MACOSOUTDIR)/installer/productbuild/Resources/$$lang/welcome.html ; \ |
| 578 | + cat $$dirname/conclusion.html.tmpl \ |
| 579 | + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ |
| 580 | + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ |
| 581 | + >$(MACOSOUTDIR)/installer/productbuild/Resources/$$lang/conclusion.html ; \ |
| 582 | + done |
566 | 583 | $(PYTHON) ./configure \ |
567 | 584 | --dest-cpu=x64 \ |
568 | 585 | --tag=$(TAG) \ |
569 | 586 | --release-urlbase=$(RELEASE_URLBASE) \ |
570 | 587 | $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS) |
571 | | - $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) |
572 | | - SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)/usr/local" bash \ |
| 588 | + $(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/node |
| 589 | + SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" bash \ |
573 | 590 | tools/osx-codesign.sh |
574 | | - cat tools/osx-pkg.pmdoc/index.xml.tmpl \ |
575 | | - | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ |
576 | | - | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ |
577 | | - > tools/osx-pkg.pmdoc/index.xml |
578 | | - $(PACKAGEMAKER) \ |
579 | | - --id "org.nodejs.pkg" \ |
580 | | - --doc tools/osx-pkg.pmdoc \ |
581 | | - --out $(PKG) |
| 591 | + mkdir -p $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules |
| 592 | + mkdir -p $(MACOSOUTDIR)/pkgs |
| 593 | + mv $(MACOSOUTDIR)/dist/node/usr/local/lib/node_modules/npm \ |
| 594 | + $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules |
| 595 | + unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npm |
| 596 | + $(NODE) tools/license2rtf.js < LICENSE > \ |
| 597 | + $(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf |
| 598 | + cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources |
| 599 | + pkgbuild --version $(FULLVERSION) \ |
| 600 | + --identifier org.nodejs.node.pkg \ |
| 601 | + --root $(MACOSOUTDIR)/dist/node $(MACOSOUTDIR)/pkgs/node-$(FULLVERSION).pkg |
| 602 | + pkgbuild --version $(NPMVERSION) \ |
| 603 | + --identifier org.nodejs.npm.pkg \ |
| 604 | + --root $(MACOSOUTDIR)/dist/npm \ |
| 605 | + --scripts ./tools/macos-installer/pkgbuild/npm/scripts \ |
| 606 | + $(MACOSOUTDIR)/pkgs/npm-$(NPMVERSION).pkg |
| 607 | + productbuild --distribution $(MACOSOUTDIR)/installer/productbuild/distribution.xml \ |
| 608 | + --resources $(MACOSOUTDIR)/installer/productbuild/Resources \ |
| 609 | + --package-path $(MACOSOUTDIR)/pkgs ./$(PKG) |
582 | 610 | SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh |
583 | 611 |
|
584 | 612 | pkg: $(PKG) |
|