summaryrefslogtreecommitdiffstats
path: root/src/metis.mk
blob: b6da6e949eb3c23d87fe775693245c001b54381a (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
# This file is part of MXE. See LICENSE.md for licensing information.

PKG             := metis
$(PKG)_WEBSITE  := glaros.dtc.umn.edu
$(PKG)_DESCR    := metis
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 5.1.0
$(PKG)_CHECKSUM := 76faebe03f6c963127dbb73c13eab58c9a3faeae48779f049066a21c087c5db2
$(PKG)_SUBDIR   := metis-$($(PKG)_VERSION)
$(PKG)_FILE     := metis-$($(PKG)_VERSION).tar.gz
$(PKG)_URL      := http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS     := gcc

define $(PKG)_UPDATE
    $(call GET_LATEST_VERSION, http://glaros.dtc.umn.edu/gkhome/metis/metis/download, metis-)
endef

define $(PKG)_BUILD
    # build and install the library
    cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \
        -DSHARED=$(CMAKE_SHARED_BOOL)
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install

    # create pkg-config file
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
    (echo 'Name: $(PKG)'; \
     echo 'Version: $($(PKG)_VERSION)'; \
     echo 'Description: $($(PKG)_DESCR)'; \
     echo 'Libs: -lmetis'; \
    ) > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'

    # compile test
    '$(TARGET)-g++' \
        -W -Wall \
        '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
        `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
endef