fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv
2, lib
3, fetchFromGitHub
4, unstableGitUpdater
5, dosbox
6
7# Docs cause an immense increase in build time, up to 2 additional hours
8, withDocs ? false
9, ghostscript
10, withGUI ? false
11}:
12
13stdenv.mkDerivation rec {
14 pname = "${passthru.prettyName}-unwrapped";
15 # nixpkgs-update: no auto update
16 version = "unstable-2023-05-17";
17
18 src = fetchFromGitHub {
19 owner = "open-watcom";
20 repo = "open-watcom-v2";
21 rev = "4053c858ac1f83a186704434bd16b6a6b8f4cf88";
22 sha256 = "sha256-o+cA5kqPow+ERCeWdA3UNKawF+EjuL87lPXUjFT/D1w=";
23 };
24
25 postPatch = ''
26 patchShebangs *.sh
27
28 for dateSource in bld/wipfc/configure; do
29 substituteInPlace $dateSource \
30 --replace '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" '
31 done
32
33 substituteInPlace bld/watcom/h/banner.h \
34 --replace '__DATE__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%b %d %Y')\"" \
35 --replace '__TIME__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%T')\""
36
37 substituteInPlace build/makeinit \
38 --replace '$+$(%__CYEAR__)$-' "$(date -ud "@$SOURCE_DATE_EPOCH" +'%Y')"
39 '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
40 substituteInPlace build/mif/local.mif \
41 --replace '-static' ""
42 '';
43
44 nativeBuildInputs = [
45 dosbox
46 ] ++ lib.optionals withDocs [
47 ghostscript
48 ];
49
50 configurePhase = ''
51 runHook preConfigure
52
53 export OWROOT=$(realpath $PWD)
54 export OWTOOLS=${if stdenv.cc.isClang then "CLANG" else "GCC"}
55 export OWDOCBUILD=${if withDocs then "1" else "0"}
56 export OWGHOSTSCRIPTPATH=${lib.optionalString withDocs "${ghostscript}/bin"}
57 export OWGUINOBUILD=${if withGUI then "0" else "1"}
58 export OWNOBUILD=
59 export OWDISTRBUILD=0
60 export OWDOSBOX=${dosbox}/bin/dosbox
61 export OWVERBOSE=0
62 export OWRELROOT=$out
63
64 source cmnvars.sh
65
66 runHook postConfigure
67 '';
68
69 buildPhase = ''
70 runHook preBuild
71
72 ./build.sh build
73
74 runHook postBuild
75 '';
76
77 installPhase = ''
78 runHook preInstall
79
80 ./build.sh cprel
81
82 runHook postInstall
83 '';
84
85 # Stripping breaks many tools
86 dontStrip = true;
87
88 passthru = {
89 prettyName = "open-watcom-v2";
90 updateScript = unstableGitUpdater {
91 url = "https://github.com/open-watcom/open-watcom-v2.git";
92 };
93 };
94
95 meta = with lib; {
96 description = "The v2 fork of the Open Watcom suite of compilers and tools";
97 longDescription = ''
98 A fork of Open Watcom: A C/C++/Fortran compiler and assembler suite
99 targeting a multitude of architectures (x86, IA-32, Alpha AXP, MIPS,
100 PowerPC) and operating systems (DOS, OS/2, Windows, Linux).
101
102 Main differences from Open Watcom 1.9:
103
104 - New two-phase build system - Open Watcom can be built by the host's
105 native C/C++ compiler or by itself
106 - Code generator properly initializes pointers by DLL symbol addresses
107 - DOS tools now support long file names (LFN) if appropriate LFN driver
108 is loaded by DOS
109 - Open Watcom is ported to 64-bit hosts (Win64, Linux x64)
110 - Librarian supports x64 CPU object modules and libraries
111 - RDOS 32-bit C run-time compact memory model libraries are fixed
112 - Resource compiler and Resource editors support Win64 executables
113 - Open Watcom text editor is now self-contained, it can be used as
114 standalone tool without any requirements for any additional files or
115 configuration
116 - Broken C++ compiler pre-compiled header template support is fixed
117 - Many C++ compiler crashes are fixed
118 - Debugger has no length limit for any used environment variable
119 '' + lib.optionalString (!withDocs) ''
120
121 The documentation has been excluded from this build for build time reasons. It can be found here:
122 https://github.com/open-watcom/open-watcom-v2/wiki/Open-Watcom-Documentation
123 '';
124 homepage = "https://open-watcom.github.io";
125 license = licenses.watcom;
126 platforms = with platforms; windows ++ unix;
127 badPlatforms = platforms.riscv ++ [ "powerpc64-linux" "powerpc64le-linux" "mips64el-linux" ];
128 maintainers = with maintainers; [ OPNA2608 ];
129 };
130}