Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Friday, August 9, 2024

building emacs on mac from source

Building emacs from source 

many github emacs don't build successfully
internet info outdated, changes in emacs 30.1 libjansson  not needed, gnutls deprecated
need macport information, most info on homebrew;
emacs source build works but is not packaged in a dmg
most fail when moved out of build directory
binaries download from: emacsformacos.com

 

Beautiful emacs site

https://www.masteringemacs.org/all-articles

Successful Emacs build on mac aarch64

builds for emacsforosx.com

https://github.com/caldwell/build-emacs

GNU Emacs 30.1 (build 1, aarch64-apple-darwin22.6.0, NS appkit-2299.77
 Version 13.7.4 (Build 22H420)) of 2025-03-16
Copyright (C) 2025 Free Software Foundation, Inc.


https://github.com/caldwell/build-emacs/issues/145
https://github.com/caldwell/build-emacs/issues/132
https://github.com/caldwell/build-emacs/issues/103#issuecomment-822056419

https://github.com/caldwell/build-emacs/issues/142#issuecomment-2730442280

Currently all my builds use Nix to automatically get dependencies, but it should work with manual dependency management using Homebrew/MacPorts/whatever as long as those dependencies are in your path when you run build-emacs-from-tar --no-deps (--no-deps should really be called --no-automatic-deps or something). Check the output of configure to see if it is detecting your dependencies.

Steps to resolve issue:

deleted previous build directory

git clone https://github.com/caldwell/build-emacs
./fetch-emacs-from-ftp -v ftp://ftp.gnu.org/pub/gnu/emacs
 

./build-emacs-from-tar -v -j 8 --no-deps emacs-30.1.tar.bz2 release

rustup target add x86_64-apple-darwin
make
./combine-and-package -v Emacs-30.1-13-arm64.tar.bz2

produced:
Emacs-30.1-universal.dmg

dependencies.nix

pkgs.mkShell {
  buildInputs = [
    pkgs.darwin.apple_sdk.frameworks.AppKit

    pkgs.autoconf
    pkgs.pkgconfig
    ncurses-no-nix-store
    pkgs.zlib

    pkgs.gnutls
    pkgs.jansson
    pkgs.libxml2
    pkgs.librsvg
    pkgs.tree-sitter
    pkgs.sqlite
  ];
}

Successful Emacs build on macos 12.7 x86_64 

https://github.com/imrehorvath/bundle-dylibs

https://imrehorvath.wordpress.com/2021/04/17/wanna-build-gnu-emacs-on-macos-from-source/

 

Use bundle_dylib to move libs inside Emacs.app. 


Efficient successful build 29.4 (138MByte)

https://github.com/mclear-tools/build-emacs-macos







Switch from macports to brew

MBP i5


Macbook Air M3

 

Install a few packages:

sudo port install autoconf

sudo port install automake

sudo port install texinfo

sudo port install gnutls

sudo port install pkgconfig

sudo port install libgcc13

 

EmacsWiki

gcc Emacs 

Get the source code.
# git clone --depth 1 --branch emacs-29.4 https://git.savannah.gnu.org/git/emacs.git emacs-29.4  
$ git clone git://git.savannah.gnu.org/emacs.git 
$ cd emacs
    
$ ./autogen.sh 
$ ./configure 
$ make 
$ make install
configure: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package. 
./configure --with-native-compilation result in libgccjit errors
  

Package Notes

libgcc-devel broken port #68421 
https://issues.guix.gnu.org/issue/57849
 
M3 build time: 11m16s
M3  build time with libgcc13: 1m12s
M1 build time:  1m5s

Compiling Emacs on Mac

builds for emacsforosx.com

https://github.com/caldwell/build-emacs

https://porkrind.org/missives/mac-os-x-codesigning-woes/


Renard mentions moving libs into a common directory to make it .app portable

https://github.com/renard/emacs-build-macosx
 

Standalone Emacs

https://gitlab.kitware.com/paraview/common-superbuild/-/blob/920d9bc5c6c69fd945df84668f50aca34cdf5f6f/cmake/scripts/fixup_bundle.apple.py


automated build 

https://github.com/jimeh/build-emacs-for-macos
credits:
https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab#1-gcc-with-libgccjit-enabled

https://github.com/shshkn/emacs.d/blob/master/docs/nativecomp.md

https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058a2d23e

 

Simple build script provided:


refs:


self-contained build
https://github.com/jimeh/emacs-builds

emacs plus features recent updates:

https://github.com/d12frosted/homebrew-emacs-plus

build emacs on mac using port:

https://mac4translators.blogspot.com/2017/10/evolution.html

Many other good sites:

https://www.zellysnyder.com/posts/compiling-emacs-on-macos/
https://www.mattduck.com/2021-05-upgrading-to-emacs-28.html
 
