summaryrefslogtreecommitdiffstats
path: root/src/ocaml-lablgl.mk
blob: e4ed6d5f7eec465311733c4aa8e5451018df46ec (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
52
53
54
55
56
57
# This file is part of MXE.
# See index.html for further information.

PKG             := ocaml-lablgl
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 20120306
$(PKG)_CHECKSUM := 996f0aba788f5fa1531587fb06d667b94237cc92
$(PKG)_SUBDIR   := lablGL
$(PKG)_FILE     := lablgl-$($(PKG)_VERSION).tar.gz
$(PKG)_URL      := http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc ocaml-findlib gtkglarea

define $(PKG)_UPDATE
    $(WGET) -q -O- 'http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html' | \
    $(SED) -n 's,.*lablgl-\([^>]*\)\.tar.*,\1,ip' | \
    head -1
endef

define $(PKG)_BUILD
    (echo 'CAMLC = $(TARGET)-ocamlc'; \
     echo 'CAMLOPT = $(TARGET)-ocamlopt'; \
     echo 'BINDIR = $(PREFIX)/$(TARGET)/bin'; \
     echo '#XINCLUDES = -I$(PREFIX)/$(TARGET)/X11R6/include'; \
     echo '#XLIBS = -lXext -lXmu -lX11'; \
     echo '#TKINCLUDES = -I(PREFIX)/$(TARGET)/include'; \
     echo 'GLINCLUDES = -DHAS_GLEXT_H -DGL_GLEXT_PROTOTYPES -DGLU_VERSION_1_3'; \
     echo 'GLLIBS = -lglu32 -lopengl32'; \
     echo 'GLUTLIBS = $(shell $(PREFIX)/bin/$(TARGET)-pkg-config --libs glut)'; \
     echo 'RANLIB = $(TARGET)-ranlib'; \
     echo 'TOOLCHAIN = unix'; \
     echo 'XB ='; \
     echo 'XE ='; \
     echo 'XS ='; \
     echo '# NB: The next two lines have a space after them.'; \
     echo 'MKLIB = $(TARGET)-ar rcs '; \
     echo 'MKDLL = $(TARGET)-ocamlmklib -o '; \
     echo 'LIBDIR = $(PREFIX)/$(TARGET)/lib/ocaml'; \
     echo 'DLLDIR = $(PREFIX)/$(TARGET)/lib/ocaml/stublibs'; \
     echo 'INSTALLDIR = $(PREFIX)/$(TARGET)/lib/ocaml/lablGL'; \
     echo '#TOGLDIR=Togl'; \
     echo '#COPTS = $RPM_OPT_FLAGS'; \
     echo 'OCAMLDLL ='; \
     echo 'LIBRARIAN = $(TARGET)-ocamlmklib'; \
     echo 'VAR2DEF=$(TARGET)-ocamlrun $$(SRCDIR)/var2def'; \
     echo 'VAR2SWITCH=$(TARGET)-ocamlrun $$(SRCDIR)/var2switch') \
     > $(1)/Makefile.config
    cd '$(1)' && $(SED) -i 's/ocamlc/$(TARGET)-ocamlc/g' src/Makefile
    cd '$(1)' && $(SED) -i 's/camlp4o/$(TARGET)-camlp4o/g' src/Makefile
    $(MAKE) -C '$(1)' -j 1 lib libopt install
    (echo 'version="$($(PKG)_VERSION)"'; \
     echo 'directory="+lablGL"'; \
     echo 'archive(byte) = "lablgl.cma"'; \
     echo 'archive(native) = "lablgl.cmxa"') \
     > $(PREFIX)/$(TARGET)/lib/ocaml/lablGL/META
endef

$(PKG)_BUILD_x86_64-w64-mingw32 =