1{
2 stdenv,
3 lib,
4 fetchzip,
5 php,
6}:
7
8let
9 phpVersion = lib.versions.majorMinor php.version;
10
11 variant = {
12 "aarch64-darwin" = {
13 url = "https://web.archive.org/web/20240209234707/https://downloads.ioncube.com/loader_downloads/ioncube_loaders_dar_arm64.tar.gz";
14 sha256 = "sha256-J6+bOXX9uRdrGouMAxt7nROjjfH4P2txb1hmPoHUmdM=";
15 prefix = "dar";
16 };
17 "aarch64-linux" = {
18 url = "https://web.archive.org/web/20240209234617/https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz";
19 sha256 = "sha256-oOO4zr0CssxVGIUIfmAujILqOfQf8dJPADkr03a8HAs=";
20 prefix = "lin";
21 };
22 "x86_64-linux" = {
23 url = "https://web.archive.org/web/20240209052345if_/https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz";
24 sha256 = "sha256-rsXKgxKHldBKDjJTsOdJP4SxfxLmMPDY+GizBpuDeyw=";
25 prefix = "lin";
26 };
27 "x86_64-darwin" = {
28 url = "https://web.archive.org/web/20240209234406/https://downloads.ioncube.com/loader_downloads/ioncube_loaders_mac_x86-64.tar.gz";
29 sha256 = "sha256-bz2hQOaFbXePa8MhAZHESpZMRjjBH51IgvbR2EfBYMg=";
30 prefix = "mac";
31 };
32 };
33in
34stdenv.mkDerivation {
35 version = "13.0.2";
36 pname = "ioncube-loader";
37 extensionName = "ioncube-loader";
38
39 src = fetchzip {
40 url = variant.${stdenv.hostPlatform.system}.url;
41 sha256 = variant.${stdenv.hostPlatform.system}.sha256;
42 };
43
44 installPhase = ''
45 mkdir -p $out/lib/php/extensions
46 cp $src/ioncube_loader_${
47 variant.${stdenv.hostPlatform.system}.prefix
48 }_${phpVersion}.so $out/lib/php/extensions/ioncube-loader.so
49 '';
50
51 meta = with lib; {
52 description = "Use ionCube-encoded files on a web server";
53 changelog = "https://www.ioncube.com/loaders.php";
54 homepage = "https://www.ioncube.com";
55 sourceProvenance = [ sourceTypes.binaryNativeCode ];
56 license = licenses.unfree;
57 maintainers = with maintainers; [ neverbehave ];
58 platforms = [
59 "x86_64-linux"
60 "aarch64-linux"
61 "x86_64-darwin"
62 "aarch64-darwin"
63 ];
64 };
65}