diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4cf9fee --- /dev/null +++ b/default.nix @@ -0,0 +1,22 @@ +{ mkDerivation, base, either, exceptions, ffmpeg-full, JuicyPixels +, mtl, stdenv, transformers, vector, Rasterific, time +}: +mkDerivation { + pname = "ffmpeg-light"; + version = "0.11.0"; + src = builtins.filterSource (path: type: + type != "directory" || (let bn = baseNameOf path; + in bn == "src" || bn == "demo")); + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base either exceptions JuicyPixels mtl transformers vector + ]; + libraryPkgconfigDepends = [ ffmpeg-full ]; + executableHaskellDepends = [ + base JuicyPixels mtl transformers vector Rasterific time + ]; + homepage = "http://github.com/acowley/ffmpeg-light"; + description = "Minimal bindings to the FFmpeg library"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..4fc5422 --- /dev/null +++ b/shell.nix @@ -0,0 +1,38 @@ +{ nixpkgs ? import {}, compiler ? "default" }: + +let + + inherit (nixpkgs) pkgs; + + f = { mkDerivation, base, either, exceptions, ffmpeg-full, JuicyPixels + , mtl, stdenv, transformers, vector, Rasterific, time + }: + mkDerivation { + pname = "ffmpeg-light"; + version = "0.11.0"; + src = builtins.filterSource (path: type: + type != "directory" || (let bn = baseNameOf path; + in bn == "src" || bn == "demo")); + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base either exceptions JuicyPixels mtl transformers vector + ]; + libraryPkgconfigDepends = [ ffmpeg-full ]; + executableHaskellDepends = [ + base JuicyPixels mtl transformers vector Rasterific time + ]; + homepage = "http://github.com/acowley/ffmpeg-light"; + description = "Minimal bindings to the FFmpeg library"; + license = stdenv.lib.licenses.bsd3; + }; + + haskellPackages = if compiler == "default" + then pkgs.haskellPackages + else pkgs.haskell.packages.${compiler}; + + drv = pkgs.myHaskellPackages.callPackage f {}; + +in + + if pkgs.lib.inNixShell then drv.env else drv