added recipe for libavlduptree

This commit is contained in:
Alex Striff
2015-01-12 03:48:40 +00:00
parent 9d81c26608
commit d83f1a91a6
2 changed files with 149 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
SUMMARY="A set of C subroutines that is useful for indexing a set of key/value \
pairs."
DESCRIPTION="
AVLDupTree is a set of C subroutines (not C++, so you can use it in drivers) \
that is useful for indexing a set of key/value pairs, using the key to find \
a matching value. The standard AVL balanced binary tree algorithm is \
enhanced to support multiple values for the same key. It is designed for \
future use in a file system to support fast attribute indexing and queries, \
but you can use it for other things. This package also includes the \
AGMSAVLTest GUI App. It tests the operations on the tree, provided by \
libavlduptree.
"
LICENSE="GNU LGPL v2.1"
COPYRIGHT="2001 Alexander G. M. Smith"
# This is the original homepage, but the domain is up for sale at the time
# of writing this recipe.
# HOMEPAGE="http://achilles.net/~agsmith/"
HOMEPAGE="https://github.com/HaikuArchives/AVLDupTree"
SRC_URI="git+https://github.com/HaikuArchives/AVLDupTree.git#5969ca7e26e65857a9ade8ed6abee2fda7f1e9d9"
REVISION="1"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 ?x86"
PATCHES="libavlduptree-${portVersion}.patch"
PROVIDES="
libavlduptree$secondaryArchSuffix = $portVersion
lib:libavlduptree$secondaryArchSuffix = 1.0.0 compat >= 1
cmd:AGMSAVLTest$secondaryArchSuffix
app:AGMSAVLTest
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:autoconf
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:ar
cmd:ranlib
cmd:install
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:autoconf
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:install
cmd:mkdir
"
BUILD()
{
autoconf
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
mkdir -p $libDir
mkdir -p $binDir
make install PREFIX=$libDir BINDIR=$binDir
addAppDeskbarSymlink $binDir/AGMSAVLTest
# set up the develop directory correctly
prepareInstalledDevelLibs libavlduptree
# devel package
packageEntries devel $developDir
}
# ----- devel package -------------------------------------------------------
PROVIDES_devel="
libavlduptree${secondaryArchSuffix}_devel = $portVersion
devel:libavlduptree$secondaryArchSuffix = 1.0.0 compat >= 1
"
REQUIRES_devel="
libavlduptree${secondaryArchSuffix} == $portVersion base
"

View File

@@ -0,0 +1,65 @@
diff -Naur AVLDupTree/configure.in AVLDupTree-haiku/configure.in
--- AVLDupTree/configure.in 1970-01-01 00:00:00.000000000 +0000
+++ AVLDupTree-haiku/configure.in 2015-01-11 18:54:32.475791360 +0000
@@ -0,0 +1,25 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT(AVLDupTree, 1.0.0, https://github.com/HaikuArchives/AVLDupTree/issues)
+AC_CONFIG_SRCDIR([Source/AVLDupTree.c])
+# AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([OS.h stdlib.h string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([memset strerror])
+
+AC_OUTPUT
diff -Naur AVLDupTree/Makefile AVLDupTree-haiku/Makefile
--- AVLDupTree/Makefile 1970-01-01 00:00:00.000000000 +0000
+++ AVLDupTree-haiku/Makefile 2015-01-11 23:01:41.289406976 +0000
@@ -0,0 +1,32 @@
+CC=gcc
+CFLAGS=-g -O2 -Wall -ISource $(OPTFLAGS)
+
+SOURCES=$(wildcard Source/*.c)
+OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
+GUISOURCES=Source/Main.cpp
+GUIEXE=bin/AGMSAVLTest
+
+TARGET=build/libavlduptree.so
+
+all: $(TARGET) $(SO_TARGET)
+
+$(TARGET): build $(OBJECTS)
+ $(CC) -shared -o $(TARGET) $(OBJECTS)
+
+build:
+ @mkdir -p build
+ @mkdir -p bin
+
+clean:
+ @rm -rf build $(OBJECTS) $(TESTS)
+
+install: all $(GUIEXE)
+ install $(TARGET) $(PREFIX)
+
+$(GUIEXE): CFLAGS += -Wno-multichar
+$(GUIEXE): CFLAGS+= -lbe
+$(GUIEXE): $(SOURCES) $(GUISOURCES)
+ $(CC) $(CFLAGS) $^ -o $@
+ install $(GUIEXE) $(BINDIR)/
+
+.PHONY: all clean install