From 42c82144d122724a95c9d311b2dd372a2ab1eefa Mon Sep 17 00:00:00 2001 From: Robbe Van Petegem Date: Mon, 5 Jan 2026 16:12:44 +0100 Subject: [PATCH 1/4] Add `ruby-vips` as explicit dependency --- Gemfile | 1 + Gemfile.lock | 5 +++-- gemset.nix | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 5812e0be..1681b262 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem 'pagy' # Use pagy for pagination gem 'pg' # Use postgresql as the database for Active Record gem 'puma' # Use the Puma web server [https://github.com/puma/puma] gem 'pundit' # Use pundit for easy authorization +gem 'ruby-vips' # Transform images gem 'turbo-rails' # Use Turbo for progressive enhancement of requests gem 'view_component' # Use ViewComponent to replace partials gem 'vite_rails' # Use ViteRails to compile assets diff --git a/Gemfile.lock b/Gemfile.lock index d7288eb0..c704f4f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -318,7 +318,7 @@ GEM ruby-lsp-rails (0.4.8) ruby-lsp (>= 0.26.0, < 0.27.0) ruby-progressbar (1.13.0) - ruby-vips (2.2.3) + ruby-vips (2.3.0) ffi (~> 1.12) logger rubyzip (3.2.2) @@ -425,6 +425,7 @@ DEPENDENCIES rubocop-rails ruby-lsp ruby-lsp-rails + ruby-vips selenium-webdriver sentry-rails sentry-ruby @@ -549,7 +550,7 @@ CHECKSUMS ruby-lsp (0.26.4) sha256=1cb3046a066c8f1983dfe5f0cd3baa76034d6ba156e8ab460b15ab129d37a9f7 ruby-lsp-rails (0.4.8) sha256=f09d1f926d4063deeb2f3049311925c20dfe6c912371e3bcd04a265a865c44ae ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 - ruby-vips (2.2.3) sha256=41d12b1a805cd6ead4a7965201a8f7c5fe459bb58d3a7d967c9eb0719a6edc92 + ruby-vips (2.3.0) sha256=e685ec02c13969912debbd98019e50492e12989282da5f37d05f5471442f5374 rubyzip (3.2.2) sha256=c0ed99385f0625415c8f05bcae33fe649ed2952894a95ff8b08f26ca57ea5b3c sax-machine (1.3.2) sha256=a1112678039eea4c402827ca0d377744e0f882fd6386f29f7b0023d938750d3a securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1 diff --git a/gemset.nix b/gemset.nix index aeb541be..f4e46f3f 100644 --- a/gemset.nix +++ b/gemset.nix @@ -1515,12 +1515,12 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "14nwdsd73c4ygjb7sfldnndlbzn5yyl02llnlzafmmjwh0d2pla1"; + sha256 = "0x2k5x272m2zs0vmznl2jac14bj9a2g0365xxcnr2s9rq41fr1g6"; target = "ruby"; type = "gem"; }; targets = []; - version = "2.2.3"; + version = "2.3.0"; }; rubyzip = { groups = ["default" "test"]; From 7c16555eedfecb02145902900f2f2328c291aa28 Mon Sep 17 00:00:00 2001 From: Robbe Van Petegem Date: Mon, 5 Jan 2026 16:16:10 +0100 Subject: [PATCH 2/4] Update flake to fix FFI override --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index f7757286..57d9444a 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1741473158, - "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "lastModified": 1764011051, + "narHash": "sha256-M7SZyPZiqZUR/EiiBJnmyUbOi5oE/03tCeFrTiUZchI=", "owner": "numtide", "repo": "devshell", - "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "rev": "17ed8d9744ebe70424659b0ef74ad6d41fc87071", "type": "github" }, "original": { @@ -60,11 +60,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1762363567, - "narHash": "sha256-YRqMDEtSMbitIMj+JLpheSz0pwEr0Rmy5mC7myl17xs=", + "lastModified": 1767379071, + "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ae814fd3904b621d8ab97418f1d0f2eb0d3716f4", + "rev": "fb7944c166a3b630f177938e478f0378e64ce108", "type": "github" }, "original": { From 9e67112012fcbfc654dad9a6ec354b210719f920 Mon Sep 17 00:00:00 2001 From: Robbe Van Petegem Date: Mon, 5 Jan 2026 16:19:26 +0100 Subject: [PATCH 3/4] Add our own override --- flake.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/flake.nix b/flake.nix index e3848cf7..3af10959 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,19 @@ lockfile = ./Gemfile.lock; gemset = ./gemset.nix; groups = [ "default" "development" "test" "production" ]; + gemConfig = pkgs.defaultGemConfig // { + ruby-vips = attrs: { + # We override the postInstall from nixpkgs, as ruby-vips changed this a bit in v2.3.0 + postInstall = '' + cd "$(cat $out/nix-support/gem-meta/install-path)" + + substituteInPlace lib/vips.rb \ + --replace 'FFI.library_name("vips", 42)' '"${pkgs.lib.getLib pkgs.vips}/lib/libvips${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}"' \ + --replace 'FFI.library_name("glib-2.0", 0)' '"${pkgs.glib.out}/lib/libglib-2.0${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}"' \ + --replace 'FFI.library_name("gobject-2.0", 0)' '"${pkgs.glib.out}/lib/libgobject-2.0${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}"' + ''; + }; + }; }; node-modules = pkgs.mkYarnModules { pname = "feed-reader-modules"; From 08607eb949182e3e4014062ca56e93883bfd6e9e Mon Sep 17 00:00:00 2001 From: Robbe Van Petegem Date: Mon, 5 Jan 2026 16:25:40 +0100 Subject: [PATCH 4/4] Install vips --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9921f5c..2d80f449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,8 @@ jobs: cache: 'yarn' - name: Install dependencies run: yarn install + - name: Install libvips + run: sudo apt-get install -y libvips - name: Compile assets run: RAILS_ENV=test bundle exec rails assets:precompile - name: Run tests @@ -120,5 +122,7 @@ jobs: cache: 'yarn' - name: Install dependencies run: yarn install + - name: Install libvips + run: sudo apt-get install -y libvips - name: Compile assets run: bundle exec rails assets:precompile