about summary refs log tree commit diff
path: root/pkgs/applications/misc/collision/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/collision/default.nix')
-rw-r--r--pkgs/applications/misc/collision/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/applications/misc/collision/default.nix b/pkgs/applications/misc/collision/default.nix
new file mode 100644
index 000000000000..a77d0b34a75e
--- /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 ];
+  };
+}