From 5dd133142ff17e74594eb6369b983e1c47bd540e Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 20 Nov 2023 18:18:09 +0200 Subject: [PATCH] snekim: build with lockfile --- pkgs/by-name/sn/snekim/lock.json | 40 +++++++++++++++++++ .../sn/snekim/package.nix} | 19 ++++----- pkgs/top-level/all-packages.nix | 2 - pkgs/top-level/nim-overrides.nix | 6 +++ 4 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 pkgs/by-name/sn/snekim/lock.json rename pkgs/{games/snekim/default.nix => by-name/sn/snekim/package.nix} (66%) diff --git a/pkgs/by-name/sn/snekim/lock.json b/pkgs/by-name/sn/snekim/lock.json new file mode 100644 index 000000000000..d381dd989411 --- /dev/null +++ b/pkgs/by-name/sn/snekim/lock.json @@ -0,0 +1,40 @@ +{ + "depends": [ + { + "method": "fetchzip", + "packages": [ + "nimraylib_now" + ], + "path": "/nix/store/vcq7r99jnqh6cj6cdd5227pymk9rnk7g-source", + "ref": "v0.15.0", + "rev": "59154abcbc4cf89b4c674f402db026dea216da7b", + "sha256": "0b6rn9y1d5fpkdf16g0bjrkj39sq1iyq0zlkwi1xmsbq681j5inp", + "srcDir": "src", + "url": "https://github.com/greenfork/nimraylib_now/archive/59154abcbc4cf89b4c674f402db026dea216da7b.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "regex" + ], + "path": "/nix/store/vfs4ysdw2kvyp18jwpbvb9wfh1ajz0a9-source", + "ref": "v0.23.0", + "rev": "577c4ec3b235c5fd2653a9c86cbc4a576cfc0869", + "sha256": "0401f9m2m2h6bikl3hffyhaw5fc2nbjdf5mj4z9wckmm9lx9hpkl", + "srcDir": "src", + "url": "https://github.com/nitely/nim-regex/archive/577c4ec3b235c5fd2653a9c86cbc4a576cfc0869.tar.gz" + }, + { + "method": "fetchzip", + "packages": [ + "unicodedb" + ], + "path": "/nix/store/wpilzdf8vdwp7w129yrl821p9qvl3ky3-source", + "ref": "0.12.0", + "rev": "b055310c08db8f879057b4fec15c8301ee93bb2a", + "sha256": "0w77h75vrgp6jiq4dd9i2m4za2cf8qhjkz2wlxiz27yn2isjrndy", + "srcDir": "src", + "url": "https://github.com/nitely/nim-unicodedb/archive/b055310c08db8f879057b4fec15c8301ee93bb2a.tar.gz" + } + ] +} diff --git a/pkgs/games/snekim/default.nix b/pkgs/by-name/sn/snekim/package.nix similarity index 66% rename from pkgs/games/snekim/default.nix rename to pkgs/by-name/sn/snekim/package.nix index 524f03252250..e041c1f0e314 100644 --- a/pkgs/games/snekim/default.nix +++ b/pkgs/by-name/sn/snekim/package.nix @@ -1,22 +1,19 @@ -{ lib, nimPackages, fetchFromGitea, raylib }: +{ lib, buildNimPackage, fetchFromGitea, raylib }: -nimPackages.buildNimPackage rec { +buildNimPackage (finalAttrs: { pname = "snekim"; version = "1.2.0"; - nimBinOnly = true; - src = fetchFromGitea { domain = "codeberg.org"; owner = "annaaurora"; repo = "snekim"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-Qgvq4CkGvNppYFpITCCifOHtVQYRQJPEK3rTJXQkTvI="; }; strictDeps = true; - - buildInputs = [ nimPackages.nimraylib-now raylib ]; + lockFile = ./lock.json; nimFlags = [ "-d:nimraylib_now_shared" ]; @@ -25,10 +22,10 @@ nimPackages.buildNimPackage rec { install -D icons/hicolor/48x48/snekim.svg -t $out/share/icons/hicolor/48x48/apps ''; - meta = with lib; { + meta = { homepage = "https://codeberg.org/annaaurora/snekim"; description = "A simple implementation of the classic snake game"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ annaaurora ]; + license = lib.licenses.lgpl3Only; + maintainers = [ lib.maintainers.annaaurora ]; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bd16fa427f84..ade2f17ecc84 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2814,8 +2814,6 @@ with pkgs; simplenes = callPackage ../applications/emulators/simplenes { }; - snekim = callPackage ../games/snekim { }; - snes9x = callPackage ../applications/emulators/snes9x { }; snes9x-gtk = callPackage ../applications/emulators/snes9x { diff --git a/pkgs/top-level/nim-overrides.nix b/pkgs/top-level/nim-overrides.nix index bb1aaf36bac9..910f5c8bcae4 100644 --- a/pkgs/top-level/nim-overrides.nix +++ b/pkgs/top-level/nim-overrides.nix @@ -5,6 +5,7 @@ , libsass , openssl , pkg-config +, raylib , SDL2 , tkrzw , xorg @@ -31,6 +32,11 @@ buildInputs = buildInputs ++ [ getdns ]; }; + nimraylib_now = lockAttrs: finalAttrs: + { buildInputs ? [ ], ... }: { + buildInputs = buildInputs ++ [ raylib ]; + }; + sass = lockAttrs: finalAttrs: { buildInputs ? [ ], ... }: { buildInputs = buildInputs ++ [ libsass ];