From d08fb843875b7a452b948581b4888778348f182a Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 15 Nov 2025 18:04:20 +0100 Subject: [PATCH 1/5] open-watcom-v2-unwrapped: 0-unstable-2025-05-07 -> 0-unstable-2025-11-15 --- pkgs/development/compilers/open-watcom/v2.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/open-watcom/v2.nix b/pkgs/development/compilers/open-watcom/v2.nix index 8850afddbd29..ea2dd7b091b8 100644 --- a/pkgs/development/compilers/open-watcom/v2.nix +++ b/pkgs/development/compilers/open-watcom/v2.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation rec { pname = "${passthru.prettyName}-unwrapped"; # nixpkgs-update: no auto update - version = "0-unstable-2025-05-07"; + version = "0-unstable-2025-11-15"; src = fetchFromGitHub { owner = "open-watcom"; repo = "open-watcom-v2"; - rev = "b168de07a7c32ad82b77dd56671b6a51a11dab70"; - hash = "sha256-9NNJcDHxOo+NKZraGqsHqK5whO3nL0QTeh+imzhThTg="; + rev = "fe2ddbd2e5833a85d9ccd3937b304f3f41e44f98"; + hash = "sha256-jv7d5DopGZDnVFQX/t0D9cZSTwgMvcb4kqCnLJSWmNI="; }; postPatch = '' From fe7ee795712792b48cbec9559a14f9e21137e4cf Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 15 Nov 2025 19:00:52 +0100 Subject: [PATCH 2/5] {open-watcom-v2,open-watcom-bin}: Adjust looked-for strings in file output --- pkgs/development/compilers/open-watcom/wrapper.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/open-watcom/wrapper.nix b/pkgs/development/compilers/open-watcom/wrapper.nix index 54b06d7db4fb..f82502c306e6 100644 --- a/pkgs/development/compilers/open-watcom/wrapper.nix +++ b/pkgs/development/compilers/open-watcom/wrapper.nix @@ -151,15 +151,15 @@ let echo "Test file format" file ./linux - file ./linux | grep "32-bit" | grep -q "Linux" + file ./linux | grep "ELF 32-bit" | grep -q "Linux" file ./nt.exe - file ./nt.exe | grep "PE32" | grep -q "Windows" + file ./nt.exe | grep "PE32 executable" | grep -q "Windows" file ./dos4g.exe - file ./dos4g.exe | grep "MS-DOS" | grep -q "executable, LE" + file ./dos4g.exe | grep "MS-DOS executable" | grep -q "LE executable" file ./windows.exe - file ./windows.exe | grep "MS-DOS" | grep -q "Windows 3.00" + file ./windows.exe | grep "MS-DOS executable" | grep -q "NE for MS Windows 3." file ./dos.exe - file ./dos.exe | grep "MS-DOS" | grep -v "LE" | grep -qv "Windows 3." + file ./dos.exe | grep "MS-DOS executable" | grep -q "MZ for MS-DOS" touch $out ''; }; From 13b7a967c8935fdb019911f563f62197bb1f2ee9 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 15 Nov 2025 19:16:38 +0100 Subject: [PATCH 3/5] open-watcom-v2-unwrapped: Do abit of housekeeping - rec -> finalAttrs - Drop meta-wide with lib - GUI tool building can default to stdenv.hostPlatform.isWindows, prolly closer to correct than defaulting to false - substituteInPlace accepts multiple files, for loop not necessary - Just to be safe, reject non-GNU & non-Clang compilers. Who knows what Watcom needs to build on those... - Use lib functions for path-related stuff (makeBinPath, getExe) --- pkgs/development/compilers/open-watcom/v2.nix | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/open-watcom/v2.nix b/pkgs/development/compilers/open-watcom/v2.nix index ea2dd7b091b8..17b426340bd7 100644 --- a/pkgs/development/compilers/open-watcom/v2.nix +++ b/pkgs/development/compilers/open-watcom/v2.nix @@ -8,11 +8,13 @@ # Docs cause an immense increase in build time, up to 2 additional hours withDocs ? false, ghostscript, - withGUI ? false, + + # GUI tools aren't ported to non-MS platforms, building them usually just wastes time + withGUI ? stdenv.hostPlatform.isWindows, }: -stdenv.mkDerivation rec { - pname = "${passthru.prettyName}-unwrapped"; +stdenv.mkDerivation (finalAttrs: { + pname = "${finalAttrs.passthru.prettyName}-unwrapped"; # nixpkgs-update: no auto update version = "0-unstable-2025-11-15"; @@ -26,10 +28,8 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs *.sh - for dateSource in bld/wipfc/configure; do - substituteInPlace $dateSource \ - --replace-fail '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' - done + substituteInPlace bld/wipfc/configure \ + --replace-fail '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' substituteInPlace bld/watcom/h/banner.h \ --replace-fail '__DATE__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%b %d %Y')\"" \ @@ -54,13 +54,20 @@ stdenv.mkDerivation rec { runHook preConfigure export OWROOT=$(realpath $PWD) - export OWTOOLS=${if stdenv.cc.isClang then "CLANG" else "GCC"} + export OWTOOLS=${ + if stdenv.cc.isClang then + "CLANG" + else if stdenv.cc.isGNU then + "GCC" + else + throw "Don't know what compiler ID to use for ${stdenv.cc.name} in open-watcom-v2 build" + } export OWDOCBUILD=${if withDocs then "1" else "0"} - export OWGHOSTSCRIPTPATH=${lib.optionalString withDocs "${ghostscript}/bin"} + export OWGHOSTSCRIPTPATH=${lib.optionalString withDocs "${lib.makeBinPath [ ghostscript ]}"} export OWGUINOBUILD=${if withGUI then "0" else "1"} export OWNOBUILD= export OWDISTRBUILD=0 - export OWDOSBOX=${dosbox}/bin/dosbox + export OWDOSBOX=${lib.getExe dosbox} export OWVERBOSE=0 export OWRELROOT=$out @@ -97,7 +104,7 @@ stdenv.mkDerivation rec { }; }; - meta = with lib; { + meta = { description = "V2 fork of the Open Watcom suite of compilers and tools"; longDescription = '' A fork of Open Watcom: A C/C++/Fortran compiler and assembler suite @@ -128,13 +135,13 @@ stdenv.mkDerivation rec { https://github.com/open-watcom/open-watcom-v2/wiki/Open-Watcom-Documentation ''; homepage = "https://open-watcom.github.io"; - license = licenses.watcom; - platforms = with platforms; windows ++ unix; - badPlatforms = platforms.riscv ++ [ + license = lib.licenses.watcom; + platforms = with lib.platforms; windows ++ unix; + badPlatforms = lib.platforms.riscv ++ [ "powerpc64-linux" "powerpc64le-linux" "mips64el-linux" ]; - maintainers = with maintainers; [ OPNA2608 ]; + maintainers = with lib.maintainers; [ OPNA2608 ]; }; -} +}) From 791e9025d32c9cb9cc461fa9297925722a6e22d3 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 15 Nov 2025 22:31:02 +0100 Subject: [PATCH 4/5] {open-watcom-v2-full-unwrapped,open-watcom-v2-full}: init at 0-unstable-2025-11-15 To allow testing of docs & GUI building, to make sure this doesn't *completely* bitrot... --- pkgs/top-level/all-packages.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7873aece5c7c..089158b0ee69 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5206,9 +5206,16 @@ with pkgs; opam-installer = callPackage ../development/tools/ocaml/opam/installer.nix { }; wrapWatcom = callPackage ../development/compilers/open-watcom/wrapper.nix { }; + open-watcom-v2-unwrapped = callPackage ../development/compilers/open-watcom/v2.nix { }; - open-watcom-v2 = wrapWatcom open-watcom-v2-unwrapped { }; + open-watcom-v2-full-unwrapped = open-watcom-v2-unwrapped.override { + withDocs = true; + withGUI = true; + }; open-watcom-bin-unwrapped = callPackage ../development/compilers/open-watcom/bin.nix { }; + + open-watcom-v2 = wrapWatcom open-watcom-v2-unwrapped { }; + open-watcom-v2-full = wrapWatcom open-watcom-v2-full-unwrapped { }; open-watcom-bin = wrapWatcom open-watcom-bin-unwrapped { }; rml = callPackage ../development/compilers/rml { From 48886168b35d804dbb5625db12651d135b83c995 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 20 Nov 2025 02:36:43 +0100 Subject: [PATCH 5/5] open-watcom-v2-unwrapped: Only pull in DOSBox when building docs, fix docs build We were doing it like this in the past, only changed to unconditionally pulling in DOSBox cus upstream said it might be necessary. Turns out that the docs build hasn't worked in awhile cus DOSBox doesn't launch without OpenGL available to it. Since the docsless variant is unaffected, DOSBox does only seem necessary when building the docs. Also, fix the docs build by using llvmpipe for OpenGL. --- pkgs/development/compilers/open-watcom/v2.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/open-watcom/v2.nix b/pkgs/development/compilers/open-watcom/v2.nix index 17b426340bd7..8e9091292f35 100644 --- a/pkgs/development/compilers/open-watcom/v2.nix +++ b/pkgs/development/compilers/open-watcom/v2.nix @@ -3,10 +3,11 @@ lib, fetchFromGitHub, unstableGitUpdater, - dosbox, # Docs cause an immense increase in build time, up to 2 additional hours withDocs ? false, + dosbox, + mesa, ghostscript, # GUI tools aren't ported to non-MS platforms, building them usually just wastes time @@ -27,7 +28,9 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' patchShebangs *.sh - + '' + # Patch references to current time & date into SOURCE_DATE_EPOCH-respecting ones + + '' substituteInPlace bld/wipfc/configure \ --replace-fail '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' @@ -38,16 +41,20 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace build/makeinit \ --replace-fail '$+$(%__CYEAR__)$-' "$(date -ud "@$SOURCE_DATE_EPOCH" +'%Y')" '' + # (SDL? DOSBox?) needs OpenGL now, and that doesn't seem to play nicely anymore with the dummy driver + + '' + substituteInPlace build/mif/wgmlcmd.mif \ + --replace-fail 'SDL_VIDEODRIVER=dummy' 'SDL_VIDEODRIVER=offscreen' + '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' substituteInPlace build/mif/local.mif \ --replace-fail '-static' "" ''; - nativeBuildInputs = [ - dosbox - ] - ++ lib.optionals withDocs [ + nativeBuildInputs = lib.optionals withDocs [ + dosbox # running prebuilt WGML tool to create docs ghostscript + mesa.llvmpipeHook # DOSBox doesn't seem to launch without OpenGL available, even on SDL dummy platform ]; configurePhase = ''