From 8c76d43a688749d3a34e158d1d69a40d91efdbdc Mon Sep 17 00:00:00 2001 From: Surma Date: Wed, 7 Aug 2024 13:05:26 +0100 Subject: [PATCH] Have a proper install script --- codecs/mozjpeg/flake.nix | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/codecs/mozjpeg/flake.nix b/codecs/mozjpeg/flake.nix index af3a0967..d680a11e 100644 --- a/codecs/mozjpeg/flake.nix +++ b/codecs/mozjpeg/flake.nix @@ -22,7 +22,8 @@ with pkgs; { packages = rec { - default = stdenv.mkDerivation { + default = mozjpeg-squoosh; + mozjpeg-squoosh = stdenv.mkDerivation { name = "mozjpeg-squoosh"; src = ./.; nativeBuildInputs = [ @@ -51,18 +52,18 @@ pkg-config ]; configurePhase = '' - # $HOME is required for Emscripten to work. - # See: https://nixos.org/manual/nixpkgs/stable/#emscripten - export HOME=$TMPDIR - autoreconf -ifv - emconfigure ./configure \ - --disable-shared \ - --without-turbojpeg \ - --without-simd \ - --without-arith-enc \ - --without-arith-dec \ - --with-build-date=squoosh \ - --prefix=$out + # $HOME is required for Emscripten to work. + # See: https://nixos.org/manual/nixpkgs/stable/#emscripten + export HOME=$TMPDIR + autoreconf -ifv + emconfigure ./configure \ + --disable-shared \ + --without-turbojpeg \ + --without-simd \ + --without-arith-enc \ + --without-arith-dec \ + --with-build-date=squoosh \ + --prefix=$out ''; buildPhase = '' export HOME=$TMPDIR @@ -75,19 +76,17 @@ ''; dontFixup = true; }; - }; - devShells.default = pkgs.mkShell { - packages = [ - autoconf - automake - libtool - emscripten - pkg-config - ]; - shellHook = '' - echo "Path to MozJPEG: ${mozjpeg-src}" + installScript = writeShellScriptBin "install.sh" '' + ${pkgs.coreutils}/bin/mkdir build + ${pkgs.coreutils}/bin/cp ${mozjpeg-squoosh}/* build/ ''; }; + apps = { + install = { + type = "app"; + # program = " + }; + }; } ); }