homebrew-core/Formula/xplanetfx.rb
2016-05-12 00:15:57 +01:00

56 lines
2.1 KiB
Ruby

class Xplanetfx < Formula
desc "Configure, run or daemonize xplanet for HQ Earth wallpapers"
homepage "http://mein-neues-blog.de/xplanetFX/"
url "http://repository.mein-neues-blog.de:9000/archive/xplanetfx-2.6.9_all.tar.gz"
version "2.6.9"
sha256 "a739f58bad5656be9c947b184661aa95941488add2bca181b294f2d5429989a1"
bottle do
cellar :any_skip_relocation
sha256 "8d4b531e39c9dc8a384155129fc23f8d7370c2e32618c774c75f47b44d5b06e7" => :el_capitan
sha256 "79421111e8b5ec8ddb4229c374c072a96882aa4b50301613e8c90d4e0a6068c2" => :yosemite
sha256 "2471ac12a443dcc6fc75cd0a3fc6587446d916ec33bb42587f04c6c548480199" => :mavericks
end
option "without-gui", "Build to run xplanetFX from the command-line only"
option "with-gnu-sed", "Build to use GNU sed instead of OS X sed"
depends_on "xplanet"
depends_on "imagemagick"
depends_on "wget"
depends_on "coreutils"
depends_on "gnu-sed" => :optional
if build.with? "gui"
depends_on "librsvg"
depends_on "pygtk" => "with-libglade"
end
skip_clean "share/xplanetFX"
def install
inreplace "bin/xplanetFX", "WORKDIR=/usr/share/xplanetFX", "WORKDIR=#{HOMEBREW_PREFIX}/share/xplanetFX"
prefix.install "bin", "share"
path = "#{Formula["coreutils"].opt_libexec}/gnubin"
path += ":#{Formula["gnu-sed"].opt_libexec}/gnubin" if build.with?("gnu-sed")
if build.with?("gui")
ENV.prepend_create_path "PYTHONPATH", "#{HOMEBREW_PREFIX}/lib/python2.7/site-packages/gtk-2.0"
ENV.prepend_create_path "GDK_PIXBUF_MODULEDIR", "#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders"
end
bin.env_script_all_files(libexec+"bin", :PATH => "#{path}:$PATH", :PYTHONPATH => ENV["PYTHONPATH"], :GDK_PIXBUF_MODULEDIR => ENV["GDK_PIXBUF_MODULEDIR"])
end
def post_install
if build.with?("gui")
# Change the version directory below with any future update
ENV["GDK_PIXBUF_MODULEDIR"]="#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders"
system "#{HOMEBREW_PREFIX}/bin/gdk-pixbuf-query-loaders", "--update-cache"
end
end
test do
system "#{bin}/xplanetFX", "--help"
end
end