[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Request for help: slashem



Hi,

I am trying to make slashem cross-buildable.
I did the following:

* It was using the build
arch's compiler, so I passed it to make in d/rules

* Since it looks like upstream is dead(no new version since 2004), I mitigated uname -S for time
being and passed the flags meant for unix system

* Now this was failing with: "../win/gtk/gtkgetlin.c:12:10: fatal error:
gtk/gtk.h: No such file or directory" error, so I suspected pkg-config
is at fault.
So I went ahead and attempted to not pass hard-coded
pkg-config. However, even after this change it ends up with:

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
In file included from ../win/gtk/gtk.c:19:
../include/winGTK.h:8:10: fatal error: gtk/gtk.h: No such file or directory
    8 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~

which looks weird. and this is where I'm stuck for now. I'm attaching my
patch with this e-mail. Please consider taking a look, any help is appreciated.

Nilesh
diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 0000000..1554fa1
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,33 @@
+--- a/sys/unix/Makefile.src
++++ b/sys/unix/Makefile.src
+@@ -1,6 +1,3 @@
+-# Determine kernel name
+-UNAME := $(shell uname -s)
+-
+ #	NetHack Makefile.
+ #	SCCS Id: @(#)Makefile.src	3.4	2002/03/02
+ 
+@@ -128,12 +125,9 @@
+ # flags for Linux and kFreeBSD
+ #   compile normally
+ #   disable optimization on non-Linux archs due to FTBFS
+-ifeq ($(UNAME),Linux)
+ CFLAGS = -DDEBIAN_$(GUI) -O2 -fomit-frame-pointer -fstack-protector -fcommon --param=ssp-buffer-size=4 -I../include -I/usr/X11R6/include
+-else
+-CFLAGS = -DDEBIAN_$(GUI) -fstack-protector -fcommon --param=ssp-buffer-size=4 -I../include -I/usr/X11R6/include
+-endif
+ LFLAGS = -L/usr/X11R6/lib -Wl,-z,relro
++PKG_CONFIG ?= pkg-config
+ #   OR compile backwards compatible a.out format
+ # CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include -I/usr/X11/include
+ # LFLAGS = -b i486-linuxaout -L/usr/X11/lib
+@@ -198,8 +192,7 @@
+ #LINK=arm-linux-gcc
+ 
+ # GTK windowing system
+-WINGTKCONFIG=PKG_CONFIG_PATH=/usr/devel/lib/pkgconfig pkg-config gtk+-2.0
+-WINGTKCFLAGS=`$(WINGTKCONFIG) --cflags`
++WINGTKCFLAGS=`$(PKG_CONFIG) gtk+-2.0 --cflags`
+ 
+ # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired
+ # combination of windowing systems.  Also set windowing systems in config.h.
diff --git a/debian/patches/series b/debian/patches/series
index 547e86f..4529255 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ slashem-debian.patch
 reproducible-build.patch
 pointer-truncation-bug-860393.patch
 clang_FTBFS_Wreturn-type.patch
+cross.patch
diff --git a/debian/rules b/debian/rules
index 961a6d7..e6631dc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+-include /usr/share/dpkg/buildtools.mk
+
 %:
 	dh $@
 
@@ -24,19 +26,19 @@ override_dh_auto_build:
 	(cd util ; $(MAKE) recover)
 
 	touch include/config.h
-	$(MAKE) slashem GUI=TTY
+	$(MAKE) slashem GUI=TTY CC="$(CC)"
 	mv src/slashem slashem-tty
 
 	touch include/config.h
-	$(MAKE) slashem GUI=X11
+	$(MAKE) slashem GUI=X11 CC="$(CC)"
 	mv src/slashem slashem-x11
 
 	touch include/config.h
-	$(MAKE) slashem GUI=SDL
+	$(MAKE) slashem GUI=SDL CC="$(CC)"
 	mv src/slashem slashem-sdl
 
 	touch include/config.h
-	$(MAKE) all GUI=GTK
+	$(MAKE) all GUI=GTK CC="$(CC)"
 	mv src/slashem slashem-gtk
 
 	# touch include/config.h

Reply to: