{cdrdao,whipper}: support Darwin

This commit is contained in:
Emily 2023-08-02 04:04:42 +01:00
parent 13e2cb64cf
commit 58dff2378f
3 changed files with 22 additions and 3 deletions

View file

@ -95,6 +95,6 @@ in python3.pkgs.buildPythonApplication rec {
description = "A CD ripper aiming for accuracy over speed"; description = "A CD ripper aiming for accuracy over speed";
maintainers = with maintainers; [ emily ]; maintainers = with maintainers; [ emily ];
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }

View file

@ -2,10 +2,14 @@
lib, lib,
stdenv, stdenv,
fetchurl, fetchurl,
fetchpatch,
pkg-config, pkg-config,
libiconv,
libvorbis, libvorbis,
libmad, libmad,
libao, libao,
CoreServices,
IOKit,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -24,13 +28,26 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
buildInputs = [ buildInputs = [
libiconv
libvorbis libvorbis
libmad libmad
libao libao
] ++ lib.optionals stdenv.isDarwin [
CoreServices
IOKit
]; ];
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
patches = [
# Fix build on macOS SDK < 12
# https://github.com/cdrdao/cdrdao/pull/19
(fetchpatch {
url = "https://github.com/cdrdao/cdrdao/commit/105d72a61f510e3c47626476f9bbc9516f824ede.patch";
hash = "sha256-NVIw59CSrc/HcslhfbYQNK/qSmD4QbfuV8hWYhWelX4=";
})
];
# we have glibc/include/linux as a symlink to the kernel headers, # we have glibc/include/linux as a symlink to the kernel headers,
# and the magic '..' points to kernelheaders, and not back to the glibc/include # and the magic '..' points to kernelheaders, and not back to the glibc/include
postPatch = '' postPatch = ''
@ -43,7 +60,7 @@ stdenv.mkDerivation (finalAttrs: {
meta = { meta = {
description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode"; description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode";
homepage = "https://cdrdao.sourceforge.net/"; homepage = "https://cdrdao.sourceforge.net/";
platforms = lib.platforms.linux; platforms = lib.platforms.unix;
license = lib.licenses.gpl2; license = lib.licenses.gpl2;
}; };
}) })

View file

@ -6547,7 +6547,9 @@ with pkgs;
cdpr = callPackage ../tools/networking/cdpr { }; cdpr = callPackage ../tools/networking/cdpr { };
cdrdao = callPackage ../tools/cd-dvd/cdrdao { }; cdrdao = callPackage ../tools/cd-dvd/cdrdao {
inherit (darwin.apple_sdk.frameworks) CoreServices IOKit;
};
cdrkit = callPackage ../tools/cd-dvd/cdrkit { }; cdrkit = callPackage ../tools/cd-dvd/cdrkit { };