summaryrefslogtreecommitdiffstats
path: root/src/lensfun.mk
blob: b86bb6c109212f7cfaca004500cc5f336db192b8 (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
# This file is part of MXE.
# See index.html for further information.

PKG             := lensfun
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 0.3.0
$(PKG)_CHECKSUM := 60e2bf3a6a2f495076db1d88778a00d358cf0b69
$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.bz2
$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/lensfun/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc glib libgnurx libpng

define $(PKG)_UPDATE
    $(WGET) -q -O- 'http://sourceforge.net/projects/lensfun/files/' | \
    $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
    $(SORT) -V | \
    tail -1
endef

define $(PKG)_BUILD
    mkdir '$(1)/building'
    cd '$(1)/building' && cmake .. \
        -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
        -DBUILD_STATIC=$(if $(BUILD_STATIC),TRUE,FALSE) \
        -DINSTALL_IN_TREE=NO
    $(MAKE) -C '$(1)/building' -j '$(JOBS)' install VERBOSE=1

    # Don't use `-ansi`, as lensfun uses C++-style `//` comments.
    '$(TARGET)-gcc' \
        -W -Wall -Werror \
        '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-lensfun.exe' \
        `'$(TARGET)-pkg-config' lensfun glib-2.0 --cflags --libs`
endef