From ee21b61658dd195be61e93b0937ad65d6e41fb6a Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 31 Oct 2023 15:45:10 +0000 Subject: [PATCH] ttop: build with lockfile --- pkgs/by-name/tt/ttop/lock.json | 63 +++++++++++++++++++ .../tt/ttop/package.nix} | 7 +-- pkgs/top-level/all-packages.nix | 2 - pkgs/top-level/nim-overrides.nix | 8 +++ 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/tt/ttop/lock.json rename pkgs/{tools/system/ttop/default.nix => by-name/tt/ttop/package.nix} (79%) diff --git a/pkgs/by-name/tt/ttop/lock.json b/pkgs/by-name/tt/ttop/lock.json new file mode 100644 index 000000000000..16c54d52f980 --- /dev/null +++ b/pkgs/by-name/tt/ttop/lock.json @@ -0,0 +1,63 @@ +{ + "depends": [ + { + "method": "fetchzip", + "packages": [ + "asciigraph" + ], + "path": "/nix/store/q3m2aqlzzrx4jj5akbf8rah0gp40ya2v-source", + "ref": "master", + "rev": "9f51fc4e94d0960ab63fa6ea274518159720aa69", + "sha256": "1n8cx5vl26ppjsn889zmfpa37yhlxahy2va4bqp6q4v4r1dl1h14", + "srcDir": "src", + "url": "https://github.com/Yardanico/asciigraph/archive/9f51fc4e94d0960ab63fa6ea274518159720aa69.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "illwill" + ], + "path": "/nix/store/3lmm3z36qn4gz7bfa209zv0pqrpm3di9-source", + "ref": "v0.3.2", + "rev": "1d12cb36ab7b76c31d2d25fa421013ecb382e625", + "sha256": "0f9yncl5gbdja18mrqf5ixrdgrh95k0khda923dm1jd1x1b7ar8z", + "srcDir": "", + "url": "https://github.com/johnnovak/illwill/archive/1d12cb36ab7b76c31d2d25fa421013ecb382e625.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "jsony" + ], + "path": "/nix/store/ila4vdklhqs6h14gwyx71yrjbzwf54g3-source", + "rev": "non_quoted_key", + "sha256": "03xg2psxk765rfbf77q0hw5p9j1lzx5aqgz0j6arknw6r3zjrvrm", + "srcDir": "src", + "url": "https://github.com/inv2004/jsony/archive/non_quoted_key.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "parsetoml" + ], + "path": "/nix/store/nrgl7ks2x3svv6pkdxzr97d6jbd3zhlr-source", + "ref": "v0.7.1", + "rev": "6e5e16179fa2db60f2f37d8b1af4128aaa9c8aaf", + "sha256": "0lsgzbjlgd0h9859yn864y9h9h1v4f5jjk81yvfnlkc9zbwb5kfa", + "srcDir": "src", + "url": "https://github.com/NimParsers/parsetoml/archive/6e5e16179fa2db60f2f37d8b1af4128aaa9c8aaf.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "zippy" + ], + "path": "/nix/store/dj520pi1q9xh5gplcjs0jsn5wgnaa0cr-source", + "ref": "0.10.11", + "rev": "9560f3d20479fb390c97f731ef8d100f1ed54e6c", + "sha256": "140r42kgynwsnrga4x2mildx9pflwniyhjjzmid2jvnl4i6jrsr4", + "srcDir": "src", + "url": "https://github.com/guzba/zippy/archive/9560f3d20479fb390c97f731ef8d100f1ed54e6c.tar.gz" + } + ] +} diff --git a/pkgs/tools/system/ttop/default.nix b/pkgs/by-name/tt/ttop/package.nix similarity index 79% rename from pkgs/tools/system/ttop/default.nix rename to pkgs/by-name/tt/ttop/package.nix index 694964daf9c3..97db97e33d44 100644 --- a/pkgs/tools/system/ttop/default.nix +++ b/pkgs/by-name/tt/ttop/package.nix @@ -1,9 +1,8 @@ -{ lib, nimPackages, fetchFromGitHub, testers }: +{ lib, buildNimPackage, fetchFromGitHub, testers }: -nimPackages.buildNimPackage (finalAttrs: { +buildNimPackage (finalAttrs: { pname = "ttop"; version = "1.2.7"; - nimBinOnly = true; src = fetchFromGitHub { owner = "inv2004"; @@ -12,7 +11,7 @@ nimPackages.buildNimPackage (finalAttrs: { hash = "sha256-oPdaUqh6eN1X5kAYVvevOndkB/xnQng9QVLX9bu5P5E="; }; - buildInputs = with nimPackages; [ asciigraph illwill jsony parsetoml zippy ]; + lockFile = ./lock.json; nimFlags = [ "-d:NimblePkgVersion=${finalAttrs.version}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b0ccb0663e65..5c1f7d3f5f1f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14155,8 +14155,6 @@ with pkgs; }; ttfautohint-nox = ttfautohint.override { enableGUI = false; }; - ttop = callPackage ../tools/system/ttop { }; - tty-clock = callPackage ../tools/misc/tty-clock { }; tty-share = callPackage ../applications/misc/tty-share { }; diff --git a/pkgs/top-level/nim-overrides.nix b/pkgs/top-level/nim-overrides.nix index cf7a14b18d7d..28bd13375e0e 100644 --- a/pkgs/top-level/nim-overrides.nix +++ b/pkgs/top-level/nim-overrides.nix @@ -1,4 +1,5 @@ { lib +, stdenv , SDL2 }: @@ -13,4 +14,11 @@ buildInputs = buildInputs ++ [ SDL2 ]; }; + zippy = lockAttrs: finalAttrs: + { nimFlags ? [ ], ... }: { + nimFlags = nimFlags ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + "--passC:-msse4.1" + "--passC:-mpclmul" + ]; + }; }