zipline: properly built sharp dependency against system libvips (#415805)

authored by Felix Bargfeldt and committed by GitHub 574609cb d80ebfd6

+21 -11
+5 -2
nixos/tests/zipline.nix
··· 1 - { lib, ... }: 1 + { lib, pkgs, ... }: 2 2 3 3 { 4 4 name = "zipline"; 5 5 meta.maintainers = with lib.maintainers; [ defelo ]; 6 6 7 7 nodes.machine = { 8 + # On x86, testing with a CPU without SSE 4.2 support 9 + # to ensure native libvips is used 10 + virtualisation.qemu.options = lib.mkIf pkgs.stdenv.hostPlatform.isx86 [ "-cpu core2duo" ]; 8 11 services.zipline = { 9 12 enable = true; 10 13 settings = { ··· 38 41 import re 39 42 40 43 machine.wait_for_unit("zipline.service") 41 - machine.wait_for_open_port(8000) 44 + machine.wait_for_open_port(8000, timeout=300) 42 45 43 46 resp = machine.succeed("curl zipline.local:8000/api/setup -v -X POST -H 'Content-Type: application/json' -d '{\"username\": \"administrator\", \"password\": \"password\"}' 2>&1") 44 47 data = json.loads(resp.splitlines()[-1])
+16 -9
pkgs/by-name/zi/zipline/package.nix
··· 12 12 versionCheckHook, 13 13 nix-update-script, 14 14 nixosTests, 15 + node-gyp, 16 + pkg-config, 17 + python3, 15 18 }: 16 19 17 20 let ··· 43 46 hash = "sha256-O8RLaKff4Dj/JDeUOyf7GtcFcOu/aOuclyaZmVqVi5s="; 44 47 }; 45 48 46 - buildInputs = [ vips ]; 49 + buildInputs = [ 50 + openssl 51 + vips 52 + ]; 47 53 48 54 nativeBuildInputs = [ 49 55 pnpm_10.configHook 50 56 nodejs_24 51 57 makeWrapper 58 + # for sharp build: 59 + node-gyp 60 + pkg-config 61 + python3 52 62 ]; 53 63 54 64 env = environment; ··· 56 66 buildPhase = '' 57 67 runHook preBuild 58 68 69 + # Force build of sharp against native libvips (requires running install scripts). 70 + # This is necessary for supporting old CPUs (ie. without SSE 4.2 instruction set). 71 + pnpm config set nodedir ${nodejs_24} 72 + pnpm install --force --offline --frozen-lockfile 73 + 59 74 pnpm build 60 75 61 76 runHook postBuild ··· 86 101 mkBin ziplinectl ctl 87 102 88 103 runHook postInstall 89 - ''; 90 - 91 - preFixup = '' 92 - find $out -name libvips-cpp.so.42 -print0 | while read -d $'\0' libvips; do 93 - echo replacing libvips at $libvips 94 - rm $libvips 95 - ln -s ${lib.getLib vips}/lib/libvips-cpp.so.42 $libvips 96 - done 97 104 ''; 98 105 99 106 nativeInstallCheckInputs = [ versionCheckHook ];