From e8a511645b5f2c6f5f77612e4fa94fd96109bc57 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 8 May 2020 13:06:41 +0200 Subject: [PATCH] dev-libs/ucl: initial import of version 1.03 --- .../dev-libs/ucl/files/ucl-1.03-CFLAGS.patch | 134 ++++++++++++++ .../dev-libs/ucl/files/ucl-1.03-x32.patch | 173 ++++++++++++++++++ packages/dev-libs/ucl/ucl-1.03.exheres-0 | 35 ++++ 3 files changed, 342 insertions(+) create mode 100644 packages/dev-libs/ucl/files/ucl-1.03-CFLAGS.patch create mode 100644 packages/dev-libs/ucl/files/ucl-1.03-x32.patch create mode 100644 packages/dev-libs/ucl/ucl-1.03.exheres-0 diff --git a/packages/dev-libs/ucl/files/ucl-1.03-CFLAGS.patch b/packages/dev-libs/ucl/files/ucl-1.03-CFLAGS.patch new file mode 100644 index 00000000..07c925b4 --- /dev/null +++ b/packages/dev-libs/ucl/files/ucl-1.03-CFLAGS.patch @@ -0,0 +1,134 @@ +From: Nathan Phillip Brink +Subject: Respect CCASFLAGS (which often defaults to CFLAGS). Fixes + compilation for portage-multilib users. + +diff -r c090ed619e90 configure.ac +--- a/configure.ac Sun Jun 26 16:00:09 2011 -0400 ++++ b/configure.ac Sun Jun 26 20:52:01 2011 -0400 +@@ -47,14 +47,12 @@ + AC_CANONICAL_TARGET + AM_MAINTAINER_MODE + +-if test -z "$ac_abs_top_srcdir"; then +- _AC_SRCPATHS(.) +-fi + if test -r .Conf.settings1; then + . ./.Conf.settings1 + fi + + AC_PROG_CC ++AM_PROG_AS + AC_PROG_CPP + mfx_PROG_CPPFLAGS + AC_C_CONST +@@ -84,13 +82,13 @@ + if test "X$enable_asm" != Xno; then + mfx_compile_S='${CC-cc} -c conftest.S 1>&AS_MESSAGE_LOG_FD' + cat > conftest.S <> 0)); +--- a/acc/acclib/perfctr.ch ++++ b/acc/acclib/perfctr.ch +@@ -63,7 +63,7 @@ ACCLIB_PUBLIC(int, acc_perfctr_open) (acc_perfctr_handle_p h) + break; /* no working TSC available */ + case PERFCTR_X86_AMD_K7: + #endif +-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) ++#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) + case PERFCTR_X86_AMD_K8: + case PERFCTR_X86_AMD_K8C: + cc->tsc_on = 1; cc->nractrs = 2; +--- a/acc/acclib/rdtsc.ch ++++ b/acc/acclib/rdtsc.ch +@@ -21,7 +21,7 @@ + #if defined(acc_int32e_t) + + +-#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC) ++#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && ACC_CC_GNUC) + # if (ACC_CC_GNUC >= 0x020000ul) + # define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx" + # else +@@ -38,7 +38,7 @@ + + ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t) + { +-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS) ++#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && defined(__ACCLIB_RDTSC_REGS) + __asm__ __volatile__( + "clc \n" ".byte 0x0f, 0x31\n" + "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n" +@@ -73,7 +73,7 @@ ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t) + + ACCLIB_PUBLIC(int, acc_tsc_read_add) (acc_uint32e_t* t) + { +-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS) ++#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && defined(__ACCLIB_RDTSC_REGS) + __asm__ __volatile__( + "clc \n" ".byte 0x0f, 0x31\n" + "addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n" +--- a/src/ucl_conf.h ++++ b/src/ucl_conf.h +@@ -172,7 +172,7 @@ + #undef UA_SET2 + #undef UA_GET4 + #undef UA_SET4 +-#if 1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32) ++#if 1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) + # define UA_GET2(p) (* (const ucl_ushortp) (p)) + # define UA_SET2(p) (* (ucl_ushortp) (p)) + # define UA_GET4(p) (* (const acc_uint32e_t *) (p)) diff --git a/packages/dev-libs/ucl/ucl-1.03.exheres-0 b/packages/dev-libs/ucl/ucl-1.03.exheres-0 new file mode 100644 index 00000000..629d95c4 --- /dev/null +++ b/packages/dev-libs/ucl/ucl-1.03.exheres-0 @@ -0,0 +1,35 @@ +# Copyright 2020 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.16 ] ] + +SUMMARY="The UCL Compression Library" +HOMEPAGE="http://www.oberhumer.com/opensource/ucl/" +DOWNLOADS="http://www.oberhumer.com/opensource/ucl/download/${PNV}.tar.gz" + +LICENCES="GPL-2" +SLOT="0" +PLATFORMS="~amd64" +MYOPTIONS="" + +DEPENDENCIES=" +" + +BUGS_TO="hasufell@posteo.de" + +DEFAULT_SRC_PREPARE_PATCHES=( + "${FILES}"/${PNV}-CFLAGS.patch + "${FILES}"/${PNV}-x32.patch +) + +src_prepare() { + edo sed -n -e '/^AC_DEFUN.*mfx_/,/^])#$/p' aclocal.m4 > acinclude.m4 + edo sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac + + autotools_src_prepare +} + +src_configure() { + econf --enable-shared CFLAGS="${CFLAGS} -std=c90" +} +