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

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

define $(PKG)_UPDATE
    $(WGET) -q -O- "http://developer.berlios.de/project/showfiles.php?group_id=9034" | \
    grep -i 'lensfun.*tar' | \
    $(SED) -n 's,.*lensfun-\([0-9][^>]*\)\.tar.*,\1,p' | \
    head -1
endef

define $(PKG)_BUILD
    $(SED) -i 's,/usr/bin/python,/usr/bin/env python,' '$(1)/configure'
    $(SED) -i 's,make ,$(MAKE) ,'                      '$(1)/configure'
    cd '$(1)' && \
        TKP='$(TARGET)-' \
        ./configure \
        --prefix='$(PREFIX)/$(TARGET)' \
        --sdkdir='$(PREFIX)/$(TARGET)' \
        --compiler=gcc \
        --target=windows.x86 \
        --mode=release \
        --vectorization= \
        --staticlibs=YES
    $(MAKE) -C '$(1)' -j '$(JOBS)' libs
    $(MAKE) -C '$(1)' -j 1 install

    #pkg-config file
    (echo 'Name: $(PKG)'; \
     echo 'Version: $($(PKG)_VERSION)'; \
     echo 'Description: $(PKG)'; \
     echo 'Requires: glib-2.0'; \
     echo 'Libs: -l$(PKG) -lstdc++ -lregex';) \
     > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'

    '$(TARGET)-gcc' \
        -W -Wall -Werror -ansi \
        '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-lensfun.exe' \
        `'$(TARGET)-pkg-config' lensfun --cflags --libs`
endef