Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php: add optional phpSrc attribute #254556

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

drupol
Copy link
Contributor

@drupol drupol commented Sep 11, 2023

This will allow building PHP from source, without using .overrideAttrs(), if the new attribute phpSrc is not set, the default behavior (fetchurl) is used.

Example:

{ callPackage, fetchFromGitHub, ... }:

php = callPackage ./generic.nix ({
  version = "8.1.13";
  phpSrc = fetchFromGitHub {
    owner = "php";
    repo = "php-src";
    rev = "php-8.1.13";
    hash = "sha256-n2SCCnMrSxVnIJrpqMJ7NLydAuSlnb/X5nULtKb03uI=";
  };
});

This PR is a refresh of the following PR: #155012

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@drupol drupol changed the title php: add phpSrc attribute php: add optional phpSrc attribute Sep 11, 2023
@@ -278,6 +285,10 @@ let
substituteInPlace configure --replace "-lstdc++" "-lc++"
'';

preInstall = ''
cp -f ${pearInstallPhar} ./pear/install-pear-nozlib.phar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this change relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mandatory when building PHP from source. I haven't found a better way to do this, do you have a better idea?
When PHP release maintainers are doing a distribution, they run the script makedist that download that file using wget.

@jtojnar
Copy link
Member

jtojnar commented Sep 11, 2023

This will allow building PHP from source, without using .overrideAttrs()

Please also include motivation in the commit message, this is just an end point.

@drupol
Copy link
Contributor Author

drupol commented Sep 11, 2023

This will allow building PHP from source, without using .overrideAttrs()

Please also include motivation in the commit message, this is just an end point.

It's done already, should I add something else ?

@jtojnar
Copy link
Member

jtojnar commented Sep 11, 2023

It's done already, should I add something else ?

I only see overrideAttrs mentioned but without an explanation why it is not desirable.

@drupol
Copy link
Contributor Author

drupol commented Sep 12, 2023

Done.

This will allow building PHP from source, without using `.overrideAttrs()`.
When the new attribute `phpSrc` is not set, the default behavior (with `fetchurl`) is used.
@drupol drupol merged commit c038b79 into master Nov 8, 2023
22 checks passed
@drupol drupol deleted the php/allow-passing-src-attr branch November 8, 2023 21:57
@cafkafk cafkafk mentioned this pull request Nov 9, 2023
13 tasks
nyabinary pushed a commit to nyabinary/nixpkgs that referenced this pull request Nov 14, 2023
This will allow building PHP from source, without using `.overrideAttrs()`.
When the new attribute `phpSrc` is not set, the default behavior (with `fetchurl`) is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants