gnustep / tools-scripts

The purpose of these scripts is to simplify GNUstep installation and dependency management.
http://www.gnustep.org
GNU General Public License v3.0
8 stars 13 forks source link

Trying to install GNUstep on macOS Big Sur using tool-scripts... #4

Open pierre-rs opened 3 years ago

pierre-rs commented 3 years ago

Hello!

I am trying to install GNUstep on macOS Big Sur using these tool-scripts. My main goal would be to try to run the GWorkspace file manager (which is amazing!) and maybe some other applications. As some errors appeared I am trying to find out what it might be, if anyone has any tips about it it would be very welcome!

What I've done so far is the following:

  1. I installed Xcode from the App Store.
  2. I installed Command Line Developer Tools (xcode-select --install)
    gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 12.0.0 (clang-1200.0.32.29)
    Target: x86_64-apple-darwin20.3.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    clang --version
    Apple clang version 12.0.0 (clang-1200.0.32.29)
    Target: x86_64-apple-darwin20.3.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
    gnumake --version
    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

3. I cloned the libs-base, libs-back, libs-gui and tool-make repositories into a directory.

mkdir -p ~/Downloads/gnustep cd ~/Downloads/gnustep git clone https://github.com/gnustep/libs-base.git git clone https://github.com/gnustep/libs-back.git git clone https://github.com/gnustep/libs-gui.git git clone https://github.com/gnustep/tools-make.git

4. The first two scripts that I ran, I didn't see any noticeable errors:

./tools-scripts/clang-build ./tools-scripts/compile-all

5. When running the build-darwin script, errors appeared:

./tools-scripts/build-darwin

I selected the most notable errors (from build-darwin script output) below:

