Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a software via Homebrew from .rb file

Tags:

homebrew

ruby

I'm new to Homebrew (as in I know nothing, I'm a Radiologist). I need to install an additional software for my medical data analysis soft. I have an .rb file and developers instructions but I'm stuck. Please help me to follow this. Where exactly should I download ruby file and how to run an installation from it?

Here's what I got.

# filename: xmedcon.rb.in                                                 #
                                                                       #
# UTILITY text: Medical Image Conversion Utility                          #                                                                     #
# # purpose     : the Homebrew formula template                             #
#                                                                         #
# project     : (X)MedCon by Erik Nolf                                    #
#                                                                         #
# credits     : contributed by Till-Karsten Hauser                        #
#               corrections by Cecil Yen                                  #
#                                                                         #
# usage       :                                                           #
#                                                                         #
#        1. download provided ".rb" file                                  #
#        2. rename to "xmedcon.rb"                                        #
#        3. install with "brew install --build-from-source xmedcon.rb"    #
#                                                                         #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

require 'formula'

class Xmedcon < Formula
  homepage 'http://xmedcon.sourceforge.net'
  url      'https://downloads.sourceforge.net/project/xmedcon/XMedCon-Source/0.23.0/xmedcon-0.23.0.tar.bz2'
  version  '0.23.0'
  sha256   '835091243a242c3cc1fb5608b9540d07204bc74d42238ec4c067a5baa543ba39'

  depends_on 'glib'
  depends_on 'gtk+3'
  depends_on 'gdk-pixbuf'
  depends_on 'pkg-config'
  depends_on 'libpng'
  depends_on 'adwaita-icon-theme'

  depends_on 'autoconf' => :build
  depends_on 'automake' => :build
  depends_on 'libtool'  => :build

  def install
    system "autoreconf", "--force", "--install"
    system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking"
    system "make", "install"
  end
> end

So I downloaded this part

require 'formula'

class Xmedcon < Formula
  homepage 'http://xmedcon.sourceforge.net'
  url      'https://downloads.sourceforge.net/project/xmedcon/XMedCon-Source/0.23.0/xmedcon-0.23.0.tar.bz2'
  version  '0.23.0'
  sha256   '835091243a242c3cc1fb5608b9540d07204bc74d42238ec4c067a5baa543ba39'

  depends_on 'glib'
  depends_on 'gtk+3'
  depends_on 'gdk-pixbuf'
  depends_on 'pkg-config'
  depends_on 'libpng'
  depends_on 'adwaita-icon-theme'

  depends_on 'autoconf' => :build
  depends_on 'automake' => :build
  depends_on 'libtool'  => :build

  def install
    system "autoreconf", "--force", "--install"
    system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking"
    system "make", "install"
  end

from GitHub and renamed it to "xmedcon.rb" as it was instructed...to my desktop, and than to Homebrew folder (¯_(ツ)_/¯)

and ran this command to my terminal and got

MacBook-Pro-USER:~ doc$ brew install --build-from- /usr/local/Homebrew/Library/Taps/homebrew/xmedcon.rb
Warning: No available formula or cask with the name "/usr/local/homebrew/library/taps/homebrew/xmedcon.rb".```
like image 975
TamaraA Avatar asked Dec 07 '25 06:12

TamaraA


1 Answers

Looking at what you posted I have two suggestions.

Inside your the xmedcon.rb you have only one "end" at the final of the file. You should have another 1. The first "end" closes "def install", the second one closes the CLASS at the top.

1- So, just download this file. It's already with the right name: xmedcon.rb

2- Install using brew install --build-from-source xmedcon.rb in the same directory of the file to keep it simple.

like image 64
Rafael Moreira Avatar answered Dec 09 '25 19:12

Rafael Moreira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!