Jump to content

NearInfinity in Linux


bgf

Recommended Posts

I have a full-install of BG1 + TotSC under Linux. I've run the WeiDU tolower tool. The game is working fine under wine.

 

I'm trying to use NearInfinity-1.33b19-1.jar (downloaded from sourceforge) under Linux. However, NI has trouble opening the game files, apparently because it's not expecting them to be all lowercase, e.g. it tries to look for data/Defaults.bif when the file is now data/defaults.bif.

 

What can I do to make NI work under Linux after the game has been tolowered? Is this an NI problem or something else? :)

 

Thanks

Link to comment

Thanks for your response.

 

I grabbed the patch, but when I tried to apply it, every single hunk failed. I've probably missed something - can someone help please? :)

 

Here's the output for the first file:

 

$ patch --dry-run --global-reject-file=reject --verbose -R -p2 < NI-diff 
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|diff -p -b -E -r NearInfinity/NearInfinity/infinity/check/StructChecker.java old/NearInfinity/NearInfinity/infinity/check/StructChecker.java
|*** NearInfinity/NearInfinity/infinity/check/StructChecker.java		2006-11-06 21:32:09.000000000 +0100
|--- old/NearInfinity/NearInfinity/infinity/check/StructChecker.java	2006-07-19 02:21:45.000000000 +0200
--------------------------
Patching file infinity/check/StructChecker.java using Plan A...
Hunk #1 FAILED at 9.
Hunk #2 FAILED at 122.
Hunk #3 FAILED at 133.
3 out of 3 hunks FAILED

 

And here's the reject file for the first hunk:

 

*** infinity/check/StructChecker.java.orig	  2006-07-19 12:21:45.000000000 +1200
--- infinity/check/StructChecker.java   2006-11-07 09:32:09.000000000 +1300
*************** import infinity.gui.*;
*** 9,14 ****
 import infinity.icon.Icons;
 import infinity.resource.*;
 import infinity.resource.key.ResourceEntry;

 import javax.swing.*;
 import javax.swing.event.*;
--- 9,15 ----
 import infinity.icon.Icons;
 import infinity.resource.*;
 import infinity.resource.key.ResourceEntry;
+ import infinity.util.*;

 import javax.swing.*;
 import javax.swing.event.*;
*************** public final class StructChecker extends

 

It all looks kosher to me, so I don't know why every single hunk failed. What patch command should I be using?

Link to comment

The patch appears to be wrongly rooted, reversed, and written against an older version. Run `sed -e's,NearInfinity/NearInfinity/,,g' NI-diff -i` to correctly root it, then `patch -p1 -R < NI-diff` should work (extract both Nearinfinity.jar and files.zip to the same directory, so that Files*CI.java end up in infinity/utils next to ArrayUti.java). Only two hunks failed for me (#9 and #10 in infinity/gui/BrowserMenuBar.java), and those aren't relevant (I suppose my editor was getting angry at character encoding in the about pop-up).

Link to comment

Thanks bigg for looking into it.

 

I did notice all of *that* with the patch, and I actually already tried all of what you suggested before I posted (sorry for not mentioning it earlier), but it still failed miserably.

 

Actually, if you look at the contents of the reject file for the first hunk (which I posted above), it shows that the patch program appears to have figured out pretty much everything correctly - that first hunk really can't be more straightforward, and it *looks* correct (to me anyway), but it still failed. :)

 

The contents of the reject file seem to be exactly the same whether or not I correct the patch file first. This leads me to believe that the problem is somewhere else, apparently only at my end. :)

 

Hmm, this is really weird and I'm out of ideas atm. I might download a fresh copy of NI from sourceforge and try again before reporting back. In the meantime if you or anyone else have any ideas please let me know.

Link to comment

Hmm. Add -l (ignore whitespace) to patch, and/or check line endings? First thing that comes to mind.

 

Run "file" on various source files and the patch, to see if it has anything to say about line endings.

 

(Here's what it has to say if the file is old mac-style weird, for example:

patches.ini: ASCII English text, with very long lines, with CR line terminators )

Link to comment

Thanks guys! Problem solved. :)

 

The cause is that all the source files have CRLF line terminators but the patch file doesn't. :) dos2unix to the rescue!

 

[FYI: my version of patch is 2.5.9. No -l option is needed, indeed it's intelligent enough to handle everything without needing to sed the patch file first.]

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...