Skip to content

Commit

Permalink
apply go and apple_sdk fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed May 31, 2024
1 parent 106726d commit 9158dbf
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
nonCargoBuildFiles = path: _type: builtins.match ".*(js|json|png)$" path != null;
includeFilesFilter = path: type:
(craneLib.filterCargoSources path type) || (nonCargoBuildFiles path type);
apple_sdk =
if system == "x86_64-darwin"
then pkgs.darwin.apple_sdk_10_12
else pkgs.darwin.apple_sdk_11_0;
in
craneLib.buildPackage {
pname = "hc-launch";
Expand All @@ -152,19 +156,31 @@
# perl needed for openssl on all platforms
buildInputs = [
pkgs.glib
pkgs.go
pkgs.perl

(if pkgs.system == "x86_64-darwin" then
pkgs.darwin.apple_sdk_11_0.stdenv.mkDerivation
{
name = "go";
nativeBuildInputs = with pkgs; [
makeBinaryWrapper
go
];
dontBuild = true;
dontUnpack = true;
installPhase = ''
makeWrapper ${pkgs.go}/bin/go $out/bin/go
'';
} else pkgs.go)
]
++ (pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.pkg-config
pkgs.webkitgtk.dev
])
++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [
# additional packages needed for darwin platforms
pkgs.darwin.apple_sdk.frameworks.AppKit
pkgs.darwin.apple_sdk.frameworks.WebKit
# # additional packages needed for darwin platforms on x86_64
# pkgs.darwin.apple_sdk_11_0.frameworks.CoreFoundation
apple_sdk.frameworks.AppKit
apple_sdk.frameworks.WebKit
]);
# do not check built package as it either builds successfully or not
doCheck = false;
Expand Down

0 comments on commit 9158dbf

Please sign in to comment.