Merge pull request #171776 from trofi/fix-fno-common-read-edid

read-edid: fix build on -fno-common toolchains

authored by Artturi and committed by GitHub 3241daed 841e6ae7

+28 -3
+6 -3
pkgs/os-specific/linux/read-edid/default.nix
··· 9 9 sha256 = "0vqqmwsgh2gchw7qmpqk6idgzcm5rqf2fab84y7gk42v1x2diin7"; 10 10 }; 11 11 12 + patches = [ ./fno-common.patch ]; 13 + 14 + postPatch = '' 15 + substituteInPlace CMakeLists.txt --replace 'COPYING' 'LICENSE' 16 + ''; 17 + 12 18 nativeBuildInputs = [ cmake ]; 13 19 buildInputs = lib.optional stdenv.hostPlatform.isx86 libx86; 14 20 15 21 cmakeFlags = [ "-DCLASSICBUILD=${if stdenv.hostPlatform.isx86 then "ON" else "OFF"}" ]; 16 22 17 - patchPhase = '' 18 - substituteInPlace CMakeLists.txt --replace 'COPYING' 'LICENSE' 19 - ''; 20 23 21 24 meta = with lib; { 22 25 description = "Tool for reading and parsing EDID data from monitors";
+22
pkgs/os-specific/linux/read-edid/fno-common.patch
··· 1 + --- a/get-edid/classic.c 2 + +++ b/get-edid/classic.c 3 + @@ -26,7 +26,7 @@ typedef byte* real_ptr; 4 + #define dosmemput(buffer,length,offset) memcpy(offset,buffer,length) 5 + 6 + #define display(...) if (quiet == 0) { fprintf(stderr, __VA_ARGS__); } 7 + -int quiet; 8 + +extern int quiet; 9 + 10 + real_ptr far_ptr_to_real_ptr( uint32 farptr ) 11 + { 12 + --- a/get-edid/i2c.c 13 + +++ b/get-edid/i2c.c 14 + @@ -15,7 +15,7 @@ 15 + 16 + //Ideas (but not too much actual code) taken from i2c-tools. Thanks guys. 17 + 18 + -int quiet; 19 + +extern int quiet; 20 + 21 + #define display(...) if (quiet == 0) { fprintf(stderr, __VA_ARGS__); } 22 +