I have always built NSIS on Ubuntu 16.04 successfully using the command line
scons XGCC_W32_PREFIX=i686-w64-mingw32- PREFIX=$prefix NSIS_MAX_STRLEN=8192 ZLIB_W32=$zlib128_dll_dir install
Now, with the very same command line, but on Ubuntu 18.04, makensis.exe is build instead of makensis. The config.log files generated on the two machines are identical. The builds are identical until the point where uninst.ico is installed. After that, the Ubuntu 16.04 build proceeds with
g++ -o build/urelease/makensis/build.o -c -Wno-non-virtual-dtor -Wall -O2 -DNSISCALL= -D_UNICODE -DUNICODE -DMAKENSIS -D_WIN32_IE=0x0500 -Ibuild/urelease/config Source/build.cpp
leading to
Install file: "build/urelease/makensis/makensis" as "/home/roberto/pdevelop-x86_64-windows/deps/bin/makensis"
whereas the Ubuntu 18.04 build continues with
i686-w64-mingw32-gcc -o build/urelease/SubStart/substart.o -c -O2 -Wall -fno-strict-aliasing -DNSISCALL="attribute((stdcall))" -D_UNICODE -DUNICODE -Ibuild/urelease/config Contrib/SubStart/substart.c
i686-w64-mingw32-g++ -o build/urelease/SubStart/substart.exe -mwindows -Wl,--file-alignment,512 -s -Wl,--subsystem,console -nostdlib -Wl,--exclude-libs,msvcrt.a build/urelease/SubStart/substart.o -lkernel32 -luser32
Install file: "build/urelease/SubStart/substart.exe" as "/space/roberto/pdevelop-x86_64-windows/deps/bin/makensis.exe"
I am using nsis-3.05 patched as indicated in https://sourceforge.net/p/nsis/bugs/1241/#d28b
I attach the config.log generated on the Ubuntu 18.04 machine, which is identical, modulo the substitution of "/space/" with "/home/" to the one generated on the Ubuntu 16.04 machine.
Apart from the compiler versions, both builds begin with the following (below is what is obtained on the Ubuntu 18.04 machine):
scons: Reading SConscript files ...
Mkdir("build/urelease/config")
WARNING: VER_PACKED not set, defaulting to 0x03004666!
Delete("nsis-01-Mar-2020.cvs")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag $MAP_FLAG... yes
Checking for linker flag -s... yes
Checking for linker flag $MAP_FLAG... yes
Checking for linker flag -s... yes
Checking for memcpy requirement... no
Checking for memset requirement... no
Checking for linker flag -pthread... yes
Checking for BIG_ENDIAN... no
i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 7.3-win32 20180312
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Checking for C library gdi32... no
Checking for C library user32... no
Checking for C library pthread... yes
Checking for C library iconv... no
Checking for C library shlwapi... no
Checking for C library oleaut32... no
Checking for C library z... yes
Checking for C library z... yes
Checking for C library zdll... yes
Checking for C library dl... yes
Checking for C library gdi32... no
Checking for C library iconv... no
Checking for C library pthread... yes
Checking for C library user32... no
Checking for C library oleaut32... no
Checking for C library z... yes
Checking for C++ library cppunit... no
scons: done reading SConscript files.
scons: Building targets ...
It turned out to be an incompatibility of the build system for nsis-3.05 with Python 3. The problem goes away if one invokes "python2 $(which scons)" instead of just "scons".
When I tried and it used Python 2, it built both makensis and makensis.exe. Just need to add
if env['PLATFORM'] == 'win32':before the last line ofContrib/SubStart/SConscript.I am running into the same issue. See also: https://savannah.gnu.org/bugs/index.php?58689#comment28
Making the mentioned change in Contrib/SubStart/SConscript doesn't make a difference.
The reason for the error is probably that with python2 two versions of the nsis executables are built:
With python3, only the latter version (win32 executable) is built. SCons fails when it tries to install the former version (that it hasn't built).
Yes, as I said the problem is that nsis-3.05 is not compatible with Python 3.
Could you try that fix (also in SVN now) with your Python 3 setup? It should work there too.
After upgrading to NSIS 3.07, it is working correctly for me now. NSIS 3.08 also compiles correctly on Ubuntu 21.04 for me.