diff options
author | Timothy Gu <timothygu99@gmail.com> | 2015-07-06 00:29:56 (GMT) |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2015-07-06 00:29:56 (GMT) |
commit | 02ba99b5f749a8e5b33cce32ae07f90a1c0e8552 (patch) | |
tree | a8f49bf32dcc5b7ade8b7792031240a345c1a904 | |
parent | 468b383354389a5da945f82e0276a962f5a5ca34 (diff) | |
parent | d4a0280fd01c0ce9db7fa638afd78bda3c3f4db5 (diff) | |
download | mxe-02ba99b5f749a8e5b33cce32ae07f90a1c0e8552.zip mxe-02ba99b5f749a8e5b33cce32ae07f90a1c0e8552.tar.gz mxe-02ba99b5f749a8e5b33cce32ae07f90a1c0e8552.tar.bz2 |
Merge pull request #631 from andrewrk/rucksack-pkg
add rucksack package
-rw-r--r-- | index.html | 4 | ||||
-rw-r--r-- | src/rucksack-1-freeimage.patch | 51 | ||||
-rw-r--r-- | src/rucksack-test.c | 14 | ||||
-rw-r--r-- | src/rucksack.mk | 31 |
4 files changed, 100 insertions, 0 deletions
@@ -2270,6 +2270,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre> <td class="website"><a href="http://breakfastquay.com/rubberband/">Rubberband</a></td> </tr> <tr> + <td class="package">rucksack</td> + <td class="website"><a href="https://github.com/andrewrk/rucksack">rucksack</a></td> + </tr> + <tr> <td class="package">sdl</td> <td class="website"><a href="http://www.libsdl.org/">SDL</a></td> </tr> diff --git a/src/rucksack-1-freeimage.patch b/src/rucksack-1-freeimage.patch new file mode 100644 index 0000000..f998b0b --- /dev/null +++ b/src/rucksack-1-freeimage.patch @@ -0,0 +1,51 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c24e161..9867184 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,12 +19,15 @@ else(C99_FLAG_DETECTED) + endif(C99_FLAG_DETECTED) + + # check for freeimage +-find_package(FreeImage) +-if(FreeImage_FOUND) ++if(NOT PKG_CONFIG_FOUND) ++ find_package(PkgConfig REQUIRED) ++endif() ++pkg_check_modules(FREEIMAGE freeimage) ++if(FREEIMAGE_FOUND) + set(STATUS_FREEIMG "OK") +-else(FreeImage_FOUND) ++else(FREEIMAGE_FOUND) + set(STATUS_FREEIMG "not found") +-endif(FreeImage_FOUND) ++endif(FREEIMAGE_FOUND) + + # check for laxjson + find_package(LaxJson) +@@ -76,7 +79,7 @@ set(EXE_HEADERS + ${PROJECT_SOURCE_DIR}/src/mkdirp.h + ) + +-set(LIB_CFLAGS "${C99_C_FLAGS} -pedantic -Werror -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_POSIX_C_SOURCE=200809L") ++set(LIB_CFLAGS "${C99_C_FLAGS} -pedantic -Werror -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_POSIX_C_SOURCE=200809L ${FREEIMAGE_CFLAGS_OTHER}") + set(EXE_CFLAGS ${LIB_CFLAGS}) + + add_library(rucksack_static STATIC ${RUCKSACK_LIB_SOURCES} ${RUCKSACK_LIB_HEADERS}) +@@ -92,7 +95,7 @@ set_target_properties(rucksack_shared PROPERTIES + COMPILE_FLAGS ${LIB_CFLAGS}) + + +-include_directories(${FreeImage_INCLUDE_DIRS}) ++include_directories(${FREEIMAGE_INCLUDE_DIRS}) + add_library(rucksackspritesheet_static STATIC + ${RUCKSACK_SPRITESHEET_LIB_SOURCES} ${RUCKSACK_SPRITESHEET_LIB_HEADERS}) + set_target_properties(rucksackspritesheet_static PROPERTIES +@@ -106,7 +109,7 @@ set_target_properties(rucksackspritesheet_shared PROPERTIES + SOVERSION ${VERSION_MAJOR} + VERSION ${VERSION} + COMPILE_FLAGS ${LIB_CFLAGS}) +-target_link_libraries(rucksackspritesheet_shared rucksack_shared ${FreeImage_LIBRARIES}) ++target_link_libraries(rucksackspritesheet_shared rucksack_shared ${FREEIMAGE_LIBRARIES}) + + + diff --git a/src/rucksack-test.c b/src/rucksack-test.c new file mode 100644 index 0000000..b18a991 --- /dev/null +++ b/src/rucksack-test.c @@ -0,0 +1,14 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <rucksack/rucksack.h> + +int main(int argc, char * argv[]) { + (void)argc; + struct RuckSackBundle *bundle; + rucksack_bundle_open(argv[1], &bundle); + rucksack_bundle_close(bundle); + return 0; +} diff --git a/src/rucksack.mk b/src/rucksack.mk new file mode 100644 index 0000000..3db9c8d --- /dev/null +++ b/src/rucksack.mk @@ -0,0 +1,31 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := rucksack +$(PKG)_IGNORE := +$(PKG)_VERSION := 3.1.0 +$(PKG)_CHECKSUM := 77b0d5d1cb4417496835df811eef5ae1a7d14487 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := https://github.com/andrewrk/rucksack/archive/$($(PKG)_VERSION).tar.gz +$(PKG)_DEPS := gcc freeimage liblaxjson + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://github.com/andrewrk/rucksack/releases' | \ + $(SED) -n 's,.*/archive/\([0-9][^>]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + mkdir '$(1)/build' + cd '$(1)/build' && cmake .. -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' + + $(MAKE) -C '$(1)/build' -j '$(JOBS)' install VERBOSE=1 + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic -std=c99 \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-rucksack.exe' \ + -lrucksack -llaxjson \ + `'$(TARGET)-pkg-config' freeimage --cflags --libs` +endef + |