Won't compile? Simple patch for modern linux compiles

Post your questions about Linux Darkbots here.

Moderator: Drago

Won't compile? Simple patch for modern linux compiles

Postby xiaodown » Tue Feb 09, 2010 10:30 am


****EDIT: Read the 2nd post - don't copy and paste this patch, the forums screw up formatting. I posted a txt file as well as a pastebin of the correct patch in the 2nd post.




Ok, on modern linuxes, for 6f6, this should work.

Code: Select all
diff -Naur darkbot6f6/darkbot.c darkbot6f6-new/darkbot.c
--- darkbot6f6/darkbot.c        2001-12-17 15:29:05.000000000 -0500
+++ darkbot6f6-new/darkbot.c    2010-02-09 09:59:59.000000000 -0500
@@ -3476,8 +3476,7 @@
           strlwr (s2);^M
           if (*s2 == '~') {^M
             S^M
-              ("PRIVMSG %s :%s, rdb files can only be called from the data of a ***, they cannot be used in the^M
- *** itself.\n",^M
+              ("PRIVMSG %s :%s, rdb files can only be called from the data of a ***, they cannot be used in the *** itself.\n",^M
                target, source);^M
             R;^M
           }^M
diff -Naur darkbot6f6/defines.h darkbot6f6-new/defines.h
--- darkbot6f6/defines.h        2001-12-17 15:29:09.000000000 -0500
+++ darkbot6f6-new/defines.h    2010-02-09 09:59:51.000000000 -0500
@@ -21,7 +21,7 @@
/* Please note that the below defines are the RECOMMENDED settings! */
/* So if you don't know if you should change something, leave it :) */

-#define NEED_CLOCK_T OFF
+#define NEED_CLOCK_T ON
/**
  * If you have Mandrake, or are getting errors complaining
  * about clock_t and CLOCKS_PER_SEC not being available,


Just save this to a file (in the example below, it's called darkbot-diff).

Then, to compile your darkbot, just do this:

Code: Select all
cd /some/dir
wget http://darkbot.sourceforge.net/archive/unix/darkbot-6f6-r6.tar.gz
tar -xzvf darkbot-6f6-r6.tar.gz
patch -p0 < darkbot-diff
cd darkbot6f6
./configure
(continue as normal)


I don't know how to get rid of the built in log warning on compile, but w/e.

This works on Centos 5.4, and thus probably RedHat Enterprise major version 5, as well as fedora / fedora core 6-10. This was using gcc 4.1.2, but it's redhat's gcc which has a lot of stuff backported from 4.2. It might work on other modern linuxes as well.

Hit me up on irc.coldfront.net with any questions, but this isn't really a complex patch, it just preemptively turns on clock stuff and takes out a spurious newline.
Last edited by xiaodown on Mon Apr 12, 2010 10:25 am, edited 1 time in total.
xiaodown
 
Posts: 2
Joined: Tue Feb 09, 2010 10:18 am

Re: Won't compile? Simple patch for modern linux compiles

Postby xiaodown » Mon Apr 12, 2010 10:13 am

Someone /msg'd me on IRC, text of:

07:05 <logik> Hey ya
07:06 <logik> I got a question for ya :)
07:07 <logik> I tried you « how to » on http://www.***.org/forum/***.php?f=4&t=321
07:08 <logik> But it sounds like I'm receiving an error
07:08 <logik> Hunk #1 FAILED at 3476.
07:09 <logik> 1 out of 1 hunk FAILED -- saving rejects to file darkbot6f6/darkbot.c.rej
07:09 <logik> patching file darkbot6f6/defines.h
07:09 <logik> patch: **** malformed patch at line 18: /* Please note that the below defines are the RECOMMENDED settings! */
07:09 <logik> Sorry for the copy/paste


So, I tried to replicate the error and was successful. The full error is as below:

Code: Select all
[user@cvlws15 darkbot]$ patch -p0 < patch
(Patch is indented 4 spaces.)
patching file darkbot6f6/darkbot.c
Hunk #1 FAILED at 3476.
1 out of 1 hunk FAILED -- saving rejects to file darkbot6f6/darkbot.c.rej
(Patch is indented 4 spaces.)
patching file darkbot6f6/defines.h
patch: **** malformed patch at line 18: /* Please note that the below defines are the RECOMMENDED settings! */



Part of that error is because the patch is indented 4 spaces, as you can see from it saying:
(Patch is indented 4 spaces.)
That's pretty annoying, but you can fix it by doing a:
Code: Select all
sed -i -e 's/^\ \ \ \ //' patch-file



But then I tried it again and it still doesn't work.

The clue came when I previewed this page (this post), and saw that the forum software censors certain things, like the fact that this logik dude messaged me the URL of THIS BOARD, but that the board censored it.
It turns out that this board - EVEN WHEN IN CODE, /CODE MODE, still censors and changes the text of stuff.

So, to that end, I have posted the diff file two other places.

For one, I have posted it here:
http://www.adventure-today.com/crapcrap/1271084292darkbot-diff
I have also posted it on Pastebin here:
http://pastebin.com/84UeNqEk

I hope those links work, Juice or someone who is in charge of darkbot now needs to fix the post censorship. It's pretty obnoxious.

Code: Select all
[darkbot@cvlws15 ~]$ mkdir darkbot
[darkbot@cvlws15 ~]$ cd darkbot/
[darkbot@cvlws15 darkbot]$ wget http://darkbot.sourceforge.net/archive/unix/darkbot-6f6-r6.tar.gz 2> /dev/null
[darkbot@cvlws15 darkbot]$ tar -xzf darkbot-6f6-r6.tar.gz
[darkbot@cvlws15 darkbot]$ wget http://www.adventure-today.com/crapcrap/1271084292darkbot-diff 2> /dev/null
[darkbot@cvlws15 darkbot]$ patch -p0 < 1271084292darkbot-diff
patching file darkbot6f6/darkbot.c
patching file darkbot6f6/defines.h
[darkbot@cvlws15 darkbot]$
xiaodown
 
Posts: 2
Joined: Tue Feb 09, 2010 10:18 am


Return to Linux Darkbot Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron