mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-02 21:18:51 +02:00
Added recipes for libprefs and launchpad, word by GCI2013 student Adrián Arroyo Calle
This commit is contained in:
48
haiku-libs/libprefs/libprefs-1.2.5.recipe
Normal file
48
haiku-libs/libprefs/libprefs-1.2.5.recipe
Normal file
@@ -0,0 +1,48 @@
|
||||
SUMMARY="Shared library to take care your preferences"
|
||||
DESCRIPTION="Shared library to take care your preferences"
|
||||
HOMEPAGE="ftp://ftp.icm.edu.pl/vol/rzm1/beos/contrib/libraries"
|
||||
SRC_URI="ftp://ftp.icm.edu.pl/vol/rzm1/beos/contrib/libraries/libprefs125.zip"
|
||||
CHECKSUM_MD5="890f1fc84b7402505ac2536f4d1c5075"
|
||||
REVISION="1"
|
||||
LICENSE="Public Domain"
|
||||
COPYRIGHT="1998 libprefs@mindcontrol.org"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 !x86 !x86_64"
|
||||
SECONDARY_ACRHITECTURES="x86_gcc2 !x86"
|
||||
|
||||
PROVIDES="
|
||||
libprefs$secondaryArchSuffix = $portVersion
|
||||
lib:libprefs$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
cmd:gcc
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
cmd:make
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
"
|
||||
|
||||
SOURCE_DIR="libprefs125"
|
||||
|
||||
PATCHES="libprefs.patch"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
g++ -shared -fPIC -o libprefs.so src/libprefs.cpp -lroot -lbe
|
||||
}
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $libDir
|
||||
mkdir -p $includeDir
|
||||
|
||||
#cp bigprefs.x86.a $libDir/bigprefs.x86.a
|
||||
cp libprefs.so $libDir
|
||||
cp src/*.h $includeDir
|
||||
}
|
||||
50
haiku-libs/libprefs/patches/libprefs.patch
Normal file
50
haiku-libs/libprefs/patches/libprefs.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
diff --git a/src/libprefs.cpp b/src/libprefs.cpp
|
||||
index da58013..90d0aa4 100644
|
||||
--- a/src/libprefs.cpp
|
||||
+++ b/src/libprefs.cpp
|
||||
@@ -71,6 +71,7 @@
|
||||
#include <image.h>
|
||||
#endif
|
||||
|
||||
+#include <Entry.h>
|
||||
|
||||
/* identifier for this implementation of the prefs library */
|
||||
#define PREF_VERSION_STRING "simple libprefs.so version 1.2.4"
|
||||
@@ -435,7 +436,7 @@ _PREFMakePath(
|
||||
{
|
||||
status_t err = B_OK;
|
||||
BPath bpath;
|
||||
- err = find_directory(user_level ? B_USER_SETTINGS_DIRECTORY : B_COMMON_SETTINGS_DIRECTORY, &bpath, true, NULL);
|
||||
+ err = find_directory(B_USER_SETTINGS_DIRECTORY, &bpath, true, NULL);
|
||||
if (err < B_OK) return err;
|
||||
strncpy(path, bpath.Path(), path_max);
|
||||
path[path_max-1] = 0;
|
||||
@@ -894,9 +895,9 @@ PREFReloadSet(PREFData data)
|
||||
#if DEBUG
|
||||
printf("reload read %d\n", rd);
|
||||
#endif
|
||||
+ char * buffer = (char *)malloc(size);
|
||||
if (rd < 0) { err = rd; goto cleanup; }
|
||||
if (rd != sizeof(size)) { err = B_ERROR; goto cleanup; }
|
||||
- char * buffer = (char *)malloc(size);
|
||||
if (buffer == NULL) { err = B_NO_MEMORY; goto cleanup; }
|
||||
rd = read(data->transaction->fd, buffer, size);
|
||||
#if DEBUG
|
||||
@@ -1156,7 +1157,7 @@ typedef struct _PREFAppIterator {
|
||||
curItem = 0;
|
||||
item = new char*[block];
|
||||
BPath bpath;
|
||||
- if (!find_directory(user_level ? B_USER_SETTINGS_DIRECTORY : B_COMMON_SETTINGS_DIRECTORY, &bpath, true, NULL))
|
||||
+ if (!find_directory(B_USER_SETTINGS_DIRECTORY, &bpath, true, NULL))
|
||||
{
|
||||
BDirectory dir(bpath.Path());
|
||||
BEntry entry;
|
||||
@@ -1278,7 +1279,7 @@ typedef struct _PREFSetIterator
|
||||
curItem = 0;
|
||||
item = new char*[block];
|
||||
BPath bpath;
|
||||
- if (!find_directory(user_level ? B_USER_SETTINGS_DIRECTORY : B_COMMON_SETTINGS_DIRECTORY, &bpath, true, NULL))
|
||||
+ if (!find_directory(B_USER_SETTINGS_DIRECTORY, &bpath, true, NULL))
|
||||
{
|
||||
char str[B_FILE_NAME_LENGTH+20];
|
||||
strcpy(str, LP_MAGIC);
|
||||
Reference in New Issue
Block a user