8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
13 owner = "MCRedstoner2004";
16 sha256 = "0978zdrfj41jsqm78afyyd1l64iki9nwjvhd8ynii1b553nn4dmd";
17 fetchSubmodules = true;
21 # upstream gcc-12 compatibility fix
23 name = "gcc-12.patch";
24 url = "https://github.com/MCredstoner2004/ImageLOL/commit/013fb1f901d88f5fd21a896bfab47c7fff0737d7.patch";
25 hash = "sha256-RVaG2xbUqE4CxqI2lhvug2qihT6A8vN+pIfK58CXLDw=";
26 includes = [ "imagelol/ImageLOL.inl" ];
27 # change lib/ for imagelol
29 extraPrefix = "imagelol/";
33 # fix for case-sensitive filesystems
34 # https://github.com/MCredstoner2004/ImageLOL/issues/1
37 substituteInPlace CMakeLists.txt \
38 --replace 'add_subdirectory("imagelol")' 'add_subdirectory("src")'
41 nativeBuildInputs = [ cmake ];
45 cp ./ImageLOL $out/bin
48 cmakeFlags = [ (lib.cmakeFeature "CMAKE_C_FLAGS" "-std=gnu90") ] ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "-DPNG_ARM_NEON=off";
51 homepage = "https://github.com/MCredstoner2004/ImageLOL";
52 description = "Simple program to store a file into a PNG image";
53 license = licenses.mit;
55 platforms = platforms.unix;
56 mainProgram = "ImageLOL";