You are not logged in.

#1 2006-10-24 16:30:40

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

dark-oberon: fmod+gcc 4.1 fix

Hi, since there is not enough space in the AUR comments, I put here the patch and updated PKGBUILD for dark-oberon.

PKGBUILD:

# Maintainer: Alexander Baldeck <alexander>
pkgname=dark-oberon
pkgver=1.0.2
pkgrel=3
pkgdesc="An open source real-time strategy game similar to Warcraft II"
url="http://dark-oberon.sourceforge.net"
depends=('glfw' 'fmod')
source=(http://dl.sourceforge.net/sourceforge/dark-oberon/dark-oberon-$pkgver-RC1.tar.gz 
        dark-oberon-$pkgver-usr.patch gcc-4.1.patch dark-oberon.sh)
md5sums=('62e5f4593b282b630a06675127afc840' '9bbb5cc6d635c2435ad1d80591150cb6' 
         '87c98151272b148c0097333e6f0d54a2' 'b1401ca7e00e5927dc89438b5d37fd74')

build() {
  export DARK_OBERON_HOME=$startdir/src/dark-oberon-$pkgver-RC$pkgrel
  cd $startdir/src/dark-oberon-$pkgver-RC1
    patch -Np1 -i ../gcc-4.1.patch || return 1
    patch -Np1 -i ../dark-oberon-$pkgver-usr.patch || return 1
    sed "s|LIBRARIES = |LIBRARIES = -pthread -lglfw -lGL -lX11 -lXxf86vm -lGLU -lXext -lfmod-3.75 |g" -i $startdir/src/dark-oberon-$pkgver-RC1/src/Makefile
  sed "s|CPPFLAGS = -g -Wall -O|CPPFLAGS = ${CXXFLAGS}|g" -i $startdir/src/dark-oberon-$pkgver-RC1/src/Makefile
  sed "s|-DDATA_DIR='""'|-DDATA_DIR='"/opt/dark-oberon/"'|g" -i $startdir/src/dark-oberon-$pkgver-RC1/src/Makefile
    make SOUND=1 || return 1

  mkdir -p $startdir/pkg/opt/dark-oberon
  for src in dark-oberon dat docs libs maps races schemes; do
    cp -a $src $startdir/pkg/opt/dark-oberon
  done
  chown -R root:root $startdir/pkg/*
  chmod -R a+r  $startdir/pkg/*

  mkdir -p $startdir/pkg/etc/profile.d
  install -c $startdir/src/dark-oberon.sh $startdir/pkg/etc/profile.d/dark-oberon.sh
}

gcc-4.1.patch

diff -ur dark-oberon-1.0.2-RC1.orig/src/doconfig.h dark-oberon-1.0.2-RC1/src/doconfig.h
--- dark-oberon-1.0.2-RC1.orig/src/doconfig.h    2006-10-24 16:56:20.000000000 +0100
+++ dark-oberon-1.0.2-RC1/src/doconfig.h    2006-10-24 17:02:05.000000000 +0100
@@ -211,7 +211,7 @@
   GLubyte pr_warfog_color[4];         //!< Precomputed warfog color and alfa-channel. [-128..127]
   double pr_expected_frame_duration;  //!<Precomputed> 1.0f) protection = 1.0f; else if (new_value < 0) protection = 0; else protection = new_value;};
 
-  TDEFENSE::TDEFENSE()
+  TDEFENSE()
     { armour = 0; protection = 0; }
 
 private:
diff -ur dark-oberon-1.0.2-RC1.orig/src/donet.h dark-oberon-1.0.2-RC1/src/donet.h
--- dark-oberon-1.0.2-RC1.orig/src/donet.h    2006-10-24 16:56:20.000000000 +0100
+++ dark-oberon-1.0.2-RC1/src/donet.h    2006-10-24 16:57:08.000000000 +0100
@@ -489,7 +489,7 @@
   /** Exception throwed when there was an error with resolving hostname. */
   class ResolveException {};
 
-  TNET_RESOLVER::TNET_RESOLVER ();
+  TNET_RESOLVER ();
 
   static std::string GetHostName ();
 
diff -ur dark-oberon-1.0.2-RC1.orig/src/doraces.h dark-oberon-1.0.2-RC1/src/doraces.h
--- dark-oberon-1.0.2-RC1.orig/src/doraces.h    2006-10-24 16:56:20.000000000 +0100
+++ dark-oberon-1.0.2-RC1/src/doraces.h    2006-10-24 16:58:48.000000000 +0100
@@ -755,7 +755,7 @@
   //!<Sets if unit can walk on source or building can be built on source when is empty.
   void SetHideable(bool hide) {hideable = hide;};
   //!<Tests whether position is available for this kind of the building.
-  bool TSOURCE_ITEM::IsPositionAvailable(int pos_x, int pos_y);
+  bool IsPositionAvailable(int pos_x, int pos_y);
 
   //! Specifies on which terrains it is able to build the item.
   TINTERVAL<TTERRAIN_ID> buildable[DAT_SEGMENTS_COUNT];
diff -ur dark-oberon-1.0.2-RC1.orig/src/dounits.h dark-oberon-1.0.2-RC1/src/dounits.h
--- dark-oberon-1.0.2-RC1.orig/src/dounits.h    2006-10-24 16:56:20.000000000 +0100
+++ dark-oberon-1.0.2-RC1/src/dounits.h    2006-10-24 17:00:11.000000000 +0100
@@ -1094,7 +1094,7 @@
 
   TSOURCE_UNIT * FindNewSource(TPOSITION_3D position);
   //bool FindNewSource(TPOSITION_3D position);
-  TSOURCE_UNIT * TWORKER_UNIT::IsSourceOnPosition(int pos_x, int pos_y);
+  TSOURCE_UNIT * IsSourceOnPosition(int pos_x, int pos_y);
 
   //! Constructor.
   TWORKER_UNIT(int uplayer, int ux, int uy, int uz, int udirection, TFORCE_ITEM *mi, int new_unit_id, bool global_unit)
diff -ur dark-oberon-1.0.2-RC1.orig/src/dowalk.h dark-oberon-1.0.2-RC1/src/dowalk.h
--- dark-oberon-1.0.2-RC1.orig/src/dowalk.h    2006-10-24 16:56:20.000000000 +0100
+++ dark-oberon-1.0.2-RC1/src/dowalk.h    2006-10-24 17:01:30.000000000 +0100
@@ -270,7 +270,7 @@
   bool TestLastPathPosition(void);              //!< Tests if a_stem is last step.
   TPOSITION_3D GetGoalPosition();                       //!<Get goal of the path.
   TPATH_LIST* CreateCopy(int shift_x, int shift_y, int shift_z);          //!<The path list create copy of the itself with shift.
-  double TPATH_LIST::CountTime(TFORCE_UNIT *unit);      //!<Counts the time, which unit spends on the exact way.
+  double CountTime(TFORCE_UNIT *unit);      //!<Counts the time, which unit spends on the exact way.
   void DecreaseSteps(int st_count) { steps -= st_count;};    //! Decreases variable steps, used when building is build, unit cant go to the goal, but just near the newly built building.
   void IncreaseASteps();                        //!< Increases actuall step
   void DecreaseASteps();                        //!< Decrease actuall step
@@ -297,10 +297,10 @@
   //! Coordinates in the map, each step of the path is storaged in this array.
   TPOSITION_3D path_pos[WLK_NODES_NUM];
 
-  TPATH_NODE::TPATH_NODE(TPATH_NODE *first, TPOSITION_3D adding);  //!< Adding constructor.
-  TPATH_NODE::TPATH_NODE(TPOSITION_3D goal);    //!< Constructor.
+  TPATH_NODE(TPATH_NODE *first, TPOSITION_3D adding);  //!< Adding constructor.
+  TPATH_NODE(TPOSITION_3D goal);    //!< Constructor.
 private:
-  TPATH_NODE::TPATH_NODE(TPATH_NODE &origin, int sx, int sy, int sz);   //!< Constructor creates copy with shift.
+  TPATH_NODE(TPATH_NODE &origin, int sx, int sy, int sz);   //!< Constructor creates copy with shift.
   friend TPATH_LIST* TPATH_LIST::CreateCopy(int, int, int);
 };
 

