lol

Merge pull request #247063 from emilazy/cdrdao-fixes

{cdrdao,whipper}: support Darwin and add patch

authored by

Weijia Wang and committed by
GitHub
77743910 4f530892

+52 -11
+1 -1
pkgs/applications/audio/whipper/default.nix
··· 95 95 description = "A CD ripper aiming for accuracy over speed"; 96 96 maintainers = with maintainers; [ emily ]; 97 97 license = licenses.gpl3Plus; 98 - platforms = platforms.linux; 98 + platforms = platforms.unix; 99 99 }; 100 100 }
+48 -9
pkgs/tools/cd-dvd/cdrdao/default.nix
··· 1 - {lib, stdenv, fetchurl, libvorbis, libmad, pkg-config, libao}: 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + fetchpatch, 6 + pkg-config, 7 + libiconv, 8 + libvorbis, 9 + libmad, 10 + libao, 11 + CoreServices, 12 + IOKit, 13 + }: 2 14 3 - stdenv.mkDerivation rec { 15 + stdenv.mkDerivation (finalAttrs: { 4 16 pname = "cdrdao"; 5 17 version = "1.2.5"; 6 18 7 19 src = fetchurl { 8 - url = "mirror://sourceforge/cdrdao/cdrdao-${version}.tar.bz2"; 20 + url = "mirror://sourceforge/cdrdao/cdrdao-${finalAttrs.version}.tar.bz2"; 9 21 hash = "sha256-0ZtnyFPF26JAavqrbNeI53817r5jTKxGeVKEd8e+AbY="; 10 22 }; 11 23 12 24 makeFlags = [ "RM=rm" "LN=ln" "MV=mv" ]; 13 25 14 - nativeBuildInputs = [ pkg-config ]; 15 - buildInputs = [ libvorbis libmad libao ]; 26 + nativeBuildInputs = [ 27 + pkg-config 28 + ]; 29 + 30 + buildInputs = [ 31 + libiconv 32 + libvorbis 33 + libmad 34 + libao 35 + ] ++ lib.optionals stdenv.isDarwin [ 36 + CoreServices 37 + IOKit 38 + ]; 16 39 17 40 hardeningDisable = [ "format" ]; 18 41 42 + patches = [ 43 + # Fix build on macOS SDK < 12 44 + # https://github.com/cdrdao/cdrdao/pull/19 45 + (fetchpatch { 46 + url = "https://github.com/cdrdao/cdrdao/commit/105d72a61f510e3c47626476f9bbc9516f824ede.patch"; 47 + hash = "sha256-NVIw59CSrc/HcslhfbYQNK/qSmD4QbfuV8hWYhWelX4="; 48 + }) 49 + 50 + # Fix undefined behaviour caused by uninitialized variable 51 + # https://github.com/cdrdao/cdrdao/pull/21 52 + (fetchpatch { 53 + url = "https://github.com/cdrdao/cdrdao/commit/251a40ab42305c412674c7c2d391374d91e91c95.patch"; 54 + hash = "sha256-+nGlWw5rgc5Ns2l+6fQ4Hp2LbhO4R/I95h9WGIh/Ebw="; 55 + }) 56 + ]; 57 + 19 58 # we have glibc/include/linux as a symlink to the kernel headers, 20 59 # and the magic '..' points to kernelheaders, and not back to the glibc/include 21 60 postPatch = '' ··· 25 64 # Needed on gcc >= 6. 26 65 env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; 27 66 28 - meta = with lib; { 67 + meta = { 29 68 description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode"; 30 69 homepage = "https://cdrdao.sourceforge.net/"; 31 - platforms = platforms.linux; 32 - license = licenses.gpl2; 70 + platforms = lib.platforms.unix; 71 + license = lib.licenses.gpl2; 33 72 }; 34 - } 73 + })
+3 -1
pkgs/top-level/all-packages.nix
··· 6563 6563 6564 6564 cdpr = callPackage ../tools/networking/cdpr { }; 6565 6565 6566 - cdrdao = callPackage ../tools/cd-dvd/cdrdao { }; 6566 + cdrdao = callPackage ../tools/cd-dvd/cdrdao { 6567 + inherit (darwin.apple_sdk.frameworks) CoreServices IOKit; 6568 + }; 6567 6569 6568 6570 cdrkit = callPackage ../tools/cd-dvd/cdrkit { }; 6569 6571