From dda8c6649dee8dc28bc50bde2e2dbf45e731f1ed Mon Sep 17 00:00:00 2001 From: Alex James Date: Thu, 23 May 2024 21:46:48 -0500 Subject: [PATCH] gpac: add support for darwin The cctools dependency is needed for libtool[^1], while the Carbon dependency comes from carbon_hook.c[^2]. [^1]: https://github.com/gpac/gpac/blob/df8121066cf8fb25cc70adf7ca8b35bda82fe216/src/Makefile#L377 [^2]: https://github.com/gpac/gpac/blob/df8121066cf8fb25cc70adf7ca8b35bda82fe216/applications/gpac/carbon_hook.c#L36. --- pkgs/applications/video/gpac/default.nix | 16 ++++++++++++---- pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/gpac/default.nix b/pkgs/applications/video/gpac/default.nix index 3aa8d879ff3d..57da5147407e 100644 --- a/pkgs/applications/video/gpac/default.nix +++ b/pkgs/applications/video/gpac/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, zlib }: +{ lib, stdenv, fetchFromGitHub, cctools, pkg-config, Carbon, zlib }: stdenv.mkDerivation rec { pname = "gpac"; @@ -13,9 +13,17 @@ stdenv.mkDerivation rec { # this is the bare minimum configuration, as I'm only interested in MP4Box # For most other functionality, this should probably be extended - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + pkg-config + ] ++ lib.optionals stdenv.isDarwin [ + cctools + ]; - buildInputs = [ zlib ]; + buildInputs = [ + zlib + ] ++ lib.optionals stdenv.isDarwin [ + Carbon + ]; enableParallelBuilding = true; @@ -36,6 +44,6 @@ stdenv.mkDerivation rec { homepage = "https://gpac.wp.imt.fr"; license = licenses.lgpl21; maintainers = with maintainers; [ bluescreen303 mgdelacroix ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 43f70ad6102d..fb361ea6dbf6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20923,7 +20923,10 @@ with pkgs; autoconf = buildPackages.autoconf269; }; - gpac = callPackage ../applications/video/gpac { }; + gpac = callPackage ../applications/video/gpac { + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) Carbon; + }; gpgme = callPackage ../development/libraries/gpgme { };