From 1faef68068582fd43fefcd8149a95707bfea5015 Mon Sep 17 00:00:00 2001 From: Mynacol Date: Sun, 26 Mar 2023 22:41:01 +0200 Subject: [PATCH 1/4] maintainers: add mynacol --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 4eefe3bea0f5..f47fda667fd4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -10540,6 +10540,11 @@ githubId = 6295090; name = "Mats"; }; + mynacol = { + github = "Mynacol"; + githubId = 26695166; + name = "Paul Prechtel"; + }; myrl = { email = "myrl.0xf@gmail.com"; github = "Myrl"; From de5088984835d244a2a02da82f675c77adfb0c7b Mon Sep 17 00:00:00 2001 From: Mynacol Date: Sun, 26 Mar 2023 22:42:47 +0200 Subject: [PATCH 2/4] leanify: init at unstable-2022-12-04 The stable v0.4.3 from 2015 wouldn't compile for me, so I just chose the last git commit. According to the changelog, there is v0.4.4, but no git tag or GitHub release is available. --- pkgs/tools/misc/leanify/default.nix | 39 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 pkgs/tools/misc/leanify/default.nix diff --git a/pkgs/tools/misc/leanify/default.nix b/pkgs/tools/misc/leanify/default.nix new file mode 100644 index 000000000000..d4f8d30aebb8 --- /dev/null +++ b/pkgs/tools/misc/leanify/default.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "leanify"; + version = "unstable-2022-12-04"; + + src = fetchFromGitHub { + owner = "JayXon"; + repo = "Leanify"; + rev = "7847668ac5bf0df1d940b674bc8b907bd1b37044"; + hash = "sha256-KxVV7AW9sEfH4YTPDfeJk7fMMGh0eSkECXM/Mv9XqBA="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp leanify $out/bin/ + + runHook postInstall + ''; + + meta = with lib; { + description = "Lightweight lossless file minifier/optimizer"; + longDescription = '' + Leanify is a lightweight lossless file minifier/optimizer. + It removes unnecessary data (debug information, comments, metadata, etc.) and recompress the file to reduce file size. + It will not reduce image quality at all. + ''; + homepage = "https://github.com/JayXon/Leanify"; + changelog = "https://github.com/JayXon/Leanify/blob/master/CHANGELOG.md"; + license = licenses.mit; + maintainers = [ maintainers.mynacol ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 489e3d50e00c..206e884393f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9448,6 +9448,8 @@ with pkgs; l3afpad = callPackage ../applications/editors/l3afpad { }; + leanify = callPackage ../tools/misc/leanify { }; + leatherman = callPackage ../development/libraries/leatherman { }; ledit = callPackage ../tools/misc/ledit { From 3f977c13dd35ad9729c237addc5f9d67898023ed Mon Sep 17 00:00:00 2001 From: Paul Prechtel Date: Mon, 27 Mar 2023 00:04:39 +0200 Subject: [PATCH 3/4] leanify: mark darwin as broken See https://github.com/NixOS/nixpkgs/pull/223300#discussion_r1148651152 Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com> --- pkgs/tools/misc/leanify/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/misc/leanify/default.nix b/pkgs/tools/misc/leanify/default.nix index d4f8d30aebb8..f478e426e9e7 100644 --- a/pkgs/tools/misc/leanify/default.nix +++ b/pkgs/tools/misc/leanify/default.nix @@ -35,5 +35,6 @@ stdenv.mkDerivation rec { license = licenses.mit; maintainers = [ maintainers.mynacol ]; platforms = platforms.all; + broken = stdenv.isDarwin; }; } From 49fc798b251045b8377e9dd91d00db3153fd1dff Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:26:44 +0300 Subject: [PATCH 4/4] leanify: support darwin --- pkgs/tools/misc/leanify/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/leanify/default.nix b/pkgs/tools/misc/leanify/default.nix index f478e426e9e7..bcb936694fd7 100644 --- a/pkgs/tools/misc/leanify/default.nix +++ b/pkgs/tools/misc/leanify/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, libiconv }: stdenv.mkDerivation rec { @@ -14,6 +15,14 @@ stdenv.mkDerivation rec { hash = "sha256-KxVV7AW9sEfH4YTPDfeJk7fMMGh0eSkECXM/Mv9XqBA="; }; + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace "-flto" "" \ + --replace "lib/LZMA/Alloc.o" "lib/LZMA/CpuArch.o lib/LZMA/Alloc.o" + ''; + + buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; + installPhase = '' runHook preInstall @@ -35,6 +44,5 @@ stdenv.mkDerivation rec { license = licenses.mit; maintainers = [ maintainers.mynacol ]; platforms = platforms.all; - broken = stdenv.isDarwin; }; }