Old 4th July 2014, 19:13   #1
digifuzzy
Junior Member
 
Join Date: Jul 2014
Posts: 5
NSIS posix build

G.3 Building on POSIX suggests that if a cross-compiler is not available to use certain commands. And that's fine.

However, if a cross-complier is available, there are no instructions given in the documentation as to how to proceed. Attempting to cross-compile 3.0b0 using correct gcc but scons will fail after the message:
code:

AttributeError: 'NoneType' object has no attribute 'rfind':
...
File "/usr/lib/python2.7/posixpath.py", line 129:
i = p.rfind('/') + 1



Suggestions?
digifuzzy is offline   Reply With Quote
Old 4th July 2014, 20:15   #2
digifuzzy
Junior Member
 
Join Date: Jul 2014
Posts: 5
Found my error.
I was passing 'x86_64-...' as the compiler to use.
However, NSIS is looking for i686 (or similar).

Still, the absence of POSIX instuctions could be fixed, no?
digifuzzy is offline   Reply With Quote
Old 4th July 2014, 21:15   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
I know JasonFriday13 uses this successfully:
Quote:
scons XGCC_W32_PREFIX=i686-w64-mingw32- PREFIX="/home/jason/nsis_install" install SKIPUTILS="zip2exe"
And we have been playing with drone.io where we don't specify any such options: https://drone.io/github.com/kichik/nsis-1/admin (System.dll is skipped there because of a old version of GCC)

The online docs are sadly out of date but the 3.0 docs include this tidbit:
Quote:
The command line option XGCC_W32_PREFIX could be used to explicitly select a specific win32 targeted cross compiler. The value of XGCC_W32_PREFIX has to be the prefix of the toolchain. For example XGCC_W32_PREFIX=i686-w64-mingw32 would deploy the win32 targeted MinGW-w64 cross compiler if it is available on the build system.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th July 2014, 21:27   #4
digifuzzy
Junior Member
 
Join Date: Jul 2014
Posts: 5
NSIS posix build

I've been playing with the PKGBUILD script for the 2.46 build from the Arch User Repositories.

I think I have 3.0b0 building and I'm testing it out now.
Just seems strange to be only able to use the i686-w64-mingw32 compiler (32 bit version) only.

I'll have to tryout the command line information you provided. I missed the part about XGCC. I saw a post in my "googling" mention it, but no real details. I'll have to dig through the documentation again.

Thanks for the feedback!
digifuzzy is offline   Reply With Quote
Old 5th July 2014, 15:44   #5
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
If I had setup the ZLIB_W32 variable for the zlib files on my main system (it's currently volatile), I would be using this: `scons XGCC_W32_PREFIX=i686-w64-mingw32- PREFIX="/home/jason/nsis_install" install`.

I also have a virtual machine setup with the old i586 mingw32 triplet toolchain installed, along with wxWidgets (dev package from the ubuntu repository) and the zlib windows files, and apart from skipping the System plugin because of the Call.sx problem, I can compile the source using "scons". Also, apart from the cross-platform utilities (genpat.exe, librarylocal.exe, NSIS.exe, technically not makensisw.exe as it's in the wrong directory on linux), help file, and makensis.exe, it will compile the installer too.

Now that's an idea, I could add a TARGET_WINDOWS option for the posix build so that everything is compiled as windows targets, and only makensis is compiled for both windows and linux so that dist-installer works.

I did a quick search for chm compilers on linux and found this: http://manpages.ubuntu.com/manpages/...d-2.6.2.1.html. It's provided with the "fp-utils-2.x.x" package under ubuntu.

I'll start experimenting with this to see if it's fesable to target windows from a posix build. The only snag I can see is with the .zip file generation, as it's possible the posix built makensis can make it into the windows targeted .zip file (where it shouldn't be included).

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 5th July 2014, 18:58   #6
digifuzzy
Junior Member
 
Join Date: Jul 2014
Posts: 5
AUR 3.0b0 build

Thanks for the help.
digifuzzy is offline   Reply With Quote
Old 6th July 2014, 13:24   #7
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
^^ No problem .

Quote:
Originally Posted by JasonFriday13 View Post
I'll start experimenting with this to see if it's fesable to target windows from a posix build.
Turns out it's not easy. wxWidgets requires the windows version of the dev files, and that alone is something that I don't want to mess with. I got most of the utils to compile, the ones that didn't were NSIS Menu, LibraryLocal, and GenPat (which gave a weird zlib win32 error).

This is a dead end for me, time to work on something else.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 6th July 2014, 17:26   #8
digifuzzy
Junior Member
 
Join Date: Jul 2014
Posts: 5
Quote:
Originally Posted by JasonFriday13 View Post
^^ No problem .

Turns out it's not easy. wxWidgets requires the windows version of the dev files, and that alone is something that I don't want to mess with. I got most of the utils to compile, the ones that didn't were NSIS Menu, LibraryLocal, and GenPat (which gave a weird zlib win32 error).

This is a dead end for me, time to work on something else.
I've never linked NSIS to wxW. I've never really explored that possibility. Building wxW for cross-compiling is actually not that difficult. The secret is the configure settings.

The sequence I use:
- download and expand zip
- cd into expanded folder
- make a build folder
- cd into build folder
- run configure with...
code:
../configure --with-msw --disable-shared --with-sdl --with-opengl --enable-unicode --enable-mediactrl --enable-stl --disable-precomp-headers CXXFLAGS="-std=gnu++11 -I/usr/x86_64-w64-mingw32/include" CFLAGS="-I/usr/x86_64-w64-mingw32/include" --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --prefix=/opt/folder

--> change x86_64 to i686 if building 32bit version
--> set the prefix destination to suit
- make
- make install

When cross building against wxW, pass the path to wx-config.
code:
/opt/folder/bin/wx-config --cxxflags --libs


There is also winres when making the final executable
code:
/opt/folder/bin/wx-config --rescomp


Shout in my direction if there is something else I can help clear away.
digifuzzy is offline   Reply With Quote
Old 7th July 2014, 07:50   #9
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
wxWidgets is only used for NSIS Menu, and all it displays is an html document. That process looks a bit complicated just for cross-compiling the NSIS Menu. If someone wants to do the hard yards, power to them. I took the easy yards.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump