Skip to content

Commit

Permalink
fpc: try using darwin fix directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhys-T committed Nov 29, 2024
1 parent 1144321 commit d957590
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
"nixos-unstable",
"nixos-24.05",
"nixos-24.11",
"ce40ce79f14469fd17dfe41c9b51490495d3f99e",
empty] as $nixpkgss |
[
Expand Down
26 changes: 18 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,25 @@ in {
});

fpc = let
needsFix = pkgs.hostPlatform.isDarwin && !(pkgs.lib.hasInfix "-syslibroot $SDKROOT" (pkgs.fpc.preConfigure or ""));
in pkgs.fpc.overrideAttrs (old: {
preConfigure = pkgs.lib.optionalString needsFix ''
NIX_LDFLAGS="-syslibroot $SDKROOT -L${pkgs.lib.getLib pkgs.libiconv}/lib"
'' + (old.preConfigure or "");
meta = old.meta // {
description = "${old.meta.description or "fpc"} (fixed for macOS/Darwin)";
inherit (pkgs) fpc lib;
needsFix =
pkgs.hostPlatform.isDarwin &&
!(lib.hasInfix "-syslibroot $SDKROOT" (fpc.preConfigure or ""))
;
nixpkgs-fpc-fix = pkgs.fetchFromGitHub {
name = "nixpkgs-fpc-fix";
owner = "NixOS";
repo = "nixpkgs";
rev = "ce40ce79f14469fd17dfe41c9b51490495d3f99e";
sparseCheckout = [
"pkgs/development/compilers/fpc"
];
nonConeMode = true;
hash = "sha256-fumRYQgvlsLLT48JPNbmP5VZD3D4C6XTfSKxiCDKIno=";
};
});
in lib.addMetaAttrs ({
description = "${fpc.meta.description or "fpc"} (fixed for macOS/Darwin)";
}) (if needsFix then pkgs.callPackage "${nixpkgs-fpc-fix}/pkgs/development/compilers/fpc/" {} else fpc);

drl-packages = callPackage ./pkgs/drl/packages.nix {};
inherit (self.drl-packages) drl drl-hq drl-lq;
Expand Down

0 comments on commit d957590

Please sign in to comment.