mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 03:11:24 +00:00
Attempt to set up nix-based docker for pict-rs
There's a bug when converting APNG files to WEBP files, which imagemagick delegates to ffmpeg. When doing 'nix build' and running the result, or running pict-rs in the dev shell, it works fine. In the container, this doesn't work at all. imagemagick complains that there's no media to convert, implying ffmpeg has output a zero-sized file. This work is helping to narrow down exactly what pict-rs needs to run, though. This still needs to be tested against h264, h265, vp8, vp9 and av1.
This commit is contained in:
parent
97159e0030
commit
f082e48ed8
4 changed files with 49 additions and 5 deletions
20
flake.nix
20
flake.nix
|
@ -15,13 +15,29 @@
|
|||
in
|
||||
{
|
||||
packages = rec {
|
||||
imagemagick7_pict-rs = pkgs.callPackage ./nix/pkgs/imagemagick_pict-rs {};
|
||||
ffmpeg6_pict-rs = pkgs.callPackage ./nix/pkgs/ffmpeg_pict-rs {};
|
||||
|
||||
pict-rs = pkgs.callPackage ./pict-rs.nix {
|
||||
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
|
||||
inherit imagemagick7_pict-rs ffmpeg6_pict-rs;
|
||||
};
|
||||
|
||||
default = pict-rs;
|
||||
};
|
||||
|
||||
docker = pkgs.dockerTools.buildLayeredImage {
|
||||
name = "pict-rs";
|
||||
tag = "latest";
|
||||
|
||||
contents = [ pkgs.tini self.packages.${system}.pict-rs ];
|
||||
|
||||
config = {
|
||||
Entrypoint = [ "/bin/tini" "--" "/bin/pict-rs" ];
|
||||
Cmd = [ "run" ];
|
||||
};
|
||||
};
|
||||
|
||||
apps = rec {
|
||||
dev = flake-utils.lib.mkApp { drv = self.packages.${system}.pict-rs; };
|
||||
default = dev;
|
||||
|
@ -36,9 +52,9 @@
|
|||
curl
|
||||
diesel-cli
|
||||
exiftool
|
||||
ffmpeg_6-full
|
||||
garage
|
||||
imagemagick
|
||||
self.packages.${system}.imagemagick7_pict-rs
|
||||
self.packages.${system}.ffmpeg6_pict-rs
|
||||
jq
|
||||
minio-client
|
||||
rust-analyzer
|
||||
|
|
5
nix/pkgs/ffmpeg_pict-rs/default.nix
Normal file
5
nix/pkgs/ffmpeg_pict-rs/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ffmpeg_6-headless }:
|
||||
|
||||
ffmpeg_6-headless.override {
|
||||
withWebp = true;
|
||||
}
|
23
nix/pkgs/imagemagick_pict-rs/default.nix
Normal file
23
nix/pkgs/imagemagick_pict-rs/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ imagemagick7 }:
|
||||
|
||||
imagemagick7.override {
|
||||
bzip2Support = true;
|
||||
zlibSupport = true;
|
||||
libX11Support = false;
|
||||
libXtSupport = false;
|
||||
fontconfigSupport = false;
|
||||
freetypeSupport = false;
|
||||
libjpegSupport = true;
|
||||
djvulibreSupport = false;
|
||||
lcms2Support = false;
|
||||
openexrSupport = false;
|
||||
libjxlSupport = true;
|
||||
libpngSupport = true;
|
||||
liblqr1Support = false;
|
||||
librsvgSupport = false;
|
||||
libtiffSupport = false;
|
||||
libxml2Support = false;
|
||||
openjpegSupport = true;
|
||||
libwebpSupport = true;
|
||||
libheifSupport = true;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ exiftool
|
||||
, ffmpeg_6-full
|
||||
, imagemagick
|
||||
, ffmpeg6_pict-rs
|
||||
, imagemagick7_pict-rs
|
||||
, lib
|
||||
, makeWrapper
|
||||
, nixosTests
|
||||
|
@ -27,7 +27,7 @@ rustPlatform.buildRustPackage {
|
|||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/pict-rs \
|
||||
--prefix PATH : "${lib.makeBinPath [ imagemagick ffmpeg_6-full exiftool ]}"
|
||||
--prefix PATH : "${lib.makeBinPath [ imagemagick7_pict-rs ffmpeg6_pict-rs exiftool ]}"
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) pict-rs; };
|
||||
|
|
Loading…
Reference in a new issue