lol

Merge pull request #203943 from OPNA2608/update/open-watcom-v2

authored by

Sandro and committed by
GitHub
4d77b915 600adcfd

+36 -19
+12 -8
pkgs/development/compilers/open-watcom/v2.nix
··· 13 13 stdenv.mkDerivation rec { 14 14 pname = "${passthru.prettyName}-unwrapped"; 15 15 # nixpkgs-update: no auto update 16 - version = "unstable-2022-10-03"; 16 + version = "unstable-2023-01-30"; 17 17 18 18 src = fetchFromGitHub { 19 19 owner = "open-watcom"; 20 20 repo = "open-watcom-v2"; 21 - rev = "61538429a501a09f369366d832799f2e3b196a02"; 22 - sha256 = "sha256-YvqRw0klSqOxIuO5QFKjcUp6aRWlO2j3L+T1ekx8SfA="; 21 + rev = "996740acdbb173499ec1bf2ba6c8942f2a374220"; 22 + sha256 = "sha256-9m+0e2v1Hk8jYZHqJwb1mN02WgGDArsWbF7Ut3Z5OIg="; 23 23 }; 24 24 25 25 postPatch = '' 26 26 patchShebangs *.sh 27 27 28 - for dateSource in cmnvars.sh bld/wipfc/configure; do 28 + for dateSource in bld/wipfc/configure; do 29 29 substituteInPlace $dateSource \ 30 30 --replace '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' 31 31 done ··· 35 35 --replace '__TIME__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%T')\"" 36 36 37 37 substituteInPlace build/makeinit \ 38 - --replace '%__CYEAR__' '%OWCYEAR' 38 + --replace '$+$(%__CYEAR__)$-' "$(date -ud "@$SOURCE_DATE_EPOCH" +'%Y')" 39 39 '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' 40 40 substituteInPlace build/mif/local.mif \ 41 41 --replace '-static' "" 42 42 ''; 43 43 44 - nativeBuildInputs = [ dosbox ] 45 - ++ lib.optional withDocs ghostscript; 44 + nativeBuildInputs = [ 45 + dosbox 46 + ] ++ lib.optionals withDocs [ 47 + ghostscript 48 + ]; 46 49 47 50 configurePhase = '' 48 51 runHook preConfigure ··· 120 123 ''; 121 124 homepage = "https://open-watcom.github.io"; 122 125 license = licenses.watcom; 123 - platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "x86_64-windows" "i686-windows" ]; 126 + platforms = with platforms; windows ++ unix; 127 + badPlatforms = platforms.riscv ++ [ "powerpc64-linux" "powerpc64le-linux" "mips64el-linux" ]; 124 128 maintainers = with maintainers; [ OPNA2608 ]; 125 129 }; 126 130 }
+24 -11
pkgs/development/compilers/open-watcom/wrapper.nix
··· 13 13 wrapper = 14 14 {}: 15 15 let 16 + archToBindir = with stdenv.hostPlatform; if isx86 then 17 + "bin" 18 + else if isAarch then 19 + "arm" 20 + # we don't support running on AXP 21 + # don't know what MIPS, PPC bindirs are called 22 + else throw "Don't know where ${system} binaries are located!"; 23 + 16 24 binDirs = with stdenv.hostPlatform; if isWindows then [ 17 - (lib.optionalString is64bit "binnt64") 18 - "binnt" 19 - (lib.optionalString is32bit "binw") 20 - ] else if (isDarwin && is64bit) then [ 21 - "bino64" 25 + (lib.optionalString is64bit "${archToBindir}nt64") 26 + "${archToBindir}nt" 27 + (lib.optionalString is32bit "${archToBindir}w") 28 + ] else if (isDarwin) then [ 29 + (lib.optionalString is64bit "${archToBindir}o64") 30 + # modern Darwin cannot execute 32-bit code anymore 31 + (lib.optionalString is32bit "${archToBindir}o") 22 32 ] else [ 23 - (lib.optionalString is64bit "binl64") 24 - "binl" 33 + (lib.optionalString is64bit "${archToBindir}l64") 34 + "${archToBindir}l" 25 35 ]; 36 + # TODO 37 + # This works good enough as-is, but should really only be targetPlatform-specific 38 + # but we don't support targeting DOS, OS/2, 16-bit Windows etc Nixpkgs-wide so this needs extra logic 26 39 includeDirs = with stdenv.hostPlatform; [ 27 40 "h" 28 41 ] ··· 71 84 } 72 85 EOF 73 86 cat test.c 74 - # Darwin target not supported, only host 75 87 wcl386 -fe=test_c test.c 76 - ${lib.optionalString (!stdenv.hostPlatform.isDarwin) "./test_c"} 88 + # Only test execution if hostPlatform is targetable 89 + ${lib.optionalString (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch) "./test_c"} 77 90 78 91 cat <<EOF >test.cpp 79 92 #include <string> ··· 91 104 } 92 105 EOF 93 106 cat test.cpp 94 - # Darwin target not supported, only host 95 107 wcl386 -fe=test_cpp test.cpp 96 - ${lib.optionalString (!stdenv.hostPlatform.isDarwin) "./test_cpp"} 108 + # Only test execution if hostPlatform is targetable 109 + ${lib.optionalString (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch) "./test_cpp"} 97 110 touch $out 98 111 ''; 99 112 cross = runCommand "${name}-test-cross" { nativeBuildInputs = [ wrapped file ]; } ''