forked from external-repos/squoosh
Filter sources
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (pkgs) callPackage stdenv;
|
||||
inherit (pkgs) callPackage stdenv lib;
|
||||
|
||||
buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) {};
|
||||
mkInstallable = callPackage (import ../../nix/mk-installable) {};
|
||||
@@ -30,8 +30,9 @@
|
||||
default = mozjpeg-squoosh;
|
||||
mozjpeg-squoosh = buildSquooshCppCodec {
|
||||
name = "mozjpeg-squoosh";
|
||||
src = ./.;
|
||||
src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?"];
|
||||
MOZJPEG = mozjpeg;
|
||||
|
||||
dontConfigure = true;
|
||||
decoder = null;
|
||||
};
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (pkgs) callPackage;
|
||||
inherit (pkgs) callPackage lib;
|
||||
|
||||
buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};};
|
||||
mkInstallable = callPackage (import ../../nix/mk-installable) {};
|
||||
|
||||
src = ./.;
|
||||
src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?"];
|
||||
in
|
||||
mkInstallable {
|
||||
packages = rec {
|
||||
|
||||
Binary file not shown.
@@ -16,12 +16,12 @@
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (pkgs) callPackage;
|
||||
inherit (pkgs) callPackage lib;
|
||||
|
||||
buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};};
|
||||
mkInstallable = callPackage (import ../../nix/mk-installable) {};
|
||||
|
||||
src = ./.;
|
||||
src = lib.sources.sourceByRegex ./. ["Cargo\.*" ".*\.rs"];
|
||||
in
|
||||
mkInstallable {
|
||||
packages = rec {
|
||||
|
||||
@@ -28,21 +28,17 @@
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (pkgs) lib stdenv runCommand emscripten writeShellScriptBin cmake;
|
||||
inherit (pkgs) lib stdenv runCommand emscripten writeShellScriptBin cmake callPackage;
|
||||
buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) {};
|
||||
mkInstallable = callPackage (import ../../nix/mk-installable) {};
|
||||
|
||||
packageVariantBuilder =
|
||||
name:
|
||||
{ simd }@variantOptions:
|
||||
{
|
||||
"webp-squoosh-${name}" = stdenv.mkDerivation {
|
||||
"webp-squoosh-${name}" = buildSquooshCppCodec {
|
||||
name = "webp-squoosh-${name}";
|
||||
# Only copy files that are actually relevant to avoid unnecessary
|
||||
# cache invalidations.
|
||||
src = runCommand "src" { } ''
|
||||
mkdir $out
|
||||
cp -r ${./.}/enc $out/
|
||||
cp -r ${./.}/dec $out/
|
||||
cp ${./.}/Makefile $out/
|
||||
'';
|
||||
src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?" "dec(/.+)?"];
|
||||
nativeBuildInputs = [
|
||||
emscripten
|
||||
self.packages.${system}."webp-${name}"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
}:
|
||||
{
|
||||
name,
|
||||
src,
|
||||
nativeBuildInputs ? [ ],
|
||||
encoder ? "enc",
|
||||
decoder ? "dec",
|
||||
@@ -16,7 +15,7 @@ stdenv.mkDerivation (
|
||||
final:
|
||||
args
|
||||
// {
|
||||
inherit name src;
|
||||
inherit name;
|
||||
nativeBuildInputs = [ pkgs.emscripten ] ++ nativeBuildInputs;
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
|
||||
Reference in New Issue
Block a user