From 15b0e305d142d27ed2f03104effee1c75b5ddc1f Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Fri, 21 Nov 2025 18:14:29 +0100 Subject: [PATCH 1/5] frotz: 2.54 -> 2.55 Signed-off-by: Marcin Serwin --- pkgs/by-name/fr/frotz/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/fr/frotz/package.nix b/pkgs/by-name/fr/frotz/package.nix index 75d60c2eaa82..cf86692cd893 100644 --- a/pkgs/by-name/fr/frotz/package.nix +++ b/pkgs/by-name/fr/frotz/package.nix @@ -15,21 +15,21 @@ stdenv.mkDerivation (finalAttrs: { pname = "frotz"; - version = "2.54"; + version = "2.55"; src = fetchFromGitLab { domain = "gitlab.com"; owner = "DavidGriffith"; repo = "frotz"; rev = finalAttrs.version; - hash = "sha256-GvGxojD8d5GVy/d8h3q6K7KJroz2lsKbfE0F0acjBl8="; + hash = "sha256-XZjimskjupTtYdgfVaOS2QnQrDIBSwkJqxrffdjgZk0="; }; patches = [ (fetchpatch { - url = "https://github.com/macports/macports-ports/raw/496e5b91e3b6c9dc6820d77ab60dbe400d1924ee/games/frotz/files/Makefile.patch"; + url = "https://raw.githubusercontent.com/macports/macports-ports/5c70d849addb2df2ea9ad2cc4fd4a15e5d4cc3a5/games/frotz/files/Makefile.patch"; extraPrefix = ""; - hash = "sha256-P83ZzSi3bhncQ52Y38Q3F/7v1SJKr5614tytt862HRg="; + hash = "sha256-ydIA1Td1ufp4y4Qfm5ijg9AY8z7cQ8BiX9hQz8gkKZY="; }) ]; From c67e16d85941294daaf71328d6c789f841ebcfc7 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Fri, 21 Nov 2025 18:19:51 +0100 Subject: [PATCH 2/5] frotz: modernize Signed-off-by: Marcin Serwin --- pkgs/by-name/fr/frotz/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fr/frotz/package.nix b/pkgs/by-name/fr/frotz/package.nix index cf86692cd893..1a51639015aa 100644 --- a/pkgs/by-name/fr/frotz/package.nix +++ b/pkgs/by-name/fr/frotz/package.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: { domain = "gitlab.com"; owner = "DavidGriffith"; repo = "frotz"; - rev = finalAttrs.version; + tag = finalAttrs.version; hash = "sha256-XZjimskjupTtYdgfVaOS2QnQrDIBSwkJqxrffdjgZk0="; }; @@ -33,6 +33,8 @@ stdenv.mkDerivation (finalAttrs: { }) ]; + strictDeps = true; + enableParallelBuilding = true; nativeBuildInputs = [ which pkg-config From 7476a3c76fea3b6244b9405b69ad900817545fdb Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Fri, 21 Nov 2025 18:31:02 +0100 Subject: [PATCH 3/5] frotz: add override for frontend Signed-off-by: Marcin Serwin --- .../0001-Fix-SDL_SOUND_CFLAGS-usage.patch | 38 ++++++++++++++++ pkgs/by-name/fr/frotz/package.nix | 44 ++++++++++++++++--- 2 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/fr/frotz/0001-Fix-SDL_SOUND_CFLAGS-usage.patch diff --git a/pkgs/by-name/fr/frotz/0001-Fix-SDL_SOUND_CFLAGS-usage.patch b/pkgs/by-name/fr/frotz/0001-Fix-SDL_SOUND_CFLAGS-usage.patch new file mode 100644 index 000000000000..6e17ee19ab13 --- /dev/null +++ b/pkgs/by-name/fr/frotz/0001-Fix-SDL_SOUND_CFLAGS-usage.patch @@ -0,0 +1,38 @@ +From 8b1db0c6724640ff995c24145a9777bd49da1ce4 Mon Sep 17 00:00:00 2001 +From: Marcin Serwin +Date: Fri, 21 Nov 2025 19:11:48 +0100 +Subject: [PATCH] Fix SDL_SOUND_CFLAGS usage + +The flags were quried but unused during compilation. Also, there was a +typo in the else branch. + +Signed-off-by: Marcin Serwin +--- + src/sdl/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sdl/Makefile b/src/sdl/Makefile +index e21477e..84a2136 100644 +--- a/src/sdl/Makefile ++++ b/src/sdl/Makefile +@@ -22,7 +22,7 @@ SDL_CFLAGS += $(shell $(PKGCONF) $(SDL_PKGS) --cflags) + SDL_SOUND_CFLAGS += $(shell $(PKGCONF) $(SDL_SOUND_PKGS) --cflags) + else + SDL_CFLAGS += $(SDL_CFLAGS_DEF) +-SD_SOUND_CFLAGS += $(SDL_SOUND_CFLAGS_DEF) ++SDL_SOUND_CFLAGS += $(SDL_SOUND_CFLAGS_DEF) + endif + + +@@ -32,7 +32,7 @@ $(TARGET): $(DEFINES) $(OBJECTS) | $(DEFINES) + @echo "** Done with SDL interface." + + %.o: %.c +- $(CC) $(CFLAGS) $(SDL_CFLAGS) -fPIC -fpic -o $@ -c $< ++ $(CC) $(CFLAGS) $(SDL_CFLAGS) $(SDL_SOUND_CFLAGS) -fPIC -fpic -o $@ -c $< + + $(DEFINES): + @echo "** Generating $@" +-- +2.51.2 + diff --git a/pkgs/by-name/fr/frotz/package.nix b/pkgs/by-name/fr/frotz/package.nix index 1a51639015aa..2d16d7daa42b 100644 --- a/pkgs/by-name/fr/frotz/package.nix +++ b/pkgs/by-name/fr/frotz/package.nix @@ -11,10 +11,25 @@ ncurses, which, pkg-config, + SDL2, + SDL2_mixer, + zlib, + libjpeg, + libpng, + freetype, + frontend ? "ncurses", }: +assert lib.assertOneOf "frontend" frontend [ + "ncurses" + "sdl" + # NOTE: more options are present in the Makefile, e.g., x11, dumb, nosound, ... +]; +let + progName = if frontend == "ncurses" then "frotz" else "sfrotz"; +in stdenv.mkDerivation (finalAttrs: { - pname = "frotz"; + pname = progName; version = "2.55"; src = fetchFromGitLab { @@ -31,6 +46,9 @@ stdenv.mkDerivation (finalAttrs: { extraPrefix = ""; hash = "sha256-ydIA1Td1ufp4y4Qfm5ijg9AY8z7cQ8BiX9hQz8gkKZY="; }) + + # https://gitlab.com/DavidGriffith/frotz/-/merge_requests/226 + ./0001-Fix-SDL_SOUND_CFLAGS-usage.patch ]; strictDeps = true; @@ -45,16 +63,30 @@ stdenv.mkDerivation (finalAttrs: { libsamplerate libsndfile libvorbis - ncurses - ]; + ] + ++ ( + if frontend == "ncurses" then + [ ncurses ] + else + [ + freetype + libjpeg + libpng + SDL2 + SDL2_mixer + zlib + ] + ); - installFlags = [ "PREFIX=$(out)" ]; + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + buildFlags = [ frontend ]; + installTargets = if frontend == "ncurses" then "install-frotz" else "install-${frontend}"; meta = { homepage = "https://davidgriffith.gitlab.io/frotz/"; changelog = "https://gitlab.com/DavidGriffith/frotz/-/raw/${finalAttrs.version}/NEWS"; - description = "Z-machine interpreter for Infocom games and other interactive fiction"; - mainProgram = "frotz"; + description = "Z-machine interpreter for Infocom games and other interactive fiction (${frontend})"; + mainProgram = progName; platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ nicknovitski From c211ce762616f30d860be2acf12d21a34908422a Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Fri, 21 Nov 2025 18:31:28 +0100 Subject: [PATCH 4/5] sfrotz: merge with frotz Signed-off-by: Marcin Serwin --- pkgs/by-name/sf/sfrotz/package.nix | 73 +----------------------------- 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/pkgs/by-name/sf/sfrotz/package.nix b/pkgs/by-name/sf/sfrotz/package.nix index 65f2359513ec..83a4b10dfc3c 100644 --- a/pkgs/by-name/sf/sfrotz/package.nix +++ b/pkgs/by-name/sf/sfrotz/package.nix @@ -1,72 +1 @@ -{ - fetchFromGitLab, - freetype, - libao, - libjpeg, - libmodplug, - libpng, - libsamplerate, - libsndfile, - libvorbis, - pkg-config, - SDL2, - SDL2_mixer, - lib, - stdenv, - zlib, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "sfrotz"; - version = "2.54"; - - src = fetchFromGitLab { - domain = "gitlab.com"; - owner = "DavidGriffith"; - repo = "frotz"; - rev = finalAttrs.version; - hash = "sha256-GvGxojD8d5GVy/d8h3q6K7KJroz2lsKbfE0F0acjBl8="; - }; - - buildInputs = [ - freetype - libao - libjpeg - libmodplug - libpng - libsamplerate - libsndfile - libvorbis - SDL2 - SDL2_mixer - zlib - ]; - nativeBuildInputs = [ pkg-config ]; - makeFlags = [ "PREFIX=${placeholder "out"}" ]; - buildPhase = "make sdl"; - installTargets = [ "install_sfrotz" ]; - - meta = { - description = "Interpreter for Infocom and other Z-Machine games (SDL interface)"; - mainProgram = "sfrotz"; - longDescription = '' - Frotz is a Z-Machine interpreter. The Z-machine is a virtual machine - designed by Infocom to run all of their text adventures. It went through - multiple revisions during the lifetime of the company, and two further - revisions (V7 and V8) were created by Graham Nelson after the company's - demise. The specification is now quite well documented; this version of - Frotz supports version 1.0. - - This version of Frotz fully supports all these versions of the Z-Machine - including the graphical version 6. Graphics and sound are created through - the use of the SDL libraries. AIFF sound effects and music in MOD and OGG - formats are supported when packaged in Blorb container files or optionally - from individual files. - ''; - homepage = "https://davidgriffith.gitlab.io/frotz/"; - changelog = "https://gitlab.com/DavidGriffith/frotz/-/raw/${finalAttrs.version}/NEWS"; - license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ ddelabru ]; - platforms = lib.platforms.linux; - }; -}) +{ frotz }: frotz.override { frontend = "sdl"; } From fb8537000fe6c9a44e70992b1594ed34e5dabe74 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Fri, 21 Nov 2025 20:22:05 +0100 Subject: [PATCH 5/5] frotz: drop macOS patch Signed-off-by: Marcin Serwin --- pkgs/by-name/fr/frotz/package.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/fr/frotz/package.nix b/pkgs/by-name/fr/frotz/package.nix index 2d16d7daa42b..20f823d9c128 100644 --- a/pkgs/by-name/fr/frotz/package.nix +++ b/pkgs/by-name/fr/frotz/package.nix @@ -2,7 +2,6 @@ lib, stdenv, fetchFromGitLab, - fetchpatch, libao, libmodplug, libsamplerate, @@ -41,12 +40,6 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (fetchpatch { - url = "https://raw.githubusercontent.com/macports/macports-ports/5c70d849addb2df2ea9ad2cc4fd4a15e5d4cc3a5/games/frotz/files/Makefile.patch"; - extraPrefix = ""; - hash = "sha256-ydIA1Td1ufp4y4Qfm5ijg9AY8z7cQ8BiX9hQz8gkKZY="; - }) - # https://gitlab.com/DavidGriffith/frotz/-/merge_requests/226 ./0001-Fix-SDL_SOUND_CFLAGS-usage.patch ]; @@ -78,7 +71,14 @@ stdenv.mkDerivation (finalAttrs: { ] ); - makeFlags = [ "PREFIX=${placeholder "out"}" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "HOMEBREW_PREFIX=/var/empty" + ]; + preConfigure = '' + makeFlagsArray+=(CURSES_CONFIG="$PKG_CONFIG ncurses") + ''; + buildFlags = [ frontend ]; installTargets = if frontend == "ncurses" then "install-frotz" else "install-${frontend}";