Git Product home page Git Product logo

Comments (5)

ralph-irving avatar ralph-irving commented on August 17, 2024

This is on purpose as I build all the decoders and support libraries as part of the my macos squeezelite builds.
Adding the PATH(s) to these other package managers break my builds.

from squeezelite.

thenktor avatar thenktor commented on August 17, 2024

What about having extra Makefiles like Makefile.m1-pkgsrc and Makefile.m1-macports?

from squeezelite.

dmangot avatar dmangot commented on August 17, 2024

I don't know if this is the kind of thing ./configure would fix, but I was able to get squeezelite compiled on my M2 Mac today. The packages available on the website the OS said were all corrupted.

I don't know what the cleanest way of handling these things are or I'd make a pull request so I'm documenting them here because the binary works fine. I haven't written C code since the 90s.

Apple M2 Mac running Ventura

  1. Comment out the -rt stuff because it's not Linux
  2. Force PORTAUDIO because it was trying to use ALSA
  3. add -I /opt/homebrew/include to CFLAGS and -L /opt/homebrew/lib to LDADD so it could find all the includes and lib.

Hope that helps!

from squeezelite.

thenktor avatar thenktor commented on August 17, 2024

I don't know if this is the kind of thing ./configure would fix,

Yes.

but I was able to get squeezelite compiled on my M2 Mac today. The packages available on the website the OS said were all corrupted.

Not sure, what you mean here.

1. Comment out the -rt stuff because it's not Linux

2. Force PORTAUDIO because it was trying to use ALSA

I guess you did not use the existing m1 Makefile. You can specify it like that: make -f Makefile.m1

3. add `-I /opt/homebrew/include`  to CFLAGS and `-L /opt/homebrew/lib` to LDADD so it could find all the includes and lib.

Yes, that is basically what you need to do. Tell the build system, where headers and libs are.

from squeezelite.

dmangot avatar dmangot commented on August 17, 2024

Corrupted packages from the Sourceforge site:
Screenshot 2024-05-09 at 09 22 28

I tried using the Makefile.m1 and it looks like it was very hacked for someone's specific machine. I think the Opus stuff might just be a quirk in how Homebrew packages stuff so I wound up taking OPUS and ALAC out since it didn't seem worth fighting with right now to get a clean compile.

This is what I had to change:

diff --git a/Makefile b/Makefile
index 78511dc..07443b1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 #Cross compile support - create a Makefile which defines these three variables and then includes this Makefile...
 CFLAGS ?= -Wall -fPIC -O2
-CFLAGS += -fcommon -std=gnu99
+CFLAGS += -fcommon
 LDADD  ?= -lpthread -lm -lrt
 EXECUTABLE ?= squeezelite

@@ -41,7 +41,7 @@ SOURCES_OPUS     = opus.c
 SOURCES_MAD      = mad.c
 SOURCES_MPG123   = mpg.c

-LINK_LINUX       = -ldl
+LINK_LINUX       = -ldl -std=gnu99
 LINK_ALSA        = -lasound
 LINK_PORTAUDIO   = -lportaudio
 LINK_PULSEAUDIO  = -lpulse
diff --git a/Makefile.m1 b/Makefile.m1
index 1157732..032732e 100644
--- a/Makefile.m1
+++ b/Makefile.m1
@@ -1,7 +1,7 @@
 # OSX 12.0+ arm64 only
-OPTS = -DUSE_LIBOGG -DPORTAUDIO -DALAC -DOPUS -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -I./includem1 -I./includem1/opus -I./includem1/alac -arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0
+OPTS = -DUSE_LIBOGG -DPORTAUDIO -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -arch arm64 -O3 -mmacosx-version-min=11.0 -I /opt/homebrew/include

-LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 -L./libm1
+LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 -L /opt/homebrew/lib

 LDADD = -lportaudio -lpthread -ldl -lm -framework CoreVideo -framework VideoDecodeAcceleration -frame
work CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon

diff --git a/opus.c b/opus.c
index baabab0..edbe18b 100644
--- a/opus.c
+++ b/opus.c
@@ -41,7 +41,7 @@
 #define ALIGN(n)       (n << 16)
 #endif

-#include <opusfile.h>
+#include <opus/opusfile.h>

 struct opus {
        struct OggOpusFile *of

Briefly:

  1. The gnu99 stuff
  2. Removed the sysroot stuff as it wasn't needed and just broke things
  3. Took out DALAC and DOPUS because they were just causing headaches on my machine. I'm guessing I could fight to get the stuff in the right place to make it work because Homebrew didn't have it or do it. The ALAC stuff is over a decade old at this point.

tl;dr I think it would be cool to get the Sourceforge downloads to not be broken. Otherwise, the Makefile.m1 (and Makefile) needs a little love if people are going to use it without too much trouble. I think the package manager stuff could be handled more cleanly in variables than as hardcoded.

If we can get these sorted out so that most people are happy, I'm happy to submit a PR for the README which is currently not useful to anyone.

from squeezelite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.