aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sxiv.rb
blob: 543c9f442e41d611ef7250fef181e32942e137b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
require 'formula'

class Sxiv < Formula
  homepage 'https://github.com/muennich/sxiv'
  url 'https://github.com/downloads/muennich/sxiv/sxiv-1.0.tar.gz'
  sha1 'e29e33c38fd2a6c8a2cb3b270776859328aa8e0e'

  head 'https://github.com/muennich/sxiv.git'

  depends_on :x11
  depends_on 'imlib2'
  depends_on 'giflib' => :optional
  depends_on 'libexif' => :optional

  # Makefile uses GNU install
  def patches; DATA; end

  def install
    system "make", "config.h"

    if build.with? "giflib"
      inreplace "config.h", "#define GIF_SUPPORT  0", "#define GIF_SUPPORT  1"
    end

    if build.with? "libexif"
      inreplace "config.h", "#define EXIF_SUPPORT 0", "#define EXIF_SUPPORT 1"
    end

    system "make", "PREFIX=#{prefix}", "install"
  end

  test do
    system "#{bin}/sxiv", "-v"
  end
end

__END__
diff --git a/Makefile b/Makefile
index 32c644f..0cd8019 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,8 @@ dist: clean
 
 install: all
 	@echo "installing executable file to $(DESTDIR)$(PREFIX)/bin"
-	@install -D -m 755 sxiv $(DESTDIR)$(PREFIX)/bin/sxiv
+	@install -d $(DESTDIR)$(PREFIX)/bin
+	@install -m 755 sxiv $(DESTDIR)$(PREFIX)/bin/sxiv
 	@echo "installing manual page to $(DESTDIR)$(MANPREFIX)/man1"
 	@mkdir -p $(DESTDIR)$(MANPREFIX)/man1
 	@sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1