-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibsoil.rb
57 lines (49 loc) · 1.39 KB
/
libsoil.rb
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
52
53
54
55
56
57
# libsoil formula
# copied from https://github.com/Nyoho/homebrew-libsoil
require 'formula'
class Libsoil < Formula
homepage 'https://github.com/smibarber/libSOIL'
url 'https://codeload.github.com/smibarber/libSOIL/zip/master'
version '1.07'
sha256 'f1bde5bd3cf0aba85da210302ff0c829ed0a239a38ae3c48cc9bcdae62c1ae94'
def patches
DATA
end
def install
system "make lib"
system "make install"
end
end
__END__
diff --git a/Makefile b/Makefile
index 6844aa6..630a698 100755
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
MAKE = make
CC = gcc
-INSTALL_FILE = install -p -o root -g admin -m 644
-INSTALL_DIR = install -o root -g admin -d
+INSTALL_FILE = install -p -m 644
+INSTALL_DIR = install -d
LN = ln -s
RM = rm -fv
CFLAGS += -c -O2 -Wall
@@ -17,8 +17,9 @@ HFILES = SOIL.h image_DXT.h image_helper.h \
stbi_DDS_aug.h stbi_DDS_aug_c.h stb_image_aug.h
AFILE = libSOIL.a
DYLIBFILE = libSOIL.dylib
-INCLUDEDIR = opt/local/include/SOIL
-LIBDIR = opt/local/lib
+DESTDIR = /$HOMEBREW_PREFIX
+INCLUDEDIR = include/SOIL
+LIBDIR = lib
all: $(OFILES) lib
@@ -30,7 +31,7 @@ lib: $(OFILES)
ar -cvq $(LIBNAME).a $(OFILES)
# create shared library
gcc -dynamiclib -o $(DYLIBFILE) $(OFILES) $(LDFLAGS)\
- -install_name $(DESTDIR)/$(LIBDIR)/$(DYLIBFILE)
+ -install_name /$HOMEBREW_PREFIX/libsoil/1.07/$(DYLIBFILE)
install:
$(INSTALL_DIR) $(DESTDIR)/$(INCLUDEDIR)