Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

saxfun

macrumors member
Mar 14, 2016
94
16
Germany
You can work around it by editing "startx" and forcing the chosen display to be :0.0..

Alternately, at a command prompt, type:

To try installing my binary edit the portfile, do not mess up the binary itself )
Assuming you have TextWrangler installed:
Code:
/usr/local/bin/edit `port file libass`
(For BBEdit the command will be bbedit, rest is the same.)

To build from source the current version, do not modify portfile, instead edit the source as suggested above. MacPorts build directory will be /opt/local/var/macports/build/. You will see some folder which long ugly name ends with libass (likely _opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass). Go there, you will see extracted source, libass. Needed file is located where it is on GitHub.
I Tried to compile the current version. Every time port tries to DL the source again. I went into your proposed folder, added the file "ass_coretext.c", chmod and chown the file accordingly. I edited the file with your fixed code and then again with the fresh proposal of user oneric,


failed again.


is it correct to add the file, name it ass_coretext.c and edit it like you did? then type in the command "sudo port install libass"?

Concerning the port file of your lower 0.15 version of libass: do I understand you correctly, unpack the archive, edit the port file (what to edit exactly?), tar it agin, and then? really confusing.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,195
1,469
I Tried to compile the current version. Every time port tries to DL the source again. I went into your proposed folder, added the file "ass_coretext.c", chmod and chown the file accordingly. I edited the file with your fixed code and then again with the fresh proposal of user oneric,


failed again.


is it correct to add the file, name it ass_coretext.c and edit it like you did? then type in the command "sudo port install libass"?

Concerning the port file of your lower 0.15 version of libass: do I understand you correctly, unpack the archive, edit the port file (what to edit exactly?), tar it agin, and then? really confusing.

Okay, let’s try building from source first.

1. Install TextWrangler: https://macintoshgarden.org/apps/textwrangler-213 (if you have BBEdit, then no need).
Make sure to install its command line tools. Those are installed into /usr/local/bin.

2. Do not do anything with the portfile at any point. It is not needed. Do not replace any files or insert anything.

3. Assuming you have default MacPorts installation, run this:
Code:
sudo port -v patch libass
/usr/local/bin/edit /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2/libass/ass_coretext.c
The file will open in the editor.

4. Edit whatever needed in the file. It will ask you to make it editable – agree, type in account password (this assumes you are the administrator). Save the file or just close it with saving.
UPD. Please use upstream fix: https://github.com/libass/libass/commit/abc7fbdbb0313536d2f9684dd527c736814e45d8

5. Run the build.
Code:
sudo port -v -n install libass
 
Last edited:
  • Like
Reactions: saxfun

saxfun

macrumors member
Mar 14, 2016
94
16
Germany
Okay, let’s try building from source first.

1. Install TextWrangler: https://macintoshgarden.org/apps/textwrangler-213 (if you have BBEdit, then no need).
Make sure to install its command line tools. Those are installed into /usr/local/bin.

2. Do not do anything with the portfile at any point. It is not needed. Do not replace any files or insert anything.

3. Assuming you have default MacPorts installation, run this:
Code:
sudo port -v patch libass
/usr/local/bin/edit /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2/libass/ass_coretext.c
The file will open in the editor.

4. Edit whatever needed in the file. It will ask you to make it editable – agree, type in account password (this assumes you are the administrator). Save the file or just close it with saving.
UPD. Please use upstream fix: https://github.com/libass/libass/commit/abc7fbdbb0313536d2f9684dd527c736814e45d8

5. Run the build.
Code:
sudo port -v -n install libass
thanks for all your explanations!

I edited with the cmd "edit" (but not in /usr/local/bin, cause it is not there) the file. Deleted line 32-35, added line 32 2ith code "#include "ass_utils.h"", saved the file and typed in the cmd "sudo port -v -n install libass".

port wants to DL the archive again, cause it is not in the verified dir.

