about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/collision
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/collision')
-rw-r--r--nixpkgs/pkgs/applications/misc/collision/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/misc/collision/make.patch20
-rw-r--r--nixpkgs/pkgs/applications/misc/collision/shards.nix25
3 files changed, 62 insertions, 36 deletions
diff --git a/nixpkgs/pkgs/applications/misc/collision/default.nix b/nixpkgs/pkgs/applications/misc/collision/default.nix
index f550e48ba954..8fd8ad8f33ba 100644
--- a/nixpkgs/pkgs/applications/misc/collision/default.nix
+++ b/nixpkgs/pkgs/applications/misc/collision/default.nix
@@ -4,34 +4,59 @@
 , crystal
 , wrapGAppsHook4
 , desktopToDarwinBundle
-, gi-crystal
 , gobject-introspection
+, gnome
+, python3
 , libadwaita
 , openssl
 , libxml2
 , pkg-config
+, gitUpdater
+, _experimental-update-script-combinators
+, runCommand
+, crystal2nix
+, writeShellScript
 }:
+
 crystal.buildCrystalPackage rec {
   pname = "Collision";
-  version = "3.6.0";
+  version = "3.8.0";
 
   src = fetchFromGitHub {
     owner = "GeopJr";
     repo = "Collision";
     rev = "v${version}";
-    hash = "sha256-Qxe4ILDdfYfxu95EvKRTvkAOgDIZDiLymBlZouBWn0M=";
+    hash = "sha256-Bo/u0UYM/N7tLqdCs2OU5pdj2s9LXPooSR1PCGk9dSc=";
   };
-  patches = [ ./make.patch ];
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace-fail 'gtk-update-icon-cache $(PREFIX)/share/icons/hicolor' 'true'
+  '';
+
   shardsFile = ./shards.nix;
+  copyShardDeps = true;
+
+  preBuild = ''
+    cd lib/gi-crystal && shards build -Dpreview_mt --release --no-debug
+    cd ../.. && mkdir bin/ && cp lib/gi-crystal/bin/gi-crystal bin/
+  '';
 
   # 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 ]
+  nativeBuildInputs = [ wrapGAppsHook4 pkg-config gobject-introspection ]
     ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
-  buildInputs = [ libadwaita openssl libxml2 ];
+
+  buildInputs = [
+    libadwaita
+    openssl
+    libxml2
+    gnome.nautilus-python
+    python3.pkgs.pygobject3
+  ];
 
   buildTargets = ["bindings" "build"];
 
@@ -40,6 +65,22 @@ crystal.buildCrystalPackage rec {
 
   installTargets = ["desktop" "install"];
 
+  postInstall = ''
+      install -Dm555 ./nautilus-extension/collision-extension.py -t $out/share/nautilus-python/extensions
+  '';
+
+  passthru = {
+    updateScript = _experimental-update-script-combinators.sequence [
+      (gitUpdater { rev-prefix = "v"; })
+      (_experimental-update-script-combinators.copyAttrOutputToFile "collision.shardLock" ./shard.lock)
+      { command = [ (writeShellScript "update-lock" "cd $1; ${lib.getExe crystal2nix}") ./. ]; supportedFeatures = [ "silent" ]; }
+      { command = [ "rm" ./shard.lock ]; supportedFeatures = [ "silent" ]; }
+    ];
+    shardLock = runCommand "shard.lock" { inherit src; } ''
+      cp $src/shard.lock $out
+    '';
+  };
+
   meta = with lib; {
     description = "Check hashes for your files";
     homepage = "https://github.com/GeopJr/Collision";
diff --git a/nixpkgs/pkgs/applications/misc/collision/make.patch b/nixpkgs/pkgs/applications/misc/collision/make.patch
deleted file mode 100644
index 73872a789278..000000000000
--- a/nixpkgs/pkgs/applications/misc/collision/make.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- 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/nixpkgs/pkgs/applications/misc/collision/shards.nix b/nixpkgs/pkgs/applications/misc/collision/shards.nix
index e7e93781eb68..e1b6032d5932 100644
--- a/nixpkgs/pkgs/applications/misc/collision/shards.nix
+++ b/nixpkgs/pkgs/applications/misc/collision/shards.nix
@@ -1,18 +1,23 @@
 {
+  blake3 = {
+    url = "https://github.com/geopjr/blake3.cr.git";
+    rev = "v1.3.0";
+    sha256 = "0pc3h7b5gfkmxlw708qaqjfzjvv5ig3iwxxainq6pwfhpff4a5wd";
+  };
   gettext = {
     url = "https://github.com/geopjr/gettext.cr.git";
     rev = "v1.0.0";
     sha256 = "1y27m4170rr4532j56grzhwbz8hj6z7j3zfkd0jnfwnsxclks1kc";
   };
-  gio = {
-    url = "https://github.com/hugopl/gio.cr.git";
-    rev = "v0.1.0";
-    sha256 = "0vj35bi64d4hni18nrl8fmms306a0gl4zlxpf3aq08lh0sbwzhd8";
+  gi-crystal = {
+    url = "https://github.com/hugopl/gi-crystal.git";
+    rev = "v0.22.2";
+    sha256 = "0bpa1f8iaf97z2kbgjc7nc8km7nd7bppiwna319lm2hvm8m5pw15";
   };
   gtk4 = {
     url = "https://github.com/hugopl/gtk4.cr.git";
-    rev = "v0.15.0";
-    sha256 = "100j5k4sfc2dpj3nplzjcaxw1bwy3hsy5cw93asg00kda9h8dbb1";
+    rev = "v0.16.1";
+    sha256 = "1cqkbh072y70l8g0p040vf50k920p32ry1larnwn9mqabd74jwaj";
   };
   harfbuzz = {
     url = "https://github.com/hugopl/harfbuzz.cr.git";
@@ -26,12 +31,12 @@
   };
   non-blocking-spawn = {
     url = "https://github.com/geopjr/non-blocking-spawn.git";
-    rev = "v1.0.5";
-    sha256 = "139gr87zlw0k9kf6pf9k2d88aa9x3kcnfg34qpbqrwsrck7708za";
+    rev = "v1.1.0";
+    sha256 = "1h43gskannylaai4dz2sjb6rds2h6slm1krg88inan12silhp66c";
   };
   pango = {
     url = "https://github.com/hugopl/pango.cr.git";
-    rev = "v0.2.0";
-    sha256 = "0dl3qrhi2ybylmvzx1x5gsznp2pcdkc50waxrljxwnf5avn8ixsf";
+    rev = "v0.3.1";
+    sha256 = "0xlf127flimnll875mcq92q7xsi975rrgdpcpmnrwllhdhfx9qmv";
   };
 }