about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-05-12 19:20:35 +0200
committerGitHub <noreply@github.com>2024-05-12 19:20:35 +0200
commit6046e8807481cfcbc143897f2e323772d251b693 (patch)
tree495a5620c8147c3889f4b56099d3df1e2d19b390
parentd279ac08b4dd70783816dd6211805b7ad9aed023 (diff)
parent8f339b27ddf1eece996e666d161baf3ea4a5c8cc (diff)
Merge pull request #311006 from annaleeleaves/eduke32-png
eduke32: convert bmp -> png for gdk-pixbuf-csource; unbreak
-rw-r--r--pkgs/games/eduke32/convert-bmp-to-png.diff23
-rw-r--r--pkgs/games/eduke32/default.nix6
2 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/games/eduke32/convert-bmp-to-png.diff b/pkgs/games/eduke32/convert-bmp-to-png.diff
new file mode 100644
index 0000000000000..7d83ce4aabafc
--- /dev/null
+++ b/pkgs/games/eduke32/convert-bmp-to-png.diff
@@ -0,0 +1,23 @@
+diff --git a/GNUmakefile b/GNUmakefile
+index f83f04d..25a4fa8 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -798,6 +798,9 @@ libklzw$(DLLSUFFIX): $(engine_src)/klzw.cpp
+ 	$(COMPILE_STATUS)
+ 	$(RECIPE_IF) $(COMPILER_C) -shared -fPIC $< -o $@ $(RECIPE_RESULT_COMPILE)
+ 
++%.png: %.bmp
++	gm convert $< $@
++
+ # to debug the tools link phase, make a copy of this rule explicitly replacing % with the name of a tool, such as kextract
+ %$(EXESUFFIX): $(tools_obj)/%.$o $(foreach i,tools $(tools_deps),$(call expandobjs,$i))
+ 	$(LINK_STATUS)
+@@ -880,7 +883,7 @@ $$($1_obj)/%.$$o: $$($1_rsrc)/%.c | $$($1_obj)
+ 	$$(call MKDIR,$$(dir $$@))
+ 	$$(RECIPE_IF) $$(COMPILER_C) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE)
+ 
+-$$($1_obj)/%_banner.c: $$($1_rsrc)/%.bmp | $$($1_obj)
++$$($1_obj)/%_banner.c: $$($1_rsrc)/%.png | $$($1_obj)
+ 	echo "#include \"gtkpixdata_shim.h\"" > $$@
+ 	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $$^ | sed 's/load_inc//' >> $$@
+ 
diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix
index 1ddcccd27f9d2..5bb9966602d85 100644
--- a/pkgs/games/eduke32/default.nix
+++ b/pkgs/games/eduke32/default.nix
@@ -37,6 +37,12 @@ in stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-dyZ4JtDBxsTDe9uQDWxJe7M74X7m+5wpEHm+i+s9hwo=";
   };
 
+  patches = [
+    # gdk-pixbuf-csource no longer supports bmp so convert to png
+    # patch GNUMakefile to use graphicsmagick to convert bmp -> png
+    ./convert-bmp-to-png.diff
+  ];
+
   buildInputs = [
     flac
     libvorbis