Code:
sudo port -v -n install libassPassword:
--->  Computing dependencies for libass.
--->  Fetching archive for libass
--->  libass-0.17.2_0.darwin_9.ppc.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
--->  Attempting to fetch libass-0.17.2_0.darwin_9.ppc.tbz2 from http://packages.macports.org/libass




Problems are still there.



Code:
libtool: compile:  /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I./libass -I/opt/local/include -std=gnu99 -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Werror-implicit-function-declaration -Wstrict-prototypes -Wpointer-arith -Wredundant-decls -Wno-missing-field-initializers -D_GNU_SOURCE -pipe -Os -arch ppc -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/fribidi -I/opt/local/include/harfbuzz -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT libass/ass_coretext.lo -MD -MP -MF libass/.deps/ass_coretext.Tpo -c libass/ass_coretext.c  -fno-common -DPIC -o libass/.libs/ass_coretext.o
libass/ass_coretext.c:34:18: error: missing binary operator before token "("
 #if __has_builtin(__builtin_available)
                  ^
libass/ass_coretext.c: In function 'get_font_file':
libass/ass_coretext.c:93:30: error: 'kCTFontURLAttribute' undeclared (first use in this function); did you mean 'kCTFontSizeAttribute'?
     else if (CHECK_AVAILABLE(kCTFontURLAttribute, macOS 10.6, *)) {
                              ^
libass/ass_coretext.c:39:50: note: in definition of macro 'CHECK_AVAILABLE'
 #define CHECK_AVAILABLE(sym, ...) (!!(intptr_t) &sym)
                                                  ^~~
libass/ass_coretext.c:93:30: note: each undeclared identifier is reported only once for each function it appears in
     else if (CHECK_AVAILABLE(kCTFontURLAttribute, macOS 10.6, *)) {
                              ^
libass/ass_coretext.c:39:50: note: in definition of macro 'CHECK_AVAILABLE'
 #define CHECK_AVAILABLE(sym, ...) (!!(intptr_t) &sym)
                                                  ^~~
make[1]: *** [libass/ass_coretext.lo] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2" && /usr/bin/make -w all
Exit code: 2
Error: Failed to build libass: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port libass failed
geekbook:~ admin$ edit /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2/libass/ass_coretext.c
 

barracuda156

macrumors 68020
Sep 3, 2021
2,195
1,469
thanks for all your explanations!

I edited with the cmd "edit" (but not in /usr/local/bin, cause it is not there) the file. Deleted line 32-35, added line 32 2ith code "#include "ass_utils.h"", saved the file and typed in the cmd "sudo port -v -n install libass".

port wants to DL the archive again, cause it is not in the verified dir.

Code:
sudo port -v -n install libassPassword:
--->  Computing dependencies for libass.
--->  Fetching archive for libass
--->  libass-0.17.2_0.darwin_9.ppc.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
--->  Attempting to fetch libass-0.17.2_0.darwin_9.ppc.tbz2 from http://packages.macports.org/libass




Problems are still there.



Code:
libtool: compile:  /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I./libass -I/opt/local/include -std=gnu99 -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Werror-implicit-function-declaration -Wstrict-prototypes -Wpointer-arith -Wredundant-decls -Wno-missing-field-initializers -D_GNU_SOURCE -pipe -Os -arch ppc -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/fribidi -I/opt/local/include/harfbuzz -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT libass/ass_coretext.lo -MD -MP -MF libass/.deps/ass_coretext.Tpo -c libass/ass_coretext.c  -fno-common -DPIC -o libass/.libs/ass_coretext.o
libass/ass_coretext.c:34:18: error: missing binary operator before token "("
 #if __has_builtin(__builtin_available)
                  ^
libass/ass_coretext.c: In function 'get_font_file':
libass/ass_coretext.c:93:30: error: 'kCTFontURLAttribute' undeclared (first use in this function); did you mean 'kCTFontSizeAttribute'?
     else if (CHECK_AVAILABLE(kCTFontURLAttribute, macOS 10.6, *)) {
                              ^
libass/ass_coretext.c:39:50: note: in definition of macro 'CHECK_AVAILABLE'
 #define CHECK_AVAILABLE(sym, ...) (!!(intptr_t) &sym)
                                                  ^~~
libass/ass_coretext.c:93:30: note: each undeclared identifier is reported only once for each function it appears in
     else if (CHECK_AVAILABLE(kCTFontURLAttribute, macOS 10.6, *)) {
                              ^
libass/ass_coretext.c:39:50: note: in definition of macro 'CHECK_AVAILABLE'
 #define CHECK_AVAILABLE(sym, ...) (!!(intptr_t) &sym)
                                                  ^~~
make[1]: *** [libass/ass_coretext.lo] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2" && /usr/bin/make -w all
Exit code: 2
Error: Failed to build libass: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port libass failed
geekbook:~ admin$ edit /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libass/libass/work/libass-0.17.2/libass/ass_coretext.c

The default on powerpc should be to build from source always. Open this file `/opt/local/etc/macports/macports.conf` and add:
Code:
buildfromsource         always
If you do not want to do that for some reason, to force building from source once add `-s` flag (i.e. sudo port -v -s build etc.).
Having said that, what you see is not an error: by default MacPorts tries to fetch prebuilt package first. If that fails, it automatically proceeds to build from source. Just let it do its work.

For libass error I suggest to follow up with upstream. As a one-time hack you can try my suggestion above, that is likely to work.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,195
1,469
I edited with the cmd "edit" (but not in /usr/local/bin, cause it is not there) the file.

I have BBEdit installed, and it has its binaries in that dir:
Code:
36-202% cd /usr/local/bin
36-202% ls
bbdiff                    jags
bbedit                    kak
bbfind                    lspci
c++decl                    mac
cdecl                    packagesbuild
darwinbuild                packagesutil
darwinmaster                powerpc-apple-darwin8-gfortran-4.2
darwinxref                setpci
gdb7                    tor
gfortran                tor-gencert
gfortran-4.0                tor-print-ed-signing-cert
gfortran-4.2                tor-resolve
gfortran-uninstall            torify
goldin_64                update-pciids
i686-apple-darwin8-gfortran-4.2
(I should probably delete all this garbage from here installed god knows how and when.)
I think TextWrangler installs by default in the same place, but anyway, as long as it works, why bother.
 

saxfun

macrumors member
Mar 14, 2016
94
16
Germany
I give up. NONE of the fixes work. it's always failing with the error above. Your temporary fix won't work and the upstream fix neither. frustrating.
 
Last edited:

barracuda156

macrumors 68020
Sep 3, 2021
2,195
1,469
I give up. NONE of the fixes work. it's always failing with the error above. YouTube temporary fix won't work and the upstream fix neither. frustrating.

Sorry, I do not get how you can possibly get the same error if you tried what I suggested in https://forums.macrumors.com/thread...ns.2433567/page-5?post=33389453#post-33389453 – because that literally deletes the chunk of code which is included by your build but should not.
It is possible that the build gonna fail on something else. It can’t fail on the code which is removed (assuming you did try that).
 

barracuda156

macrumors 68020
Sep 3, 2021
2,195
1,469
  • Like
Reactions: saxfun

doctor_dog

macrumors regular
Dec 19, 2022
109
107
Let me be clear, I do not make a claim that no existing port can possibly build and work as `-x11 +quartz` (there are no +xquartz variants, AFAIK). Maybe some will, I just do not know of such. At least what I did try failed, because essential dependencies do not build (I recall, gtk3 itself does not, which means nothing using gtk will – unless, maybe, you use an archaic gtk2).

You were 100% correct, I was conflating two different things. +/-x11 or +/-quartz are indeed the port variant norms.

I went back and looked, I did change to a -x11 variant for a Python package because it specifically needed XQuartz, but I don't know why. All I know is that the program wouldn't launch until I installed XQuartz and installed the -x11 variant. No such thing as +xquartz though AFAICT.
 
  • Like
Reactions: barracuda156
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.