migrate php to nix
This commit is contained in:
parent
dc2c5f3380
commit
3530a79a57
|
@ -1,20 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=$(realpath $(dirname $0))
|
||||
|
||||
mkdir -p build/php
|
||||
cd build
|
||||
|
||||
curl "https://www.php.net/distributions/php-8.0.2.tar.gz" -o php.tar.gz
|
||||
tar xzf php.tar.gz --strip-components=1 -C php
|
||||
|
||||
cd php
|
||||
|
||||
|
||||
./configure --prefix "$PREFIX"
|
||||
|
||||
make -j$(nproc)
|
||||
make install -j$(nproc)
|
||||
|
||||
cd ../../
|
||||
rm -rf build
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "php",
|
||||
"version": "8.0.2",
|
||||
"aliases": ["php8", "html"]
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
php "$@"
|
|
@ -1 +0,0 @@
|
|||
OK
|
|
@ -26,4 +26,5 @@ args: {
|
|||
"powershell" = import ./powershell.nix args;
|
||||
"prolog" = import ./prolog.nix args;
|
||||
"ponylang" = import ./ponylang.nix args;
|
||||
"php" = import ./php.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.php;
|
||||
in piston.mkRuntime {
|
||||
language = "php";
|
||||
version = pkg.version;
|
||||
aliases = [];
|
||||
|
||||
run = ''
|
||||
${pkg}/bin/php "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.php" = ''
|
||||
OK
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.php";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue