add working php 5.3

This commit is contained in:
kolaente 2024-09-28 21:59:31 +02:00
parent 7833353327
commit 404121b160
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 55 additions and 24 deletions

View File

@ -1,24 +0,0 @@
{
description = "A flake using nixpkgs 18.09 with PHP";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-18.09";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
in {
packages.${system} = {
default = pkgs.php;
};
devShell.${system} = pkgs.mkShell {
buildInputs = [ pkgs.php ];
};
};
}

55
shell.nix Normal file
View File

@ -0,0 +1,55 @@
{ pkgs ? import <nixpkgs> {} }:
let
openssl_1_0_2 = pkgs.stdenv.mkDerivation {
name = "openssl-1.0.2u";
src = pkgs.fetchurl {
url = "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz";
sha256 = "ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16";
};
buildInputs = [ pkgs.perl ];
configurePhase = ''
./config --prefix=$out shared
'';
};
php53 = pkgs.stdenv.mkDerivation {
name = "php-5.3.29";
src = pkgs.fetchurl {
url = "https://www.php.net/distributions/php-5.3.29.tar.bz2";
sha256 = "c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091";
};
buildInputs = with pkgs; [
autoconf
automake
bison
flex
libtool
re2c
zlib
libxml2
openssl_1_0_2
curl
pkg-config
];
configureFlags = [
"--with-libxml-dir=${pkgs.libxml2.dev}"
"--with-openssl=${openssl_1_0_2}"
"--with-zlib=${pkgs.zlib.dev}"
"--with-curl=${pkgs.curl.dev}"
];
CPPFLAGS = "-I${openssl_1_0_2}/include";
LDFLAGS = "-L${openssl_1_0_2}/lib";
preConfigure = ''
export PKG_CONFIG_PATH="${openssl_1_0_2}/lib/pkgconfig:$PKG_CONFIG_PATH"
'';
};
in
pkgs.mkShell {
buildInputs = [ php53 ];
shellHook = ''
echo "PHP 5.3 environment loaded"
php --version
'';
}