Skip to content

Instantly share code, notes, and snippets.

@thomasfinch
Created March 23, 2017 06:20
Show Gist options
  • Save thomasfinch/424ab7da276f8474b53058fe29af1ae2 to your computer and use it in GitHub Desktop.
Save thomasfinch/424ab7da276f8474b53058fe29af1ae2 to your computer and use it in GitHub Desktop.
Bash script to build the fish shell for a jailbroken iOS device
#!/bin/bash
# Before running this script:
# Find AC_CHECK_FILES([/proc/self/stat]) in configure.ac and comment it out
# cd into the fish source directory
FLAGS="-stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -target armv7-apple-darwin16 -miphoneos-version-min=8.0.0"
PREFIX=$(pwd)"/deb"
# Build fish
CFLAGS=$FLAGS CXXFLAGS=$FLAGS ./configure --with-included-pcre2 --host=armv7-apple-darwin16 --build=x86_64-apple-darwin16 --prefix=PREFIX
make
make install
# "sign" all binaries
ldid -S ./deb/bin/*
# Create the control file
mkdir ./deb/DEBIAN
printf "Package: fish\nName: Fish Shell\nVersion: 2.5.0\nArchitecture: iphoneos-arm\nDescription: Fish is a smart and user-friendly command line shell\nHomepage: https://fishshell.com\nMaintainer: Thomas Finch <[email protected]>\nSection: Development\n" > ./deb/DEBIAN/control
# Make the deb
dpkg-deb --build -Zlzma deb/
mv deb.deb fish.deb
# Clean up
rm -r ./deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment