Statically link glib2 - macos

Is there any way to statically link glib2 to my binary? I am on a Mac OS X Lion.
If not, how someone suppose to develop an application that could be installed in a system not having glib libraries installed in their default location or not installed at all? In other words, distribution of binaries built with glib2 are for advanced users only, that know hot to download, build and install glib!? Where is the "Free software" spirit?

I don't know if there's any way to statically link GLib, but GIMP and GEdit (and other apps too) offer "normal" Mac OS X application bundles for download, so it's certainly possible to do it without static linking. Here are instructions on how GEdit does it.

Related

Can I use homebrew to compile static binaries with all dependency on macOS

I would like to compile a binary that is portable like a "normal" macOS bundle app.
For example using https://formulae.brew.sh/formula/cherrytree to create a macOS app that I can then share on a computer that do not have brew.
I know I can compile it using gcc directly. But is their a way to automatize library download and statically link those to the target binary?
I thought someone may have extended homebrew to do that?
I am also trying to create an app bundle which uses Homebrew packages but does not require other users to have Homebrew. The best I have been able to do so far is to install Homebrew inside the app bundle, for example, into a folder
/Applications/myApp.app/Contents/Homebrew
This has a big downside - it takes up a huge amount of disk space, of which only a small fraction is needed at runtime. You can clean it out by hand some after building, but it's painful.
Homebrew says installing into non default location is not officially supported, but it has been working OK. OTOH, the other Mac package manager, MacPorts, does officially support arbitrary install locations, but it doesn't actually work. Go figure...

install Frama-C on Mac OS X

How do I install a current Frama-C release and its prerequisites on Macs?
I have a laptop running Mac OS X 10.6.8 and a desktop running Mac OS X 10.7.5
which I can install software on. I also have access to a lab of machines
running Mac OS X 10.8 which our technical support people will install stuff on
if I ask nicely.
I have a student who is interested in program analysis and needs something
that we have a fighting chance of understanding and adding to. I was already
aware of Frama-C, and a colleague at another university recommended it.
I had previously tried to install Frama-C and failed miserably. The colleague
commented that he'd had the same experience. Well, times change. So I visited
the Frama-C web site, was more impressed and keener to have it than ever, and
set about it.
The frama-c.com download page doesn't have links to any binaries for the
current (Flourine 3) release for any platform. The link to installation
instruction takes me to a page that says to download the auto-installer.
What auto-installer?
There are instructions for an old version of Mac OS X, but following them
didn't work; loading one set of prerequisites as instructed produced a
state where the next prerequisite (gtksourceview) would not install.
Of course I checked the older releases, and I see that there's a Nitrogen
version for Mac OS X Leopard, but "Please untar the archive as root in /"
asks me to perform the impossible. I don't have a root account and will
never be given one (the machines all belong to the university). It is
perfectly possible to install gcc and clang anywhere you like; why does
Frama-C want to be in /?
In addition to Pascal's answer, you can also have a look to opam, which is a source package manager for OCaml applications. It appears to run on MacOS X, and there are packages for Frama-C's Oxygen and Fluorine.
All Frama-C binary packages want to install in / (precisely, in /usr/local/Frama-C) because Frama-C uses GTK+ and various GTK+-related libraries that were never designed to run from anything other than a fixed location. They load configuration files and resources from paths that have been hard-coded at compile-time. GCC and Clang install anywhere because they don't rely on GTK+. Like them, the command-line version of Frama-C can be relocated through various environment variables listed here.
Note that to take advantage of a binary package, you would only need one symbolic link pointing from /usr/local/Frama-C to the place where you really extracted the files, if your administrator(s) can grant you that. Binary packages only work for one OS X version. For packages available from the official website, this version is usually 10.6 (Snow Leopard).
I have ceased making Frama-C binary packages for two reasons:
by removing features and support for hardware configurations in each of the last two OS X releases, Apple has fragmented the OS X landscape in a way I don't have the time to deal with. You mention 10.6, 10.7 and 10.8 in your question. I also have Macs running each of 10.6, 10.7 and 10.8. They are all incompatible (when trying to build a software package that includes a compiler).
I have much less time available now that I am participating in the creation of a start-up that offers Frama-C-based static analysis to interested industrial users.
This said, Frama-C the Open-Source advanced research prototype continues to be developed and maintained, and continues to be a great testbed to experiment in. You can install Frama-C without root access on a Mac in two ways apart from what you have already tried:
Install only the command-line version. Then the only dependency is a recent version of the OCaml compiler. Frama-C's configure will detect that you do not have the GTK libraries and will not try to use them. Installation should take 20 minutes at most for a recent OCaml + the latest Frama-C.
Install a recent Linux distribution in a virtual machine. Use that distribution's package manager to obtain all the GTK+ dependencies. If the distribution's OCaml package is recent enough, use that and then the lablgtk-2 package, otherwise, compile OCaml and then lablgtk-2 from source. Then compile Frama-C.
For Fluorine, the oldest supported OCaml version is 3.12.1.
with macports:
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
sudo port install opam
opam init
Y
eval `opam config env`
sudo port install gtksourceview2 lablgtk2 ocaml-ocamlgraph
opam install frama-c