https://www.masteringemacs.org/article/speed-up-emacs-libjansson-native-elisp-compilation
https://andersmurphy.com/2021/11/14/emacs-building-from-source-on-macos.html 
https://emacs-ng.github.io/emacs-ng/build/building/
https://emacs.stackexchange.com/questions/58526/how-do-i-build-emacs-from-sources-on-macos-catalina-version-10-15-4
https://github.com/railwaycat/homebrew-emacsmacport?tab=readme-ov-file
https://www.reddit.com/r/emacs/comments/u28dji/emacs_28_with_nativecomp_on_macos_with_macports/
 

Native m1 builds

https://cpufun.substack.com/p/setting-up-the-apple-m1-for-native

https://github.com/jimeh/build-emacs-for-macos/issues/47

Create signing Certificate




m3 pkgs:
port installed
The following ports are currently installed:
  autoconf @2.72_0 (active)
  cctools @949.0.1_3+xcode (active)
-   cowsay @3.7.0_0 (active)
  curl-ca-bundle @8.12.1_0 (active)
  db48 @4.8.30_5 (active)
  gcc13 @13.3.0_2+stdlib_flag (active)
  gcc13-libcxx @13.3.0_2+clang16 (active)
  gcc_select @0.1_10 (active)
  gdbm @1.24_0 (active)
  gettext-runtime @0.22.5_0 (active)
  gmp @6.3.0_0 (active)
  gnutls @3.7.11_1 (active)
  icu @76.1_0 (active)
  isl @0.24_1 (active)
  ld64 @3_6+ld64_xcode (active)
  ld64-xcode @2_6 (active)
  libffi @3.4.6_1 (active)
  libgcc @9.0_0 (active)
  libgcc13 @13.3.0_2+stdlib_flag (active)
  libgcc14 @14.2.0_3+stdlib_flag (active)
  libiconv @1.17_0 (active)
  libidn2 @2.3.8_0 (active)
  libmpc @1.3.1_0 (active)
  libtasn1 @4.20.0_0 (active)
  libunistring @1.3_0 (active)
  libxml2 @2.13.6_0 (active)
  libxslt @1.1.42_0 (active)
  lz4 @1.10.0_0 (active)
  m4 @1.4.19_1 (active)
  mpfr @4.2.1_0 (active)
  ncurses @6.5_0 (active)
  nettle @3.10_0 (active)
  p11-kit @0.25.5_0 (active)
  perl5.34 @5.34.3_1 (active)
  pkgconfig @0.29.2_0 (active)
  readline @8.2.013_0 (active)
  texinfo @7.2_0+perl5_34 (active)
  xz @5.6.4_0 (active)
  zlib @1.3.1_0 (active)
  zstd @1.5.6_0 (active)



m1 pkgs:
The following ports are currently installed:
  autoconf @2.72_0 (active)
  automake @1.16.5_0 (active)
  brotli @1.1.0_0 (active)
  bzip2 @1.0.8_0 (active)
  cctools @949.0.1_3+xcode (active)
  curl @8.8.0_1+ssl
  curl @8.9.1_1+brotli+http2+idn+psl+ssl+zstd (active)
  curl-ca-bundle @8.8.0_0
  curl-ca-bundle @8.9.1_0 (active)
  db48 @4.8.30_5 (active)
  gdbm @1.24_0 (active)
  gettext-runtime @0.22.5_0 (active)
  gmp @6.3.0_0 (active)
  gnutls @3.7.11_0 (active)
  icu @74.2_0 (active)
  isl @0.24_1 (active)
  ld64 @3_6+ld64_xcode (active)
  ld64-xcode @2_6 (active)
  libedit @20240517-3.1_0 (active)
  libffi @3.4.6_1 (active)
  libgcc @8.0_0 (active)
  libgcc13 @13.3.0_1+stdlib_flag (active)
  libgcc14 @14.2.0_1+stdlib_flag (active)
  libgit2 @1.7.2_0+threadsafe (active)
  libiconv @1.17_0 (active)
  libidn2 @2.3.7_0 (active)
  libmpc @1.3.1_0 (active)
  libpsl @0.21.5-20240306_0 (active)
  libssh2 @1.11.0_0 (active)
  libtasn1 @4.19.0_0 (active)
  libunistring @1.2_0 (active)
  libxml2 @2.13.3_0 (active)
  libxslt @1.1.42_0 (active)
  lz4 @1.9.4_0
  lz4 @1.10.0_0 (active)
  m4 @1.4.19_1 (active)
  mpfr @4.2.1_0 (active)
  ncurses @6.5_0 (active)
  nettle @3.10_0 (active)
  nghttp2 @1.62.1_0 (active)
  openssl @3_18 (active)
  openssl3 @3.3.1_1 (active)
  p11-kit @0.25.5_0 (active)
  pcre2 @10.44_0 (active)
  perl5.34 @5.34.3_1 (active)
  pkgconfig @0.29.2_0 (active)
  readline @8.2.001_0 (active)
  starship @1.19.0_0
  starship @1.20.1_0 (active)
  texinfo @7.1_0 (active)
  xz @5.4.7_0 (active)
  zlib @1.3.1_0 (active)
  zstd @1.5.6_0 (active)




 

 



