Archive: scons install on Linux


scons install on Linux
After reading the available documentation, I have been able to build makensis on Linux (Fedora Core 5). I have confirmed that makensis runs and correctly builds an installer when makensis is copied to the distribution zip directory structure.

BUT, I cannot install the results of the build. If I do a "scons install", here is what I get:


scons: done reading SConscript files.
scons: Building targets ...
gcc -o build/release/stub_bzip2/bgbg.o -c -Os -Wall -x c -fno-strict-aliasing -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 Source/exehead/bgbg.c
In file included from Source/exehead/bgbg.c:21:
Source/exehead/state.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'g_hwnd'
Source/exehead/state.h:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'insthwnd'
In file included from Source/exehead/bgbg.c:22:
Source/exehead/ui.h:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm_curwnd'
In file included from Source/exehead/bgbg.c:23:
Source/exehead/util.h:19:20: error: shlobj.h: No such file or directory
In file included from Source/exehead/bgbg.c:23:
Source/exehead/util.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Source/exehead/util.h:35: error: expected ')' before 'idl'
Source/exehead/util.h:39: error: expected ')' before 'dlg'
Source/exehead/util.h:91: error: expected ')' before 'pszExisting'
Source/exehead/bgbg.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CALLBACK'
scons: *** [build/release/stub_bzip2/bgbg.o] Error 1
scons: building terminated because of errors.
[cch1@bmw nsis-2.24-src]$
So, how can I get the results of the build installed to the proper locations? I'm pretty sure the zip file that I downloaded has to be part of the equation, but I'm not sure how to put the zip plus the makensis executable together so that scons install will work.

You must pass the same parameters to `install` or scons will rebuild it with the new (default) parameters. You can also use install-compiler which should only install makensis.


How can I find the parameters that were used to build the zip? I used the recommended parameters to build makensis:

scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no


The zip is built with the default parameters. They match the line in INSTALL which matches the line you just posted. Simply append `install-compiler` or `install` to that line. You can also just copy makensis from build/release/makensis/makensis.


Just running "sudo scons install-compiler" yields results which you probably could have predicted:

[cch1@bmw mmwin]$ makensis setup
Error: opening stub "/usr/local/share/nsis/Stubs/zlib"
Error initalizing CEXEBuild: error setting default stub

Regarding my previous question about ensuring the parameters match: I think that means matching my build parameters with those used to build the files in the zip (hard for me to guess). I also tried making sure my build params match my install params. But then I get this:

$ scons install SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no
...
scons: Building targets ...
scons: *** Do not know how to make target `install'. Stop.


Using just scons when not compiling the entire package is not enough. You must extract the zip contents to /usr/local/share/nsis, in your case.

I'm currently checking why 'install' and 'install-compiler' don't work with all the SKIPs in place.


I am still confused as to how to get the contents of the zip file installed into the correct location.

When I did the build using the default target and all the SKIPXXX options, that just made the native linux makensis. So doing an scons install is not going to be able to install any more than makensis anyway. Yet I want the contents of the zip installed as well so that makensis can put all the pieces together into a compiled installer.

How can scons know where to get the files that are in the zip (to put them into the correct locations in the linux filesystem so that makensis finds them later)?

My apologies if these questions are answered elsewhere -or should be obvious. I just don't get it!


Actually, it's not the SKIPs, it's NSIS_CONFIG_CONST_DATA_PATH. When using NSIS_CONFIG_CONST_DATA_PATH, you must install using a PREFIX or the build system won't know where to put the files. Point PREFIX to the path where you've extracted the zip file.


AHA! I think you have provided the key: extract the zip to /usr/local/share/nsis. That has resolved the problem very nicely. I assumed that the locations for all the zip files would be spread out -but with something as simple as dumping them all into /usr/local/share/nsis, it's very reasonable to do it manually.

Thanks for all your help. I am now up and running NICELY with the files in the right location. If I can be of any help with the debugging of the install target, let me know.
(Fedora Core 5)


I've gotten the installation working, so from here on out we're working to make it easier on the next guy that comes along. I'll post our final solution to my blog (cho.hapgoods.com/wordpress/?p=136) and reference it in this post here on the forum.

OK. I have extracted the zip file to ~/nsis/nsis-2.24. I have extracted the source file to ~/nsis/nsis-2.24-src.

First, I run scons with all the SKIP options and NSIS_CONFIG_CONST_DATA_PATH=no. This builds the makensis native compiler with no problems.

Now, to get the install target to work, I have tried:

[cch1@bmw nsis-2.24-src]$ scons PREFIX=../nsis-2.24 install

This gives me the following:

gcc -o build/release/stub_bzip2/bgbg.o -c -Os -Wall -x c -fno-strict-aliasing -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 Source/exehead/bgbg.c
In file included from Source/exehead/bgbg.c:21:
Source/exehead/state.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'g_hwnd'
Source/exehead/state.h:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'insthwnd'
In file included from Source/exehead/bgbg.c:22:
Source/exehead/ui.h:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm_curwnd'
In file included from Source/exehead/bgbg.c:23:
Source/exehead/util.h:19:20: error: shlobj.h: No such file or directory
In file included from Source/exehead/bgbg.c:23:
Source/exehead/util.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Source/exehead/util.h:35: error: expected ')' before 'idl'
Source/exehead/util.h:39: error: expected ')' before 'dlg'
Source/exehead/util.h:91: error: expected ')' before 'pszExisting'
Source/exehead/bgbg.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CALLBACK'
scons: *** [build/release/stub_bzip2/bgbg.o] Error 1
scons: building terminated because of errors.



Any ideas?


GOT IT!!!

This did it:

scons install SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=../nsis-2.24

I should have tried all the skip options with the PREFIX option first.

Blog updated with the entire story, amended to show this last step.

Thanks a 10^6.

-CHris


Exactly what I said in the first reply. Either use the same parameters or use `install-compiler` instead of just `install`. It tries to build the other parts of NSIS because you haven't skipped them and specifically told it to install them.

You should simply use:

scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all
NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/path/to/extracted/zip
install-compiler

I spoke too soon. It seems as though the scons install SKIPXXX NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=../nsis-2.24 just pumped all the files from the build back into the zip directory. Nothing seems to have been installed into the appropriate Linux fs locations...

Are we getting close?


You can't install into the appropriate Linux locations with NSIS_CONFIG_CONST_DATA_PATH and you can't use the ZIP file without NSIS_CONFIG_CONST_DATA_PATH. The best you can do is create a symlink from /bin to wherever you installed makensis.


First, sorry for not keeping things in order. I need to refresh my browser before submitting the reply -you are too fast!

If I understand correctly, the install target can't install ALL the files (zip + makensis) to the appropriate Linux fs locations automatically. The install-compiler target will put the makensis file into the correct location (/usr/local/bin), but it can't put the zip files into the correct location.

If this is correct, then I think the best solution is to use the install-compiler target to place makensis correctly and then manually put the zip contents into /usr/local/share/nsis.

OK?


Any target of the build system doesn't touch the ZIP file. That's up to you to extract.

Setting NSIS_CONFIG_CONST_DATA_PATH to "no" tells makensis to look for the files it needs in the directory where makensis itself is located. Without it, it'll look for the files in PREFIX_DATA which is $PREFIX/share/nsis by default. $PREFIX is /usr/local by default.

That leaves you with two options.

  1. Don't use NSIS_CONFIG_CONST_DATA_PATH, install into the extracted ZIP and manually put a symlink in /bin.
  2. Use NSIS_CONFIG_CONST_DATA_PATH and extract the ZIP to PREFIX_DATA which is /usr/local/share/nsis by default.