Skip to content

Instantly share code, notes, and snippets.

@mig
Forked from wfarr/build-emacs-osx.rb
Created December 24, 2008 05:05

Revisions

  1. mig renamed this gist Dec 24, 2008. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions build-emacs-osx.rb → build-emacs-fedora10.rb
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,10 @@

    config_opts = ["--with-jpeg=no", "--with-gif=no", "--with-tiff=no", "--with-ns"]

    source_dir = "#{ENV['HOME']}/Source"
    source_dir = "#{ENV['HOME']}/src"
    repo_dir = "#{source_dir}/emacs"
    install_dir = "#{repo_dir}/nextstep/Emacs.app"
    install_target = "/Applications/Emacs.app"
    #install_dir = "#{repo_dir}/nextstep/Emacs.app"
    #install_target = "/Applications/Emacs.app"

    def git(command); system "git #{command}"; end
    def make(command); system "make #{command}"; end
    @@ -31,11 +31,11 @@ def make(command); system "make #{command}"; end
    make "clean"
    system "./configure #{config_opts.join(' ')}"
    make "-j2"
    make "install"
    #make "install"

    puts "Installing Emacs.app"
    FileUtils.rm_rf(install_target) if File.directory?(install_target)
    FileUtils.move(install_dir, "/Applications/")
    #puts "Installing Emacs.app"
    #FileUtils.rm_rf(install_target) if File.directory?(install_target)
    #FileUtils.move(install_dir, "/Applications/")

    puts "All done. Just run Emacs.app from your Applications folder."
    #puts "All done. Just run Emacs.app from your Applications folder."

  2. @wfarr wfarr revised this gist Dec 5, 2008. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-emacs-osx.rb
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ def make(command); system "make #{command}"; end
    make "install"

    puts "Installing Emacs.app"
    FileUtils.rm_rf(install_target) if File.directory(install_target)
    FileUtils.rm_rf(install_target) if File.directory?(install_target)
    FileUtils.move(install_dir, "/Applications/")

    puts "All done. Just run Emacs.app from your Applications folder."
  3. @wfarr wfarr revised this gist Dec 2, 2008. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion build-emacs-osx.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    #!/bin/env ruby
    require 'fileutils'

    config_opts = ["--with-jpeg=no", "--with-gif=no", "--with-tiff=no", "--with-ns"]

    source_dir = "#{ENV['HOME']}/Source"
    repo_dir = "#{source_dir}/emacs"
    install_dir = "#{repo_dir}/nextstep/Emacs.app"
    @@ -27,7 +29,7 @@ def make(command); system "make #{command}"; end
    end

    make "clean"
    system "./configure --with-jpeg=no --with-gif=no --with-tiff=no --with-ns"
    system "./configure #{config_opts.join(' ')}"
    make "-j2"
    make "install"

  4. @wfarr wfarr renamed this gist Dec 2, 2008. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @wfarr wfarr created this gist Dec 2, 2008.
    39 changes: 39 additions & 0 deletions build-emacs-osx.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/env ruby
    require 'fileutils'

    source_dir = "#{ENV['HOME']}/Source"
    repo_dir = "#{source_dir}/emacs"
    install_dir = "#{repo_dir}/nextstep/Emacs.app"
    install_target = "/Applications/Emacs.app"

    def git(command); system "git #{command}"; end
    def make(command); system "make #{command}"; end

    unless File.directory?(repo_dir)
    puts "Need to clone emacs repo first"
    Dir.mkdir(source_dir) unless File.directory?(source_dir)
    Dir.chdir(source_dir)
    git "clone git://repo.or.cz/emacs.git"
    first_time = true
    end

    Dir.chdir(repo_dir)
    pull = `git pull`
    if (pull =~ /Already up-to-date\./) && (!first_time)
    puts "No commits to pull in. Not building."
    exit
    else
    puts "There are new commits. Building."
    end

    make "clean"
    system "./configure --with-jpeg=no --with-gif=no --with-tiff=no --with-ns"
    make "-j2"
    make "install"

    puts "Installing Emacs.app"
    FileUtils.rm_rf(install_target) if File.directory(install_target)
    FileUtils.move(install_dir, "/Applications/")

    puts "All done. Just run Emacs.app from your Applications folder."