... ======== Build base (...) In file included from GCObject.m:31: In file included from .././common.h:59: ../../Headers/Foundation/NSString.h:974:15: error: 'objc_class' is unavailable extern struct objc_class _NSConstantStringClassReference; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/runtime.h:55:8: note: 'objc_class' has been explicitly marked unavailable here struct objc_class { ^ In file included from GCArray.m:27: In file included from .././common.h:59: ../../Headers/Foundation/NSString.h:974:15: error: 'objc_class' is unavailable extern struct objc_class _NSConstantStringClassReference; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/runtime.h:55:8: note: 'objc_class' has been explicitly marked unavailable here struct objc_class { ^ In file included from GSObjCRuntime.m:32: In file included from .././common.h:59: ../../Headers/Foundation/NSString.h:974:15: error: 'objc_class' is unavailable extern struct objc_class _NSConstantStringClassReference; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/runtime.h:55:8: note: 'objc_class' has been explicitly marked unavailable here struct objcclass { ^ 1 error generated. 1 error generated. gnumake[4]: [obj/Additions.obj/GCObject.m.o] Error 1 gnumake[4]: Waiting for unfinished jobs.... gnumake[4]: [obj/Additions.obj/GCArray.m.o] Error 1 In file included from GSObjCRuntime.m:52: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/Protocol.h:39: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:53:1: error: duplicate interface definition for class 'NSObject' @interface NSObject { ^ ../../Headers/Foundation/NSObject.h:292:12: note: previous definition is here @interface NSObject ^ 2 errors generated. gnumake[4]: [obj/Additions.obj/GSObjCRuntime.m.o] Error 1 gnumake[3]: *** [internal-subproject-all] Error 2 gnumake[2]: [Additions.all.subproject.variables] Error 2 gnumake[1]: [internal-all] Error 2 make: [internal-all] Error 2 (...) ======== Build gui (...) aking all in Source ... /usr/local/opt/GNUstep/System/Library/Makefiles/mkinstalldirs . mv ../Headers/Additions/GNUstepGUI/config.h . touch ./config.h Making all for library libgnustep-gui... Compiling file Functions.m ... Compiling file NSAccessibility.m ... Compiling file NSAccessibilityCustomAction.m ... Compiling file NSAccessibilityCustomRotor.m ... /bin/sh: gcc-10: command not found /bin/sh: gcc-10: command not found /bin/sh: gcc-10: command not found /bin/sh: gcc-10: command not found gnumake[4]: [obj/libgnustep-gui.obj/NSAccessibility.m.o] Error 127 gnumake[4]: Waiting for unfinished jobs.... gnumake[4]: [obj/libgnustep-gui.obj/Functions.m.o] Error 127 gnumake[4]: [obj/libgnustep-gui.obj/NSAccessibilityCustomAction.m.o] Error 127 gnumake[4]: [obj/libgnustep-gui.obj/NSAccessibilityCustomRotor.m.o] Error 127 gnumake[3]: [internal-library-all_] Error 2 gnumake[2]: [libgnustep-gui.all.library.variables] Error 2 gnumake[1]: [internal-all] Error 2 make: [internal-all] Error 2 (...) ======== Build back (...) configure: error: libXt not found - required for building x11 server /usr/local/opt/GNUstep/System/Library/Makefiles/common.make:203: back.make: No such file or directory This is gnustep-make 2.9.0. Type 'gnumake print-gnustep-make-help' for help. Running in gnustep-make version 2 strict mode. if [ -x config.status ]; then \ ./config.status --recheck && ./config.status; \ else \ ./configure; \ fi checking build system type... x86_64-apple-darwin20.3.0 checking host system type... x86_64-apple-darwin20.3.0 checking target system type... x86_64-apple-darwin20.3.0 configure: WARNING: You are running configure with the compiler (gcc-10) set to a different value from that used by gnustep-make (clang). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use gcc-10 or run the gnustep-base configure again with your CC environment var iable set to clang configure: WARNING: You are running configure with the compiler (g++-10) set to a different value from that used by gnustep-make (clang++). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use g++-10 or run the gnustep-base configure again with your CXX environment variable set to clang++ checking for gcc... gcc-10 checking whether the C compiler works... no configure: error: in /Users/pierre/Downloads/gnustep/libs-back': configure: error: C compiler cannot create executables Seeconfig.log' for more details make: *** [back.make] Error 77 Done.



Searching the internet for the error ```"checking whether the C compiler works ... no"``` I found [this](https://stackoverflow.com/questions/22844522/os-x-10-9-2-checking-whether-the-c-compiler-works-no) and [this](https://github.com/react-native-maps/react-native-maps/issues/2290) too. Which suggested running the ```"sudo xcode-select --switch /Applications/Xcode.app"``` command. But it ended up having no effect.

I also don't know if what is happening has anything to do with disabling this [SIP](https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection) thing on macOS.

I also don't know when I should install X11 (Xorg), whether from Brew or Macports or XQuartz ... I don't know if the errors I'm seeing now would have anything to do with the lack of X11 ...

Any help would be greatly appreciated!
porteusconf commented 1 year ago

Well, homebrew has a formula for gnustep-base and gnustep-make that can build from source. Excepts below from gnustep-base.rb and gnustep-make.rb

class GnustepBase < Formula
  desc "Library of general-purpose, non-graphical Objective C objects"
  homepage "https://github.com/gnustep/libs-base"
  url "https://github.com/gnustep/libs-base

lass GnustepMake < Formula
  desc "Basic GNUstep Makefiles"
  homepage "http://gnustep.org"
  url "http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.9.0.tar.gz"

But the pre-compiled binaries and libs (aka bottles) installed ok for me on macos12 on intel (with no X11/XQuartz)...

student@studentair Tools % date
Sun Nov  6 00:21:39 EDT 2022
student@studentair Tools % sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
brew install gnustep-base gnustep-make
 % brew info gnustep-base gnustep-make 
==> gnustep-base: stable 1.28.0 (bottled)
Library of general-purpose, non-graphical Objective C objects
https://github.com/gnustep/libs-base
/usr/local/Cellar/gnustep-base/1.28.0_1 (1,918 files, 5.1MB) *
  Poured from bottle on 2022-11-05 at 20:39:57
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gnustep-base.rb
License: GPL-2.0-or-later
==> Dependencies
Build: gnustep-make ✔
Required: gmp ✔, gnutls ✔
==> Analytics
install: 12 (30 days), 56 (90 days), 122 (365 days)
install-on-request: 11 (30 days), 55 (90 days), 121 (365 days)
build-error: 0 (30 days)

==> gnustep-make: stable 2.9.0 (bottled)
Basic GNUstep Makefiles
http://gnustep.org
/usr/local/Cellar/gnustep-make/2.9.0 (204 files, 1.5MB) *
  Poured from bottle on 2022-11-05 at 20:40:04
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gnustep-make.rb
License: GPL-3.0-or-later
==> Analytics
install: 10 (30 days), 42 (90 days), 154 (365 days)
install-on-request: 10 (30 days), 35 (90 days), 139 (365 days)
build-error: 0 (30 days)
gcasa commented 5 months ago

There are much LARGER issues to getting GNUstep to build on macOS. Very little attention has been given to doing this since macOS is considered to be the model that we are following. It would be like having WINE on Windows. That being said, I do understand the need for this given that it would allow more direct comparison between GNUstep and Cocoa.