From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Mon, 22 Sep 2008 12:02:34 +0000 (+0100) Subject: Forward-port Debian patches to 2.39. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=4efd870b45dd6dd558c3c1d5baaf2c15fe3ba8e3;p=fedora-mingw.git Forward-port Debian patches to 2.39. --- diff --git a/.hgignore b/.hgignore index 2eec6d5..41fa2fe 100644 --- a/.hgignore +++ b/.hgignore @@ -19,6 +19,8 @@ libjpeg/jpegsrc.v6b.tar.gz libpng/libpng-1.2.31.tar.bz2 libvirt/libvirt-0.4.5.tar.gz libxml2/libxml2-2.6.32.tar.gz +nsis/nsis-2.19-src.tar.bz2 +nsis/nsis-2.39-src.tar.bz2 pango/pango-1.21.6.tar.bz2 pixman/pixman-0.11.10.tar.gz portablexdr/portablexdr-4.0.10.tar.gz diff --git a/nsis/mingw-nsis.spec b/nsis/mingw-nsis.spec index 4a4e933..02e22ef 100644 --- a/nsis/mingw-nsis.spec +++ b/nsis/mingw-nsis.spec @@ -1,3 +1,5 @@ +%define sconsopts VERSION=%{version} PREFIX=%{_prefix} PREFIX_CONF=%{_sysconfdir} SKIPPLUGINS=System DEBUG_SYMBOLS=1 OPTS=1 + Name: mingw-nsis Version: 2.39 Release: 1%{?dist} @@ -9,7 +11,12 @@ URL: http://nsis.sourceforge.net/ Source0: http://dl.sourceforge.net/sourceforge/nsis/nsis-%{version}-src.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch0: nsis-2.39-mingw-search.patch +# Patches from Debian (mainly by Paul Wise). +Patch0: nsis-2.39-debian-64bit-fixes.patch +Patch1: nsis-2.39-debian-debug-opt.patch + +# This patch is required for NSIS to find the correct cross-compiler. +Patch2: nsis-2.39-mingw-search.patch BuildRequires: mingw-filesystem >= 20 BuildRequires: mingw-gcc @@ -23,49 +30,31 @@ BuildRequires: wxGTK-devel NSIS, the Nullsoft Scriptable Install System, is a script-driven Windows installation system. -This package includes native Fedora binaries of makensis (etc.) There -are no native NSIS plugins available. Complete Windows binaries and -plugins are in the mingw-nsis-win package, but you must run those -either on a Windows machine or under Wine. - - -%package win -Summary: Windows binaries for %{name} -Requires: %{name} = %{version}-%{release} -Group: Development/Libraries - -BuildArch: noarch - - -%description win -This package includes complete Windows binaries and plugins for -%{name}. +This package includes native Fedora binaries of makensis (etc.) and +all plugins except for System.dll. The System.dll plugin cannot be +built natively at this time since it includes inline Microsoft +assembler code. %prep %setup -q -n nsis-%{version}-src %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build -scons \ - PREFIX=%{_prefix} PREFIX_CONF=%{_sysconfdir} +scons %{sconsopts} %install rm -rf $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT -scons \ - PREFIX=%{_prefix} PREFIX_CONF=%{_sysconfdir} \ - PREFIX_DEST=$RPM_BUILD_ROOT \ - install +scons %{sconsopts} PREFIX_DEST=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT%{_docdir}/nsis $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} -# It's not clear if we should move the Windows binaries -# to %{_mingw_sysroot} or leave them where they are. - %clean rm -rf $RPM_BUILD_ROOT @@ -78,11 +67,7 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/nsis %doc %{_docdir}/%{name}-%{version} -%files win -%defattr(-,root,root) -%{_datadir}/nsis - %changelog -* Fri Sep 5 2008 Richard W.M. Jones - 2.39-1 +* Mon Sep 22 2008 Richard W.M. Jones - 2.39-1 - Initial RPM release. diff --git a/nsis/nsis-2.19-debian-64bit-fixes.patch b/nsis/nsis-2.19-debian-64bit-fixes.patch new file mode 100644 index 0000000..83e7721 --- /dev/null +++ b/nsis/nsis-2.19-debian-64bit-fixes.patch @@ -0,0 +1,218 @@ +01_64bit_fixes.patch +Andreas Jochens , Andreas Barth , +Steve Langasek , Paul Wise +Fix some issues with building and running makensis on 64-bit platforms +Index: Source/DialogTemplate.cpp +=================================================================== +--- Source/DialogTemplate.cpp.orig 2007-01-30 09:03:35.000000000 +0100 ++++ Source/DialogTemplate.cpp 2007-01-30 09:03:56.000000000 +0100 +@@ -93,7 +93,7 @@ + if (IS_INTRESOURCE(x)) { \ + *(WORD*)seeker = 0xFFFF; \ + seeker += sizeof(WORD); \ +- *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ ++ *(WORD*)seeker = ConvertEndianness(WORD(long(x))); \ + seeker += sizeof(WORD); \ + } \ + else { \ +@@ -629,7 +629,7 @@ + } + } + +- assert((DWORD) seeker - (DWORD) pbDlg == dwSize); ++ assert((long) seeker - (long) pbDlg == dwSize); + + // DONE! + return pbDlg; +Index: Source/Platform.h +=================================================================== +--- Source/Platform.h.orig 2007-01-30 09:03:35.000000000 +0100 ++++ Source/Platform.h 2007-01-30 09:05:35.000000000 +0100 +@@ -135,7 +135,7 @@ + # define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i))) + # endif + # ifndef IMAGE_FIRST_SECTION +-# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ ++# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (long) h + \ + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ + FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) + # endif +@@ -147,7 +147,7 @@ + # endif + #endif + #ifndef IS_INTRESOURCE +-# define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0) ++# define IS_INTRESOURCE(_r) (((unsigned long)(_r) >> 16) == 0) + #endif + + // functions +@@ -666,7 +666,7 @@ + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; +- LONG e_lfanew; ++ DWORD e_lfanew; + } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; + # pragma pack() + # pragma pack(4) +Index: Source/ResourceEditor.cpp +=================================================================== +--- Source/ResourceEditor.cpp.orig 2007-01-30 09:03:35.000000000 +0100 ++++ Source/ResourceEditor.cpp 2007-01-30 09:03:56.000000000 +0100 +@@ -545,7 +545,7 @@ + rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); + + CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); +- crd->m_dwWrittenAt = DWORD(seeker); ++ crd->m_dwWrittenAt = long(seeker); + seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); + + for (int i = 0; i < crd->CountEntries(); i++) { +@@ -566,7 +566,7 @@ + rDirE.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; + + CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); +- crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); ++ crd->GetEntry(i)->m_dwWrittenAt = long(seeker); + seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); + } + qDirs.pop(); +@@ -582,7 +582,7 @@ + rDataE.Size = ConvertEndianness(cRDataE->GetSize()); + + CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); +- cRDataE->m_dwWrittenAt = DWORD(seeker); ++ cRDataE->m_dwWrittenAt = long(seeker); + seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); + + qDataEntries.pop(); +@@ -594,7 +594,7 @@ + while (!qStrings.empty()) { + CResourceDirectoryEntry* cRDirE = qStrings.front(); + +- PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); ++ PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(long(seeker) - long(pbRsrcSec)); + + char* szName = cRDirE->GetName(); + WORD iLen = strlen(szName) + 1; +@@ -636,7 +636,7 @@ + /* + * Set all of the directory entries offsets. + */ +- SetOffsets(m_cResDir, DWORD(pbRsrcSec)); ++ SetOffsets(m_cResDir, long(pbRsrcSec)); + } + + // Sets the offsets in directory entries +@@ -758,7 +758,7 @@ + // Returns -1 if can not be found + int CResourceDirectory::Find(char* szName) { + if (IS_INTRESOURCE(szName)) +- return Find((WORD) (DWORD) szName); ++ return Find((WORD) (long) szName); + else + if (szName[0] == '#') + return Find(WORD(atoi(szName + 1))); +@@ -836,7 +836,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (long) szName; + } + else { + m_bHasName = true; +@@ -851,7 +851,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (long) szName; + } + else { + m_bHasName = true; +Index: Source/util.cpp +=================================================================== +--- Source/util.cpp.orig 2007-01-30 09:03:35.000000000 +0100 ++++ Source/util.cpp 2007-01-30 09:07:54.000000000 +0100 +@@ -57,9 +57,9 @@ + } + + if (width != 0) { +- LONG biWidth; ++ DWORD biWidth; + fseek(f, 18, SEEK_SET); // Seek to the width member of the header +- fread(&biWidth, sizeof(LONG), 1, f); ++ fread(&biWidth, sizeof(DWORD), 1, f); + FIX_ENDIAN_INT32_INPLACE(biWidth); + if (width != biWidth) { + fclose(f); +@@ -68,12 +68,12 @@ + } + + if (height != 0) { +- LONG biHeight; ++ DWORD biHeight; + fseek(f, 22, SEEK_SET); // Seek to the height member of the header +- fread(&biHeight, sizeof(LONG), 1, f); ++ fread(&biHeight, sizeof(DWORD), 1, f); + FIX_ENDIAN_INT32_INPLACE(biHeight); + // Bitmap height can be negative too... +- if (height != abs(biHeight)) { ++ if (height != abs((long int)biHeight)) { + fclose(f); + return -3; + } +@@ -312,7 +312,7 @@ + FIX_ENDIAN_INT32_INPLACE(rdEntry.OffsetToData); + MY_ASSERT(!rdEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + long(rdRoot)); + + MY_ASSERT((size_t)rdIcons - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -325,7 +325,7 @@ + FIX_ENDIAN_INT32_INPLACE(icoEntry.OffsetToData); + + MY_ASSERT(!icoEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); +- PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + long(rdRoot)); + + MY_ASSERT((size_t)rd - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -334,7 +334,7 @@ + + MY_ASSERT(datEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + DWORD(rdRoot)); ++ PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + long(rdRoot)); + + MY_ASSERT((size_t)rde - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -355,10 +355,10 @@ + } + + // Set offset +- DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + DWORD(rdRoot) - dwResourceSectionVA - DWORD(exeHeader); ++ DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + long(rdRoot) - dwResourceSectionVA - long(exeHeader); + *(LPDWORD) seeker = FIX_ENDIAN_INT32(dwOffset); + +- MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (DWORD)rdRoot - (DWORD)exeHeader, "invalid data offset - icon resource probably compressed"); ++ MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (long)rdRoot - (long)exeHeader, "invalid data offset - icon resource probably compressed"); + } + + LPBYTE seeker = uninstIconData; +Index: Source/Plugins.cpp +=================================================================== +--- Source/Plugins.cpp.orig 2007-01-30 09:05:50.000000000 +0100 ++++ Source/Plugins.cpp 2007-01-30 09:07:05.000000000 +0100 +@@ -120,7 +120,7 @@ + DWORD prd = FIX_ENDIAN_INT32(sections[i].PointerToRawData); + PIMAGE_EXPORT_DIRECTORY exports = PIMAGE_EXPORT_DIRECTORY(&dlldata[0] + prd + ExportDirVA - va); + DWORD na = FIX_ENDIAN_INT32(exports->AddressOfNames); +- unsigned long *names = (unsigned long*)((unsigned long) exports + (char *) na - ExportDirVA); ++ unsigned int *names = (unsigned int*)((unsigned long) exports + (char *) na - ExportDirVA); + for (unsigned long j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++) + { + const string name = string((char*)exports + FIX_ENDIAN_INT32(names[j]) - ExportDirVA); diff --git a/nsis/nsis-2.19-debian-debug-opt.patch b/nsis/nsis-2.19-debian-debug-opt.patch new file mode 100644 index 0000000..f7e5ef8 --- /dev/null +++ b/nsis/nsis-2.19-debian-debug-opt.patch @@ -0,0 +1,71 @@ +02_debug_symbols.patch +Paul Wise +Add an option to generate debugging symbols +without side-effects on optimisation flags +and an option to enable/disable optimisation +Index: SCons/Config/gnu +=================================================================== +--- SCons/Config/gnu.orig 2007-02-02 20:34:33.000000000 +1100 ++++ SCons/Config/gnu 2007-02-08 15:33:51.000000000 +1100 +@@ -81,13 +81,16 @@ + + makensis_env = defenv.Copy() + +-if not defenv['DEBUG']: +- makensis_env.Append(CCFLAGS = '-O2') # optimize ++if defenv['DEBUG_SYMBOLS']: ++ makensis_env.Append(CCFLAGS = '-g') # debugging ++ makensis_env.Append(LINKFLAGS = '-g') # debugging ++if not defenv['DEBUG'] and defenv['OPT']: ++ makensis_env.Append(CCFLAGS = '-O2') # optimize + makensis_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(makensis_env) + conf.CheckLinkFlag('$MAP_FLAG') # generate map file +-if not defenv['DEBUG']: ++if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS']: + TestStrip(conf) # strip + conf.Finish() + +@@ -110,13 +113,16 @@ + + cp_util_env = defenv.Copy() + +-if not defenv['DEBUG']: ++if defenv['DEBUG_SYMBOLS']: ++ cp_util_env.Append(CCFLAGS = '-g') # debugging ++ cp_util_env.Append(LINKFLAGS = '-g') # debugging ++if not defenv['DEBUG'] and defenv['OPT']: + cp_util_env.Append(CCFLAGS = '-O2') # optimize + cp_util_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(cp_util_env) + conf.CheckLinkFlag('$MAP_FLAG') # generate map file +-if not defenv['DEBUG']: ++if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS']: + TestStrip(conf) # strip + conf.Finish() + +@@ -131,6 +137,9 @@ + ### test environment + + test_env = defenv.Copy() ++if defenv['DEBUG_SYMBOLS']: ++ test_env.Append(LINKFLAGS = '-g') # debugging ++ test_env.Append(CCFLAGS = '-g') # debugging + + ### weird GCC requirements + +Index: SConstruct +=================================================================== +--- SConstruct.orig 2007-02-02 20:34:33.000000000 +1100 ++++ SConstruct 2007-02-08 15:48:40.000000000 +1100 +@@ -127,6 +127,8 @@ + opts.Add(PathOption('LIBPATH', 'Path to search for libraries', None)) + # build options + opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no')) ++opts.Add(BoolOption('DEBUG_SYMBOLS', 'Build with debugging information, but none of the side effects of DEBUG', 'no')) ++opts.Add(BoolOption('OPT', 'Build with optimization', 'yes')) + opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None)) + # path related build options + opts.Add(('PREFIX_DEST', 'Intermediate installation prefix (extra install time prefix)', dirs['dest'])) diff --git a/nsis/nsis-2.19-mingw-search.patch b/nsis/nsis-2.19-mingw-search.patch new file mode 100644 index 0000000..021e1df --- /dev/null +++ b/nsis/nsis-2.19-mingw-search.patch @@ -0,0 +1,10 @@ +--- nsis-2.19-src/SCons/Tools/crossmingw.py.orig 2006-02-24 16:19:55.000000000 +0000 ++++ nsis-2.19-src/SCons/Tools/crossmingw.py 2008-09-22 12:03:34.000000000 +0100 +@@ -44,6 +44,7 @@ + + # This is what we search for to find mingw: + prefixes = SCons.Util.Split(""" ++ i686-pc-mingw32- + mingw32- + mingw32msvc- + i386-mingw32- diff --git a/nsis/nsis-2.39-debian-64bit-fixes.patch b/nsis/nsis-2.39-debian-64bit-fixes.patch new file mode 100644 index 0000000..7d32757 --- /dev/null +++ b/nsis/nsis-2.39-debian-64bit-fixes.patch @@ -0,0 +1,169 @@ +diff -ur nsis-2.39-src.orig/Source/DialogTemplate.cpp nsis-2.39-src.64bit/Source/DialogTemplate.cpp +--- nsis-2.39-src.orig/Source/DialogTemplate.cpp 2007-11-30 09:54:13.000000000 +0000 ++++ nsis-2.39-src.64bit/Source/DialogTemplate.cpp 2008-09-22 12:37:11.000000000 +0100 +@@ -74,7 +74,7 @@ + if (IS_INTRESOURCE(x)) { \ + *(WORD*)seeker = 0xFFFF; \ + seeker += sizeof(WORD); \ +- *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ ++ *(WORD*)seeker = ConvertEndianness(WORD(long(x))); \ + seeker += sizeof(WORD); \ + } \ + else { \ +@@ -622,7 +622,7 @@ + } + } + +- assert((DWORD) seeker - (DWORD) pbDlg == dwSize); ++ assert((long) seeker - (long) pbDlg == dwSize); + + // DONE! + return pbDlg; +diff -ur nsis-2.39-src.orig/Source/Platform.h nsis-2.39-src.64bit/Source/Platform.h +--- nsis-2.39-src.orig/Source/Platform.h 2007-12-22 09:41:57.000000000 +0000 ++++ nsis-2.39-src.64bit/Source/Platform.h 2008-09-22 12:38:20.000000000 +0100 +@@ -185,7 +185,7 @@ + # define MAKEINTRESOURCE MAKEINTRESOURCEA + # endif + # ifndef IMAGE_FIRST_SECTION +-# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ ++# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (long) h + \ + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ + FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) + # endif +@@ -197,7 +197,7 @@ + # endif + #endif + #ifndef IS_INTRESOURCE +-# define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0) ++# define IS_INTRESOURCE(_r) (((unsigned long)(_r) >> 16) == 0) + #endif + + // functions +@@ -722,7 +722,7 @@ + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; +- LONG e_lfanew; ++ DWORD e_lfanew; + } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; + # pragma pack() + # pragma pack(4) +diff -ur nsis-2.39-src.orig/Source/Plugins.cpp nsis-2.39-src.64bit/Source/Plugins.cpp +--- nsis-2.39-src.orig/Source/Plugins.cpp 2007-12-22 09:41:57.000000000 +0000 ++++ nsis-2.39-src.64bit/Source/Plugins.cpp 2008-09-22 12:42:47.000000000 +0100 +@@ -136,7 +136,7 @@ + DWORD prd = FIX_ENDIAN_INT32(sections[i].PointerToRawData); + PIMAGE_EXPORT_DIRECTORY exports = PIMAGE_EXPORT_DIRECTORY(&dlldata[0] + prd + ExportDirVA - va); + DWORD na = FIX_ENDIAN_INT32(exports->AddressOfNames); +- unsigned long *names = (unsigned long*)((unsigned long) exports + (char *) na - ExportDirVA); ++ unsigned int *names = (unsigned int*)((unsigned long) exports + (char *) na - ExportDirVA); + for (unsigned long j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++) + { + const string name = string((char*)exports + FIX_ENDIAN_INT32(names[j]) - ExportDirVA); +diff -ur nsis-2.39-src.orig/Source/ResourceEditor.cpp nsis-2.39-src.64bit/Source/ResourceEditor.cpp +--- nsis-2.39-src.orig/Source/ResourceEditor.cpp 2007-12-22 09:41:57.000000000 +0000 ++++ nsis-2.39-src.64bit/Source/ResourceEditor.cpp 2008-09-22 12:40:20.000000000 +0100 +@@ -665,7 +665,7 @@ + rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); + + CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); +- crd->m_dwWrittenAt = DWORD(seeker); ++ crd->m_dwWrittenAt = long(seeker); + seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); + + for (int i = 0; i < crd->CountEntries(); i++) { +@@ -686,7 +686,7 @@ + rDirE.UName.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; + + CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); +- crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); ++ crd->GetEntry(i)->m_dwWrittenAt = long(seeker); + seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); + } + qDirs.pop(); +@@ -702,7 +702,7 @@ + rDataE.Size = ConvertEndianness(cRDataE->GetSize()); + + CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); +- cRDataE->m_dwWrittenAt = DWORD(seeker); ++ cRDataE->m_dwWrittenAt = long(seeker); + seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); + + qDataEntries.pop(); +@@ -714,7 +714,7 @@ + while (!qStrings.empty()) { + CResourceDirectoryEntry* cRDirE = qStrings.front(); + +- PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->UName.NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); ++ PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->UName.NameString.NameOffset = ConvertEndianness(long(seeker) - long(pbRsrcSec)); + + WCHAR* szName = cRDirE->GetName(); + WORD iLen = winchar_strlen(szName) + 1; +@@ -745,7 +745,7 @@ + /* + * Set all of the directory entries offsets. + */ +- SetOffsets(m_cResDir, DWORD(pbRsrcSec)); ++ SetOffsets(m_cResDir, long(pbRsrcSec)); + } + + // Sets the offsets in directory entries +@@ -868,7 +868,7 @@ + // Returns -1 if can not be found + int CResourceDirectory::Find(WCHAR* szName) { + if (IS_INTRESOURCE(szName)) +- return Find((WORD) (DWORD) szName); ++ return Find((WORD) (long) szName); + else + if (szName[0] == '#') + return Find(WORD(winchar_stoi(szName + 1))); +@@ -946,7 +946,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (long) szName; + } + else { + m_bHasName = true; +@@ -960,7 +960,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (long) szName; + } + else { + m_bHasName = true; +diff -ur nsis-2.39-src.orig/Source/util.cpp nsis-2.39-src.64bit/Source/util.cpp +--- nsis-2.39-src.orig/Source/util.cpp 2008-03-04 16:59:51.000000000 +0000 ++++ nsis-2.39-src.64bit/Source/util.cpp 2008-09-22 12:41:03.000000000 +0100 +@@ -75,9 +75,9 @@ + } + + if (width != 0) { +- LONG biWidth; ++ DWORD biWidth; + fseek(f, 18, SEEK_SET); // Seek to the width member of the header +- fread(&biWidth, sizeof(LONG), 1, f); ++ fread(&biWidth, sizeof(DWORD), 1, f); + FIX_ENDIAN_INT32_INPLACE(biWidth); + if (width != biWidth) { + fclose(f); +@@ -86,12 +86,12 @@ + } + + if (height != 0) { +- LONG biHeight; ++ DWORD biHeight; + fseek(f, 22, SEEK_SET); // Seek to the height member of the header +- fread(&biHeight, sizeof(LONG), 1, f); ++ fread(&biHeight, sizeof(DWORD), 1, f); + FIX_ENDIAN_INT32_INPLACE(biHeight); + // Bitmap height can be negative too... +- if (height != abs(biHeight)) { ++ if (height != abs((long int)biHeight)) { + fclose(f); + return -3; + } diff --git a/nsis/nsis-2.39-debian-debug-opt.patch b/nsis/nsis-2.39-debian-debug-opt.patch new file mode 100644 index 0000000..fa112ac --- /dev/null +++ b/nsis/nsis-2.39-debian-debug-opt.patch @@ -0,0 +1,61 @@ +diff -ur nsis-2.39-src.orig/SCons/Config/gnu nsis-2.39-src.debopt/SCons/Config/gnu +--- nsis-2.39-src.orig/SCons/Config/gnu 2008-03-03 16:33:56.000000000 +0000 ++++ nsis-2.39-src.debopt/SCons/Config/gnu 2008-09-22 12:53:18.000000000 +0100 +@@ -61,8 +61,11 @@ + stub_env = defenv.Clone() + cross_env(stub_env) + +-if not defenv['DEBUG']: +- stub_env.Append(CCFLAGS = '-Os') # optimize for size ++if not defenv['DEBUG_SYMBOLS']: ++ stub_env.Append(CCFLAGS = '-g') # debugging ++ stub_env.Append(LINKFLAGS = '-g') # debugging ++if not defenv['DEBUG'] and defenv['OPT']: ++ stub_env.Append(CCFLAGS = '-O2') # optimize + stub_env.Append(CCFLAGS = '-Wall') # all warnings + stub_env.Append(CCFLAGS = '-x c') # force compile as c + stub_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing +@@ -88,7 +91,7 @@ + conf.CheckCompileFlag('-m32') # + conf.CheckLinkFlag('-m32') # + conf.CheckLinkFlag('$MAP_FLAG') # generate map file +-if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']: ++if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_CP']: + TestStrip(conf) # strip + conf.Finish() + +@@ -112,7 +115,10 @@ + + cp_util_env = defenv.Clone() + +-if not defenv['DEBUG']: ++if defenv['DEBUG_SYMBOLS']: ++ cp_util_env.Append(CCFLAGS = '-g') # debugging ++ cp_util_env.Append(LINKFLAGS = '-g') # debugging ++if not defenv['DEBUG'] and defenv['OPT']: + cp_util_env.Append(CCFLAGS = '-O2') # optimize + cp_util_env.Append(CCFLAGS = '-Wall') # all warnings + cp_util_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing +@@ -146,6 +152,10 @@ + ### test environment + + test_env = defenv.Clone() ++if defenv['DEBUG_SYMBOLS']: ++ test_env.Append(LINKFLAGS = '-g') # debugging ++ test_env.Append(CCFLAGS = '-g') # debugging ++ + conf = FlagsConfigure(test_env) + conf.CheckCompileFlag('-m32') + conf.CheckLinkFlag('-m32') +diff -ur nsis-2.39-src.orig/SConstruct nsis-2.39-src.debopt/SConstruct +--- nsis-2.39-src.orig/SConstruct 2008-05-04 09:30:07.000000000 +0100 ++++ nsis-2.39-src.debopt/SConstruct 2008-09-22 12:55:55.000000000 +0100 +@@ -168,6 +168,8 @@ + opts.Add(('APPEND_LINKFLAGS', 'Additional linker flags')) + # build options + opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no')) ++opts.Add(BoolOption('DEBUG_SYMBOLS', 'Build with debugging information, but none of the side effects of DEBUG', 'no')) ++opts.Add(BoolOption('OPT', 'Build with optimization', 'yes')) + opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None)) + opts.Add(BoolOption('STRIP', 'Strips executables of any unrequired data such as symbols', 'yes')) + opts.Add(BoolOption('STRIP_CP', 'Strips cross-platform executables of any unrequired data such as symbols', 'yes'))