Patchwork [2,of,2,v2] osx: create dmg with installer instead of zip

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 31, 2014, 8:25 a.m.
Message ID <1573ac7e9c1ac2eadcb3.1409473521@localhost.localdomain>
Download mbox | patch
Permalink /patch/5653/
State Accepted
Headers show

Comments

Mads Kiilerich - Aug. 31, 2014, 8:25 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1409473465 -7200
#      Sun Aug 31 10:24:25 2014 +0200
# Node ID 1573ac7e9c1ac2eadcb3d585909301e41d690b61
# Parent  7ae1fe0a0751e3e5970574e472d1361f9593f5f5
osx: create dmg with installer instead of zip

OS X would offer to expand the zip so the (multi file) installer inside it
could be run ... but that would leave the expanded zip folder around.

Instead, use a .dmg file that automatically will be mounted - that seems more
common on OS X.

Still, there is two levels of levels of clicking before actually launching the
installer. Having a single file installer would be better ... but seems to be
hard. A more feasible improvement would be some fancy layout inside the .dmg .
Augie Fackler - Aug. 31, 2014, 9:22 a.m.
queued these, thanks

On Aug 31, 2014, at 10:25 AM, Mads Kiilerich <mads@kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1409473465 -7200
> #      Sun Aug 31 10:24:25 2014 +0200
> # Node ID 1573ac7e9c1ac2eadcb3d585909301e41d690b61
> # Parent  7ae1fe0a0751e3e5970574e472d1361f9593f5f5
> osx: create dmg with installer instead of zip
> 
> OS X would offer to expand the zip so the (multi file) installer inside it
> could be run ... but that would leave the expanded zip folder around.
> 
> Instead, use a .dmg file that automatically will be mounted - that seems more
> common on OS X.
> 
> Still, there is two levels of levels of clicking before actually launching the
> installer. Having a single file installer would be better ... but seems to be
> hard. A more feasible improvement would be some fancy layout inside the .dmg .
> 
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -137,10 +137,11 @@ i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
> osx:
> 	@which -s bdist_mpkg || \
> 	   (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
> +	rm -rf dist/mercurial-*.mpkg
> 	bdist_mpkg setup.py
> 	mkdir -p packages/osx
> +	N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
> 	rm -rf dist/mercurial-*.mpkg
> -	mv dist/mercurial*macosx*.zip packages/osx
> 
> fedora:
> 	mkdir -p packages/fedora
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -588,7 +588,7 @@ setup(name='mercurial',
>       cmdclass=cmdclass,
>       distclass=hgdist,
>       options={'py2exe': {'packages': ['hgext', 'email']},
> -               'bdist_mpkg': {'zipdist': True,
> +               'bdist_mpkg': {'zipdist': False,
>                               'license': 'COPYING',
>                               'readme': 'contrib/macosx/Readme.html',
>                               'welcome': 'contrib/macosx/Welcome.html',
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -137,10 +137,11 @@  i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
 osx:
 	@which -s bdist_mpkg || \
 	   (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
+	rm -rf dist/mercurial-*.mpkg
 	bdist_mpkg setup.py
 	mkdir -p packages/osx
+	N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
 	rm -rf dist/mercurial-*.mpkg
-	mv dist/mercurial*macosx*.zip packages/osx
 
 fedora:
 	mkdir -p packages/fedora
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -588,7 +588,7 @@  setup(name='mercurial',
       cmdclass=cmdclass,
       distclass=hgdist,
       options={'py2exe': {'packages': ['hgext', 'email']},
-               'bdist_mpkg': {'zipdist': True,
+               'bdist_mpkg': {'zipdist': False,
                               'license': 'COPYING',
                               'readme': 'contrib/macosx/Readme.html',
                               'welcome': 'contrib/macosx/Welcome.html',