Skip to content

Conversation

@djp3
Copy link
Contributor

@djp3 djp3 commented Dec 21, 2016

I couldn't get the mac .dmg build to work unless I made the two changes to python in this patch.
Update: I subsequently added a fix to the dmg build to make the background image work

@fanquake fanquake added the macOS label Dec 21, 2016
@kallewoof
Copy link
Contributor

I ran into the background.tiff issue mentioned in #8120 when I tried to check this.
theuni@c622254 addresses the encode/decode stuff in this PR as well but uses output.decode instead of str(output, "utf-8").

@fanquake
Copy link
Member

Indeed, I wondered if this was going to sort out the background image issues. Lets try and fix those up here as well.

@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

What is the background image issue? I can probably fix that

@kallewoof
Copy link
Contributor

$ make deploy
/Library/Developer/CommandLineTools/usr/bin/make -C src qt/bitcoin-qt
make[2]: `libsecp256k1.la' is up to date.
build-aux/install-sh -c -d Bitcoin-Qt.app/Contents/MacOS
STRIPPROG="/usr/bin/strip" /bin/sh /Users/me/workspace/bitcoin-kw/build-aux/install-sh -c -s  src/qt/bitcoin-qt Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
/usr/local/bin/python3.5 ./contrib/macdeploy/macdeployqtplus Bitcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -translations-dir= -dmg -fancy ./contrib/macdeploy/fancy.plist -verbose 2 -volname Bitcoin-Core
Error: Could not find background picture at "background.tiff" or "./contrib/macdeploy/background.tiff"
make: *** [Bitcoin-Core.dmg] Error 1

@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

output.decode("utf-8") and str(output,"utf-8") are equivalent according to the documentation:

"If at least one of encoding or errors is given, object should be a bytes-like object (e.g. bytes or bytearray). In this case, if object is a bytes (or bytearray) object, then str(bytes, encoding, errors) is equivalent to bytes.decode(encoding, errors). Otherwise, the bytes object underlying the buffer object is obtained before calling bytes.decode(). See Binary Sequence Types — bytes, bytearray, memoryview and Buffer Protocol for information on buffer objects." cite: https://docs.python.org/3/library/stdtypes.html

@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

Okay, I'll take a look at background.tiff issue in the morning.

@jonasschnelli
Copy link
Contributor

AFAIK, make deploy on native macOS machines is currently broken (introduced in #7192). Before 7192, there was just a tiff that was used as DMG background.
Since #7192, the tiff gets created by adding the package-name (Bitcoin-Core) on top of the background.svg file.

I think most devs compile releases over Gitian, so its not among the top priorities to fix. But we should.

@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

Ok. I changed the dmg build process to just use a static jpg image as the background. I don't know why a dynamic background image was being built from an svg. That seems kind of crazy. In the process I found a bug in the macqtdeployplus script which I also fixed.

@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

Checking on why it didn't pass tests

@djp3 djp3 changed the title Contrib: Mac: Two changes to python bytes and string management to get the mac deploy to work Contrib: Mac: Fix mac deploy so that the dmg background works Dec 22, 2016
@djp3
Copy link
Contributor Author

djp3 commented Dec 22, 2016

Okay, so if someone else can check this out on their machine. There are some fixes to the python in the build process and I fixed the dmg background image. It works fine on my machine and in the automated builds.

@jonasschnelli
Copy link
Contributor

I think this solution is a step backward. In #7192 we got rid of the static image and introduced a SVG with a flexible product name.

@maflcko
Copy link
Member

maflcko commented Dec 23, 2016

use a static jpg image as the background

Please don't use jpg for compression of such data. I think #9412 is the solution to go.

@fanquake
Copy link
Member

Agree with @jonasschnelli's comments.

Thanks for the initial bugfix and further contributions @djp3, however I'm going to close this in favour of #9412. It'd be great if you could test that PR and check it fixes your original issue.

@fanquake fanquake closed this Dec 23, 2016
}
if "window_bounds" in fancy:
params["window.bounds"] = ",".join([str(p) for p in fancy["window_bounds"]])
params["window_bounds"] = ",".join([str(p) for p in fancy["window_bounds"]])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fanquake This wasn't in #9412

@djp3
Copy link
Contributor Author

djp3 commented Dec 23, 2016

@fanquake #9412 worked for me. There was one bug in this PR that wasn't in 9412 though. I'll tag you in the body of the code. Should I generate a PR just for that?

@fanquake
Copy link
Member

@djp3 Thanks for pointing that out, a new PR won't be necessary, we can cherry pick the bug fix into #9412.

@djp3
Copy link
Contributor Author

djp3 commented Dec 24, 2016

@fanquake Ok thanks!

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants