Skip to content

Commit

Permalink
Merge pull request #242681 from sund3RRR/collision-package-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Jul 19, 2023
2 parents dd5b7cf + df21f9e commit f119d4c
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
42 changes: 42 additions & 0 deletions pkgs/applications/misc/collision/collision-shards.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
gettext = {
url = "https://github.com/geopjr/gettext.cr.git";
rev = "v1.0.0";
sha256 = "1y27m4170rr4532j56grzhwbz8hj6z7j3zfkd0jnfwnsxclks1kc";
};
non-blocking-spawn = {
url = "https://github.com/geopjr/non-blocking-spawn.git";
rev = "v1.0.5";
sha256 = "139gr87zlw0k9kf6pf9k2d88aa9x3kcnfg34qpbqrwsrck7708za";
};
version_from_shard = {
url = "https://github.com/hugopl/version_from_shard.git";
rev = "v1.2.5";
sha256 = "0xizj0q4rd541rwjbx04cjifc2gfx4l5v6q2y7gmd0ndjmkgb8ik";
};
gio = {
url = "https://github.com/hugopl/gio.cr.git";
rev = "v0.1.0";
sha256 = "0vj35bi64d4hni18nrl8fmms306a0gl4zlxpf3aq08lh0sbwzhd8";
};
gtk4 = {
url = "https://github.com/hugopl/gtk4.cr.git";
rev = "v0.13.0";
sha256 = "0xsrcsh5qvwm9l7cywxpw49rfv94mkkqcliws4zkhxgr9isnirbm";
};
harfbuzz = {
url = "https://github.com/hugopl/harfbuzz.cr.git";
rev = "v0.1.0";
sha256 = "1lcb778b4k34sqxg979fpl425bbzf2gikjf2m5aj6x1fzxn46jg0";
};
pango = {
url = "https://github.com/hugopl/pango.cr.git";
rev = "v0.2.0";
sha256 = "0dl3qrhi2ybylmvzx1x5gsznp2pcdkc50waxrljxwnf5avn8ixsf";
};
libadwaita = {
url = "https://github.com/geopjr/libadwaita.cr.git";
rev = "203737fc96bb48e1a710cb68e896d2c5b9c1a6e5";
sha256 = "11c2knxncjnwg4cgppfllxwgli1hf6sjyyx4ii8rgmnbird6xcmh";
};
}
50 changes: 50 additions & 0 deletions pkgs/applications/misc/collision/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ stdenv
, lib
, fetchFromGitHub
, crystal
, wrapGAppsHook4
, desktopToDarwinBundle
, gi-crystal
, gobject-introspection
, libadwaita
, openssl
, libxml2
, pkg-config
}:
crystal.buildCrystalPackage rec {
pname = "Collision";
version = "3.5.0";

src = fetchFromGitHub {
owner = "GeopJr";
repo = "Collision";
rev = "v${version}";
hash = "sha256-YNMtiMSzDqBlJJTUntRtL6oXg+IuyAobQ4FYcwOdOas=";
};
patches = [ ./make.patch ];
shardsFile = ./collision-shards.nix;

# Crystal compiler has a strange issue with OpenSSL. The project will not compile due to
# main_module:(.text+0x6f0): undefined reference to `SSL_library_init'
# There is an explanation for this https://danilafe.com/blog/crystal_nix_revisited/
# Shortly, adding pkg-config to buildInputs along with openssl fixes the issue.

nativeBuildInputs = [ wrapGAppsHook4 pkg-config gobject-introspection gi-crystal ]
++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
buildInputs = [ libadwaita openssl libxml2 ];

buildTargets = ["bindings" "build"];

doCheck = false;
doInstallCheck = false;

installTargets = ["desktop" "install"];

meta = with lib; {
description = "Check hashes for your files";
homepage = "https://github.com/GeopJr/Collision";
license = licenses.bsd2;
mainProgram = "collision";
maintainers = with maintainers; [ sund3RRR ];
};
}
20 changes: 20 additions & 0 deletions pkgs/applications/misc/collision/make.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/Makefile 2023-07-09 10:49:31.064190374 +0300
+++ b/Makefile 2023-07-19 11:19:37.415480179 +0300
@@ -6,7 +6,7 @@
all: desktop bindings build

bindings:
- ./bin/gi-crystal || $(CRYSTAL_LOCATION)shards install && ./bin/gi-crystal
+ gi-crystal

build:
COLLISION_LOCALE_LOCATION="$(PREFIX)$(LOCALE_LOCATION)" $(CRYSTAL_LOCATION)shards build -Dpreview_mt --release --no-debug
@@ -43,7 +43,7 @@
install -D -m 0644 data/dev.geopjr.Collision.desktop $(PREFIX)/share/applications/dev.geopjr.Collision.desktop
install -D -m 0644 data/icons/dev.geopjr.Collision.svg $(PREFIX)/share/icons/hicolor/scalable/apps/dev.geopjr.Collision.svg
install -D -m 0644 data/icons/dev.geopjr.Collision-symbolic.svg $(PREFIX)/share/icons/hicolor/symbolic/apps/dev.geopjr.Collision-symbolic.svg
- gtk-update-icon-cache $(PREFIX)/share/icons/hicolor
+ gtk4-update-icon-cache --ignore-theme-index $(PREFIX)/share/icons/hicolor
glib-compile-schemas $(PREFIX)/share/glib-2.0/schemas/

uninstall:
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ with pkgs;

colemak-dh = callPackage ../data/misc/colemak-dh { };

collision = callPackage ../applications/misc/collision { };

colmena = callPackage ../tools/admin/colmena { };

colorz = callPackage ../tools/misc/colorz { };
Expand Down

0 comments on commit f119d4c

Please sign in to comment.