mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -05:00
Merge pull request #529 from nix-community/minor-macos-fixes
Minor macos fixes
This commit is contained in:
commit
35f0b22424
4 changed files with 56 additions and 40 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -64,4 +64,4 @@ jobs:
|
|||
with:
|
||||
name: poetry2nix
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
- run: nix-shell -p nix-build-uncached --run 'nix-build-uncached --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'
|
||||
- run: nix-shell --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
{
|
||||
"nix-build-uncached": {
|
||||
"branch": "master",
|
||||
"description": "A CI friendly wrapper around nix-build.",
|
||||
"homepage": "",
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-build-uncached",
|
||||
"rev": "77fe5c8c4c5c7a1fa3f9baa042474b98f2456652",
|
||||
"sha256": "04hqiw3rhz01qqyz2x1q14aml1ifk3m97pldf4v5vhd5hg73k1zn",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/Mic92/nix-build-uncached/archive/77fe5c8c4c5c7a1fa3f9baa042474b98f2456652.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"branch": "nixos-unstable",
|
||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
||||
|
|
|
@ -232,7 +232,8 @@ lib.composeManyExtensions [
|
|||
++ lib.optional (!self.isPyPy) pyBuildPackages.cffi
|
||||
++ lib.optional (lib.versionAtLeast old.version "3.5")
|
||||
(with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]);
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ];
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]
|
||||
++ lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
|
||||
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.cffi ];
|
||||
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") {
|
||||
CRYPTOGRAPHY_DONT_BUILD_RUST = "1";
|
||||
|
@ -802,26 +803,8 @@ lib.composeManyExtensions [
|
|||
|
||||
interactive = enableTk || enableGtk3 || enableQt;
|
||||
|
||||
inherit (pkgs) tk tcl wayland qhull;
|
||||
inherit (pkgs.xorg) libX11;
|
||||
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
|
||||
in
|
||||
{
|
||||
XDG_RUNTIME_DIR = "/tmp";
|
||||
|
||||
buildInputs = (old.buildInputs or [ ])
|
||||
++ lib.optional enableGhostscript pkgs.ghostscript
|
||||
++ lib.optional stdenv.isDarwin [ Cocoa ]
|
||||
++ [ self.certifi ];
|
||||
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
pkg-config
|
||||
] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [
|
||||
self.setuptools-scm
|
||||
self.setuptools-scm-git-archive
|
||||
];
|
||||
|
||||
passthru.config = {
|
||||
passthru = {
|
||||
config = {
|
||||
directories = { basedirlist = "."; };
|
||||
libs = {
|
||||
system_freetype = true;
|
||||
|
@ -831,15 +814,44 @@ lib.composeManyExtensions [
|
|||
enable_lto = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" ''
|
||||
[libs]
|
||||
system_freetype = True
|
||||
system_qhull = True
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
# LTO not working in darwin stdenv, see NixOS/nixpkgs/pull/19312
|
||||
enable_lto = false
|
||||
'';
|
||||
inherit (pkgs) tk tcl wayland qhull;
|
||||
inherit (pkgs.xorg) libX11;
|
||||
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
|
||||
in
|
||||
{
|
||||
XDG_RUNTIME_DIR = "/tmp";
|
||||
|
||||
buildInputs = old.buildInputs or [ ] ++ [
|
||||
pkgs.which
|
||||
] ++ lib.optional enableGhostscript [
|
||||
pkgs.ghostscript
|
||||
] ++ lib.optional stdenv.isDarwin [
|
||||
Cocoa
|
||||
];
|
||||
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
|
||||
self.certifi
|
||||
pkgs.libpng
|
||||
pkgs.freetype
|
||||
qhull
|
||||
]
|
||||
++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
|
||||
++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
|
||||
++ lib.optionals enableQt [ self.pyqt5 ]
|
||||
;
|
||||
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
pkg-config
|
||||
] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [
|
||||
self.setuptools-scm
|
||||
self.setuptools-scm-git-archive
|
||||
];
|
||||
|
||||
passthru = old.passthru or { } // passthru;
|
||||
|
||||
MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" (lib.generators.toINI { } passthru.config);
|
||||
|
||||
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
|
||||
# corresponding interpreter object for its library paths. This fails if
|
||||
|
@ -861,24 +873,11 @@ lib.composeManyExtensions [
|
|||
'' +
|
||||
# avoid matplotlib trying to download dependencies
|
||||
''
|
||||
cp $MPLSETUPCFG mplsetup.cfg
|
||||
echo "[libs]
|
||||
system_freetype=true
|
||||
system_qhull=true" > mplsetup.cfg
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
|
||||
pkgs.libpng
|
||||
pkgs.freetype
|
||||
qhull
|
||||
]
|
||||
++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
|
||||
++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
|
||||
++ lib.optionals enableQt [ self.pyqt5 ]
|
||||
;
|
||||
|
||||
preBuild = ''
|
||||
cp -r ${pkgs.qhull} .
|
||||
'';
|
||||
|
||||
inherit (super.matplotlib) patches;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ let
|
|||
};
|
||||
tools = pkgs.callPackage ./tools { };
|
||||
|
||||
nix-build-uncached = import sources.nix-build-uncached {
|
||||
inherit pkgs;
|
||||
};
|
||||
|
||||
in
|
||||
pkgs.mkShell {
|
||||
|
||||
|
@ -23,5 +27,6 @@ pkgs.mkShell {
|
|||
pkgs.jq
|
||||
pkgs.nix-prefetch-git
|
||||
pkgs.nix-eval-jobs
|
||||
nix-build-uncached
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue