nixconfig/pkgs/custom/repalette.nix

33 lines
731 B
Nix
Raw Normal View History

2023-04-12 20:32:07 +02:00
{ lib, stdenv, fetchFromGitHub, makeWrapper, stb
}:
stdenv.mkDerivation rec {
pname = "repalette";
version = "849e1857cc985968c5dd08377fff27b258931937";
src = fetchFromGitHub {
owner = "ziap";
repo = pname;
rev = version;
sha256 = "sha256-Q86W9/xwFjViIyvnCQfwyQjzrfC122+KK6A3mwJPXOg=";
};
nativeBuildInputs = [
makeWrapper
];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
configurePhase = ''
cp ${stb.src}/stb_image.h stb_image.h
cp ${stb.src}/stb_image_write.h stb_image_write.h
'';
buildPhase = ''
make ${pname}
'';
installPhase = ''
mkdir -p $out/bin
mv repalette $out/bin
'';
}