Mac compiler on windows

Is it possible to develop cross-platform application on Windows and can also compile for Mac OS X from Windows? I have checked Qt but that requires one to compile from Mac using Xcode.
If this is your priority then one option would be Java as at least a jar file built on one platform can be run on another.
If however you're talking about C or C++...
If you are creating a small command line tool then you might be able to make this work with gcc and a cross compiler, but I think it would be a lot of work.
If however you are wanting to create a GUI application I would urge you to give up now. There are so many issues - you'd have to use Carbon or Cocoa APIs which you can't build for on any other platform, you'd have to link against frameworks which won't exist on your compilation host, you won't be able to easily generate .plist files. Qt won't help as you need to be able to build it, which relies on these same frameworks.
In short, there's no alternative to building on an actual mac.
Furthermore, when it comes to fixing bugs, you will absolutely have to do this on a mac (either physical or virtual).
From what I know , in general you do need a mac to make the executable , even for a simple ansi c program you need gcc for mac.
You can create MacPorts Portfile.(If your application is open source)
A MacPorts port is a set of specifications contained in a Portfile
that defines an application, its characteristics, and any files or
special instructions required to install it. This allows you to use a
single command to tell MacPorts to automatically download, compile,
and install applications and libraries.
Take a look at IMCROSS.
IMCROSS is a simple, scripted method of installing cross-compilers and
cross-compiled libraries on a Linux (or possibly other *nix) system,
so that you can develop programs targeted to run on Microsoft Windows
and Mac OS X at the same time and in the same environment as you
develop Linux versions of those programs.
You can certainly do this using Real Studio. It can create Mac OS X applications on Windows without any trouble.
It cross-compiles for Windows, OS X and Linux. And it does it from any platform. It also can create web apps.
Sounds like you should check it out.

PyGTK Binaries for Mac

I'm trying to find the Mac OS X binaries for PyGTK 2.24, PyCairo, and PyGObjects, as well as for Glade 2.8.0.
Where can I download these?
The included versions are one older than what you specified, but the 0install project has a very nice Quartz build installer package.
I don't think precompiled binaries are available.
You can install via macports or fink: PyGTK from these package repositories use X11.
There's a native port of GTK at gtk-osx.sourceforge. I don't know how mature it is, because I haven't followed it for the last few years. In this case I'm afraid you need to build it yourself.

What is the quickest ay to enable fulltext support for Sqlite 3 on OS X?

Sqlite comes installed with OS X Developer Tools. What is the quickest/best way to upgrade or rebuild the default binary to support Sqlite's fulltext features?
The sqlite3 library is included as part of OS X in /usr/lib/. You should never attempt to modify or replace OS X system libraries. That could break your system and will likely get removed by a Software Update. Instead, install a separate copy and link your applications to that. For sqllite3, an easy solution is to install the version from MacPorts. You could also just build your own and install it in /usr/local/lib.

Resources