From df21f9e39c902de6ba0cb9bd1f90869072582023 Mon Sep 17 00:00:00 2001 From: sunder Date: Wed, 19 Jul 2023 11:56:50 +0300 Subject: [PATCH] collision: init at 3.5.0 --- .../misc/collision/collision-shards.nix | 42 ++++++++++++++++ pkgs/applications/misc/collision/default.nix | 50 +++++++++++++++++++ pkgs/applications/misc/collision/make.patch | 20 ++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 114 insertions(+) create mode 100644 pkgs/applications/misc/collision/collision-shards.nix create mode 100644 pkgs/applications/misc/collision/default.nix create mode 100644 pkgs/applications/misc/collision/make.patch diff --git a/pkgs/applications/misc/collision/collision-shards.nix b/pkgs/applications/misc/collision/collision-shards.nix new file mode 100644 index 0000000000000..0c27255041545 --- /dev/null +++ b/pkgs/applications/misc/collision/collision-shards.nix @@ -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"; + }; +} diff --git a/pkgs/applications/misc/collision/default.nix b/pkgs/applications/misc/collision/default.nix new file mode 100644 index 0000000000000..a77d0b34a75ee --- /dev/null +++ b/pkgs/applications/misc/collision/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/applications/misc/collision/make.patch b/pkgs/applications/misc/collision/make.patch new file mode 100644 index 0000000000000..73872a789278f --- /dev/null +++ b/pkgs/applications/misc/collision/make.patch @@ -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: \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 523be31c5a0b7..ba26bdb63416d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };