Skip to content
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 (Rebase of #776 against master) #2571

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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ ipch/
/dist-osx
/npm.wxs
/tools/msvs/npm.wixobj
/tools/osx-pkg.pmdoc/index.xml
/test/addons/??_*/
email.md
deps/v8-*
Expand Down Expand Up @@ -88,3 +87,9 @@ test.tap
# Xcode workspaces and project folders
*.xcodeproj
*.xcworkspace

# mac installer files
/tools/osx-pkg/osx-pkg-out.pkgproj
/tools/osx-pkg/strings/LICENSE.txt
/tools/osx-pkg/strings/**/*.out.rtf
/tools/osx-pkg/scripts/nodejs-run-uninstall
28 changes: 18 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ BINARYTAR=$(BINARYNAME).tar
XZ=$(shell which xz > /dev/null 2>&1; echo $$?)
XZ_COMPRESSION ?= 9
PKG=$(TARNAME).pkg
PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
PACKAGESBUILD=/usr/local/bin/packagesbuild
PKGDIR=out/dist-osx

release-only:
Expand All @@ -330,7 +330,22 @@ release-only:
exit 1 ; \
fi

$(PKG): release-only
pre-pkg:
touch tools/osx-pkg/scripts/nodejs-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|__nodeversion__|'$(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|__nodeversion__|'$(FULLVERSION)'|g' | \
sed -e 's|__npmversion__|'$(NPMVERSION)'|g' > \
$(dir)introduction.out.rtf; \
)

$(PKG): release-only pre-pkg
rm -rf $(PKGDIR)
rm -rf out/deps out/Release
$(PYTHON) ./configure \
Expand All @@ -340,14 +355,7 @@ $(PKG): release-only
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
cat tools/osx-pkg.pmdoc/index.xml.tmpl \
| sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \
| sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
> tools/osx-pkg.pmdoc/index.xml
$(PACKAGEMAKER) \
--id "org.nodejs.pkg" \
--doc tools/osx-pkg.pmdoc \
--out $(PKG)
$(PACKAGESBUILD) tools/osx-pkg/osx-pkg-out.pkgproj
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh

pkg: $(PKG)
Expand Down
Binary file modified doc/osx_installer_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion tools/osx-pkg.pmdoc/01local-contents.xml

This file was deleted.

25 changes: 0 additions & 25 deletions tools/osx-pkg.pmdoc/01local.xml

This file was deleted.

1 change: 0 additions & 1 deletion tools/osx-pkg.pmdoc/02npm-contents.xml

This file was deleted.

24 changes: 0 additions & 24 deletions tools/osx-pkg.pmdoc/02npm.xml

This file was deleted.

55 changes: 0 additions & 55 deletions tools/osx-pkg.pmdoc/index.xml.tmpl

This file was deleted.

46 changes: 46 additions & 0 deletions tools/osx-pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## osx-pkg

### Build

Prerequisites:

* Packages: http://s.sudre.free.fr/Software/Packages/about.html

In the root 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
`__nodeversion__` or `__npmversion__`, as these are automatically replaced
by the build step with the Node.js and npm versions, respectively.
4. In the root 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.
Loading