build 1.54 KB
Newer Older
1 2
#!/bin/bash
[% c("var/set_default_env") -%]
3 4 5
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf nsis-[% c('version') %].tar.bz2
6 7 8 9

# NSIS requires zlib and we later set the path using ZLIB_W32.
tar -C /var/tmp/build -xf [% c('input_files_by_name/zlib') %]

10
cd /var/tmp/build/nsis-[% c('version') %]-src
11 12 13 14 15
# Adding --no-insert-timestamp to APPEND_LINKFLAGS is not working as it
# is used for both the host and cross-compiled parts, but this option is
# only valid for the Windows linker. Therefore we add it using a patch
# to the cross-compilation part only. Still needed as of 3.06.1, see: #40090.
patch -p1 < $rootdir/no-insert-timestamp.patch
16 17 18 19 20 21 22 23 24 25

[% IF c("var/windows-x86_64") %]
  # Seems like setting TARGET_ARCH is not enough so we need to patch build.cpp
  # manually; this is confirmed by a comment in the same file.
  sed -i 's/m_target_type=TARGET_X86ANSI/m_target_type=TARGET_AMD64/' Source/build.cpp
  [% SET target = "amd64" %]
[% ELSE %]
  [% SET target = "x86" %]
[% END %]

boklm's avatar
boklm committed
26 27
[% SET scons_args = 'VERSION=' _ c("version")
        _ ' APPEND_CCFLAGS="-fgnu89-inline"'
28 29 30
        _ " SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=" _ c("arch") _ "-w64-mingw32-"
        _ " TARGET_ARCH=" _ target
        _ " ZLIB_W32=/var/tmp/build/zlib/"
31 32 33 34 35 36 37 38
        _ ' PREFIX=/var/tmp/dist/nsis' -%]
scons [% scons_args %]
scons [% scons_args %] install
cd /var/tmp/dist
[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
        }) %]