Monday, July 15, 2024

cargo-generate bug iconv libiconv match libraries

linking error between macOS and macport provided libiconv library #1208

The problem is widespread and long lasting with many long discussions.

_libiconv or _iconv undefined symbol on Mac OSX

 

R-Problems with iconv on macOS

Longstanding GHC linking issues when multiple iconv libraries are installed on macOS (Haskell #18743)

 

long discussion:

MacOS iconv linkage misdetection (also deprecation warnings) #830

 

libiconv breaks compatibility with OS-provided #57821

 

rav1e @0.6.6: iconv linking fails, expecting symbols from MacOS's iconv lib #68026

rav1e: build fails due to git_allocator missing members #68178


 

Examples of possible fixes: 

ghc: Bugfixes for test and iconv linking #8523

Fix i/macOS libc++ initialization on early instrumentation #194

frida/frida-core

 

solution: libiconv on Mac OS X


FindIconv: Problem on macOS with mac ports


I can't imagine how cmake could possibly help you with this problem. The only thing cmake does is tell you where libiconv is located. It should not matter at all to your application whether it tells you about a system copy of libiconv like the one in /usr on macOS or a third-party copy of libiconv like the one in /opt/local provided by MacPorts, so long as you use both the headers and the library from the same place. The only way the problem you're experiencing could occur is if you're using the headers from one place and the library from another, so Don't Do That.

 

Thursday, May 9, 2024

building zed code editor on pop_os!

 building zed code editor on pop_os!

 

 https://github.com/zed-industries/zed/blob/main/docs/src/development/linux.md


Success!  Don't forget to install clang

Monday, August 23, 2021

macports gramps geneology build Universal binary

 

Installing macports pkg manager for macos 11.5.2


  • Install port 
  • edit macports.conf; uncomment the universal_archs line

sudo nano /opt/local/etc/macports/macports.conf

sudo port install gramps +universal

try this instead 

sudo port -s install gramps +universal 

result:

--->  Configuring m4

Error: Failed to configure m4: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/config.log

Error: Failed to configure m4: configure failure: command execution failed

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Error: Processing of port gramps failed

 

known issue

#62991    m4 @1.4.19+universal: configure: error:
 
sudo port clean m4 

sudo port install gramps

result:


--->  Configuring db53

Error: Failed to configure db53: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_db53/db53/work/db-5.3.28/build_unix/config.log

Error: Failed to configure db53: configure failure: command execution failed

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_db53/db53/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Error: Processing of port gramps failed

--->  Some of the ports you installed have notes:

  gawk has the following notes:

    readline support has been removed from gawk. If you need to run gawk interactively, install rlwrap:

    

    sudo port install rlwrap

    

    and run gawk using rlwrap:

    

    rlwrap gawk ...


db53 report filed

#63400    Error: Processing of port db53 failed


Check:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/config.log


$xcodebuild -showsdks




Nice Table of Xcode and macos versions

https://developer.apple.com/support/xcode/




Update needed after OS upgrade


sudo xcode-select --install



Big Sur problem builds

broken ports









Thursday, February 18, 2010

Building FireFox on Mac OS X 10.6 SnowLeopard

On Mac OS X 10.6 Snow Leopard

The 10.5 .mozconfig works fine for Firefox 3.6 called Gecko 1.9.2. The problems start after putting the 10.6 sdk line into .mozconfig many many crashes.




[DRAFT]

Saturday, September 26, 2009

my notes on building git on OS X 10.6 Snow Leopard

Hello!

Looking at the Omni frameworks I realized I would need the git source control package.

Dan Benjamin's HiveLogic article on building git on Snow Leopard explains the steps in detail.
What I am going to talk about are the road bumps I ran into.

After getting the git source, download:
asciidoc
xmlto
getopt
packages.

Alright, time to turn to MacPorts 1.8.0 to resolve all these dependencies. Except xmlto (bug#) hung up the works in MacPorts. Thanks to lightning fast response from MacPorts I found I needed to upgrade libxml2 to 2.7.5 thus:

sudo port install libxml2

After that xmlto installs fine as does git. Hope that helps. Cheers.

More links:
asciidoc
http://www.methods.co.nz/asciidoc/INSTALL.html#X1
http://sourceforge.net/projects/asciidoc/

xmlto
http://directory.fsf.org/project/xmlto/

getopt
http://huizen.dds.nl/~frodol/getopt.html
http://software.frodo.looijaard.name/getopt/download.php