lol

phpExtensions.relay: 0.6.3 -> 0.6.8

+87 -37
+3 -1
pkgs/development/libraries/hiredis/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub }: 1 + { lib, stdenv, fetchFromGitHub, openssl }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "hiredis"; 5 5 version = "1.2.0"; 6 + nativeBuildInputs = [openssl]; 6 7 7 8 src = fetchFromGitHub { 8 9 owner = "redis"; ··· 12 13 }; 13 14 14 15 PREFIX = "\${out}"; 16 + USE_SSL = 1; 15 17 16 18 meta = with lib; { 17 19 homepage = "https://github.com/redis/hiredis";
+84 -36
pkgs/development/php-packages/relay/default.nix
··· 3 3 , fetchurl 4 4 , php 5 5 , openssl 6 - , openssl_1_1 6 + , hiredis 7 7 , zstd 8 8 , lz4 9 9 , autoPatchelfHook 10 + , writeShellScript 11 + , curl 12 + , common-updater-scripts 10 13 }: 11 14 12 15 let 13 - version = "0.6.3"; 14 - system = stdenv.hostPlatform.system; 15 - phpVersion = lib.versions.majorMinor php.version; 16 - variation = { 16 + version = "0.6.8"; 17 + hashes = { 17 18 "aarch64-darwin" = { 18 19 platform = "darwin-arm64"; 19 - hashes = { 20 - "8.0" = "00a7pyf9na7hjifkmp2482c7sh086w72zniqgr4cz2rhz7hnqp7p"; 21 - "8.1" = "0mg6nsllycgjxxinn8s30y9sk06g40vk8blnpx0askjw5zdsf5y7"; 22 - "8.2" = "0qmcbrj6jaxczv25rdgfjrj9nwq4vb2faw7kzlyxrvvzb5pyn9dm"; 23 - "8.3" = "1hqjy5y4q3alxvrj7xksaf7vvmz8p51bgzxbvmzdx6jnl63dix33"; 20 + hash = { 21 + "8.0" = "sha256-DDn5JcRux8DN1728cqMWL7eMwueiY+jO/+fw2+ND394="; 22 + "8.1" = "sha256-4r954EKFUA45G55MpnnKcYONCNe45dIffiygs6r8OOI="; 23 + "8.2" = "sha256-qB2IWSsyAKzbUxjt2nz5uLp7PkgPPna1mEBqvz8oTHc="; 24 + "8.3" = "sha256-0s+4zNknH8lEfGS8oU3JjVEuX3mZEo9AULE0hlv11mQ="; 24 25 }; 25 26 }; 26 27 "aarch64-linux" = { 27 28 platform = "debian-aarch64+libssl3"; 28 - hashes = { 29 - "8.0" = "19zzw4324z096b6bph1686r30i4i2kwmlmmcqmb33lqkr9b9n5ag"; 30 - "8.1" = "0j6wpwy8d67pqij4v8m2xwydfddzr7nn4c3lyrssp8llbn4ghwpn"; 31 - "8.2" = "1nbajvi5zk6z8qr32l86p65f1zxv12kald56pg8k7bj4axlj2pmy"; 32 - "8.3" = "1sn638g2636m6s3lv2cclza9lzmzgqxamcga7jz3ijhn2ja6znbv"; 29 + hash = { 30 + "8.0" = "sha256-tLrampq1BBrhC+F/v2vcNBJp+16wzjHC8CGFKSswPUo="; 31 + "8.1" = "sha256-DQG3maP9ImwSCTEmP152l5wr7A964lg9kNFAmVQhPqA="; 32 + "8.2" = "sha256-3Ygb2J+MFL+H1zsepBaQKg/ybqgXVwFWt2QrNRctT8o="; 33 + "8.3" = "sha256-MKpN09+Ai9NFARUEL+pkxQxbpRpFTx78als8ViXMdB8="; 33 34 }; 34 35 }; 35 36 "x86_64-darwin" = { 36 37 platform = "darwin-x86-64"; 37 - hashes = { 38 - "8.0" = "13q6va9lxgfyx86xw20iqjz4s9r9xms74ywb2hgqrhs5mjnazzz4"; 39 - "8.1" = "1ncih5bf0jcylpl0nj8hi50kcwb4nl1g0ql359dgg9gp8s1b4hmw"; 40 - "8.2" = "150difm3vg0g2pl5hb5cci4jzybd7jcd7prjdv3rmwsi91gsydlv"; 41 - # 8.3 for this platform does not exist 38 + hash = { 39 + "8.0" = "sha256-jYnhJowVgryKSec+rOfyBiH2gZyasr1h1I+sjPiLods="; 40 + "8.1" = "sha256-VKvVo6so0NOfiq7JjnanBEUDa1Iqmkn9egKnOJSCHTg="; 41 + "8.2" = "sha256-WXWhSljy199UbZiEjfC50XvnKfVEU54lPa6e2+jCqiQ="; 42 + "8.3" = "sha256-CrJoONSm0aXlBWjsRqAJC39qB4tHkMuLAvM5d847DsE="; 42 43 }; 43 44 }; 44 45 "x86_64-linux" = { 45 46 platform = "debian-x86-64+libssl3"; 46 - hashes = { 47 - "8.0" = "1qvd5r591kp7qf9pkymz78s8llzs1vxjwqhwy9rvma21hh6gd8ld"; 48 - "8.1" = "0fm9ppgx7qaggid134qnl9jkq5h97dac2ax21f1f1d0k8f5blmc2"; 49 - "8.2" = "0g2yqwfrigf047dqkrvfcj318lvgp38zy522ry484mrgq7iqwvb8"; 50 - "8.3" = "06mi3yr7k1a9icdljzl76xvrw6xqnvwiavgzx2g487s097mycjp4"; 47 + hash = { 48 + "8.0" = "sha256-kzPlotJWsUIhYUFUwcXEBGv5eNfCNLDNgrs+IqZPH5c="; 49 + "8.1" = "sha256-QBnKHXBW2XpD4GvphzyMPiIrOfs9pzyG2Fv/VyV+h9k="; 50 + "8.2" = "sha256-yk+dkULtWVIccKurBdT96HOPbW8Q9l44iYpAAcoZYog="; 51 + "8.3" = "sha256-MpMupGFGxipghoA57EOytSsDsm9b25rc/VPIza+QMfM="; 51 52 }; 52 53 }; 53 - }.${system} or (throw "Unsupported platform for relay: ${system}"); 54 + }; 55 + 56 + makeSource = { system, phpMajor }: fetchurl { 57 + url = "https://builds.r2.relay.so/v${version}/relay-v${version}-php" 58 + + phpMajor + "-" + hashes.${system}.platform + ".tar.gz"; 59 + sha256 = hashes.${system}.hash.${phpMajor} or (throw "Unsupported PHP version for relay ${phpMajor} on ${system}"); 60 + }; 54 61 in 55 62 stdenv.mkDerivation (finalAttrs: { 56 63 inherit version; 57 64 pname = "relay"; 58 65 extensionName = "relay"; 59 66 60 - src = fetchurl { 61 - url = "https://builds.r2.relay.so/v${finalAttrs.version}/relay-v${finalAttrs.version}-php" 62 - + phpVersion + "-" + variation.platform + ".tar.gz"; 63 - sha256 = variation.hashes.${phpVersion} or (throw "Unsupported PHP version for relay ${phpVersion} on ${system}"); 67 + src = makeSource { 68 + system = stdenv.hostPlatform.system; 69 + phpMajor = lib.versions.majorMinor php.version; 64 70 }; 65 71 nativeBuildInputs = lib.optionals (!stdenv.isDarwin) [ 66 72 autoPatchelfHook ··· 79 85 '' + (if stdenv.isDarwin then 80 86 let 81 87 args = lib.strings.concatMapStrings 82 - (v: " -change /Users/administrator/dev/relay-dev/relay-deps/build/arm64/lib/${v.name}" 83 - + " ${lib.strings.makeLibraryPath [ v.value ]}/${v.name}") 88 + (v: " -change ${v.name}" + " ${lib.strings.makeLibraryPath [ v.value ]}/${builtins.baseNameOf v.name}") 84 89 (with lib.attrsets; [ 85 - (nameValuePair "libssl.1.1.dylib" openssl_1_1) 86 - (nameValuePair "libcrypto.1.1.dylib" openssl_1_1) 87 - (nameValuePair "libzstd.1.dylib" zstd) 88 - (nameValuePair "liblz4.1.dylib" lz4) 90 + (nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis.1.1.0.dylib" hiredis) 91 + (nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis_ssl.dylib.1.1.0" openssl) 92 + (nameValuePair "/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib" openssl) 93 + (nameValuePair "/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib" openssl) 94 + (nameValuePair "/opt/homebrew/opt/zstd/lib/libzstd.1.dylib" zstd) 95 + (nameValuePair "/opt/homebrew/opt/lz4/lib/liblz4.1.dylib" lz4) 89 96 ]); 90 97 in 91 98 # fixDarwinDylibNames can't be used here because we need to completely remap .dylibs, not just add absolute paths ··· 100 107 101 108 runHook postInstall 102 109 ''; 110 + 111 + passthru = { 112 + updateScript = writeShellScript "update-${finalAttrs.pname}" '' 113 + set -o errexit 114 + export PATH="$PATH:${lib.makeBinPath [ curl common-updater-scripts ]}" 115 + NEW_VERSION=$(curl --silent https://builds.r2.relay.so/meta/builds | tail -n1 | cut -c2-) 116 + 117 + if [[ "${version}" = "$NEW_VERSION" ]]; then 118 + echo "The new version same as the old version." 119 + exit 0 120 + fi 121 + 122 + for source in ${lib.concatStringsSep " " (builtins.attrNames finalAttrs.passthru.updateables)}; do 123 + update-source-version "$UPDATE_NIX_ATTR_PATH.updateables.$source" "0" "sha256-${lib.fakeSha256}" 124 + update-source-version "$UPDATE_NIX_ATTR_PATH.updateables.$source" "$NEW_VERSION" 125 + done 126 + ''; 127 + 128 + # All sources for updating by the update script. 129 + updateables = 130 + builtins.listToAttrs 131 + # Collect all leaf attributes (containing hashes). 132 + (lib.collect 133 + (attrs: attrs ? name) 134 + # create an attr containing 135 + (lib.mapAttrsRecursive 136 + ( 137 + path: _value: 138 + lib.nameValuePair 139 + (builtins.replaceStrings [ "." ] [ "_" ] (lib.concatStringsSep "_" path)) 140 + (finalAttrs.finalPackage.overrideAttrs (attrs: { 141 + src = makeSource { 142 + system = builtins.head path; 143 + phpMajor = builtins.head (builtins.tail (builtins.tail path)); 144 + }; 145 + })) 146 + ) 147 + (lib.filterAttrsRecursive (name: _value: name != "platform") hashes) 148 + ) 149 + ); 150 + }; 103 151 104 152 meta = with lib; { 105 153 description = "Next-generation Redis extension for PHP";