diff options
author | Jiajie Chen <c@jia.je> | 2022-08-17 00:45:01 +0800 |
---|---|---|
committer | Jiajie Chen <c@jia.je> | 2022-08-17 15:15:46 +0800 |
commit | 77525f0f95505695987411365d9349019ad6e020 (patch) | |
tree | 43190a2142dad3d832a473663e8ffaa260ad3bf6 /pkgs/development/libraries/libkrunfw | |
parent | 23d21ce9c90dc1f2501632e06c02c96fe02d84f9 (diff) | |
download | nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar.gz nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar.bz2 nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar.lz nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar.xz nixpkgs-77525f0f95505695987411365d9349019ad6e020.tar.zst nixpkgs-77525f0f95505695987411365d9349019ad6e020.zip |
libkrunfw: add support for darwin
Diffstat (limited to 'pkgs/development/libraries/libkrunfw')
-rw-r--r-- | pkgs/development/libraries/libkrunfw/default.nix | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pkgs/development/libraries/libkrunfw/default.nix b/pkgs/development/libraries/libkrunfw/default.nix index 10ff3746049..8769cf6913b 100644 --- a/pkgs/development/libraries/libkrunfw/default.nix +++ b/pkgs/development/libraries/libkrunfw/default.nix @@ -15,11 +15,14 @@ stdenv.mkDerivation rec { pname = "libkrunfw"; version = "3.3.0"; - src = fetchFromGitHub { + src = if stdenv.isLinux then fetchFromGitHub { owner = "containers"; repo = pname; rev = "v${version}"; hash = "sha256-ay+E5AgJeA0i3T4JDosDawwtezDGquzAvYEWHGbPidg="; + } else fetchurl { + url = "https://github.com/containers/libkrunfw/releases/download/v${version}/v${version}-with_macos_prebuilts.tar.gz"; + hash = "sha256-9Wp93PC+PEqUpWHIe6BUnfDMpFvYL8rGGjTU2nWSUVY="; }; kernelSrc = fetchurl { @@ -28,14 +31,18 @@ stdenv.mkDerivation rec { }; preBuild = '' - substituteInPlace Makefile --replace 'curl $(KERNEL_REMOTE) -o $(KERNEL_TARBALL)' 'ln -s $(kernelSrc) $(KERNEL_TARBALL)' + substituteInPlace Makefile \ + --replace 'curl $(KERNEL_REMOTE) -o $(KERNEL_TARBALL)' 'ln -s $(kernelSrc) $(KERNEL_TARBALL)' \ + --replace 'gcc' '$(CC)' ''; nativeBuildInputs = [ flex bison bc python3 python3.pkgs.pyelftools ]; - buildInputs = [ elfutils ]; + buildInputs = lib.optionals stdenv.isLinux [ elfutils ]; - makeFlags = [ "PREFIX=${placeholder "out"}" ] - ++ lib.optional sevVariant "SEV=1"; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "SONAME_Darwin=-Wl,-install_name,${placeholder "out"}/lib/libkrunfw.dylib" + ] ++ lib.optional sevVariant "SEV=1"; enableParallelBuilding = true; @@ -44,6 +51,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/containers/libkrunfw"; license = with licenses; [ lgpl2Only lgpl21Only ]; maintainers = with maintainers; [ nickcao ]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; }; } |