Page MenuHomePhabricator

[CMAKE] Build the OSX DMG image
Changes PlannedPublic

Authored by Fabien on Thu, Oct 31, 15:02.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

This diff adds a couple targets:

  • osx-deploydir: this is the dmg directory before being an image

(equivalent to autotools deploydir).

  • osx-dmg: the osx installation image (equivalent to autotools

deploy).

These targets can run on native OSX as well as Linux when
cross-compiling.

Test Plan

On both Linux (cross compilation) and OSX (native):

ninja osx-deploydir

There should be a dist directory at the root of the build directory.
Compare the content with the dist from an autotool deploydir cross
build (cross compilation only !).
Note: there is a PkgInfo file created by autotools under
dist/BitcoinABC-Qt.app/Contents which is not included with the cmake
build. This file is redundant with the application bundle metadata and
can be safely removed.

ninja osx-dmg

Install using the DMG. Check the software runs after installation. Check
it uninstalls as expected.

Note 1: On OSX, building the DMG will overwrite the dist directory
(which can be rebuilt if needed by using the osx-deploydir target
again).

Note 2: the low resolution background file generated on native OSX has a
bad rendering of the text on my Sierra test machine. The same occurs
with autotools and seems to be a bug from rsvg-convert. I cannot
reproduce the issue when converting the image from Linux.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_dmg
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7936
Build 13875: Bitcoin ABC Buildbot
Build 13874: arc lint + arc unit

Event Timeline

Fabien created this revision.Thu, Oct 31, 15:02
Herald added a reviewer: Restricted Project. · View Herald TranscriptThu, Oct 31, 15:02
deadalnix requested changes to this revision.Sat, Nov 2, 17:29

This is a very large diff. You may want to split it up in more logical chunks, such as generating the different variation of the png. This would make review easier, and ensure that parts of it that are good do not end up blocked by arts that are not.

cmake/modules/ImageHelper.cmake
15

I don't think this really hep readibility to put every one of them on their own line. Some of these arguement go together, like -f png so grouping them make things more readable.

cmake/platforms/OSX.cmake
38

And strip.

src/qt/CMakeLists.txt
438

Is there a reason these aren't just referred as background.svg and alike ? AFAIK, generated file are going into CMAKE_CURRENT_BINARY_DIR by default.

This revision now requires changes to proceed.Sat, Nov 2, 17:29
Fabien planned changes to this revision.Mon, Nov 4, 08:59

Will split for better readability.

Fabien added inline comments.Tue, Nov 5, 08:57
src/qt/CMakeLists.txt
438

Generally speaking, the inputs are relative to CMAKE_CURRENT_SOURCE_DIR and the outputs to CMAKE_CURRENT_BINARY_DIR.
Here we are using custom commands where the files will be both the output then the input during the transformation workflow, so it sounded more natural to use absolute path to avoid confusion.