diff --git a/repos/libports/lib/import/import-liblzma.mk b/repos/libports/lib/import/import-liblzma.mk new file mode 100644 index 0000000000..03fec5629f --- /dev/null +++ b/repos/libports/lib/import/import-liblzma.mk @@ -0,0 +1 @@ +INC_DIR += $(call select_from_ports,xz)/include/liblzma diff --git a/repos/libports/lib/mk/liblzma.mk b/repos/libports/lib/mk/liblzma.mk new file mode 100644 index 0000000000..69ed706ade --- /dev/null +++ b/repos/libports/lib/mk/liblzma.mk @@ -0,0 +1,60 @@ +LIBLZMA_PORT_DIR := $(call select_from_ports,xz) +LIBLZMA_DIR := $(LIBLZMA_PORT_DIR)/src/xz/src/liblzma + +CC_DEF += -DHAVE_CONFIG_H + +SRC_C = $(notdir $(wildcard $(LIBLZMA_DIR)/common/*.c)) +SRC_C += $(notdir $(wildcard $(LIBLZMA_DIR)/delta/*.c)) +SRC_C += $(notdir $(wildcard $(LIBLZMA_DIR)/lz/*.c)) +SRC_C += $(notdir $(wildcard $(LIBLZMA_DIR)/simple/*.c)) + +# tuklib +SRC_C += tuklib_physmem.c \ + tuklib_cpucores.c + +# liblzma/check +SRC_C += check.c \ + crc32_fast.c \ + crc32_table.c \ + crc64_fast.c \ + crc64_table.c \ + sha256.c + +# liblzma/lzma +SRC_C += fastpos_table.c \ + lzma_decoder.c \ + lzma_encoder_optimum_fast.c \ + lzma_encoder_optimum_normal.c \ + lzma_encoder_presets.c \ + lzma_encoder.c \ + lzma2_decoder.c \ + lzma2_encoder.c + +# liblzma/rangecoder +SRC_C += price_table.c + +vpath %.c $(LIBLZMA_DIR)/../common +vpath %.c $(LIBLZMA_DIR)/check +vpath %.c $(LIBLZMA_DIR)/common +vpath %.c $(LIBLZMA_DIR)/delta +vpath %.c $(LIBLZMA_DIR)/lz +vpath %.c $(LIBLZMA_DIR)/lzma +vpath %.c $(LIBLZMA_DIR)/rangecoder +vpath %.c $(LIBLZMA_DIR)/simple + +# find 'config.h' +INC_DIR += $(REP_DIR)/src/lib/liblzma + +INC_DIR += $(LIBLZMA_DIR)/../common \ + $(LIBLZMA_DIR)/api \ + $(LIBLZMA_DIR)/check \ + $(LIBLZMA_DIR)/common \ + $(LIBLZMA_DIR)/delta \ + $(LIBLZMA_DIR)/lz \ + $(LIBLZMA_DIR)/lzma \ + $(LIBLZMA_DIR)/rangecoder \ + $(LIBLZMA_DIR)/simple + +LIBS += libc + +SHARED_LIB = yes diff --git a/repos/libports/ports/xz.hash b/repos/libports/ports/xz.hash new file mode 100644 index 0000000000..a6715d8761 --- /dev/null +++ b/repos/libports/ports/xz.hash @@ -0,0 +1 @@ +99159500502f628b89fd4b87b37e5997c168515a diff --git a/repos/libports/ports/xz.port b/repos/libports/ports/xz.port new file mode 100644 index 0000000000..a44e47d02f --- /dev/null +++ b/repos/libports/ports/xz.port @@ -0,0 +1,11 @@ +LICENSE := GPLv3 +VERSION := 5.2.3 +DOWNLOADS := xz.archive + +URL(xz) := http://tukaani.org/xz/xz-$(VERSION).tar.xz +SHA(xz) := a2975d12e0905daec48ec87c0098602e0669d195 +DIR(xz) := src/xz + +DIRS := include/liblzma +DIR_CONTENT(include/liblzma) := src/xz/src/liblzma/api/lzma.h \ + src/xz/src/liblzma/api/lzma diff --git a/repos/libports/src/lib/liblzma/config.h b/repos/libports/src/lib/liblzma/config.h new file mode 100644 index 0000000000..0e113a9d92 --- /dev/null +++ b/repos/libports/src/lib/liblzma/config.h @@ -0,0 +1,24 @@ +#define HAVE_DECODER_LZMA2 1 + +#define HAVE_DLFCN_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_GETOPT_H 1 +#define HAVE_GETOPT_LONG 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_OPTRESET 1 +#define HAVE_STDBOOL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_ENDIAN_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UINTPTR_T 1 +#define HAVE_UNISTD_H 1 +#define STDC_HEADERS 1 +#define MYTHREAD_POSIX 1 diff --git a/repos/libports/src/test/liblzma/main.c b/repos/libports/src/test/liblzma/main.c new file mode 100644 index 0000000000..3c7b6992c6 --- /dev/null +++ b/repos/libports/src/test/liblzma/main.c @@ -0,0 +1,5 @@ +#include + +int main() { + return 0; +} diff --git a/repos/libports/src/test/liblzma/target.mk b/repos/libports/src/test/liblzma/target.mk new file mode 100644 index 0000000000..7a226a2c71 --- /dev/null +++ b/repos/libports/src/test/liblzma/target.mk @@ -0,0 +1,3 @@ +TARGET = test-lzma +LIBS = liblzma posix +SRC_C = main.c