Merge master into staging-next
This commit is contained in:
commit
12aa32e71e
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@ -257,7 +257,8 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
||||
# PHP interpreter, packages, extensions, tests and documentation
|
||||
/doc/languages-frameworks/php.section.md @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/nixos/tests/php @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/pkgs/build-support/build-pecl.nix @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/pkgs/build-support/php/build-pecl.nix @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/pkgs/build-support/php @drupol @etu
|
||||
/pkgs/development/interpreters/php @jtojnar @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/pkgs/development/php-packages @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
/pkgs/top-level/php-packages.nix @jtojnar @aanderse @drupol @etu @globin @ma27 @talyz
|
||||
|
@ -130,6 +130,7 @@ package: a project may depend on certain extensions and `composer`
|
||||
won't work with that project unless those extensions are loaded.
|
||||
|
||||
Example of building `composer` with additional extensions:
|
||||
|
||||
```nix
|
||||
(php.withExtensions ({ all, enabled }:
|
||||
enabled ++ (with all; [ imagick redis ]))
|
||||
@ -138,7 +139,9 @@ Example of building `composer` with additional extensions:
|
||||
|
||||
### Overriding PHP packages {#ssec-php-user-guide-overriding-packages}
|
||||
|
||||
`php-packages.nix` form a scope, allowing us to override the packages defined within. For example, to apply a patch to a `mysqlnd` extension, you can simply pass an overlay-style function to `php`’s `packageOverrides` argument:
|
||||
`php-packages.nix` form a scope, allowing us to override the packages defined
|
||||
within. For example, to apply a patch to a `mysqlnd` extension, you can simply
|
||||
pass an overlay-style function to `php`’s `packageOverrides` argument:
|
||||
|
||||
```nix
|
||||
php.override {
|
||||
@ -153,3 +156,138 @@ php.override {
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### Building PHP projects {#ssec-building-php-projects}
|
||||
|
||||
With [Composer](https://getcomposer.org/), you can effectively build PHP
|
||||
projects by streamlining dependency management. As the de-facto standard
|
||||
dependency manager for PHP, Composer enables you to declare and manage the
|
||||
libraries your project relies on, ensuring a more organized and efficient
|
||||
development process.
|
||||
|
||||
Composer is not a package manager in the same sense as `Yum` or `Apt` are. Yes,
|
||||
it deals with "packages" or libraries, but it manages them on a per-project
|
||||
basis, installing them in a directory (e.g. `vendor`) inside your project. By
|
||||
default, it does not install anything globally. This idea is not new and
|
||||
Composer is strongly inspired by node's `npm` and ruby's `bundler`.
|
||||
|
||||
Currently, there is no other PHP tool that offers the same functionality as
|
||||
Composer. Consequently, incorporating a helper in Nix to facilitate building
|
||||
such applications is a logical choice.
|
||||
|
||||
In a Composer project, dependencies are defined in a `composer.json` file,
|
||||
while their specific versions are locked in a `composer.lock` file. Some
|
||||
Composer-based projects opt to include this `composer.lock` file in their source
|
||||
code, while others choose not to.
|
||||
|
||||
In Nix, there are multiple approaches to building a Composer-based project.
|
||||
|
||||
One such method is the `php.buildComposerProject` helper function, which serves
|
||||
as a wrapper around `mkDerivation`.
|
||||
|
||||
Using this function, you can build a PHP project that includes both a
|
||||
`composer.json` and `composer.lock` file. If the project specifies binaries
|
||||
using the `bin` attribute in `composer.json`, these binaries will be
|
||||
automatically linked and made accessible in the derivation. In this context,
|
||||
"binaries" refer to PHP scripts that are intended to be executable.
|
||||
|
||||
To use the helper effectively, simply add the `vendorHash` attribute, which
|
||||
enables the wrapper to handle the heavy lifting.
|
||||
|
||||
Internally, the helper operates in three stages:
|
||||
|
||||
1. It constructs a `composerRepository` attribute derivation by creating a
|
||||
composer repository on the filesystem containing dependencies specified in
|
||||
`composer.json`. This process uses the function
|
||||
`php.mkComposerRepository` which in turn uses the
|
||||
`php.composerHooks.composerRepositoryHook` hook. Internaly this function uses
|
||||
a custom
|
||||
[Composer plugin](https://github.com/nix-community/composer-local-repo-plugin) to
|
||||
generate the repository.
|
||||
2. The resulting `composerRepository` derivation is then used by the
|
||||
`php.composerHooks.composerInstallHook` hook, which is responsible for
|
||||
creating the final `vendor` directory.
|
||||
3. Any "binary" specified in the `composer.json` are linked and made accessible
|
||||
in the derivation.
|
||||
|
||||
As the autoloader optimization can be activated directly within the
|
||||
`composer.json` file, we do not enable any autoloader optimization flags.
|
||||
|
||||
To customize the PHP version, you can specify the `php` attribute. Similarly, if
|
||||
you wish to modify the Composer version, use the `composer` attribute. It is
|
||||
important to note that both attributes should be of the `derivation` type.
|
||||
|
||||
Here's an example of working code example using `php.buildComposerProject`:
|
||||
|
||||
```nix
|
||||
{ php, fetchFromGitHub }:
|
||||
|
||||
php.buildComposerProject (finalAttrs: {
|
||||
pname = "php-app";
|
||||
version = "1.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "git-owner";
|
||||
repo = "git-repo";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
|
||||
};
|
||||
|
||||
# PHP version containing the `ast` extension enabled
|
||||
php = php.buildEnv {
|
||||
extensions = ({ enabled, all }: enabled ++ (with all; [
|
||||
ast
|
||||
]));
|
||||
};
|
||||
|
||||
# The composer vendor hash
|
||||
vendorHash = "sha256-86s/F+/5cBAwBqZ2yaGRM5rTGLmou5//aLRK5SA0WiQ=";
|
||||
|
||||
# If the composer.lock file is missing from the repository, add it:
|
||||
# composerLock = ./path/to/composer.lock;
|
||||
})
|
||||
```
|
||||
|
||||
In case the file `composer.lock` is missing from the repository, it is possible
|
||||
to specify it using the `composerLock` attribute.
|
||||
|
||||
The other method is to use all these methods and hooks individually. This has
|
||||
the advantage of building a PHP library within another derivation very easily
|
||||
when necessary.
|
||||
|
||||
Here's a working code example to build a PHP library using `mkDerivation` and
|
||||
separate functions and hooks:
|
||||
|
||||
```nix
|
||||
{ stdenvNoCC, fetchFromGitHub, php }:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs:
|
||||
let
|
||||
src = fetchFromGitHub {
|
||||
owner = "git-owner";
|
||||
repo = "git-repo";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
|
||||
};
|
||||
in {
|
||||
inherit src;
|
||||
pname = "php-app";
|
||||
version = "1.0.0";
|
||||
|
||||
buildInputs = [ php ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
php.packages.composer
|
||||
# This hook will use the attribute `composerRepository`
|
||||
php.composerHooks.composerInstallHook
|
||||
];
|
||||
|
||||
composerRepository = php.mkComposerRepository {
|
||||
inherit (finalAttrs) src;
|
||||
# Specifying a custom composer.lock since it is not present in the sources.
|
||||
composerLock = ./composer.lock;
|
||||
# The composer vendor hash
|
||||
vendorHash = "sha256-86s/F+/5cBAwBqZ2yaGRM5rTGLmou5//aLRK5SA0WiQ=";
|
||||
};
|
||||
})
|
||||
```
|
||||
|
@ -301,6 +301,12 @@
|
||||
githubId = 1174810;
|
||||
name = "Nikolay Amiantov";
|
||||
};
|
||||
abdiramen = {
|
||||
email = "abdirahman.osmanthus@gmail.com";
|
||||
github = "Abdiramen";
|
||||
githubId = 15805292;
|
||||
name = "Abdirahman Osman";
|
||||
};
|
||||
abhi18av = {
|
||||
email = "abhi18av@gmail.com";
|
||||
github = "abhi18av";
|
||||
|
@ -6,27 +6,27 @@
|
||||
, gettext
|
||||
, appstream
|
||||
, appstream-glib
|
||||
, wrapGAppsHook
|
||||
, wrapGAppsHook4
|
||||
, desktop-file-utils
|
||||
, gobject-introspection
|
||||
, gtksourceview4
|
||||
, gspell
|
||||
, libhandy
|
||||
, poppler_gi
|
||||
, webkitgtk_4_1
|
||||
, librsvg
|
||||
, gtk4
|
||||
, gtksourceview5
|
||||
, libadwaita
|
||||
, libportal
|
||||
, librsvg
|
||||
, poppler_gi
|
||||
, webkitgtk_6_0
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "setzer";
|
||||
version = "56";
|
||||
version = "59";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cvfosammmm";
|
||||
repo = "Setzer";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-YCJu8EU+8RD09QNVT/RYF2ZJZ7cp+oawXThqTzg8ENQ=";
|
||||
hash = "sha256-PmkEOOi30Fa8VXNmKPvp6UAaw74MID9uTaCzXs9vPpk=";
|
||||
};
|
||||
|
||||
format = "other";
|
||||
@ -37,28 +37,28 @@ python3.pkgs.buildPythonApplication rec {
|
||||
gettext
|
||||
appstream # for appstreamcli
|
||||
appstream-glib
|
||||
wrapGAppsHook
|
||||
wrapGAppsHook4
|
||||
desktop-file-utils
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gtksourceview4
|
||||
gspell
|
||||
libhandy
|
||||
poppler_gi
|
||||
webkitgtk_4_1
|
||||
librsvg
|
||||
gtk4
|
||||
gtksourceview5
|
||||
libadwaita
|
||||
libportal
|
||||
librsvg
|
||||
poppler_gi
|
||||
webkitgtk_6_0
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
bibtexparser
|
||||
pdfminer-six
|
||||
pexpect
|
||||
pycairo
|
||||
pygobject3
|
||||
pyxdg
|
||||
pdfminer-six
|
||||
pycairo
|
||||
pexpect
|
||||
bibtexparser
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
|
@ -10,11 +10,14 @@
|
||||
, readline
|
||||
, which
|
||||
, musl-fts
|
||||
, pcre
|
||||
# options
|
||||
, conf ? null
|
||||
, withIcons ? false
|
||||
, withNerdIcons ? false
|
||||
, withEmojis ? false
|
||||
, withPcre ? false
|
||||
, extraMakeFlags ? [ ]
|
||||
}:
|
||||
|
||||
# Mutually exclusive options
|
||||
@ -44,7 +47,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
preBuild = lib.optionalString (conf != null) "cp ${finalAttrs.configFile} src/nnn.h";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
|
||||
buildInputs = [ readline ncurses ] ++ lib.optional stdenv.hostPlatform.isMusl musl-fts;
|
||||
buildInputs = [ readline ncurses ]
|
||||
++ lib.optional stdenv.hostPlatform.isMusl musl-fts
|
||||
++ lib.optional withPcre pcre;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-I${musl-fts}/include";
|
||||
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts";
|
||||
@ -52,7 +57,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
makeFlags = [ "PREFIX=$(out)" ]
|
||||
++ lib.optionals withIcons [ "O_ICONS=1" ]
|
||||
++ lib.optionals withNerdIcons [ "O_NERD=1" ]
|
||||
++ lib.optionals withEmojis [ "O_EMOJI=1" ];
|
||||
++ lib.optionals withEmojis [ "O_EMOJI=1" ]
|
||||
++ lib.optionals withPcre [ "O_PCRE=1" ]
|
||||
++ extraMakeFlags;
|
||||
|
||||
binPath = lib.makeBinPath [ file which ];
|
||||
|
||||
@ -63,6 +70,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
installShellCompletion --fish misc/auto-completion/fish/nnn.fish
|
||||
installShellCompletion --zsh misc/auto-completion/zsh/_nnn
|
||||
|
||||
cp -r plugins $out/share
|
||||
cp -r misc/quitcd $out/share/quitcd
|
||||
|
||||
wrapProgram $out/bin/nnn --prefix PATH : "$binPath"
|
||||
'';
|
||||
|
||||
|
@ -27,14 +27,14 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "boinc";
|
||||
version = "7.22.2";
|
||||
version = "7.24.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
name = "${pname}-${version}-src";
|
||||
owner = "BOINC";
|
||||
repo = "boinc";
|
||||
rev = "client_release/${lib.versions.majorMinor version}/${version}";
|
||||
hash = "sha256-9GgvyYiDfppRuDFfxn50e+YZeSX0SLKSfo31lWx2FBs=";
|
||||
hash = "sha256-CAzAKxNHG8ew9v2B1jK7MxfWGwTfdmDncDe7QT+twd8=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ libtool automake autoconf m4 pkg-config ];
|
||||
|
@ -1,25 +1,25 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pdm-backend
|
||||
, hatchling
|
||||
, more-itertools
|
||||
, click
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "hyprshade";
|
||||
version = "0.9.3";
|
||||
version = "0.12.1";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "loqusion";
|
||||
repo = "hyprshade";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-ou072V9nZUqf5DEolkMQy979SjaZs4iOuoszw50k4Y8=";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-xcFX1YApwEN40jPgRT0H/7SiODxXGYVTPUkSZ8OFIWs=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pdm-backend
|
||||
hatchling
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ more-itertools click ];
|
||||
|
71
pkgs/build-support/php/build-composer-project.nix
Normal file
71
pkgs/build-support/php/build-composer-project.nix
Normal file
@ -0,0 +1,71 @@
|
||||
{ callPackage, stdenvNoCC, lib, writeTextDir, php, makeBinaryWrapper, fetchFromGitHub, fetchurl }:
|
||||
|
||||
let
|
||||
buildComposerProjectOverride = finalAttrs: previousAttrs:
|
||||
|
||||
let
|
||||
phpDrv = finalAttrs.php or php;
|
||||
composer = finalAttrs.composer or phpDrv.packages.composer;
|
||||
composer-local-repo-plugin = callPackage ./pkgs/composer-local-repo-plugin.nix { };
|
||||
in
|
||||
{
|
||||
composerLock = previousAttrs.composerLock or null;
|
||||
composerNoDev = previousAttrs.composerNoDev or true;
|
||||
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
||||
composerNoScripts = previousAttrs.composerNoScripts or true;
|
||||
|
||||
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [
|
||||
composer
|
||||
composer-local-repo-plugin
|
||||
phpDrv.composerHooks.composerInstallHook
|
||||
];
|
||||
|
||||
buildInputs = (previousAttrs.buildInputs or [ ]) ++ [
|
||||
phpDrv
|
||||
];
|
||||
|
||||
patches = previousAttrs.patches or [ ];
|
||||
strictDeps = previousAttrs.strictDeps or true;
|
||||
|
||||
# Should we keep these empty phases?
|
||||
configurePhase = previousAttrs.configurePhase or ''
|
||||
runHook preConfigure
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = previousAttrs.buildPhase or ''
|
||||
runHook preBuild
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
doCheck = previousAttrs.doCheck or true;
|
||||
checkPhase = previousAttrs.checkPhase or ''
|
||||
runHook preCheck
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = previousAttrs.installPhase or ''
|
||||
runHook preInstall
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
composerRepository = phpDrv.mkComposerRepository {
|
||||
inherit composer composer-local-repo-plugin;
|
||||
inherit (finalAttrs) patches pname src vendorHash version;
|
||||
|
||||
composerLock = previousAttrs.composerLock or null;
|
||||
composerNoDev = previousAttrs.composerNoDev or true;
|
||||
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
||||
composerNoScripts = previousAttrs.composerNoScripts or true;
|
||||
};
|
||||
|
||||
meta = previousAttrs.meta or { } // {
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
};
|
||||
in
|
||||
args: (stdenvNoCC.mkDerivation args).overrideAttrs buildComposerProjectOverride
|
87
pkgs/build-support/php/build-composer-repository.nix
Normal file
87
pkgs/build-support/php/build-composer-repository.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{ callPackage, stdenvNoCC, lib, writeTextDir, fetchFromGitHub, php }:
|
||||
|
||||
let
|
||||
mkComposerRepositoryOverride =
|
||||
/*
|
||||
We cannot destruct finalAttrs since the attrset below is used to construct it
|
||||
and Nix currently does not support lazy attribute names.
|
||||
{
|
||||
php ? null,
|
||||
composer ? null,
|
||||
composerLock ? "composer.lock",
|
||||
src,
|
||||
vendorHash,
|
||||
...
|
||||
}@finalAttrs:
|
||||
*/
|
||||
finalAttrs: previousAttrs:
|
||||
|
||||
let
|
||||
phpDrv = finalAttrs.php or php;
|
||||
composer = finalAttrs.composer or phpDrv.packages.composer;
|
||||
composer-local-repo-plugin = callPackage ./pkgs/composer-local-repo-plugin.nix { };
|
||||
in
|
||||
assert (lib.assertMsg (previousAttrs ? src) "mkComposerRepository expects src argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? vendorHash) "mkComposerRepository expects vendorHash argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? version) "mkComposerRepository expects version argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? pname) "mkComposerRepository expects pname argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? composerNoDev) "mkComposerRepository expects composerNoDev argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? composerNoPlugins) "mkComposerRepository expects composerNoPlugins argument.");
|
||||
assert (lib.assertMsg (previousAttrs ? composerNoScripts) "mkComposerRepository expects composerNoScripts argument.");
|
||||
{
|
||||
composerNoDev = previousAttrs.composerNoDev or true;
|
||||
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
||||
composerNoScripts = previousAttrs.composerNoScripts or true;
|
||||
|
||||
name = "${previousAttrs.pname}-${previousAttrs.version}-composer-repository";
|
||||
|
||||
# See https://github.com/NixOS/nix/issues/6660
|
||||
dontPatchShebangs = previousAttrs.dontPatchShebangs or true;
|
||||
|
||||
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [
|
||||
composer
|
||||
composer-local-repo-plugin
|
||||
phpDrv.composerHooks.composerRepositoryHook
|
||||
];
|
||||
|
||||
buildInputs = previousAttrs.buildInputs or [ ];
|
||||
|
||||
strictDeps = previousAttrs.strictDeps or true;
|
||||
|
||||
# Should we keep these empty phases?
|
||||
configurePhase = previousAttrs.configurePhase or ''
|
||||
runHook preConfigure
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = previousAttrs.buildPhase or ''
|
||||
runHook preBuild
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
doCheck = previousAttrs.doCheck or true;
|
||||
checkPhase = previousAttrs.checkPhase or ''
|
||||
runHook preCheck
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = previousAttrs.installPhase or ''
|
||||
runHook preInstall
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
COMPOSER_CACHE_DIR = "/dev/null";
|
||||
COMPOSER_MIRROR_PATH_REPOS = "1";
|
||||
COMPOSER_HTACCESS_PROTECT = "0";
|
||||
COMPOSER_DISABLE_NETWORK = "0";
|
||||
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = if (finalAttrs ? vendorHash && finalAttrs.vendorHash != "") then null else "sha256";
|
||||
outputHash = finalAttrs.vendorHash or "";
|
||||
};
|
||||
in
|
||||
args: (stdenvNoCC.mkDerivation args).overrideAttrs mkComposerRepositoryOverride
|
113
pkgs/build-support/php/hooks/composer-install-hook.sh
Normal file
113
pkgs/build-support/php/hooks/composer-install-hook.sh
Normal file
@ -0,0 +1,113 @@
|
||||
declare composerRepository
|
||||
declare version
|
||||
declare composerNoDev
|
||||
declare composerNoPlugins
|
||||
declare composerNoScripts
|
||||
|
||||
preConfigureHooks+=(composerInstallConfigureHook)
|
||||
preBuildHooks+=(composerInstallBuildHook)
|
||||
preCheckHooks+=(composerInstallCheckHook)
|
||||
preInstallHooks+=(composerInstallInstallHook)
|
||||
|
||||
composerInstallConfigureHook() {
|
||||
echo "Executing composerInstallConfigureHook"
|
||||
|
||||
if [[ ! -e "${composerRepository}" ]]; then
|
||||
echo "No local composer repository found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -e "$composerLock" ]]; then
|
||||
cp "$composerLock" composer.lock
|
||||
fi
|
||||
|
||||
if [[ ! -f "composer.lock" ]]; then
|
||||
echo "No composer.lock file found, consider adding one to your repository to ensure reproducible builds."
|
||||
|
||||
if [[ -f "${composerRepository}/composer.lock" ]]; then
|
||||
cp ${composerRepository}/composer.lock composer.lock
|
||||
fi
|
||||
|
||||
echo "Using an autogenerated composer.lock file."
|
||||
fi
|
||||
|
||||
chmod +w composer.json composer.lock
|
||||
|
||||
echo "Finished composerInstallConfigureHook"
|
||||
}
|
||||
|
||||
composerInstallBuildHook() {
|
||||
echo "Executing composerInstallBuildHook"
|
||||
|
||||
# Since this file cannot be generated in the composer-repository-hook.sh
|
||||
# because the file contains hardcoded nix store paths, we generate it here.
|
||||
composer-local-repo-plugin --no-ansi build-local-repo -p "${composerRepository}" > packages.json
|
||||
|
||||
# Remove all the repositories of type "composer"
|
||||
# from the composer.json file.
|
||||
jq -r -c 'del(try .repositories[] | select(.type == "composer"))' composer.json | sponge composer.json
|
||||
|
||||
# Configure composer to disable packagist and avoid using the network.
|
||||
composer config repo.packagist false
|
||||
# Configure composer to use the local repository.
|
||||
composer config repo.composer composer file://"$PWD"/packages.json
|
||||
|
||||
# Since the composer.json file has been modified in the previous step, the
|
||||
# composer.lock file needs to be updated.
|
||||
COMPOSER_DISABLE_NETWORK=1 \
|
||||
COMPOSER_ROOT_VERSION="${version}" \
|
||||
composer \
|
||||
--lock \
|
||||
--no-ansi \
|
||||
--no-install \
|
||||
--no-interaction \
|
||||
${composerNoDev:+--no-dev} \
|
||||
${composerNoPlugins:+--no-plugins} \
|
||||
${composerNoScripts:+--no-scripts} \
|
||||
update
|
||||
|
||||
echo "Finished composerInstallBuildHook"
|
||||
}
|
||||
|
||||
composerInstallCheckHook() {
|
||||
echo "Executing composerInstallCheckHook"
|
||||
|
||||
composer validate --no-ansi --no-interaction
|
||||
|
||||
echo "Finished composerInstallCheckHook"
|
||||
}
|
||||
|
||||
composerInstallInstallHook() {
|
||||
echo "Executing composerInstallInstallHook"
|
||||
|
||||
# Finally, run `composer install` to install the dependencies and generate
|
||||
# the autoloader.
|
||||
# The COMPOSER_ROOT_VERSION environment variable is needed only for
|
||||
# vimeo/psalm.
|
||||
COMPOSER_CACHE_DIR=/dev/null \
|
||||
COMPOSER_DISABLE_NETWORK=1 \
|
||||
COMPOSER_ROOT_VERSION="${version}" \
|
||||
COMPOSER_MIRROR_PATH_REPOS="1" \
|
||||
composer \
|
||||
--no-ansi \
|
||||
--no-interaction \
|
||||
${composerNoDev:+--no-dev} \
|
||||
${composerNoPlugins:+--no-plugins} \
|
||||
${composerNoScripts:+--no-scripts} \
|
||||
install
|
||||
|
||||
# Remove packages.json, we don't need it in the store.
|
||||
rm packages.json
|
||||
|
||||
# Copy the relevant files only in the store.
|
||||
mkdir -p "$out"/share/php/"${pname}"
|
||||
cp -r . "$out"/share/php/"${pname}"/
|
||||
|
||||
# Create symlinks for the binaries.
|
||||
jq -r -c 'try .bin[]' composer.json | while read -r bin; do
|
||||
mkdir -p "$out"/share/php/"${pname}" "$out"/bin
|
||||
ln -s "$out"/share/php/"${pname}"/"$bin" "$out"/bin/"$(basename "$bin")"
|
||||
done
|
||||
|
||||
echo "Finished composerInstallInstallHook"
|
||||
}
|
69
pkgs/build-support/php/hooks/composer-repository-hook.sh
Normal file
69
pkgs/build-support/php/hooks/composer-repository-hook.sh
Normal file
@ -0,0 +1,69 @@
|
||||
declare composerLock
|
||||
declare version
|
||||
declare composerNoDev
|
||||
declare composerNoPlugins
|
||||
declare composerNoScripts
|
||||
|
||||
preConfigureHooks+=(composerRepositoryConfigureHook)
|
||||
preBuildHooks+=(composerRepositoryBuildHook)
|
||||
preCheckHooks+=(composerRepositoryCheckHook)
|
||||
preInstallHooks+=(composerRepositoryInstallHook)
|
||||
|
||||
composerRepositoryConfigureHook() {
|
||||
echo "Executing composerRepositoryConfigureHook"
|
||||
|
||||
if [[ -e "$composerLock" ]]; then
|
||||
cp $composerLock composer.lock
|
||||
fi
|
||||
|
||||
if [[ ! -f "composer.lock" ]]; then
|
||||
echo "No composer.lock file found, consider adding one to your repository to ensure reproducible builds."
|
||||
composer \
|
||||
--no-ansi \
|
||||
--no-install \
|
||||
--no-interaction \
|
||||
${composerNoDev:+--no-dev} \
|
||||
${composerNoPlugins:+--no-plugins} \
|
||||
${composerNoScripts:+--no-scripts} \
|
||||
update
|
||||
echo "Using an autogenerated composer.lock file."
|
||||
fi
|
||||
|
||||
echo "Finished composerRepositoryConfigureHook"
|
||||
}
|
||||
|
||||
composerRepositoryBuildHook() {
|
||||
echo "Executing composerRepositoryBuildHook"
|
||||
|
||||
mkdir -p repository
|
||||
|
||||
# Build the local composer repository
|
||||
# The command 'build-local-repo' is provided by the Composer plugin
|
||||
# nix-community/composer-local-repo-plugin.
|
||||
COMPOSER_CACHE_DIR=/dev/null \
|
||||
composer-local-repo-plugin --no-ansi build-local-repo ${composerNoDev:+--no-dev} -r repository
|
||||
|
||||
echo "Finished composerRepositoryBuildHook"
|
||||
}
|
||||
|
||||
composerRepositoryCheckHook() {
|
||||
echo "Executing composerRepositoryCheckHook"
|
||||
|
||||
composer validate --no-ansi --no-interaction
|
||||
|
||||
echo "Finished composerRepositoryCheckHook"
|
||||
}
|
||||
|
||||
composerRepositoryInstallHook() {
|
||||
echo "Executing composerRepositoryInstallHook"
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
cp -ar repository/. $out/
|
||||
|
||||
# Copy the composer.lock files to the output directory, in case it has been
|
||||
# autogenerated.
|
||||
cp composer.lock $out/
|
||||
|
||||
echo "Finished composerRepositoryInstallHook"
|
||||
}
|
21
pkgs/build-support/php/hooks/default.nix
Normal file
21
pkgs/build-support/php/hooks/default.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ makeSetupHook
|
||||
, php
|
||||
, jq
|
||||
, moreutils
|
||||
}:
|
||||
|
||||
{
|
||||
composerRepositoryHook = makeSetupHook
|
||||
{
|
||||
name = "composer-repository-hook.sh";
|
||||
propagatedBuildInputs = [ php jq moreutils ];
|
||||
substitutions = { };
|
||||
} ./composer-repository-hook.sh;
|
||||
|
||||
composerInstallHook = makeSetupHook
|
||||
{
|
||||
name = "composer-install-hook.sh";
|
||||
propagatedBuildInputs = [ php jq moreutils ];
|
||||
substitutions = { };
|
||||
} ./composer-install-hook.sh;
|
||||
}
|
112
pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix
Normal file
112
pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix
Normal file
@ -0,0 +1,112 @@
|
||||
{ callPackage, stdenvNoCC, lib, fetchFromGitHub, makeBinaryWrapper }:
|
||||
|
||||
let
|
||||
composer = callPackage ./composer-phar.nix { };
|
||||
|
||||
composerKeys = stdenvNoCC.mkDerivation (finalComposerKeysAttrs: {
|
||||
pname = "composer-keys";
|
||||
version = "fa5a62092f33e094073fbda23bbfc7188df3cbc5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "composer";
|
||||
repo = "composer.github.io";
|
||||
rev = "${finalComposerKeysAttrs.version}";
|
||||
hash = "sha256-3Sfn71LDG1jHwuEIU8iEnV3k6D6QTX7KVIKVaNSuCVE=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
install releases.pub $out/keys.tags.pub
|
||||
install snapshots.pub $out/keys.dev.pub
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
in
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "composer-local-repo-plugin";
|
||||
version = "1.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nix-community";
|
||||
repo = "composer-local-repo-plugin";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-sjWV4JXK8YJ5XLASMPipKlk9u57352wIDV2PPFIP+sk=";
|
||||
};
|
||||
|
||||
COMPOSER_CACHE_DIR = "/dev/null";
|
||||
COMPOSER_MIRROR_PATH_REPOS = "1";
|
||||
COMPOSER_HTACCESS_PROTECT = "0";
|
||||
COMPOSER_DISABLE_NETWORK = "1";
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
composer
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
export COMPOSER_HOME=${placeholder "out"}
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# Configure composer globally
|
||||
composer global init --quiet --no-interaction --no-ansi \
|
||||
--name="nixos/composer" \
|
||||
--homepage "https://nixos.org/" \
|
||||
--description "Composer with nix-community/composer-local-repo-plugin" \
|
||||
--license "MIT"
|
||||
|
||||
composer global config --quiet minimum-stability dev
|
||||
composer global config --quiet prefer-stable true
|
||||
composer global config --quiet autoloader-suffix "nixPredictableAutoloaderSuffix"
|
||||
composer global config --quiet apcu-autoloader false
|
||||
composer global config --quiet allow-plugins.nix-community/composer-local-repo-plugin true
|
||||
composer global config --quiet repo.packagist false
|
||||
composer global config --quiet repo.plugin path $src
|
||||
|
||||
# Install the local repository plugin
|
||||
composer global require --quiet --no-ansi --no-interaction nix-community/composer-local-repo-plugin
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
composer global validate --no-ansi
|
||||
composer global show --no-ansi nix-community/composer-local-repo-plugin
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp -ar ${composerKeys}/* $out/
|
||||
|
||||
makeWrapper ${composer}/bin/composer $out/bin/composer-local-repo-plugin \
|
||||
--prefix COMPOSER_HOME : $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Composer local repo plugin for Composer";
|
||||
homepage = "https://github.com/nix-community/composer-local-repo-plugin";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ drupol ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
48
pkgs/build-support/php/pkgs/composer-phar.nix
Normal file
48
pkgs/build-support/php/pkgs/composer-phar.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
_7zz
|
||||
, cacert
|
||||
, curl
|
||||
, fetchurl
|
||||
, git
|
||||
, lib
|
||||
, makeBinaryWrapper
|
||||
, php
|
||||
, stdenvNoCC
|
||||
, unzip
|
||||
, xz
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "composer-phar";
|
||||
version = "2.6.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/composer/composer/releases/download/${finalAttrs.version}/composer.phar";
|
||||
hash = "sha256-iMhNSlP88cJ9Z2Lh1da3DVfG3J0uIxT9Cdv4a/YeGu8=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
install -D $src $out/libexec/composer/composer.phar
|
||||
makeWrapper ${php}/bin/php $out/bin/composer \
|
||||
--add-flags "$out/libexec/composer/composer.phar" \
|
||||
--prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/composer/composer/releases/tag/${finalAttrs.version}";
|
||||
description = "Dependency Manager for PHP, shipped from the PHAR file";
|
||||
homepage = "https://getcomposer.org/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ drupol ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
@ -159,7 +159,7 @@ let
|
||||
nixos = lib.recurseIntoAttrs nixosTests."php${lib.strings.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor php.version)}";
|
||||
package = tests.php;
|
||||
};
|
||||
inherit (php-packages) extensions buildPecl mkExtension;
|
||||
inherit (php-packages) extensions buildPecl mkComposerRepository buildComposerProject composerHooks mkExtension;
|
||||
packages = php-packages.tools;
|
||||
meta = php.meta // {
|
||||
outputsToInstall = [ "out" ];
|
||||
|
@ -242,6 +242,14 @@ stdenv.mkDerivation rec {
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
doInstallCheck = (lib.elem "webp" selectedPlugins) && !stdenv.hostPlatform.isStatic &&
|
||||
stdenv.hostPlatform.parsed.kernel.execFormat == lib.systems.parse.execFormats.elf;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
readelf -a $out/lib/gstreamer-1.0/libgstrswebp.so | grep -F 'Shared library: [libwebpdemux.so'
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
# use numbered releases rather than gstreamer-* releases
|
||||
extraArgs = [ "--version-regex" "([0-9.]+)" ];
|
||||
|
@ -1,23 +1,32 @@
|
||||
{lib, stdenv, fetchurl, autoreconfHook, texinfo, mpfr}:
|
||||
{lib, stdenv, fetchFromGitLab, autoreconfHook, texinfo, mpfr}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mpfi";
|
||||
version = "1.5.4";
|
||||
file_nr = "38111";
|
||||
|
||||
src = fetchurl {
|
||||
# NOTE: the file_nr is whats important here. The actual package name (including the version)
|
||||
# is ignored. To find out the correct file_nr, go to https://gforge.inria.fr/projects/mpfi/
|
||||
# and click on Download in the section "Latest File Releases".
|
||||
url = "https://gforge.inria.fr/frs/download.php/file/${file_nr}/mpfi-${version}.tgz";
|
||||
sha256 = "sha256-Ozk4WV1yCvF5c96vcnz8DdQcixbCCtwQOpcPSkOuOlY=";
|
||||
src = fetchFromGitLab {
|
||||
domain = "gitlab.inria.fr";
|
||||
owner = "mpfi";
|
||||
repo = "mpfi";
|
||||
|
||||
# Apparently there is an upstream off-by-one-commit error in tagging
|
||||
# Conditional to allow auto-updaters to try new releases
|
||||
# TODO: remove the conditional after an upstream update
|
||||
# rev = version;
|
||||
rev = if version == "1.5.4" then
|
||||
"feab26bc54529417af983950ddbffb3a4c334d4f"
|
||||
else version;
|
||||
|
||||
sha256 = "sha256-aj/QmJ38ifsW36JFQcbp55aIQRvOpiqLHwEh/aFXsgo=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/mpfi";
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook texinfo ];
|
||||
buildInputs = [ mpfr ];
|
||||
|
||||
meta = {
|
||||
description = "A multiple precision interval arithmetic library based on MPFR";
|
||||
homepage = "https://gforge.inria.fr/projects/mpfi/";
|
||||
homepage = "http://perso.ens-lyon.fr/nathalie.revol/software.html";
|
||||
license = lib.licenses.lgpl21Plus;
|
||||
maintainers = [lib.maintainers.raskin];
|
||||
platforms = lib.platforms.unix;
|
||||
|
@ -1,33 +1,32 @@
|
||||
{ mkDerivation, fetchurl, makeBinaryWrapper, unzip, lib, php }:
|
||||
{ lib, callPackage, fetchFromGitHub, php, unzip, _7zz, xz, git, curl, cacert, makeBinaryWrapper }:
|
||||
|
||||
php.buildComposerProject (finalAttrs: {
|
||||
composer = callPackage ../../../build-support/php/pkgs/composer-phar.nix { };
|
||||
|
||||
mkDerivation (finalAttrs: {
|
||||
pname = "composer";
|
||||
version = "2.6.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/composer/composer/releases/download/${finalAttrs.version}/composer.phar";
|
||||
hash = "sha256-iMhNSlP88cJ9Z2Lh1da3DVfG3J0uIxT9Cdv4a/YeGu8=";
|
||||
src = fetchFromGitHub {
|
||||
owner = "composer";
|
||||
repo = "composer";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-tNc0hP41aRk7MmeWXCd73uHxK9pk1tCWyjiSO568qbE=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install -D $src $out/libexec/composer/composer.phar
|
||||
makeWrapper ${php}/bin/php $out/bin/composer \
|
||||
--add-flags "$out/libexec/composer/composer.phar" \
|
||||
--prefix PATH : ${lib.makeBinPath [ unzip ]}
|
||||
runHook postInstall
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/composer \
|
||||
--prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]}
|
||||
'';
|
||||
|
||||
vendorHash = "sha256-V6C4LxEfXNWH/pCKATv1gf8f6/a0s/xu5j5bNJUNmnA=";
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/composer/composer/releases/tag/${finalAttrs.version}";
|
||||
description = "Dependency Manager for PHP";
|
||||
homepage = "https://getcomposer.org/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ offline ] ++ lib.teams.php.members;
|
||||
maintainers = lib.teams.php.members;
|
||||
};
|
||||
})
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "authheaders";
|
||||
version = "0.15.2";
|
||||
version = "0.15.3";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -21,7 +21,7 @@ buildPythonPackage rec {
|
||||
owner = "ValiMail";
|
||||
repo = "authentication-headers";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-vtLt7JUdLF0gBWgMzP65UAR6A9BnTech5n0alFErcSQ=";
|
||||
hash = "sha256-96fCx5uN7yegTrCN+LSjtu4u3RL+dcxV/Puyo0eziI8=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
87
pkgs/development/python-modules/cachier/default.nix
Normal file
87
pkgs/development/python-modules/cachier/default.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, fetchPypi
|
||||
, pythonRelaxDepsHook
|
||||
, setuptools
|
||||
, watchdog
|
||||
, portalocker
|
||||
, pathtools
|
||||
, pytestCheckHook
|
||||
, pymongo
|
||||
, dnspython
|
||||
, pymongo-inmemory
|
||||
, pandas
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "cachier";
|
||||
version = "2.2.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-nm98LT87Z7yErKvIqMp93OEX9TDojqqtItgryHgSQJQ=";
|
||||
};
|
||||
|
||||
pythonRemoveDeps = [ "setuptools" ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pythonRelaxDepsHook
|
||||
setuptools
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
watchdog
|
||||
portalocker
|
||||
pathtools
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
substituteInPlace pytest.ini \
|
||||
--replace \
|
||||
"--cov" \
|
||||
"#--cov"
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
pymongo
|
||||
dnspython
|
||||
pymongo-inmemory
|
||||
pandas
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# touches network
|
||||
"test_mongetter_default_param"
|
||||
"test_stale_after_applies_dynamically"
|
||||
"test_next_time_applies_dynamically"
|
||||
"test_wait_for_calc_"
|
||||
"test_precache_value"
|
||||
"test_ignore_self_in_methods"
|
||||
"test_mongo_index_creation"
|
||||
"test_mongo_core"
|
||||
|
||||
# don't test formatting
|
||||
"test_flake8"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export HOME="$(mktemp -d)"
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
"cachier"
|
||||
"cachier.scripts"
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/python-cachier/cachier";
|
||||
description = "Persistent, stale-free, local and cross-machine caching for functions";
|
||||
maintainers = with lib.maintainers; [ pbsds ];
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "checkdmarc";
|
||||
version = "4.8.0";
|
||||
version = "4.8.4";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -24,9 +24,8 @@ buildPythonPackage rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "domainaware";
|
||||
repo = "checkdmarc";
|
||||
# https://github.com/domainaware/checkdmarc/issues/102
|
||||
rev = "d0364ceef3cfd41052273913369e3831cb6fe4fd";
|
||||
hash = "sha256-OSljewDeyJtoxkCQjPU9wIsNhhxumHmeu9GHvRD4DRY=";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-NNB5dYQzzdNapjP4mtpCW08BzfZ+FFRESUtpxCOzrdk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "dbus-fast";
|
||||
version = "2.2.0";
|
||||
version = "2.7.0";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -22,7 +22,7 @@ buildPythonPackage rec {
|
||||
owner = "Bluetooth-Devices";
|
||||
repo = pname;
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-47Z8szHVBz8Sx7g+WiKfLzg3MIFTyMjPLDlgGfPb//U=";
|
||||
hash = "sha256-o75N/msocSYBe3tTLYGJbqMnbiQb/t3nfJIDDr6kPxM=";
|
||||
};
|
||||
|
||||
# The project can build both an optimized cython version and an unoptimized
|
||||
|
65
pkgs/development/python-modules/pymongo-inmemory/default.nix
Normal file
65
pkgs/development/python-modules/pymongo-inmemory/default.nix
Normal file
@ -0,0 +1,65 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, poetry-core
|
||||
, pymongo
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pymongo-inmemory";
|
||||
version = "0.3.1";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kaizendorks";
|
||||
repo = "pymongo_inmemory";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-1v36cI6JjDZA/uJE85NSMNnoyKI1VCgDrymfnCkpVqU=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# move cache location from nix store to home
|
||||
substituteInPlace pymongo_inmemory/context.py \
|
||||
--replace \
|
||||
'CACHE_FOLDER = path.join(path.dirname(__file__), "..", ".cache")' \
|
||||
'CACHE_FOLDER = os.environ.get("XDG_CACHE_HOME", os.environ["HOME"] + "/.cache") + "/pymongo-inmemory"'
|
||||
|
||||
# fix a broken assumption arising from the above fix
|
||||
substituteInPlace pymongo_inmemory/_utils.py \
|
||||
--replace \
|
||||
'os.mkdir(current_path)' \
|
||||
'os.makedirs(current_path)'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
poetry-core
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pymongo
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export HOME="$(mktemp -d)"
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
"pymongo_inmemory"
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/kaizendorks/pymongo_inmemory";
|
||||
description = "A mongo mocking library with an ephemeral MongoDB running in memory";
|
||||
maintainers = with lib.maintainers; [ pbsds ];
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
@ -9,16 +9,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "rust-cbindgen";
|
||||
version = "0.25.0";
|
||||
version = "0.26.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mozilla";
|
||||
repo = "cbindgen";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-gljICr0abKEXxJfLCJN3L2OIwUvw/QoIC6T5C7pieEA=";
|
||||
hash = "sha256-gyNZAuxpeOjuC+Rh9jAyHSBQRRYUlYoIrBKuCFg3Hao=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-agBzn2MibM7158/QlLXI2HBBcYIe0p50rYSF1jBDF8U=";
|
||||
cargoSha256 = "sha256-pdTxhECAZzBx5C01Yx7y/OGwhhAdlEDpqLBdvQcb8bc=";
|
||||
|
||||
buildInputs = lib.optional stdenv.isDarwin Security;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
version = "1.0.0";
|
||||
version = "1.0.1";
|
||||
pname = "bun";
|
||||
|
||||
src = passthru.sources.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
|
||||
@ -35,19 +35,19 @@ stdenvNoCC.mkDerivation rec {
|
||||
sources = {
|
||||
"aarch64-darwin" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-aarch64.zip";
|
||||
hash = "sha256-Bd8KL1IbWBRiMZq4YPhNLdhBOqRReCFeUPAilLfk0TM=";
|
||||
hash = "sha256-AzjCqfvR4Uad6+ocLo+KfqHKFjxOlZt4//Nw80FRijM=";
|
||||
};
|
||||
"aarch64-linux" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-aarch64.zip";
|
||||
hash = "sha256-CHOiQ47wXjkFyJG9ElE9gBpmWpylMEUf6c+Sm+YCpGc=";
|
||||
hash = "sha256-EEcKoaaC0KnaAfUqd5QNYpTeArY3ia38l5dkZCooZuw=";
|
||||
};
|
||||
"x86_64-darwin" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-x64.zip";
|
||||
hash = "sha256-0AT58hjawS60q5YAQd/upVz0vOIs11JM+lc3c1mGyOE=";
|
||||
hash = "sha256-g4k0NdpWU1K+66Mi/idYAMx8pFLOBbUDk4rVczrxRjg=";
|
||||
};
|
||||
"x86_64-linux" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64.zip";
|
||||
hash = "sha256-1ju7ZuW82wRfXEiU24Lx9spCoIhhddJ2p4dTTQmsa7A=";
|
||||
hash = "sha256-RmgnWTG6kTebYwIa/VAwvvJmbL+ARNC+HkbF4mJPF7o=";
|
||||
};
|
||||
};
|
||||
updateScript = writeShellScript "update-bun" ''
|
||||
@ -66,7 +66,7 @@ stdenvNoCC.mkDerivation rec {
|
||||
};
|
||||
meta = with lib; {
|
||||
homepage = "https://bun.sh";
|
||||
changelog = "https://bun.sh/blog/bun-v1.0"; # 1.0 changelog does not use the full version name, please change this to ${version} in the following releases
|
||||
changelog = "https://bun.sh/blog/bun-v${version}";
|
||||
description = "Incredibly fast JavaScript runtime, bundler, transpiler and package manager – all in one";
|
||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||
longDescription = ''
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
let
|
||||
pname = "yabai";
|
||||
version = "5.0.7";
|
||||
version = "5.0.8";
|
||||
|
||||
test-version = testers.testVersion {
|
||||
package = yabai;
|
||||
@ -53,7 +53,7 @@ in
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/koekeishiya/yabai/releases/download/v${version}/yabai-v${version}.tar.gz";
|
||||
hash = "sha256-6RtA3xFOVwTYrfHE72Qa65kDSwv/3/NQ8z4bVCsm9Fc=";
|
||||
hash = "sha256-w4MTHHYWwBq0/WkemYIeV49aA/DzFxXITD8gF5St0Yo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -89,7 +89,7 @@ in
|
||||
owner = "koekeishiya";
|
||||
repo = "yabai";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-wFrMMiy+K+bnEeVyY3RGVZBoxiKQ69Q+Bp1xa+IcWas=";
|
||||
hash = "sha256-VahfeKYz/cATb0RF9QykngMtRpCh392jY8aJuggpqMU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -18,11 +18,11 @@ let
|
||||
'';
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "keycloak";
|
||||
version = "22.0.1";
|
||||
version = "22.0.3";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/keycloak/keycloak/releases/download/${version}/keycloak-${version}.zip";
|
||||
hash = "sha256-I0tmCcXqS1nfA7ZQd0qUsSWEUYvNa/caCZU8AYWSO7Y=";
|
||||
hash = "sha256-QDa5YPPi7JR8fd3jni8fjkwWH/PF023avVBENEwnbVA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper jre ];
|
||||
|
54
pkgs/servers/knxd/default.nix
Normal file
54
pkgs/servers/knxd/default.nix
Normal file
@ -0,0 +1,54 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, indent
|
||||
, perl
|
||||
, argp-standalone
|
||||
, fmt_9
|
||||
, libev
|
||||
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
|
||||
, withUsb ? stdenv.isLinux, libusb1
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "knxd";
|
||||
version = "0.14.59";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "knxd";
|
||||
repo = "knxd";
|
||||
rev = version;
|
||||
hash = "sha256-m3119aD23XTViQJ2s7hwnJZ1ct4bcEFWuyUQajmqySQ=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
sed -i '2i echo ${version}; exit' tools/version.sh
|
||||
sed -i '2i exit' tools/get_libfmt
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config indent perl ];
|
||||
|
||||
buildInputs = [ fmt_9 libev ]
|
||||
++ lib.optional withSystemd systemd
|
||||
++ lib.optional withUsb libusb1
|
||||
++ lib.optional stdenv.isDarwin argp-standalone;
|
||||
|
||||
configureFlags = lib.optional (!withSystemd) "--disable-systemd"
|
||||
++ lib.optional (!withUsb) "--disable-usb";
|
||||
|
||||
installFlags = lib.optionals withSystemd [
|
||||
"systemdsystemunitdir=$(out)/lib/systemd/system"
|
||||
"systemdsysusersdir=$(out)/lib/sysusers.d"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Advanced router/gateway for KNX";
|
||||
homepage = "https://github.com/knxd/knxd";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ sikmir ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, fetchYarnDeps
|
||||
, mkYarnPackage
|
||||
, baseUrl ? null
|
||||
}:
|
||||
@ -14,10 +15,14 @@ mkYarnPackage rec {
|
||||
sha256 = "sha256-kvQBzrCu1sgDccKhr0i2DgDmO5z6u6s+vw5KymttoK4=";
|
||||
};
|
||||
|
||||
yarnNix = ./yarn.nix;
|
||||
yarnLock = ./yarn.lock;
|
||||
packageJSON = ./package.json;
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
inherit yarnLock;
|
||||
hash = "sha256-f0ilsF3lA+134qUaX96mdntjpR4gRlmtRIh/xEFhtXQ=";
|
||||
};
|
||||
|
||||
NODE_ENV = "production";
|
||||
${if baseUrl != null then "REACT_APP_SERVER" else null} = baseUrl;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "snowflake";
|
||||
version = "2.5.1";
|
||||
version = "2.6.1";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
domain = "gitlab.torproject.org";
|
||||
@ -10,16 +10,16 @@ buildGoModule rec {
|
||||
owner = "anti-censorship/pluggable-transports";
|
||||
repo = "snowflake";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-r2NRIb6qbA1B5HlVNRqa9ongQpyiyPskhembPHX3Lgc=";
|
||||
sha256 = "sha256-3gLcSZv8GpEio+yvPyBVVceb1nO0HzhpQKhEgf4nQvU=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-dnfm4KiVD89bnHV7bfw5aXWHGdcH9JBdrtvuS6s8N5w=";
|
||||
vendorHash = "sha256-MjxDB9fcPM6nIeGk6YvJOKXI/ThlMrxqJl9ROAREwXk=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "System to defeat internet censorship";
|
||||
homepage = "https://snowflake.torproject.org/";
|
||||
changelog = "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/raw/v${version}/ChangeLog";
|
||||
maintainers = with maintainers; [ lourkeur ];
|
||||
maintainers = with maintainers; [ lourkeur yayayayaka ];
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "gotestwaf";
|
||||
version = "0.4.3";
|
||||
version = "0.4.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "wallarm";
|
||||
repo = pname;
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-NalXG4I4BtDU7vfKb4H3gJERDQ92Y/46OWIgdg+7+MA=";
|
||||
hash = "sha256-jiEs5/HWNZ3DmahWVC6j2eJqFyCAibp1rFS+gtK7haI=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
@ -5812,6 +5812,8 @@ with pkgs;
|
||||
|
||||
klog = qt5.callPackage ../applications/radio/klog { };
|
||||
|
||||
knxd = callPackage ../servers/knxd { };
|
||||
|
||||
komga = callPackage ../servers/komga { };
|
||||
|
||||
komorebi = callPackage ../applications/graphics/komorebi { };
|
||||
|
@ -1,4 +1,6 @@
|
||||
{ stdenv
|
||||
, config
|
||||
, callPackages
|
||||
, lib
|
||||
, pkgs
|
||||
, phpPackage
|
||||
@ -44,12 +46,15 @@
|
||||
}:
|
||||
|
||||
lib.makeScope pkgs.newScope (self: with self; {
|
||||
buildPecl = import ../build-support/build-pecl.nix {
|
||||
buildPecl = callPackage ../build-support/php/build-pecl.nix {
|
||||
php = php.unwrapped;
|
||||
inherit lib;
|
||||
inherit (pkgs) stdenv autoreconfHook fetchurl re2c nix-update-script;
|
||||
};
|
||||
|
||||
composerHooks = callPackages ../build-support/php/hooks { };
|
||||
|
||||
mkComposerRepository = callPackage ../build-support/php/build-composer-repository.nix { };
|
||||
buildComposerProject = callPackage ../build-support/php/build-composer-project.nix { };
|
||||
|
||||
# Wrap mkDerivation to prepend pname with "php-" to make names consistent
|
||||
# with how buildPecl does it and make the file easier to overview.
|
||||
mkDerivation = origArgs:
|
||||
|
@ -1695,6 +1695,8 @@ self: super: with self; {
|
||||
|
||||
cacheyou = callPackage ../development/python-modules/cacheyou { };
|
||||
|
||||
cachier = callPackage ../development/python-modules/cachier { };
|
||||
|
||||
cachy = callPackage ../development/python-modules/cachy { };
|
||||
|
||||
cadquery = callPackage ../development/python-modules/cadquery {
|
||||
@ -9532,6 +9534,8 @@ self: super: with self; {
|
||||
|
||||
pymongo = callPackage ../development/python-modules/pymongo { };
|
||||
|
||||
pymongo-inmemory = callPackage ../development/python-modules/pymongo-inmemory { };
|
||||
|
||||
pymoo = callPackage ../development/python-modules/pymoo { };
|
||||
|
||||
pymorphy2 = callPackage ../development/python-modules/pymorphy2 { };
|
||||
|
Loading…
Reference in New Issue
Block a user