![]() |
#1 |
Junior Member
Join Date: Sep 2015
Posts: 1
|
How to build on Mac (mainly: where to find zlib?)
I'm trying to use NSIS to build Windows installers on my Mac. It appears to be one of the few tools out there that can do this (though I'm open to other suggestions if you have 'em).
I'm stuck on finding zlib for Win32, which it appears to require. I tried downloading the Binaries package from http://gnuwin32.sourceforge.net/packages/zlib.htm, and setting my ZLIB_W32 environment variable to point to the directory where I unzipped that, but scons still aborts with "zlib (win32) is missing!". I also tried pointing ZLIB_W32 to the zlib/bin directory, but get the same result. I rechecked the build documentation, which doesn't have anything about this in the POSIX section, but does mention that "for Windows" I should get the zlib-1.2.7 prebuilt package linked here. So I downloaded that, unzipped it into my devtools directory, and updated my ZLIB_W32 environment variable to point to it. Then tried scons again... same result: code: What am I doing wrong here? Note that I have searched this forum for "Mac" (no matches), and googled around for more detailed instructions on how to build this thing on OS X, but turned up nothing. Any tips would be very appreciated. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,457
|
You could try checking config.log in the root of the nsis source tree.
It sometimes also helps to delete .sconsign.dblite, .sconf_temp and build. There are some threads about Mac on our bug tracker, you could check those. Hopefully someone with more POSIX experience will chime in... IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
The problem is known, but you don't have to build your own NSIS binaries if you're fine with v2.46. That's available on both, Homebrew and Mac Ports.
If for some reason, you have to build NSIS binaries, does this only happen when building 3.0? Would be great if this could be solved (by someone better with POSIX experience) to get the beta running on both package managers. Edit: I also remembered posting this on Stack Overflow, but no solution has been found |
![]() |
![]() |
![]() |
#4 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
For the record: I don't have any zlib-related problem when building 2.46
|
![]() |
![]() |
![]() |
#5 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
I'm getting the same error when compiling on an Ubuntu-based Linux distro
|
![]() |
![]() |
![]() |
#6 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,457
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Try specifing the ZLIB_W32 variable on the scons command line, if that fails use 'export ZLIB_W32="path/to/folder"' before calling scons. I have a VM setup identical to the nightly build (ubuntu 12.04 with the old cross-compiler triplet).
I'm hoping to remove the requirement for windows zlib files on linux completely by adding a wxwidgets version of zip2exe, which is the only program to use it. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#8 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Quote:
Before: Please specify folder of zlib for Win32 via ZLIB_W32 After: zlib (win32) is missing! (Mac) zlib (posix) is missing! (Linux) Just to be clear, which version of zlib do you use: Windows or native; source or binary? On OS X I tried both, including a mixed setup — without success. I haven't tried that on Linux, but I guess once I understand the details how to get it running on Linux, I can manage on OS X. PS: I will give the nightly a try when I get home! |
|
![]() |
![]() |
![]() |
#9 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Ubuntu: I can't build it using the SCons command from the script, but this worked fine (after installing the dependencies, of course):
code: OS X: Still getting zlib (win32) is missing! after wgetting the same file as in nightly.sh |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
I haven't touched a single Apple product, so you are on your own, sorry.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#11 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Quote:
Anyway, the script provided by Anders solved all my previous problems. While I'm still figuring out how to get building to work on OS X, I'm installing FreeBSD to see whether this is a general issue with BSDs. |
|
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Cool. Good idea trying FreeBSD, I didn't think of that.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#13 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
I'm not much of a help here, I have problems running FreeBSD (actually GhostBSD) in VMware. Apparently, I'm not alone with this problem, but none of the advised solutions were of help.
Apart from this, I tried building NSIS on Fedora, but ended up with the same old zlib (posix) is missing! error. If anyone with more experience would like to look into this, this is what my adapted script looks like: code: See attachments for build logs. |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,457
|
You need both the Windows version and the native POSIX version.
Kichik says that ZLIB_W32 should be used as a scons parameter and needs to point to the Windows version that you can download from our wiki. SCons also needs to be able to find the zlib-dev package for your platform (zlib.h and z library, see AddZLib in %NSISSource%\SCons\utils.py) IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
^^ What he said. The zlib(posix) error is fixed by installing the zlib package and it's -dev counterpart with the source headers. I installed this first before I started compiling nsis, that's probably why I never see this error.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#16 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Quote:
Anyway, I tried to localize the problems to help the OP, but I don't have too much time for this. Hopefully someone else can pick up from here. Looking at the history for the makensis formula, I'm positive that NSIS 3.0 will be supported as soon as it goes final. |
|
![]() |
![]() |
![]() |
#17 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,457
|
zlib + zlib-devel on Fedora?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#18 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
@JoeStrout I just thought you could take a look at how Brew compiles the source, don't know why I didn't think of it earlier
https://github.com/Homebrew/homebrew...la/makensis.rb |
![]() |
![]() |
![]() |
#19 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
I finally managed to build NSIS 3.0b3 on OS X!
Kickik pointed out, that zlib is required by zip2exe, for which -imho- there's no need to be compiled on non-Windows. So you can compile using the flag or evencode: .code: Here's an updated formula for Homebrew, pull request is pending |
![]() |
![]() |
![]() |
#20 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
I've been working on a port of zip2exe to get rid of this problem, but it still isn't finished yet. I should really finish it off before NSIS 3 exits beta.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#21 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
It sure would be nice, for the sake of offering the full feature set, but I don't see it as a requirement. It's one thing to be able to compile installers on non-Windows, but I doubt there are (m)any people who need zip2exe on non-Windows.
|
![]() |
![]() |
![]() |
#22 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Yeah, that's the main reason why it hasn't changed. But the reason I'm doing the port is to get rid of the requirement to have windows zlib files on non-windows platforms in the first place.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|