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:
|
with:
|
||||||
name: poetry2nix
|
name: poetry2nix
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
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": {
|
"nixpkgs": {
|
||||||
"branch": "nixos-unstable",
|
"branch": "nixos-unstable",
|
||||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
"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 (!self.isPyPy) pyBuildPackages.cffi
|
||||||
++ lib.optional (lib.versionAtLeast old.version "3.5")
|
++ lib.optional (lib.versionAtLeast old.version "3.5")
|
||||||
(with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]);
|
(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 ];
|
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.cffi ];
|
||||||
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") {
|
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") {
|
||||||
CRYPTOGRAPHY_DONT_BUILD_RUST = "1";
|
CRYPTOGRAPHY_DONT_BUILD_RUST = "1";
|
||||||
|
@ -802,6 +803,19 @@ lib.composeManyExtensions [
|
||||||
|
|
||||||
interactive = enableTk || enableGtk3 || enableQt;
|
interactive = enableTk || enableGtk3 || enableQt;
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
config = {
|
||||||
|
directories = { basedirlist = "."; };
|
||||||
|
libs = {
|
||||||
|
system_freetype = true;
|
||||||
|
system_qhull = true;
|
||||||
|
} // lib.optionalAttrs stdenv.isDarwin {
|
||||||
|
# LTO not working in darwin stdenv, see Nixpkgs #19312
|
||||||
|
enable_lto = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
inherit (pkgs) tk tcl wayland qhull;
|
inherit (pkgs) tk tcl wayland qhull;
|
||||||
inherit (pkgs.xorg) libX11;
|
inherit (pkgs.xorg) libX11;
|
||||||
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
|
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
|
||||||
|
@ -809,10 +823,24 @@ lib.composeManyExtensions [
|
||||||
{
|
{
|
||||||
XDG_RUNTIME_DIR = "/tmp";
|
XDG_RUNTIME_DIR = "/tmp";
|
||||||
|
|
||||||
buildInputs = (old.buildInputs or [ ])
|
buildInputs = old.buildInputs or [ ] ++ [
|
||||||
++ lib.optional enableGhostscript pkgs.ghostscript
|
pkgs.which
|
||||||
++ lib.optional stdenv.isDarwin [ Cocoa ]
|
] ++ lib.optional enableGhostscript [
|
||||||
++ [ self.certifi ];
|
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 [ ]) ++ [
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
@ -821,25 +849,9 @@ lib.composeManyExtensions [
|
||||||
self.setuptools-scm-git-archive
|
self.setuptools-scm-git-archive
|
||||||
];
|
];
|
||||||
|
|
||||||
passthru.config = {
|
passthru = old.passthru or { } // passthru;
|
||||||
directories = { basedirlist = "."; };
|
|
||||||
libs = {
|
|
||||||
system_freetype = true;
|
|
||||||
system_qhull = true;
|
|
||||||
} // lib.optionalAttrs stdenv.isDarwin {
|
|
||||||
# LTO not working in darwin stdenv, see Nixpkgs #19312
|
|
||||||
enable_lto = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" ''
|
MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" (lib.generators.toINI { } passthru.config);
|
||||||
[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
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
|
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
|
||||||
# corresponding interpreter object for its library paths. This fails if
|
# corresponding interpreter object for its library paths. This fails if
|
||||||
|
@ -861,24 +873,11 @@ lib.composeManyExtensions [
|
||||||
'' +
|
'' +
|
||||||
# avoid matplotlib trying to download dependencies
|
# 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 { };
|
tools = pkgs.callPackage ./tools { };
|
||||||
|
|
||||||
|
nix-build-uncached = import sources.nix-build-uncached {
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
|
|
||||||
|
@ -23,5 +27,6 @@ pkgs.mkShell {
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
pkgs.nix-prefetch-git
|
pkgs.nix-prefetch-git
|
||||||
pkgs.nix-eval-jobs
|
pkgs.nix-eval-jobs
|
||||||
|
nix-build-uncached
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue