summaryrefslogtreecommitdiffstats
path: root/package/libsoil/libsoil.mk
blob: efa67d9eee5222b9424a3f45a00f3ac6d84708b2 (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
################################################################################
#
# libsoil
#
################################################################################

LIBSOIL_VERSION = 20080707
LIBSOIL_SOURCE = soil.zip
LIBSOIL_SITE = http://www.lonesock.net/files
LIBSOIL_INSTALL_STAGING = YES
LIBSOIL_DEPENDENCIES = libgl
LIBSOIL_LICENSE = Public Domain, MIT
LIBSOIL_LICENSE_FILES = src/stb_image_aug.c src/image_helper.c
LIBSOIL_MAKEFILE = ../projects/makefile/alternate_Makefile.txt

define LIBSOIL_EXTRACT_CMDS
	$(UNZIP) -d $(@D) $(DL_DIR)/$(LIBSOIL_SOURCE)
	mv $(@D)/Simple\ OpenGL\ Image\ Library/* $(@D)
endef

# gnu patch < v2.5.9 doesn't correctly handle spaces in file names,
# and we want to patch the 'alternate Makefile.txt' file, so rename
# the file (and patch the renamed file) for compatibility with older
# distributions
define REMOVE_SPACE_FROM_FILENAME
	cd $(@D)/projects/makefile/ && \
		mv "alternate Makefile.txt" alternate_Makefile.txt
endef
LIBSOIL_POST_EXTRACT_HOOKS += REMOVE_SPACE_FROM_FILENAME

define LIBSOIL_BUILD_CMDS
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -f $(LIBSOIL_MAKEFILE) \
		-C $(@D)/src
endef

define LIBSOIL_INSTALL_STAGING_CMDS
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -f $(LIBSOIL_MAKEFILE) \
		DESTDIR=$(STAGING_DIR) install \
		INSTALL=$(INSTALL) \
		-C $(@D)/src
endef

define LIBSOIL_INSTALL_TARGET_CMDS
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -f $(LIBSOIL_MAKEFILE) \
		DESTDIR=$(TARGET_DIR) install \
		INSTALL=$(INSTALL) \
		-C $(@D)/src
endef

$(eval $(generic-package))
OpenPOWER on IntegriCloud