summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lensfun-1-fixes.patch231
-rw-r--r--src/lensfun-1-libregex.patch70
-rw-r--r--src/lensfun-2-pkg-config.patch34
-rw-r--r--src/lensfun-3-mac-build.patch15
-rw-r--r--src/lensfun-test.c14
-rw-r--r--src/lensfun.mk45
6 files changed, 271 insertions, 138 deletions
diff --git a/src/lensfun-1-fixes.patch b/src/lensfun-1-fixes.patch
new file mode 100644
index 0000000..f4cebd3
--- /dev/null
+++ b/src/lensfun-1-fixes.patch
@@ -0,0 +1,231 @@
+This file is part of MXE.
+See index.html for further information.
+
+From fd0f1a46e5220cb13c5b445b9447f2fbc26ff7eb Mon Sep 17 00:00:00 2001
+From: Timothy Gu <timothygu99@gmail.com>
+Date: Tue, 21 Oct 2014 18:24:56 -0700
+Subject: [PATCH 1/3] build system: Detect POSIX regex lib more properly
+
+Previously, if the regex lib has to be linked separately, as in the case
+of MinGW/libgnurx, it is not detected properly, and build fails for shared
+lib.
+
+The imported FindRegex.cmake file is from
+https://raw.githubusercontent.com/dubourg/openturns/master/cmake/FindRegex.cmake
+and is licensed under the LGPL 3, same as this library.
+
+Signed-off-by: Timothy Gu <timothygu99@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8416fe6..bbdf75a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,16 +16,18 @@ SET(VERSION_BUGFIX 0)
+
+ # check if some include are available
+ INCLUDE(CheckIncludeFiles)
+-CHECK_INCLUDE_FILES(regex.h HAVE_REGEX_H)
++FIND_PACKAGE(Regex)
+ CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
+
+ # set include directories
+ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/lensfun)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/auxfun)
+-IF(NOT HAVE_REGEX_H)
++IF(NOT REGEX_FOUND)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/regex)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/regex)
++ELSE()
++ INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR})
+ ENDIF()
+
+ # options controlling the build process
+@@ -153,7 +155,7 @@ ENDIF()
+
+ # install include files
+ INSTALL(FILES ${CMAKE_BINARY_DIR}/lensfun.h DESTINATION ${INCLUDEDIR}/lensfun)
+-IF(NOT HAVE_REGEX_H)
++IF(NOT REGEX_FOUND)
+ INSTALL(FILES include/regex/regex.h DESTINATION ${INCLUDEDIR}/regex)
+ ENDIF()
+ IF(BUILD_AUXFUN)
+diff --git a/build/CMakeModules/FindRegex.cmake b/build/CMakeModules/FindRegex.cmake
+new file mode 100644
+index 0000000..cae186f
+--- /dev/null
++++ b/build/CMakeModules/FindRegex.cmake
+@@ -0,0 +1,64 @@
++# -*- cmake -*-
++#
++# FindRegex.cmake: Try to find Regex
++#
++# Copyright (C) 2005-2014 Airbus-EDF-Phimeca
++#
++# This library is free software: you can redistribute it and/or modify
++# it under the terms of the GNU Lesser General Public License as published by
++# the Free Software Foundation, either version 3 of the License, or
++# (at your option) any later version.
++#
++# This library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# along with this library. If not, see <http://www.gnu.org/licenses/>.
++#
++# @author dutka
++# @date 2010-02-04 16:44:49 +0100 (Thu, 04 Feb 2010)
++#
++#
++# - Try to find Regex
++# Once done this will define
++#
++# REGEX_FOUND - System has Regex
++# REGEX_INCLUDE_DIR - The Regex include directory
++# REGEX_LIBRARIES - The libraries needed to use Regex
++# REGEX_DEFINITIONS - Compiler switches required for using Regex
++
++IF (REGEX_INCLUDE_DIR AND REGEX_LIBRARIES)
++ # in cache already
++ SET(Regex_FIND_QUIETLY TRUE)
++ENDIF (REGEX_INCLUDE_DIR AND REGEX_LIBRARIES)
++
++#IF (NOT WIN32)
++# # use pkg-config to get the directories and then use these values
++# # in the FIND_PATH() and FIND_LIBRARY() calls
++# FIND_PACKAGE(PkgConfig)
++# PKG_CHECK_MODULES(PC_REGEX regex)
++# SET(REGEX_DEFINITIONS ${PC_REGEX_CFLAGS_OTHER})
++#ENDIF (NOT WIN32)
++
++FIND_PATH(REGEX_INCLUDE_DIR regex.h
++ HINTS
++ ${REGEX_INCLUDEDIR}
++ ${PC_LIBXML_INCLUDE_DIRS}
++ PATH_SUFFIXES regex
++ )
++
++FIND_LIBRARY(REGEX_LIBRARIES NAMES gnurx c regex
++ HINTS
++ ${PC_REGEX_LIBDIR}
++ ${PC_REGEX_LIBRARY_DIRS}
++ )
++
++INCLUDE(FindPackageHandleStandardArgs)
++
++# handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if
++# all listed variables are TRUE
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(Regex DEFAULT_MSG REGEX_LIBRARIES REGEX_INCLUDE_DIR)
++
++MARK_AS_ADVANCED(REGEX_INCLUDE_DIR REGEX_LIBRARIES)
+diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
+index 9e210f3..ab6ce9a 100644
+--- a/libs/CMakeLists.txt
++++ b/libs/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-IF(NOT HAVE_REGEX_H)
++IF(NOT REGEX_FOUND)
+ ADD_SUBDIRECTORY(regex)
+ ENDIF()
+
+diff --git a/libs/lensfun/CMakeLists.txt b/libs/lensfun/CMakeLists.txt
+index 7eaadcc..23262f5 100644
+--- a/libs/lensfun/CMakeLists.txt
++++ b/libs/lensfun/CMakeLists.txt
+@@ -17,8 +17,10 @@ ELSE()
+ ENDIF()
+ SET_TARGET_PROPERTIES(lensfun PROPERTIES SOVERSION "${VERSION_MAJOR}" VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}")
+
+-IF(NOT HAVE_REGEX_H)
++IF(NOT REGEX_FOUND)
+ TARGET_LINK_LIBRARIES(lensfun tre_regex)
++ELSE()
++ TARGET_LINK_LIBRARIES(lensfun ${REGEX_LIBRARIES})
+ ENDIF()
+ TARGET_LINK_LIBRARIES(lensfun ${GLIB2_LIBRARIES})
+
+diff --git a/libs/lensfun/lensfun.pc.cmake b/libs/lensfun/lensfun.pc.cmake
+index 6d14b12..5f91d44 100644
+--- a/libs/lensfun/lensfun.pc.cmake
++++ b/libs/lensfun/lensfun.pc.cmake
+@@ -10,4 +10,5 @@ Description: A photographic lens database and access library
+ Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@.@VERSION_BUGFIX@
+ Requires.private: glib-2.0
+ Libs: -L${libdir} -llensfun
++Libs.private: @REGEX_LIBRARIES@
+ Cflags: -I${includedir} -I${includedir}/lensfun
+diff --git a/libs/regex/CMakeLists.txt b/libs/regex/CMakeLists.txt
+index 27bc6c6..bcddcf0 100644
+--- a/libs/regex/CMakeLists.txt
++++ b/libs/regex/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ # build regex library
+-IF(NOT HAVE_REGEX_H)
++IF(NOT REGEX_FOUND)
+ FILE(GLOB REGEX_SRC *.c *.h)
+ LIST(APPEND REGEX_SRC ../../include/regex/regex.h)
+ ADD_LIBRARY(tre_regex STATIC ${REGEX_SRC})
+--
+1.9.1
+
+
+From bed1d4d5ed265083b340aed398403cbaba46e340 Mon Sep 17 00:00:00 2001
+From: Timothy Gu <timothygu99@gmail.com>
+Date: Tue, 21 Oct 2014 18:36:15 -0700
+Subject: [PATCH 2/3] Only install glib DLL on MSVC
+
+Signed-off-by: Timothy Gu <timothygu99@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bbdf75a..7690630 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -172,7 +172,7 @@ IF(BUILD_DOC)
+ ADD_SUBDIRECTORY(docs)
+ ENDIF()
+
+-IF(WIN32 AND NOT BUILD_STATIC)
++IF(MSVC AND NOT BUILD_STATIC)
+ FIND_FILE(GLIB2_DLL
+ NAMES glib-2.dll glib-2-vs9.dll
+ PATHS "${GLIB2_BASE_DIR}/bin"
+--
+1.9.1
+
+
+From ccdd4f111b4c45bd654531650e4cdb25fdd38b6c Mon Sep 17 00:00:00 2001
+From: Timothy Gu <timothygu99@gmail.com>
+Date: Tue, 21 Oct 2014 18:41:09 -0700
+Subject: [PATCH 3/3] Add option whether or not to install into source tree on
+ WIN32
+
+Signed-off-by: Timothy Gu <timothygu99@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7690630..ef8cf65 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,6 +38,9 @@ OPTION(BUILD_FOR_SSE "Build with support for SSE" ON)
+ OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ON)
+ OPTION(BUILD_DOC "Build documentation with doxygen" OFF)
+ OPTION(INSTALL_HELPER_SCRIPTS "Install various helper scripts" ON)
++IF(WIN32)
++ OPTION(INSTALL_IN_TREE "Install into source tree" ON)
++ENDIF()
+
+ IF(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Debug CACHE STRING
+@@ -102,7 +105,7 @@ IF(BUILD_DOC)
+ SET(DOCDIR share/doc/lensfun-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}.${VERSION_BUGFIX} CACHE PATH "Directory to put library documentation in")
+ ENDIF(BUILD_DOC)
+
+-IF(WIN32)
++IF(WIN32 AND INSTALL_IN_TREE)
+ # install into place in build-dir
+ SET(LENSFUN_INSTALL_PREFIX "${SOURCE_BASE_DIR}/lensfun" CACHE PATH "Install prefix for lensfun")
+ ELSE()
+--
+1.9.1
+
diff --git a/src/lensfun-1-libregex.patch b/src/lensfun-1-libregex.patch
deleted file mode 100644
index c8e679a..0000000
--- a/src/lensfun-1-libregex.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-This file is part of MXE.
-See index.html for further information.
-
-From 9d90674798a5f26f364893d38c9bf5abf980c586 Mon Sep 17 00:00:00 2001
-From: Timothy Gu <timothygu99@gmail.com>
-Date: Sun, 20 Apr 2014 07:55:35 -0700
-Subject: [PATCH 1/3] Split libregex and regex.h detection
-
-On some systems like Windows there might be a regex.h but you need to
-explicitly link to it.
-
-Only applies to tibs-based build system as that's what MXE uses.
-
-Signed-off-by: Timothy Gu <timothygu99@gmail.com>
----
- configure | 6 ++++++
- libs/lensfun/lensfun.mak | 4 ++--
- libs/lensfun/lensfun.pc.in | 2 +-
- 3 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/configure b/configure
-index 0ac4bf7..6f55ec2 100755
---- a/configure
-+++ b/configure
-@@ -74,6 +74,12 @@ if tibs.pkgconfig_check_library ("libpng", "1.0"):
- # One day we'll switch to regex library from GLib
- if not tibs.check_header ("regex.h"):
- tibs.add_config_mak ("NEED_REGEX")
-+ tibs.add_config_mak ("NEED_LIB_REGEX", "regex")
-+elif tibs.TARGET [0] == "windows":
-+ # FIXME: make this a real check instead of a special case
-+ # On some systems if regex.h is there we still need to link to libregex as
-+ # it is not in libc.
-+ tibs.add_config_mak ("NEED_LIB_REGEX", "regex")
-
- # Check for CPU vectorization feature enable flags
- if tibs.VECTORIZATION.strip ().upper () == "YES":
-diff --git a/libs/lensfun/lensfun.mak b/libs/lensfun/lensfun.mak
-index 9adc56a..a45f0f2 100644
---- a/libs/lensfun/lensfun.mak
-+++ b/libs/lensfun/lensfun.mak
-@@ -4,7 +4,7 @@ DIR.INCLUDE.C += :include/lensfun
- TARGETS.lensfun = lensfun$L
- SRC.lensfun$L := $(wildcard libs/lensfun/*.cpp libs/lensfun/$(TARGET)/*.cpp)
- SHARED.lensfun$L = $(if $(SHAREDLIBS),$(CONF_LIB_VERSION))
--LIBS.lensfun = $(TARGETS.regex)
-+LIBS.lensfun = $(if $(NEED_REGEX),$(TARGETS.regex),$(NEED_LIB_REGEX))
- SYSLIBS.lensfun = GLIB_20
- INSTALL.TARGETS += lensfun
- INSTALL.INCLUDE.lensfun$L = include/lensfun/lensfun.h
-@@ -22,4 +22,4 @@ TOOLKIT.lensfun-pc = PKGCONFIG
- TARGETS.lensfun-pc = lensfun.pc
- SRC.lensfun.pc := $(wildcard libs/lensfun/*.pc.in) config.mak
- INSTALL.TARGETS += lensfun-pc
--PKGCONFIG.SED.lensfun-pc = -e "s,@NEED_REGEX@,$(if $(NEED_REGEX),-lregex,),g" -e "s,@CONF_LENSFUN_STATIC@,$(if $(SHAREDLIBS),,-DCONF_LENSFUN_STATIC),g"
-+PKGCONFIG.SED.lensfun-pc = -e "s,@NEED_LIB_REGEX@,$(if $(NEED_LIB_REGEX),-l$(NEED_LIB_REGEX),),g" -e "s,@CONF_LENSFUN_STATIC@,$(if $(SHAREDLIBS),,-DCONF_LENSFUN_STATIC),g"
-diff --git a/libs/lensfun/lensfun.pc.in b/libs/lensfun/lensfun.pc.in
-index 801a556..f61af62 100644
---- a/libs/lensfun/lensfun.pc.in
-+++ b/libs/lensfun/lensfun.pc.in
-@@ -2,5 +2,5 @@ Name: lensfun
- Description: A photographic lens database and access library
- Version: @CONF_VERSION@
- Requires: glib-2.0
--Libs: -L@CONF_LIBDIR@ -llensfun @NEED_REGEX@
-+Libs: -L@CONF_LIBDIR@ -llensfun @NEED_LIB_REGEX@
- Cflags: -I@CONF_INCLUDEDIR@ @CONF_LENSFUN_STATIC@
---
-1.8.3.2
-
diff --git a/src/lensfun-2-pkg-config.patch b/src/lensfun-2-pkg-config.patch
index 3f8265b..ab0c3e2 100644
--- a/src/lensfun-2-pkg-config.patch
+++ b/src/lensfun-2-pkg-config.patch
@@ -1,27 +1,29 @@
This file is part of MXE.
See index.html for further information.
-From a104558efebdc4db05a6c79b5f0aa364d4036366 Mon Sep 17 00:00:00 2001
+From da0bb87d6e520c042f98204c35105bcf4be7ea0f Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
-Date: Sun, 20 Apr 2014 07:57:41 -0700
-Subject: [PATCH 2/3] Add -lstdc++ to pkg-config file
+Date: Tue, 21 Oct 2014 18:54:03 -0700
+Subject: [PATCH] pkgconfig: Explicitly depend on libstdc++
+
+Fixes MinGW static.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
---
- libs/lensfun/lensfun.pc.in | 2 +-
+ libs/lensfun/lensfun.pc.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/libs/lensfun/lensfun.pc.in b/libs/lensfun/lensfun.pc.in
-index f61af62..294212b 100644
---- a/libs/lensfun/lensfun.pc.in
-+++ b/libs/lensfun/lensfun.pc.in
-@@ -2,5 +2,5 @@ Name: lensfun
- Description: A photographic lens database and access library
- Version: @CONF_VERSION@
- Requires: glib-2.0
--Libs: -L@CONF_LIBDIR@ -llensfun @NEED_LIB_REGEX@
-+Libs: -L@CONF_LIBDIR@ -llensfun -lstdc++ @NEED_LIB_REGEX@
- Cflags: -I@CONF_INCLUDEDIR@ @CONF_LENSFUN_STATIC@
+diff --git a/libs/lensfun/lensfun.pc.cmake b/libs/lensfun/lensfun.pc.cmake
+index 5f91d44..9c291f8 100644
+--- a/libs/lensfun/lensfun.pc.cmake
++++ b/libs/lensfun/lensfun.pc.cmake
+@@ -10,5 +10,5 @@ Description: A photographic lens database and access library
+ Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@.@VERSION_BUGFIX@
+ Requires.private: glib-2.0
+ Libs: -L${libdir} -llensfun
+-Libs.private: @REGEX_LIBRARIES@
++Libs.private: @REGEX_LIBRARIES@ -lstdc++
+ Cflags: -I${includedir} -I${includedir}/lensfun
--
-1.8.3.2
+1.9.1
diff --git a/src/lensfun-3-mac-build.patch b/src/lensfun-3-mac-build.patch
deleted file mode 100644
index 61f2621..0000000
--- a/src/lensfun-3-mac-build.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-This file is part of MXE.
-See index.html for further information.
-
-diff -ur lensfun-0.2.8.orig/build/tibs/compiler/pkgconfig.mak lensfun-0.2.8/build/tibs/compiler/pkgconfig.mak
---- lensfun-0.2.8.orig/build/tibs/compiler/pkgconfig.mak 2014-05-10 03:07:49.000000000 +1000
-+++ lensfun-0.2.8/build/tibs/compiler/pkgconfig.mak 2014-05-10 03:08:38.000000000 +1000
-@@ -4,7 +4,7 @@
- # Try to guess here if target supports pkgconfig
- # - Any POSIX platform
- # - Cross-compiling on a POSIX target for WINDOWS (mingw32)
--ifneq ($(findstring /posix/,/$(TARGET)/)$(findstring /posix-windows/,/$(HOST)-$(TARGET)/),)
-+ifneq ($(findstring /posix/,/$(TARGET)/)$(findstring /posix-windows/,/$(HOST)-$(TARGET)/)$(findstring /mac-windows/,/$(HOST)-$(TARGET)/),)
-
- XFNAME.PKGCONFIG = $(addprefix $$(OUT),$1)
- MKDEPS.PKGCONFIG = $1
diff --git a/src/lensfun-test.c b/src/lensfun-test.c
index 46c284f..f00a13f 100644
--- a/src/lensfun-test.c
+++ b/src/lensfun-test.c
@@ -4,18 +4,24 @@
*/
/*
+ * Modifications from the original example:
+ * - Do not use negative reserved return codes in main()
+ * - Sort headers and use <> instead of "" for lensfun.h
+ */
+
+/*
http://lensfun.sourceforge.net/manual/example_8c-example.html
A simple example of library usage from plain C
*/
-#include <lensfun.h>
#include <stdio.h>
#include <locale.h>
+
#include <glib.h>
+#include <lensfun.h>
int main ()
-{
- int i, j;
+{ int i, j;
const struct lfMount *const *mounts;
const struct lfCamera *const *cameras;
const struct lfLens *const *lenses;
@@ -68,10 +74,10 @@ int main ()
lf_mlstr_get (lenses [i]->Maker),
lf_mlstr_get (lenses [i]->Model));
g_print ("\tCrop factor: %g\n", lenses [i]->CropFactor);
+ g_print ("\tAspect ratio: %g\n", lenses [i]->AspectRatio);
g_print ("\tFocal: %g-%g\n", lenses [i]->MinFocal, lenses [i]->MaxFocal);
g_print ("\tAperture: %g-%g\n", lenses [i]->MinAperture, lenses [i]->MaxAperture);
g_print ("\tCenter: %g,%g\n", lenses [i]->CenterX, lenses [i]->CenterY);
- g_print ("\tCCI: %g/%g/%g\n", lenses [i]->RedCCI, lenses [i]->GreenCCI, lenses [i]->BlueCCI);
if (lenses [i]->Mounts)
for (j = 0; lenses [i]->Mounts [j]; j++)
g_print ("\tMount: %s\n", lf_db_mount_name (ldb, lenses [i]->Mounts [j]));
diff --git a/src/lensfun.mk b/src/lensfun.mk
index 1c3ecca..b86bb6c 100644
--- a/src/lensfun.mk
+++ b/src/lensfun.mk
@@ -3,12 +3,12 @@
PKG := lensfun
$(PKG)_IGNORE :=
-$(PKG)_VERSION := 0.2.8
-$(PKG)_CHECKSUM := 0e85eb7692620668d27e2303687492ad68c90eb4
+$(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 libpng glib libgnurx
+$(PKG)_DEPS := gcc glib libgnurx libpng
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://sourceforge.net/projects/lensfun/files/' | \
@@ -17,38 +17,17 @@ define $(PKG)_UPDATE
tail -1
endef
-define $(PKG)_INSTALL_SHARED
- # lensfun's shared lib installation is a little bit non-MinGW-friendly:
- # * its DLL is installed to usr/TARGET/lib
- # * it doesn't install import lib
- # This macro fixes that.
- rm '$(PREFIX)/$(TARGET)/lib/lensfun.dll'
- cd '$(1)' && \
- $(INSTALL) -m 0755 'out/windows.x86/release/lensfun.dll' \
- '$(PREFIX)/$(TARGET)/bin/lensfun.dll' && \
- $(INSTALL) -m 0644 'out/windows.x86/release/lensfun.dll.a' \
- '$(PREFIX)/$(TARGET)/lib/lensfun.dll.a'
-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=$(if $(BUILD_STATIC),YES,NO)
- $(MAKE) -C '$(1)' -j '$(JOBS)' libs V=1
- $(MAKE) -C '$(1)' -j 1 install-lensdb install-lensfun-pc install-lensfun V=1
- $(if $(BUILD_SHARED),$($(PKG)_INSTALL_SHARED),)
+ 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 -ansi \
+ -W -Wall -Werror \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-lensfun.exe' \
- `'$(TARGET)-pkg-config' lensfun --cflags --libs`
+ `'$(TARGET)-pkg-config' lensfun glib-2.0 --cflags --libs`
endef