harvid: fix on Darwin

This commit is contained in:
Emily
2024-08-01 23:16:23 +01:00
parent 3607d36550
commit 0793d3ec35
+15 -2
View File
@@ -3,6 +3,9 @@
stdenv,
fetchFromGitHub,
pkg-config,
which,
unixtools,
cctools,
ffmpeg,
libjpeg,
libpng,
@@ -20,7 +23,12 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-p0W+rKHH/iuGOcRjl6b4s6jQYkm7bqWCz849SDI/7fQ=";
};
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs =
[ pkg-config ]
++ lib.optionals stdenv.isDarwin [
which
unixtools.xxd
];
buildInputs = [
ffmpeg
@@ -28,6 +36,11 @@ stdenv.mkDerivation (finalAttrs: {
libpng
];
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace libharvid/Makefile \
--replace-fail /usr/bin/libtool ${cctools}/bin/libtool
'';
makeFlags = [
"PREFIX=$(out)"
"VERSION=v${finalAttrs.version}"
@@ -48,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
homepage = "http://x42.github.io/harvid";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.mitchmindtree ];
mainProgram = "harvid";
};