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