Wednesday, August 14, 2024

macports port hints

macports.org

search for available packages

https://ports.macports.org/

 

port installed
 
 
sudo port selfupdate

 

2.4. Uninstall MacPorts

uninstall all installed packages

sudo port -fp uninstall installed

 To find the location of installed components, use the contents subcommand:

port contents libxml2
macport prefix
 
 
https://github.com/cargo-generate/cargo-generate/issues/1208#issuecomment-2182884600
sudo port deactivate libiconv cargo install cargo-generate sudo port activate libiconv

 

 

 
 
 
 

Friday, August 9, 2024

building emacs on mac from source

Building emacs from source 

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 pkg-config

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/


Mentions many good previous refs like renard

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

 


Standalone Emacs

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

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

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

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

emacs plus features recent updates:

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

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

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:
The following ports are currently installed:
  alex @3.5.1.0_0+haskell_cabal_use_prebuilt
  autoconf @2.72_0 (active)
  automake @1.16.5_0 (active)
  brotli @1.1.0_0 (active)
  bzip2 @1.0.8_0 (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-devel @3.8.6_0 (active)
  icu @74.2_0 (active)
  libedit @20240517-3.1_0 (active)
  libffi @3.4.6_1 (active)
  libgit2 @1.7.2_0+threadsafe (active)
  libiconv @1.17_0 (active)
  libidn2 @2.3.7_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)
  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)

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)




 

 


Wednesday, July 17, 2024

using git; rust doc guessing game

using git

 

git init

git add .

git commit . -m "initial commit"

 

Files to exclude from version control

.gitignore
https://github.com/github/gitignore/blob/main/Rust.gitignore
 
https://github.com/github/gitignore/blob/main/Haskell.gitignore
 

and for other languages.

git - the simple guide

MS Class Github Foundations

Programming a Guessing Game

Rust Book: Guessing Game

 

 

 

 

 

 

 

 

Monday, July 15, 2024

cargo-generate bug iconv libiconv

linking error between macOS and macport provided libiconv library #1208

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


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

 

Examples of possible fixes: 

ghc: Bugfixes for test and iconv linking #8523

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

frida/frida-core

 



 

Sunday, July 7, 2024

raspberry pico,linux on ipad

Raspberry Pi Pico 

Microcontroller Development Board

Pico Displays


 

 

 

 

Need to put that 1st gen iPad to use.  

Apple Cortex A7 processor

https://konradybcio.pl/linuxona7/

https://ipadlinux.org/



Saturday, June 29, 2024

emacs install rust-mode, universal binary, emacs-nw

Install rust-mode for emacs

https://github.com/rust-lang/rust-mode?tab=readme-ov-file#melpa

https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html 

https://melpa.org/#/getting-started

create 

touch ~/.emacs.d/init.el

add lines to init.el

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)

 

Now you can install rust-mode with:

M-x package-install rust-mode

And put this in your config to load rust-mode automatically:

(require 'rust-mode)

emacs in the terminal

Prevent launching of a new window for emacs.

 sudo ln -s /Applications/Emacs.app/Contents/MacOS/emacs-nw /usr/local/bin/emacs

 

macOS emacs Universal Binary

emacs osx Universal binary 

lipo -arch almost pointless; tried it on the emacs Universal Binary only reduced the size by 4MB.  Not worth it.  

 man lipo

lipo -archs Emacs.app/Contents/MacOS/Emacs
 
lipo -remove x86_64 Emacs.app/Contents/MacOS/Emacs -output Emacs.app/Contents/MacOS/Emacs2
eclecticlight.co has an article about it:

Instant weight loss: how to strip Universal Apps

 

Installing emacs-nox (linux)

From PPA:

https://ubuntuhandbook.org/index.php/2022/06/install-gnu-emacs-28-1-ubuntu-22-04-20-04/ 

## Installing emacs from PPA ##
sudo apt remove --autoremove emacs emacs-common
sudo add-apt-repository ppa:ubuntuhandbook1/emacs
sudo apt install emacs-nox emacs-common


Other methods

https://gist.github.com/rscircus/77e91b36de1e431e0310611a32786e3c

 https://github.com/alexmurray/emacs-snap

 

Thursday, June 27, 2024

Considering nix on macOS

Considering nix on macOS

Stop the madness: Let's not go down this rabbit hole

I have known about nix and nixOS for a long, long time.  I think Eelco Dolstra was still a graduate student when I first took it for a spin.  It was cool; but I didn't need its features because I was not a developer.  port (macports.org) does everything I need.

A graphical installer for Nix

 
 
https://determinate.systems/posts/graphical-nix-installer/

Setting up Nix on macOS



zero-to-nix.com

 

6nok.org

How Fatih uses Nix on macOS

read more at the end

 

Ian Henry: blog posts on Nix

 

Upgrade your Development Environments with Devbox