fix mac support

This commit is contained in:
Rodolphe Fouquet
2024-04-28 02:14:01 +01:00
parent a5ddd64517
commit b4d88cebda
3 changed files with 25 additions and 10 deletions

4
configure vendored
View File

@@ -92,6 +92,7 @@ libgpac_extralibs=""
static_build="no"
static_bin="no"
static_modules="no"
libgpac_static="yes"
lm_lib=""
has_directx="no"
win32="no"
@@ -674,6 +675,8 @@ for opt do
echo "$opt deprecated, use --static-build instead"
static_build="yes";
;;
--disable-static) libgpac_static="no";
;;
--enable-fixed-point) use_fixed_point="yes"
;;
--strip) INSTFLAGS="-s $INSTFLAGS"
@@ -3001,6 +3004,7 @@ echo "DEBUGBUILD=$debuginfo" >> config.mak
echo "GPROFBUILD=$gprof_build" >> config.mak
echo "STATIC_BINARY=$static_bin" >> config.mak
echo "STATIC_BUILD=$static_build" >> config.mak
echo "LIBGPAC_STATIC=$libgpac_static" >> config.mak
echo "CONFIG_IPV6=$has_ipv6" >> config.mak
if test "$has_ipv6" = "yes" ; then

View File

@@ -8,7 +8,6 @@
flake-utils.lib.eachDefaultSystem (system:
let
name = "gpac";
src = self;
pkgs = nixpkgs.legacyPackages.${system};
buildInputs = with pkgs; [
zlib
@@ -24,37 +23,45 @@
ffmpeg
xvidcore
openssl
alsa-lib
SDL2
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
darwin.CarbonHeaders
darwin.apple_sdk.frameworks.Carbon
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
mesa
mesa-demos
alsa-lib
pulseaudio
jack2
xorg.libX11
xorg.libXv
xorg.xorgproto
];
nativeBuildInputs = with pkgs; [ git pkg-config ];
nativeBuildInputs = with pkgs; [
git
pkg-config
];
in
with pkgs;
{
packages.default = stdenv.mkDerivation {
inherit buildInputs name src nativeBuildInputs;
inherit buildInputs name nativeBuildInputs;
src = self;
meta = with nixpkgs.lib; {
homepage = "https://gpac.io";
description =
"For Video Streaming and Next-Gen Multimedia Transcoding, Packaging and Delivery.";
platforms = platforms.darwin ++ platforms.linux;
mainProgram = "gpac";
#TODO support Nix uses glibtool instead of Apple libtool, we do not support it
darwinConfigureFlags = [ "--disable-static" ];
};
};
devShells.default = mkShell {
inherit buildInputs nativeBuildInputs;
};
meta = with nixpkgs.lib; {
homepage = "https://gpac.io";
description =
"For Video Streaming and Next-Gen Multimedia Transcoding, Packaging and Delivery.";
platforms = platforms.all;
};
}
);

View File

@@ -374,16 +374,20 @@ crypto/g_crypt_openssl.o: crypto/g_crypt_openssl.c
ifeq ($(CONFIG_DARWIN),yes)
ifeq ($(LIBGPAC_STATIC),yes)
$(LIBTOOL) -s -o ../bin/gcc/libgpac_static.a $(OBJS)
$(RANLIB) ../bin/gcc/libgpac_static.a
endif
ifneq ($(STATIC_BUILD),yes)
$(CC) $(SHFLAGS) $(LD_SONAME) -o $@ $(OBJS) $(ALL_LIBS) $(LDFLAGS)
endif
else
ifeq ($(LIBGPAC_STATIC),yes)
$(AR) cr ../bin/gcc/libgpac_static.a $(OBJS)
$(RANLIB) ../bin/gcc/libgpac_static.a
endif
ifneq ($(STATIC_BUILD),yes)
$(CC) $(SHFLAGS) $(LD_SONAME) -o $@ $(OBJS) $(ALL_LIBS) $(LDFLAGS)
mv $@ $@.$(VERSION_SONAME)