imagelol: fix darwin build

This commit is contained in:
Dmitry Kalinkin 2021-12-16 17:52:01 -05:00
parent 53e0f6daf2
commit bd7796dfcd
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333

View File

@ -12,8 +12,19 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
# fix for case-sensitive filesystems
# https://github.com/MCredstoner2004/ImageLOL/issues/1
postPatch = ''
mv ImageLOL src
substituteInPlace CMakeLists.txt \
--replace 'add_subdirectory("imagelol")' 'add_subdirectory("src")'
'';
nativeBuildInputs = [ cmake ];
# error: 'path' is unavailable: introduced in macOS 10.15
CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-D_LIBCPP_DISABLE_AVAILABILITY";
installPhase = ''
mkdir -p $out/bin
cp ./ImageLOL $out/bin