Offline

#2 2006-10-24 18:29:14

kastor
Member
From: Mendoza - Argentina
Registered: 2006-06-18
Posts: 59
Website

Re: dark-oberon: fmod+gcc 4.1 fix

doesn't work for me:

[kastor@lappy] ~/arch/dark-oberon $ makepkg 
==> Entering fakeroot environment
==> Making package: dark-oberon 1.0.2-3 (Tue Oct 24 15:19:45 ART 2006)
==> Checking Runtime Dependencies...

==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==>     Found dark-oberon-1.0.2-RC1.tar.gz in build dir
==>     Found dark-oberon-1.0.2-usr.patch in build dir
==>     Found gcc-4.1.patch in build dir
==>     Found dark-oberon.sh in build dir
==> Validating source files with MD5sums
    dark-oberon-1.0.2-RC1.tar.gz ... Passed
    dark-oberon-1.0.2-usr.patch ... Passed
    gcc-4.1.patch ... Passed
    dark-oberon.sh ... Passed
==> Extracting Sources...
==>     tar --use-compress-program=gzip -xf dark-oberon-1.0.2-RC1.tar.gz
==> Removing existing pkg/ directory...
==> Starting build()...
patching file src/doconfig.h
Hunk #1 FAILED at 211.
1 out of 1 hunk FAILED -- saving rejects to file src/doconfig.h.rej
patching file src/donet.h
patching file src/doraces.h
patching file src/dounits.h
patching file src/dowalk.h
Hunk #2 succeeded at 297 with fuzz 2.
==> ERROR: Build Failed.  Aborting...

