Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15980 closed patch (fixed)

Patch for compiling on Windows

Reported by: Skylark Owned by: tomkiewicz
Milestone: 3.0.0 Component: winpidgin (gtk)
Version: 3.0.0hg Keywords:
Cc: tomkiewicz, wernerml

Description

Hello,

Here is a patch for compiling the main branch (pidgin-main, aka 3.0.0-devel) on Windows. (There is no 3.0.0 or main in the version field, sorry)

I used Tomasz's prepare-workspace.sh script (which I modified slightly, more below) and then worked through the compile errors (surprisingly few considering I get the feeling no one compiles on Windows lately).

Here is the rationale of each diff in order.

1. libpurple/protocols/gg/keymapper.h

uint16_t was not declared - other headers using uint16_t in the gg directory all included libgadu.h so I expect that should be fine.

2. libpurple/protocols/mxit/markup.c

uint8_t was not declared - in this case I declared it directly there since no other files in the mxit directory used that type so I couldn't figure out if there was an appropriate header to include from there.

3. libpurple/win32/global.mak

Tomasz's script downloads nss-3.14 into the win32-dev/nss-3.14 directory, if the intent is really to use nss-3.15-nspr-4.10.2 then change the prepare-workspace.sh script instead to match.

4. pidgin/gtk3compat.h

Using GTK_CHECK_VERSION without including any gtk header... Again other places that used GTK_CHECK_VERSION included pidgin.h (which includes gtk.h) so I think that's fine.

5. pidgin/libpidgin.c, pidgin/pidgin.h and pidgin/pidgin.c

in libpidgin.c there is a call to winpidgin_init(hint); inside an ifdef _WIN32. However the hint variable does not exist. Going back in the history of these files, I found that the pidgin_start() function used to be pidgin_main() and had an additional HINSTANCE hint argument. Seeing that main in pidgin.c is ifdeffed _WIN32 to have that additional argument too, I modified the pidgin_start() function and declaration if _WIN32 is declared, to be able to pass it the HINSTANCE hint parameter. It's a bit ugly but it works.

6. pidgin/plugins/Makefile.mingw

Removed the convcolors.dll plugin, there is no file pidgin/plugins/convcolors.c (it probably used to exist?). Remove the commented out line, I just wanted it to be clear that I was removing it.

7. pidgin/win32/nsis/pidgin-installer.nsi

NSIS 3.0+ seems to have two sets of plugins, x86-ansi and x86-unicode in its Plugins directory. I chose x86-unicode (as I think Windows 7 is unicode-only anyways) and it seemed to work... But I don't know any more than that about this.

8. pidgin/win32/prepare-workspace.sh

The first change is probably not wanted, I just didn't want to keep the Bonjour SDK installed on my system (why you'd want an installer for an SDK on Windows is beyond me, give me a zip or tar.gz and I'm happy, I'm oldskool like that). So I copied the files out into some directory and then uninstalled it.

The second change is that I had a recent perl installed in my Cygwin environment so I chose to use that instead of ActivePerl?. I think that may be the easiest - tell people to install Perl during Cygwin setup and use that.

If you have any questions just let me know.

Jean-Sébastien Guay

Attachments (1)

pidgin-3.0.0-devel_win32_build_fixes.patch (4.6 KB) - added by Skylark 5 years ago.

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by Skylark

comment:1 in reply to: ↑ description Changed 5 years ago by QuLogic

Replying to Skylark:

2. libpurple/protocols/mxit/markup.c

uint8_t was not declared - in this case I declared it directly there since no other files in the mxit directory used that type so I couldn't figure out if there was an appropriate header to include from there.

This should be guint8 instead.

comment:2 Changed 5 years ago by QuLogic

  • Component changed from unclassified to winpidgin (gtk)
  • Owner changed from EionRobb to datallah
  • Version 2.10.9 deleted

comment:3 Changed 5 years ago by QuLogic

  • Owner changed from datallah to tomkiewicz

Sorry for the noise there.

comment:4 in reply to: ↑ description ; follow-up: Changed 5 years ago by tomkiewicz

Replying to Skylark:

8. pidgin/win32/prepare-workspace.sh

The first change is probably not wanted, I just didn't want to keep the Bonjour SDK installed on my system (why you'd want an installer for an SDK on Windows is beyond me, give me a zip or tar.gz and I'm happy, I'm oldskool like that). So I copied the files out into some directory and then uninstalled it.

I would really like to repackage those files, but I'm not sure, if these files are properly licensed, to do that. Does anyone knows it?

comment:5 in reply to: ↑ 4 Changed 5 years ago by Skylark

Replying to tomkiewicz:

I would really like to repackage those files, but I'm not sure, if these files are properly licensed, to do that. Does anyone knows it?

From what I can see, there is a form you can sign and snail-mail (because we're in 1983) to have the right to redistribute the Bonjour client-side installer (I guess that's the Windows driver). See https://developer.apple.com/softwarelicensing/agreements/bonjour.php

For the SDK itself, the header (Include/dns_sd.h) contains the following:

/* -*- Mode: C; tab-width: 4 -*-
 *
 * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1.  Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
 *     contributors may be used to endorse or promote products derived from this
 *     software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

So I think you're fine if you put the necessary headers/libs directly in your repository, and to be extra safe you could reproduce the above text in your documentation (in a section titled "Contains software from Apple Computer, Inc. under the following license"). But IANAL, this is just my interpretation of item 1 above.

comment:6 Changed 5 years ago by tomkiewicz

  • Resolution set to fixed
  • Status changed from new to closed
  • Version set to 3.0.0hg

Win32 should build fine, right now.

A matter of repackaging Bonjour SDK without violating GPL could be extracted to another ticket. I don't feel qualified here.

comment:7 in reply to: ↑ description ; follow-up: Changed 5 years ago by wernerml

Replying to Skylark:

Why the f..k should we need a PATCH to compile this buill...t ???????

Aren't the developers building in Windows too?

damn... someone told me that Pidgin developers were noobs... but this is beyound noobness...

comment:8 Changed 5 years ago by wernerml

this isn't working anyway....

Invalid command: nsisunz::UnzipToLog
Error in script "pidgin/win32/nsis/pidgin-installer.nsi" on line 282 -- aborting creation process
Makefile.mingw:129: recipe for target 'installer' failed
make: *** [installer] Error 1

comment:9 in reply to: ↑ 7 Changed 5 years ago by QuLogic

Replying to wernerml:

Replying to Skylark:

Why the f..k should we need a PATCH to compile this buill...t ???????

Maybe because this is about the development version, which you shouldn't be compiling unless you know what you are doing anyway?

Aren't the developers building in Windows too?

See above.

damn... someone told me that Pidgin developers were noobs... but this is beyound noobness...

Before calling people noobs, maybe you want to read the instructions first.

Replying to wernerml:

this isn't working anyway....

Invalid command: nsisunz::UnzipToLog
Error in script "pidgin/win32/nsis/pidgin-installer.nsi" on line 282 -- aborting creation process
Makefile.mingw:129: recipe for target 'installer' failed
make: *** [installer] Error 1

Well, this only proves my point.

comment:10 Changed 5 years ago by wernerml

kkkkkkkkkkkk, sorry, I'm too damn irritated here... =P

comment:11 Changed 5 years ago by Robby

Whoever said "ignorance is bliss" never felt your torment.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!