Skip to content

Commit

Permalink
colorstorm: 2.0.0 -> 2.0.0-unstable-2025-01-17 (#377279)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillrdy authored Jan 28, 2025
2 parents 11a8012 + 837da5a commit b2a8492
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
12 changes: 12 additions & 0 deletions pkgs/by-name/co/colorstorm/0001-fix-segfault.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/templator.zig b/src/templator.zig
index 5630a04..0dc8ca7 100644
--- a/src/templator.zig
+++ b/src/templator.zig
@@ -77,7 +77,6 @@ pub fn parse_themes(f: std.fs.File) ![]Theme {
}

const parsed = try std.json.parseFromSlice([]Theme, a, list.items, .{});
- defer parsed.deinit();
const themes = parsed.value;

return themes;
21 changes: 15 additions & 6 deletions pkgs/by-name/co/colorstorm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,39 @@
lib,
stdenv,
fetchFromGitHub,
zig_0_9,
zig_0_13,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "colorstorm";
version = "2.0.0";
# last tagged release is three years old and requires outdated Zig 0.9
# new release requested in: https://github.com/benbusby/colorstorm/issues/16
version = "2.0.0-unstable-2025-01-17";

src = fetchFromGitHub {
owner = "benbusby";
repo = "colorstorm";
rev = "v${finalAttrs.version}";
hash = "sha256-6+P+QQpP1jxsydqhVrZkjl1gaqNcx4kS2994hOBhtu8=";
rev = "e645c4293fb5f72968038dac99e0b8dab3db194f";
hash = "sha256-6D+aNcjJksv7E9RJB9fnzgzvGoUPXV4Shz5wLu5YHtg=";
};

patches = [
# Fixes a use-after-free segfault.
# See https://github.com/benbusby/colorstorm/pull/15#discussion_r1930406581
# and upstream PR https://github.com/NixOS/nixpkgs/pull/377279
./0001-fix-segfault.patch
];

nativeBuildInputs = [
zig_0_9.hook
zig_0_13.hook
];

meta = {
description = "Color theme generator for editors and terminal emulators";
homepage = "https://github.com/benbusby/colorstorm";
license = lib.licenses.mit;
maintainers = [ ];
inherit (zig_0_9.meta) platforms;
inherit (zig_0_13.meta) platforms;
mainProgram = "colorstorm";
};
})

0 comments on commit b2a8492

Please sign in to comment.