any idea?

cheers

Offline

#3 2006-10-25 00:37:10

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: dark-oberon: fmod+gcc 4.1 fix

It might be a copy'n'paste issue. Maybe the forum has added spaces or changed tabs to spaces.
Check the src/doconfig.h.rej  for info.

Offline

#4 2006-10-25 01:33:15

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: dark-oberon: fmod+gcc 4.1 fix

seems like the patch there is cut short and incorrect. one hunk points to the wrong file, and it still fails building.

complete working patch available here:
http://archlinux.org/~james/gcc-4.1.patch

interesting game, though it still seems to lack a bit. the AI didnt do anything in the game I started, and I didnt have a gold mine so i couldnt do anything.

James

Offline

#5 2006-10-25 11:48:56

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: dark-oberon: fmod+gcc 4.1 fix

Snowman wrote:

It might be a copy'n'paste issue. Maybe the forum has added spaces or changed tabs to spaces.
Check the src/doconfig.h.rej  for info.

I would think the same, but in this case, shouldn't be the md5sum different?

It looks like the code environment cut some parts of the patch sad

Offline

#6 2006-10-25 13:25:13

kastor
Member
From: Mendoza - Argentina
Registered: 2006-06-18
Posts: 59
Website

Re: dark-oberon: fmod+gcc 4.1 fix

iphitus wrote:

seems like the patch there is cut short and incorrect. one hunk points to the wrong file, and it still fails building.

complete working patch available here:
http://archlinux.org/~james/gcc-4.1.patch

interesting game, though it still seems to lack a bit. the AI didnt do anything in the game I started, and I didnt have a gold mine so i couldnt do anything.

James

thanks James,, patch works great.

Offline

#7 2006-10-25 23:45:35

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: dark-oberon: fmod+gcc 4.1 fix

sebcactus wrote:
Snowman wrote:

It might be a copy'n'paste issue. Maybe the forum has added spaces or changed tabs to spaces.
Check the src/doconfig.h.rej  for info.

I would think the same, but in this case, shouldn't be the md5sum different?

Yes, they should. I didn't think about the md5sums.

sebcactus wrote:

It looks like the code environment cut some parts of the patch sad

I just remembered I had this problem once. When posting, you didn't  checked  "Disable HTML in this post".  So the text between < > was interpreted as an html tag and was not displayed.

Offline

#8 2006-11-01 15:13:58

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: dark-oberon: fmod+gcc 4.1 fix

Snowman wrote:

I just remembered I had this problem once. When posting, you didn't  checked  "Disable HTML in this post".  So the text between < > was interpreted as an html tag and was not displayed.

That's good to know!

Offline

Board footer

Powered by FluxBB