added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
From 4ca405e9763fd0ba747ef00edd30648b66992fbb Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 30 Nov 2021 15:14:39 -0800
Subject: [PATCH] Use v2.1.2 xxhash to fix build with go 1.17
Fixes
| # github.com/cespare/xxhash
| asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 000
92 (/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/influxdb/1.8.10-r0/build/pkg/mod/github.com/cespare/xxhash@
v1.1.0/xxhash_amd64.s:120) ADDQ R15, AX
| asm: assembly failed
Upstream-Status: Backport [https://github.com/cespare/xxhash/commit/e7a6b52374f7e2abfb8abb27249d53a1997b09a7]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
go.mod | 3 ++-
go.sum | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
--- a/go.mod
+++ b/go.mod
@@ -55,3 +55,5 @@ require (
gonum.org/v1/gonum v0.6.0 // indirect
google.golang.org/grpc v1.26.0
)
+
+replace github.com/cespare/xxhash => github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56
--- a/go.sum
+++ b/go.sum
@@ -188,6 +188,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dA
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56 h1:hCQ0jTkNInQ7PpNeGlSV9s+QMi6nUyyMuz37Bg3TduE=
+github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=

View File

@@ -0,0 +1,31 @@
From f3713628fac72e45223013dcf8e37ac65d17d886 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 11 Jan 2021 15:16:57 -0800
Subject: [PATCH] patch term module for mips ispeed/ospeed termios absense
Upstream-Status: Inappropriate [OE-Specific needed on mips]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
go.mod | 2 ++
1 file changed, 2 insertions(+)
--- a/go.mod
+++ b/go.mod
@@ -56,4 +56,5 @@ require (
google.golang.org/grpc v1.26.0
)
+replace github.com/pkg/term => github.com/kraj/term v0.0.0-20210111231523-7c42fcb0e627
replace github.com/cespare/xxhash => github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56
--- a/go.sum
+++ b/go.sum
@@ -188,6 +188,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dA
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kraj/term v0.0.0-20210111231523-7c42fcb0e627 h1:3/XXm86KqrOZEJvEmFlzl3NTFA99n5Pd/cSXl60LmuA=
+github.com/kraj/term v0.0.0-20210111231523-7c42fcb0e627/go.mod h1:BYR4E+NOQrH+NhXE71KuBNmyR1lQ+yDvP+O3IIHO5bM=
github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56 h1:hCQ0jTkNInQ7PpNeGlSV9s+QMi6nUyyMuz37Bg3TduE=
github.com/kraj/xxhash v1.1.1-0.20211201014032-8254a11eab56/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=

View File

@@ -0,0 +1,235 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: influxd
# Required-Start: $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the InfluxDB process
### END INIT INFO
set -x
# If you modify this, please make sure to also edit influxdb.service
# Command-line options that can be set in /etc/default/influxdb. These will override
# any config file values.
DEFAULT=/etc/default/influxdb
# Daemon options
INFLUXD_OPTS=
# Process name ( For display )
NAME=influxdb
# User and group
USER=influxdb
GROUP=influxdb
# Check for sudo or root privileges before continuing
if [ "$UID" != "0" ]; then
echo "You must be root to run this script"
exit 1
fi
# Daemon name, where is the actual executable If the daemon is not
# there, then exit.
DAEMON=/usr/bin/influxd
if [ ! -x $DAEMON ]; then
echo "Executable $DAEMON does not exist!"
exit 5
fi
# Configuration file
CONFIG=/etc/influxdb/influxdb.conf
# PID file for the daemon
PIDFILE=/var/run/influxdb/influxd.pid
PIDDIR=`dirname $PIDFILE`
if [ ! -d "$PIDDIR" ]; then
mkdir -p $PIDDIR
chown $USER:$GROUP $PIDDIR
fi
# Max open files
OPEN_FILE_LIMIT=65536
if [ -r /lib/lsb/init-functions ]; then
source /lib/lsb/init-functions
fi
# Logging
if [ -z "$STDOUT" ]; then
STDOUT=/var/log/influxdb/influxd.log
fi
if [ ! -f "$STDOUT" ]; then
mkdir -p $(dirname $STDOUT)
fi
if [ -z "$STDERR" ]; then
STDERR=/var/log/influxdb/influxd.log
fi
if [ ! -f "$STDERR" ]; then
mkdir -p $(dirname $STDERR)
fi
# Override init script variables with DEFAULT values
if [ -r $DEFAULT ]; then
source $DEFAULT
fi
function log_failure_msg() {
echo "$@" "[ FAILED ]"
}
function log_success_msg() {
echo "$@" "[ OK ]"
}
function start() {
# Check if config file exist
if [ ! -r $CONFIG ]; then
log_failure_msg "config file $CONFIG doesn't exist (or you don't have permission to view)"
exit 4
fi
# Check that the PID file exists, and check the actual status of process
if [ -f $PIDFILE ]; then
PID="$(cat $PIDFILE)"
if kill -0 "$PID" &>/dev/null; then
# Process is already up
log_success_msg "$NAME process is already running"
return 0
fi
else
su -s /bin/sh -c "touch $PIDFILE" $USER &>/dev/null
if [ $? -ne 0 ]; then
log_failure_msg "$PIDFILE not writable, check permissions"
exit 5
fi
fi
# Bump the file limits, before launching the daemon. These will
# carry over to launched processes.
ulimit -n $OPEN_FILE_LIMIT
if [ $? -ne 0 ]; then
log_failure_msg "Unable to set ulimit to $OPEN_FILE_LIMIT"
exit 1
fi
# Launch process
echo "Starting $NAME..."
if command -v start-stop-daemon &>/dev/null; then
start-stop-daemon \
--background \
--chuid $USER:$GROUP \
--start \
--quiet \
--pidfile $PIDFILE \
--exec $DAEMON \
-- \
-config $CONFIG \
$INFLUXD_OPTS >>$STDOUT 2>>$STDERR
else
local CMD="$DAEMON -config $CONFIG $INFLUXD_OPTS >>$STDOUT 2>>$STDERR &"
su -s /bin/sh -c "$CMD" $USER
fi
# Sleep to verify process is still up
sleep 1
echo $(pidof influxd) > $PIDFILE
if [ -f $PIDFILE ]; then
# PIDFILE exists
PID="$(cat $PIDFILE)"
if kill -0 "$PID" &>/dev/null; then
# PID up, service running
log_success_msg "$NAME process was started"
return 0
fi
fi
log_failure_msg "$NAME process was unable to start"
exit 1
}
function stop() {
# Stop the daemon.
if [ -f $PIDFILE ]; then
local PID="$(cat $PIDFILE)"
if kill -0 $PID &>/dev/null; then
echo "Stopping $NAME..."
# Process still up, send SIGTERM and remove PIDFILE
kill -s TERM $PID &>/dev/null && rm -f "$PIDFILE" &>/dev/null
n=0
while true; do
# Enter loop to ensure process is stopped
kill -0 $PID &>/dev/null
if [ "$?" != "0" ]; then
# Process stopped, break from loop
log_success_msg "$NAME process was stopped"
return 0
fi
# Process still up after signal, sleep and wait
sleep 1
n=$(expr $n + 1)
if [ $n -eq 30 ]; then
# After 30 seconds, send SIGKILL
echo "Timeout exceeded, sending SIGKILL..."
kill -s KILL $PID &>/dev/null
elif [ $? -eq 40 ]; then
# After 40 seconds, error out
log_failure_msg "could not stop $NAME process"
exit 1
fi
done
fi
fi
log_success_msg "$NAME process already stopped"
}
function restart() {
# Restart the daemon.
stop
start
}
function status() {
# Check the status of the process.
if [ -f $PIDFILE ]; then
PID="$(cat $PIDFILE)"
if kill -0 $PID &>/dev/null; then
log_success_msg "$NAME process is running"
exit 0
fi
fi
log_failure_msg "$NAME process is not running"
exit 1
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
version)
$DAEMON version
;;
*)
# For invalid arguments, print the usage message.
echo "Usage: $0 {start|stop|restart|status|version}"
exit 2
;;
esac

View File

@@ -0,0 +1,586 @@
### Welcome to the InfluxDB configuration file.
# The values in this file override the default values used by the system if
# a config option is not specified. The commented out lines are the configuration
# field and the default value used. Uncommenting a line and changing the value
# will change the value used at runtime when the process is restarted.
# Once every 24 hours InfluxDB will report usage data to usage.influxdata.com
# The data includes a random ID, os, arch, version, the number of series and other
# usage data. No data from user databases is ever transmitted.
# Change this option to true to disable reporting.
# reporting-disabled = false
# Bind address to use for the RPC service for backup and restore.
# bind-address = "127.0.0.1:8088"
###
### [meta]
###
### Controls the parameters for the Raft consensus group that stores metadata
### about the InfluxDB cluster.
###
[meta]
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"
# Automatically create a default retention policy when creating a database.
# retention-autocreate = true
# If log messages are printed for the meta service
# logging-enabled = true
###
### [data]
###
### Controls where the actual shard data for InfluxDB lives and how it is
### flushed from the WAL. "dir" may need to be changed to a suitable place
### for your system, but the WAL settings are an advanced configuration. The
### defaults should work for most systems.
###
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/var/lib/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/var/lib/influxdb/wal"
# The amount of time that a write will wait before fsyncing. A duration
# greater than 0 can be used to batch up multiple fsync calls. This is useful for slower
# disks or when WAL write contention is seen. A value of 0s fsyncs every write to the WAL.
# Values in the range of 0-100ms are recommended for non-SSD disks.
# wal-fsync-delay = "0s"
# The type of shard index to use for new shards. The default is an in-memory index that is
# recreated at startup. A value of "tsi1" will use a disk based index that supports higher
# cardinality datasets.
# index-version = "inmem"
# Trace logging provides more verbose output around the tsm engine. Turning
# this on can provide more useful output for debugging tsm engine issues.
# trace-logging-enabled = false
# Whether queries should be logged before execution. Very useful for troubleshooting, but will
# log any sensitive data contained within a query.
# query-log-enabled = true
# Validates incoming writes to ensure keys only have valid unicode characters.
# This setting will incur a small overhead because every key must be checked.
# validate-keys = false
# Settings for the TSM engine
# CacheMaxMemorySize is the maximum size a shard's cache can
# reach before it starts rejecting writes.
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
# cache-max-memory-size = "1g"
# CacheSnapshotMemorySize is the size at which the engine will
# snapshot the cache and write it to a TSM file, freeing up memory
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
# cache-snapshot-memory-size = "25m"
# CacheSnapshotWriteColdDuration is the length of time at
# which the engine will snapshot the cache and write it to
# a new TSM file if the shard hasn't received writes or deletes
# cache-snapshot-write-cold-duration = "10m"
# CompactFullWriteColdDuration is the duration at which the engine
# will compact all TSM files in a shard if it hasn't received a
# write or delete
# compact-full-write-cold-duration = "4h"
# The maximum number of concurrent full and level compactions that can run at one time. A
# value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. Any number greater
# than 0 limits compactions to that value. This setting does not apply
# to cache snapshotting.
# max-concurrent-compactions = 0
# CompactThroughput is the rate limit in bytes per second that we
# will allow TSM compactions to write to disk. Note that short bursts are allowed
# to happen at a possibly larger value, set by CompactThroughputBurst
# compact-throughput = "48m"
# CompactThroughputBurst is the rate limit in bytes per second that we
# will allow TSM compactions to write to disk.
# compact-throughput-burst = "48m"
# If true, then the mmap advise value MADV_WILLNEED will be provided to the kernel with respect to
# TSM files. This setting has been found to be problematic on some kernels, and defaults to off.
# It might help users who have slow disks in some cases.
# tsm-use-madv-willneed = false
# Settings for the inmem index
# The maximum series allowed per database before writes are dropped. This limit can prevent
# high cardinality issues at the database level. This limit can be disabled by setting it to
# 0.
# max-series-per-database = 1000000
# The maximum number of tag values per tag that are allowed before writes are dropped. This limit
# can prevent high cardinality tag values from being written to a measurement. This limit can be
# disabled by setting it to 0.
# max-values-per-tag = 100000
# Settings for the tsi1 index
# The threshold, in bytes, when an index write-ahead log file will compact
# into an index file. Lower sizes will cause log files to be compacted more
# quickly and result in lower heap usage at the expense of write throughput.
# Higher sizes will be compacted less frequently, store more series in-memory,
# and provide higher write throughput.
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
# max-index-log-file-size = "1m"
# The size of the internal cache used in the TSI index to store previously
# calculated series results. Cached results will be returned quickly from the cache rather
# than needing to be recalculated when a subsequent query with a matching tag key/value
# predicate is executed. Setting this value to 0 will disable the cache, which may
# lead to query performance issues.
# This value should only be increased if it is known that the set of regularly used
# tag key/value predicates across all measurements for a database is larger than 100. An
# increase in cache size may lead to an increase in heap usage.
series-id-set-cache-size = 100
###
### [coordinator]
###
### Controls the clustering service configuration.
###
[coordinator]
# The default time a write request will wait until a "timeout" error is returned to the caller.
# write-timeout = "10s"
# The maximum number of concurrent queries allowed to be executing at one time. If a query is
# executed and exceeds this limit, an error is returned to the caller. This limit can be disabled
# by setting it to 0.
# max-concurrent-queries = 0
# The maximum time a query will is allowed to execute before being killed by the system. This limit
# can help prevent run away queries. Setting the value to 0 disables the limit.
# query-timeout = "0s"
# The time threshold when a query will be logged as a slow query. This limit can be set to help
# discover slow or resource intensive queries. Setting the value to 0 disables the slow query logging.
# log-queries-after = "0s"
# The maximum number of points a SELECT can process. A value of 0 will make
# the maximum point count unlimited. This will only be checked every second so queries will not
# be aborted immediately when hitting the limit.
# max-select-point = 0
# The maximum number of series a SELECT can run. A value of 0 will make the maximum series
# count unlimited.
# max-select-series = 0
# The maximum number of group by time bucket a SELECT can create. A value of zero will max the maximum
# number of buckets unlimited.
# max-select-buckets = 0
###
### [retention]
###
### Controls the enforcement of retention policies for evicting old data.
###
[retention]
# Determines whether retention policy enforcement enabled.
# enabled = true
# The interval of time when retention policy enforcement checks run.
# check-interval = "30m"
###
### [shard-precreation]
###
### Controls the precreation of shards, so they are available before data arrives.
### Only shards that, after creation, will have both a start- and end-time in the
### future, will ever be created. Shards are never precreated that would be wholly
### or partially in the past.
[shard-precreation]
# Determines whether shard pre-creation service is enabled.
# enabled = true
# The interval of time when the check to pre-create new shards runs.
# check-interval = "10m"
# The default period ahead of the endtime of a shard group that its successor
# group is created.
# advance-period = "30m"
###
### Controls the system self-monitoring, statistics and diagnostics.
###
### The internal database for monitoring data is created automatically if
### if it does not already exist. The target retention within this database
### is called 'monitor' and is also created with a retention period of 7 days
### and a replication factor of 1, if it does not exist. In all cases the
### this retention policy is configured as the default for the database.
[monitor]
# Whether to record statistics internally.
# store-enabled = true
# The destination database for recorded statistics
# store-database = "_internal"
# The interval at which to record statistics
# store-interval = "10s"
###
### [http]
###
### Controls how the HTTP endpoints are configured. These are the primary
### mechanism for getting data into and out of InfluxDB.
###
[http]
# Determines whether HTTP endpoint is enabled.
# enabled = true
# Determines whether the Flux query endpoint is enabled.
# flux-enabled = false
# Determines whether the Flux query logging is enabled.
# flux-log-enabled = false
# The bind address used by the HTTP service.
# bind-address = ":8086"
# Determines whether user authentication is enabled over HTTP/HTTPS.
# auth-enabled = false
# The default realm sent back when issuing a basic auth challenge.
# realm = "InfluxDB"
# Determines whether HTTP request logging is enabled.
# log-enabled = true
# Determines whether the HTTP write request logs should be suppressed when the log is enabled.
# suppress-write-log = false
# When HTTP request logging is enabled, this option specifies the path where
# log entries should be written. If unspecified, the default is to write to stderr, which
# intermingles HTTP logs with internal InfluxDB logging.
#
# If influxd is unable to access the specified path, it will log an error and fall back to writing
# the request log to stderr.
# access-log-path = ""
# Filters which requests should be logged. Each filter is of the pattern NNN, NNX, or NXX where N is
# a number and X is a wildcard for any number. To filter all 5xx responses, use the string 5xx.
# If multiple filters are used, then only one has to match. The default is to have no filters which
# will cause every request to be printed.
# access-log-status-filters = []
# Determines whether detailed write logging is enabled.
# write-tracing = false
# Determines whether the pprof endpoint is enabled. This endpoint is used for
# troubleshooting and monitoring.
# pprof-enabled = true
# Enables authentication on pprof endpoints. Users will need admin permissions
# to access the pprof endpoints when this setting is enabled. This setting has
# no effect if either auth-enabled or pprof-enabled are set to false.
# pprof-auth-enabled = false
# Enables a pprof endpoint that binds to localhost:6060 immediately on startup.
# This is only needed to debug startup issues.
# debug-pprof-enabled = false
# Enables authentication on the /ping, /metrics, and deprecated /status
# endpoints. This setting has no effect if auth-enabled is set to false.
# ping-auth-enabled = false
# Determines whether HTTPS is enabled.
# https-enabled = false
# The SSL certificate to use when HTTPS is enabled.
# https-certificate = "/etc/ssl/influxdb.pem"
# Use a separate private key location.
# https-private-key = ""
# The JWT auth shared secret to validate requests using JSON web tokens.
# shared-secret = ""
# The default chunk size for result sets that should be chunked.
# max-row-limit = 0
# The maximum number of HTTP connections that may be open at once. New connections that
# would exceed this limit are dropped. Setting this value to 0 disables the limit.
# max-connection-limit = 0
# Enable http service over unix domain socket
# unix-socket-enabled = false
# The path of the unix domain socket.
# bind-socket = "/var/run/influxdb.sock"
# The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit.
# max-body-size = 25000000
# The maximum number of writes processed concurrently.
# Setting this to 0 disables the limit.
# max-concurrent-write-limit = 0
# The maximum number of writes queued for processing.
# Setting this to 0 disables the limit.
# max-enqueued-write-limit = 0
# The maximum duration for a write to wait in the queue to be processed.
# Setting this to 0 or setting max-concurrent-write-limit to 0 disables the limit.
# enqueued-write-timeout = 0
###
### [logging]
###
### Controls how the logger emits logs to the output.
###
[logging]
# Determines which log encoder to use for logs. Available options
# are auto, logfmt, and json. auto will use a more a more user-friendly
# output format if the output terminal is a TTY, but the format is not as
# easily machine-readable. When the output is a non-TTY, auto will use
# logfmt.
# format = "auto"
# Determines which level of logs will be emitted. The available levels
# are error, warn, info, and debug. Logs that are equal to or above the
# specified level will be emitted.
# level = "info"
# Suppresses the logo output that is printed when the program is started.
# The logo is always suppressed if STDOUT is not a TTY.
# suppress-logo = false
###
### [subscriber]
###
### Controls the subscriptions, which can be used to fork a copy of all data
### received by the InfluxDB host.
###
[subscriber]
# Determines whether the subscriber service is enabled.
# enabled = true
# The default timeout for HTTP writes to subscribers.
# http-timeout = "30s"
# Allows insecure HTTPS connections to subscribers. This is useful when testing with self-
# signed certificates.
# insecure-skip-verify = false
# The path to the PEM encoded CA certs file. If the empty string, the default system certs will be used
# ca-certs = ""
# The number of writer goroutines processing the write channel.
# write-concurrency = 40
# The number of in-flight writes buffered in the write channel.
# write-buffer-size = 1000
###
### [[graphite]]
###
### Controls one or many listeners for Graphite data.
###
[[graphite]]
# Determines whether the graphite endpoint is enabled.
# enabled = false
# database = "graphite"
# retention-policy = ""
# bind-address = ":2003"
# protocol = "tcp"
# consistency-level = "one"
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in.
# Flush if this many points get buffered
# batch-size = 5000
# number of batches that may be pending in memory
# batch-pending = 10
# Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s"
# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# udp-read-buffer = 0
### This string joins multiple matching 'measurement' values providing more control over the final measurement name.
# separator = "."
### Default tags that will be added to all metrics. These can be overridden at the template level
### or by tags extracted from metric
# tags = ["region=us-east", "zone=1c"]
### Each template line requires a template pattern. It can have an optional
### filter before the template and separated by spaces. It can also have optional extra
### tags following the template. Multiple tags should be separated by commas and no spaces
### similar to the line protocol format. There can be only one default template.
# templates = [
# "*.app env.service.resource.measurement",
# # Default template
# "server.*",
# ]
###
### [collectd]
###
### Controls one or many listeners for collectd data.
###
[[collectd]]
# enabled = false
# bind-address = ":25826"
# database = "collectd"
# retention-policy = ""
#
# The collectd service supports either scanning a directory for multiple types
# db files, or specifying a single db file.
# typesdb = "/usr/local/share/collectd"
#
# security-level = "none"
# auth-file = "/etc/collectd/auth_file"
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in.
# Flush if this many points get buffered
# batch-size = 5000
# Number of batches that may be pending in memory
# batch-pending = 10
# Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "10s"
# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# read-buffer = 0
# Multi-value plugins can be handled two ways.
# "split" will parse and store the multi-value plugin data into separate measurements
# "join" will parse and store the multi-value plugin as a single multi-value measurement.
# "split" is the default behavior for backward compatibility with previous versions of influxdb.
# parse-multivalue-plugin = "split"
###
### [opentsdb]
###
### Controls one or many listeners for OpenTSDB data.
###
[[opentsdb]]
# enabled = false
# bind-address = ":4242"
# database = "opentsdb"
# retention-policy = ""
# consistency-level = "one"
# tls-enabled = false
# certificate= "/etc/ssl/influxdb.pem"
# Log an error for every malformed point.
# log-point-errors = true
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Only points
# metrics received over the telnet protocol undergo batching.
# Flush if this many points get buffered
# batch-size = 1000
# Number of batches that may be pending in memory
# batch-pending = 5
# Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s"
###
### [[udp]]
###
### Controls the listeners for InfluxDB line protocol data via UDP.
###
[[udp]]
# enabled = false
# bind-address = ":8089"
# database = "udp"
# retention-policy = ""
# InfluxDB precision for timestamps on received points ("" or "n", "u", "ms", "s", "m", "h")
# precision = ""
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in.
# Flush if this many points get buffered
# batch-size = 5000
# Number of batches that may be pending in memory
# batch-pending = 10
# Will flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s"
# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# read-buffer = 0
###
### [continuous_queries]
###
### Controls how continuous queries are run within InfluxDB.
###
[continuous_queries]
# Determines whether the continuous query service is enabled.
# enabled = true
# Controls whether queries are logged when executed by the CQ service.
# log-enabled = true
# Controls whether queries are logged to the self-monitoring data store.
# query-stats-enabled = false
# interval for how often continuous queries will be checked if they need to run
# run-interval = "1s"
###
### [tls]
###
### Global configuration settings for TLS in InfluxDB.
###
[tls]
# Determines the available set of cipher suites. See https://golang.org/pkg/crypto/tls/#pkg-constants
# for a list of available ciphers, which depends on the version of Go (use the query
# SHOW DIAGNOSTICS to see the version of Go used to build InfluxDB). If not specified, uses
# the default settings from Go's crypto/tls package.
# ciphers = [
# "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
# "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
# ]
# Minimum version of the tls protocol that will be negotiated. If not specified, uses the
# default settings from Go's crypto/tls package.
# min-version = "tls1.2"
# Maximum version of the tls protocol that will be negotiated. If not specified, uses the
# default settings from Go's crypto/tls package.
# max-version = "tls1.3"

View File

@@ -0,0 +1,70 @@
DESCRIPTION = "InfluxDB is a time series database designed to handle high write and query loads."
HOMEPAGE = "https://www.influxdata.com/products/influxdb-overview/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=f39a8d10930fb37bd59adabb3b9d0bd6"
RDEPENDS:${PN} = "bash"
RDEPENDS:${PN}-dev = "bash"
GO_IMPORT = "github.com/influxdata/influxdb"
GO_INSTALL = "\
${GO_IMPORT}/cmd/influx \
${GO_IMPORT}/cmd/influxd \
"
SRC_URI = "\
git://${GO_IMPORT};protocol=https;branch=1.8;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \
file://0001-Use-v2.1.2-xxhash-to-fix-build-with-go-1.17.patch;patchdir=src/${GO_IMPORT} \
file://influxdb \
file://influxdb.conf \
"
SRC_URI:append:mipsarch = " file://0001-patch-term-module-for-mips-ispeed-ospeed-termios-abs.patch;patchdir=src/${GO_IMPORT}"
SRCREV = "688e697c51fd5353725da078555adbeff0363d01"
inherit go-mod pkgconfig systemd update-rc.d useradd
# Workaround for network access issue during compile step
# this needs to be fixed in the recipes buildsystem to move
# this such that it can be accomplished during do_fetch task
do_compile[network] = "1"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system -d /var/lib/influxdb -m -s /bin/nologin influxdb"
do_install:prepend() {
rm ${B}/src/${GO_IMPORT}/build.py
rm ${B}/src/${GO_IMPORT}/build.sh
rm ${B}/src/${GO_IMPORT}/Dockerfile*
sed -i -e "s#usr/bin/sh#bin/sh#g" ${B}/src/${GO_IMPORT}/scripts/ci/run_perftest.sh
}
do_install:append() {
install -d ${D}${sysconfdir}/influxdb
install -m 0644 ${WORKDIR}/influxdb.conf ${D}${sysconfdir}/influxdb
chown -R root.influxdb ${D}${sysconfdir}/influxdb
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/influxdb ${D}${sysconfdir}/init.d/influxdb
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ] ; then
install -d ${D}${sysconfdir}/logrotate.d
install -m 0644 ${S}/src/${GO_IMPORT}/scripts/logrotate ${D}${sysconfdir}/logrotate.d/influxdb
fi
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ] ; then
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${S}/src/${GO_IMPORT}/scripts/influxdb.service ${D}${systemd_system_unitdir}/influxdb.service
fi
# TODO chown
}
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "influxdb"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE:${PN} = "influxdb.service"

View File

@@ -0,0 +1,10 @@
#!/bin/sh
for test in *_test; do
if ./${test}; then
echo "PASS: ${test}"
else
echo "FAIL: ${test}"
fi
done

View File

@@ -0,0 +1,33 @@
SUMMARY = "LevelDB is a fast key-value storage library"
DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values"
HOMEPAGE = "https://github.com/google/leveldb"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
SRC_URI = "git://github.com/google/${BPN}.git;branch=main;protocol=https \
file://run-ptest"
SRCREV = "78b39d68c15ba020c0d60a3906fb66dbf1697595"
S = "${WORKDIR}/git"
inherit cmake ptest
PACKAGECONFIG ??= ""
PACKAGECONFIG[benchmarks] = "-DLEVELDB_BUILD_BENCHMARKS=ON,-DLEVELDB_BUILD_BENCHMARKS=OFF,sqlite"
PACKAGECONFIG[snappy] = ",,snappy"
PACKAGECONFIG[tcmalloc] = ",,gperftools"
EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH=ON \
-DLEVELDB_BUILD_TESTS=${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'ON', 'OFF', d)}"
do_install:append() {
install -D -m 0755 ${B}/leveldbutil ${D}${bindir}/leveldbutil
}
do_install_ptest() {
install -m 0755 ${B}/*_test ${D}${PTEST_PATH}
}
# Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb.
#
COMPATIBLE_HOST:mipsarcho32:pn-lib32-leveldb = "null"

View File

@@ -0,0 +1,17 @@
# libdbi OE build file
# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
# Released under the MIT license (see packages/COPYING)
DESCRIPTION = "Database Independent Abstraction Layer for C"
HOMEPAGE = "http://libdbi.sourceforge.net/"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
SECTION = "libs"
INC_PR = "r0"
SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi/libdbi-${PV}.tar.gz"
inherit autotools
EXTRA_OECONF = "--disable-docs"

View File

@@ -0,0 +1,6 @@
require ${PN}.inc
PR = "${INC_PR}.0"
SRC_URI[md5sum] = "05e2ceeac4bc85fbe40de8b4b22d9ab3"
SRC_URI[sha256sum] = "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503"

View File

@@ -0,0 +1,33 @@
From 4a11d4d03ef66729d302cc122fa0c693299a7776 Mon Sep 17 00:00:00 2001
From: Sakib Sajal <sakib.sajal@windriver.com>
Date: Wed, 18 Aug 2021 10:49:38 -0400
Subject: [PATCH] Makefile: use libprefix instead of libdir
libdir expands to "$(exec_prefix)/lib" where "lib" is hardcoded.
This is a problem for builds that enable MULTILIB since libraries
are to be installed in "lib64" directory. Hence allow the directory
to be configurable.
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
---
libraries/liblmdb/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index f254511..1ec74e6 100644
--- a/Makefile
+++ b/Makefile
@@ -46,11 +46,11 @@ all: $(ILIBS) $(PROGS)
install: $(ILIBS) $(IPROGS) $(IHDRS)
mkdir -p $(DESTDIR)$(bindir)
- mkdir -p $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(libprefix)
mkdir -p $(DESTDIR)$(includedir)
mkdir -p $(DESTDIR)$(mandir)/man1
for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
+ for f in $(ILIBS); do cp $$f $(DESTDIR)$(libprefix); done
for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done

View File

@@ -0,0 +1,22 @@
From b4d418bf3f78748d84e3cfb110833443eef34284 Mon Sep 17 00:00:00 2001
From: Justin Bronder <jsbronder@cold-front.org>
Date: Thu, 25 Aug 2022 17:22:20 -0400
Subject: [PATCH] make: set soname on liblmdb
---
libraries/liblmdb/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
index 1ec74e6..ea08cd6 100644
--- a/libraries/liblmdb/Makefile
+++ b/libraries/liblmdb/Makefile
@@ -66,7 +66,7 @@ liblmdb.a: mdb.o midl.o
liblmdb$(SOEXT): mdb.lo midl.lo
# $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS)
+ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,$@ -o $@ mdb.lo midl.lo $(SOLIBS)
mdb_stat: mdb_stat.o liblmdb.a
mdb_copy: mdb_copy.o liblmdb.a

View File

@@ -0,0 +1,25 @@
#!/bin/sh
cd tests
retval=0
for t in mtest*
do
mkdir testdb
./$t > /dev/null && ./mdb_stat testdb > /dev/null
if [ $? -ne 0 ]; then
echo "FAIL: $t"
retval=$(( ${retval} + 1))
else
echo "PASS: $t"
fi
rm -rf testdb
done
if [ $retval -eq 0 ] ; then
echo "PASS: lmdb"
else
echo "FAIL: lmdb"
fi
exit $retval

View File

@@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2017-2019 Volker Krause <vkrause@kde.org>
# SPDX-FileCopyrightText: 2019 Hannah Kiekens <hannahkiekens@gmail.com>
#
# SPDX-License-Identifier: MIT
SUMMARY = "Lightning Memory-Mapped Database (LMDB)"
HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/"
LICENSE = "OLDAP-2.8"
LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972"
SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1;protocol=https \
file://run-ptest \
file://0001-Makefile-use-libprefix-instead-of-libdir.patch \
file://0001-make-set-soname-on-liblmdb.patch;patchdir=../.. \
"
SRCREV = "8ad7be2510414b9506ec9f9e24f24d04d9b04a1a"
inherit ptest
S = "${WORKDIR}/git/libraries/liblmdb"
do_compile() {
oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}"
}
do_install() {
oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}" install
cd ${D}${libdir}
ln -s liblmdb.so.${PV} liblmdb.so
rm liblmdb.a
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do
install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests
done
}

View File

@@ -0,0 +1,23 @@
require mariadb.inc
inherit native
PROVIDES += "mysql5-native"
DEPENDS = "ncurses-native zlib-native bison-native libpcre2-native \
gnutls-native fmt-native \
"
RDEPENDS:${PN} = ""
PACKAGES = ""
EXTRA_OEMAKE = ""
do_install() {
oe_runmake 'DESTDIR=${D}' install
install -d ${D}${bindir}
install -m 0755 sql/gen_lex_hash ${D}${bindir}/
install -m 0755 sql/gen_lex_token ${D}${bindir}/
install -m 0755 extra/comp_err ${D}${bindir}/
install -m 0755 scripts/comp_sql ${D}${bindir}/
install -m 0755 strings/uca-dump ${D}${bindir}/
}

View File

@@ -0,0 +1,353 @@
SUMMARY = "A robust, scalable, and reliable SQL server"
HOMEPAGE = "http://mariadb.org"
SECTION = "libs"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b1becf0cfa3366e0f4d854d1d264f311"
SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
file://my.cnf \
file://mysqld.service \
file://install_db.service \
file://install_db \
file://mysql-systemd-start \
file://configure.cmake-fix-valgrind.patch \
file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \
file://fix-arm-atomic.patch \
file://0001-Fix-library-LZ4-lookup.patch \
file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \
file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \
file://ssize_t.patch \
file://mm_malloc.patch \
file://sys_futex.patch \
file://cross-compiling.patch \
file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
file://lfs64.patch \
file://0001-Add-missing-includes-cstdint-and-cstdio.patch \
"
SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
SRC_URI[sha256sum] = "1c89dee0caed0f68bc2a1d203eb98a123150e6a179f6ee0f1fc0ba3f08dc71dc"
UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
S = "${WORKDIR}/mariadb-${PV}"
BINCONFIG_GLOB = "mysql_config"
inherit cmake gettext binconfig update-rc.d useradd systemd multilib_script pkgconfig
MULTILIB_SCRIPTS = "${PN}-server:${bindir}/mariadbd-safe \
${PN}-setupdb:${bindir}/mariadb-install-db"
INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb"
INITSCRIPT_NAME:${PN}-server = "mysqld"
INITSCRIPT_PARAMS:${PN}-server ?= "start 45 5 . stop 45 0 6 1 ."
USERADD_PACKAGES = "${PN}-setupdb"
USERADD_PARAM:${PN}-setupdb = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql"
GROUPADD_PARAM:${PN}-setupdb = "--system mysql"
INITSCRIPT_NAME:${PN}-setupdb = "install_db"
INITSCRIPT_PARAMS:${PN}-setupdb ?= "defaults 44 44"
SYSTEMD_PACKAGES = "${PN}-server ${PN}-setupdb"
SYSTEMD_SERVICE:${PN}-server = "mysqld.service"
SYSTEMD_AUTO_ENABLE:${PN}-server ?= "disable"
SYSTEMD_SERVICE:${PN}-setupdb = "install_db.service"
SYSTEMD_AUTO_ENABLE:${PN}-setupdb ?= "enable"
ALLOW_EMPTY:${PN}-setupdb ?= "1"
FILES:${PN}-setupdb = "${sysconfdir}/init.d/install_db \
${bindir}/mariadb-install-db \
${bindir}/my_print_defaults \
${bindir}/mysql_install_db \
${bindir}/mysql-systemd-start \
"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} lz4 openssl"
EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
PACKAGECONFIG:class-native = ""
PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind"
PACKAGECONFIG[krb5] = ", ,krb5"
PACKAGECONFIG[lz4] = ", ,lz4"
PACKAGECONFIG[openssl] = "-DWITH_SSL='system',-DWITH_SSL='bundled',openssl"
# MariaDB doesn't link properly with gold
# https://mariadb.atlassian.net/browse/MDEV-5982
TARGET_CFLAGS += "-fuse-ld=bfd"
LDFLAGS += " -pthread"
BUILD_CFLAGS += "-fuse-ld=bfd"
BUILD_CXXFLAGS += "-fuse-ld=bfd"
LDFLAGS:x86:toolchain-clang = "-latomic"
EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
-DWITH_JEMALLOC=no \
-DWITHOUT_TOKUDB=TRUE \
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \
-DGROFF=FALSE \
-DNROFF=FALSE \
-DENABLE_DTRACE=FALSE \
-DWITH_PIC=ON \
-DWITH_PCRE=system \
-DINSTALL_LAYOUT=RPM \
-DINSTALL_DOCDIR:PATH=${datadir}/doc/${BPN} \
-DINSTALL_LIBDIR:PATH=${baselib} \
-DINSTALL_PLUGINDIR:PATH=${baselib}/plugin \
-DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \
-DMYSQL_DATADIR:PATH=/var/mysql \
-DCAT_EXECUTABLE=`which cat` \
-DSTACK_DIRECTION=1 \
-DCMAKE_AR:FILEPATH=${AR}"
# With Ninja it fails with:
# make: *** No rule to make target `install'. Stop.
OECMAKE_GENERATOR = "Unix Makefiles"
ARM_INSTRUCTION_SET:armv4 = "arm"
ARM_INSTRUCTION_SET:armv5 = "arm"
do_configure:append() {
# handle distros with different values of ${libexecdir}
libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'`
sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh
sed -i -e "s:mysqld libexec:mysqld $libexecdir2:g" ${S}/scripts/mysql_install_db.sh
sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh
}
do_generate_toolchain_file:append:class-native () {
# If these are set cmake will assume we're cross-compiling, which will
# result in certain things we want being disabled
sed -i "/set( CMAKE_SYSTEM_NAME/d" ${WORKDIR}/toolchain.cmake
sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake
}
do_compile:prepend:class-target () {
# These need to be in-tree or make will think they need to be built,
# and since we're cross-compiling that is disabled
cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra
cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts
if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then
if ! [ -e ${B}/include/openssl/kssl.h ] ; then
mkdir -p ${B}/include/openssl
echo "#ifndef KSSL_H" >${B}/include/openssl/kssl.h
echo "#define KSSL_H" >>${B}/include/openssl/kssl.h
echo "#include <openssl/opensslconf.h>">>${B}/include/openssl/kssl.h
echo "#endif" >>${B}/include/openssl/kssl.h
fi
fi
}
SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess"
# We need to append this so it runs *after* binconfig's preprocess function
#
# We really don't care exactly what the directories were set to originally.
# plugindir is not fixed, but we don't create any plugins.
#
mariadb_sysroot_preprocess () {
sed -i -es,^pkgincludedir=.*,pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
sed -i -es,^pkglibdir=.*,pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
}
do_install() {
oe_runmake 'DESTDIR=${D}' install
install -d ${D}/${sysconfdir}/init.d
install -m 0644 ${WORKDIR}/my.cnf ${D}/${sysconfdir}/
install -m 0755 ${WORKDIR}/install_db ${D}/${sysconfdir}/init.d/
mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/mysqld.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/install_db.service ${D}${systemd_unitdir}/system
sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service \
${D}${systemd_unitdir}/system/install_db.service
install -d ${D}${bindir}
install -m 755 ${WORKDIR}/mysql-systemd-start ${D}${bindir}
install -d ${D}${datadir}/doc/${PN}
if [ -f ${D}${datadir}/doc/README ]; then
mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/
fi
# mini-benchmark used for Gitlab-CI to run on every commit to catch
# if there are severe performance regressions.
# remove it to avoid introducing bash dependency
if [ -f ${D}${datadir}/mysql/mini-benchmark ]; then
rm -rf ${D}${datadir}/mysql/mini-benchmark
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
pam_so=$(find ${D} -name pam_user_map.so)
if [ x"${pam_so}" != x ]; then
pam_dir=$(dirname ${pam_so})
mv ${pam_dir} ${D}/${libdir}
rmdir --ignore-fail-on-non-empty ${pam_dir%security}
fi
fi
}
PACKAGES = "${PN}-dbg ${PN}-setupdb ${PN} \
libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev \
libmysqlclient libmysqlclient-dev libmysqlclient-staticdev \
libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-leftovers"
CONFFILES:${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf"
CONFFILES:${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf"
CONFFILES:libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf"
RPROVIDES:${PN}-dbg += "libmysqlclient-r-dbg libmysqlclient-dbg"
FILES:${PN} = " "
RDEPENDS:${PN} = "${PN}-client ${PN}-server"
ALLOW_EMPTY:${PN} = "1"
RDEPENDS:${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \
perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \
perl-module-exporter"
RDEPENDS:${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \
perl-module-file-basename perl-module-file-path perl-module-sys-hostname \
perl-module-file-copy perl-module-file-temp perl-module-posix \
${PN}-client ${PN}-setupdb libdbi-perl libdbd-mysql-perl lzo"
RDEPENDS:${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \
perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \
perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \
perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \
perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \
perl-module-io-socket-inet perl-module-io-select bash"
RDEPENDS:${PN}-setupdb = "coreutils"
# Allow old code to link to the backward compatible library
RDEPENDS:libmysqlclient-dev = "libmysqlclient-r-dev"
PACKAGE_PREPROCESS_FUNCS += "src_package_preprocess"
src_package_preprocess () {
# Trim build paths from comments in generated sources to ensure reproducibility
sed -i -e "s,${S}/sql/,,g" \
-e "s,${B}/sql/,,g" \
${B}/sql/yy_oracle.hh \
${B}/sql/yy_mariadb.cc \
${B}/sql/yy_mariadb.hh \
${B}/sql/yy_oracle.cc
}
FILES:libmysqlclient = "\
${libdir}/libmysqlclient.so.* \
${libdir}/libmariadb.so.* \
${sysconfdir}/my.cnf.d/client.cnf"
FILES:libmysqlclient-dev = " \
${includedir}/mysql/ \
${libdir}/libmysqlclient.so \
${libdir}/libmariadb.so \
${sysconfdir}/aclocal \
${bindir}/mysql_config"
FILES:libmysqlclient-staticdev = "\
${libdir}/*.a"
# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0
# which are intentionally non-PIC on 32-bit x86 (see e.g.
# storage/xtradb/plug.in in the source)
INSANE_SKIP:libmysqlclient:append:x86 = " textrel"
FILES:libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
FILES:libmysqlclient-r-dev = "\
${libdir}/libmysqlclient_r.so"
FILES:libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
FILES:libmysqld = "\
${libdir}/libmysqld.so.* \
${libdir}/libmariadbd.so.*"
FILES:libmysqld-dev = "\
${libdir}/libmysqld.so \
${libdir}/libmariadbd.so"
FILES:${PN}-client = "\
${bindir}/myisam_ftdump \
${bindir}/mysql \
${bindir}/mariadb \
${bindir}/mysql_client_test \
${bindir}/mariadb-client-test \
${bindir}/mysql_client_test_embedded \
${bindir}/mariadb-client-test-embedded \
${bindir}/mysql_find_rows \
${bindir}/mariadb-find-rows \
${bindir}/mysql_fix_extensions \
${bindir}/mariadb-fix-extensions \
${bindir}/mysql_waitpid \
${bindir}/mariadb-waitpid \
${bindir}/mysqlaccess \
${bindir}/mariadb-access \
${bindir}/mysqladmin \
${bindir}/mariadb-admin \
${bindir}/mysqlcheck \
${bindir}/mariadb-check \
${bindir}/mysqldump \
${bindir}/mariadb-dump \
${bindir}/mysqldumpslow \
${bindir}/mariadb-dumpslow \
${bindir}/mysqlimport \
${bindir}/mariadb-import \
${bindir}/mysqlshow \
${bindir}/mariadb-show \
${bindir}/mysqlslap \
${bindir}/mariadb-slap \
${bindir}/mysqltest_embedded \
${bindir}/mariadb-test-embedded \
${libexecdir}/mysqlmanager \
${sysconfdir}/my.cnf.d/mysql-clients.cnf"
FILES:${PN}-server = "\
${bindir}/msql2mysql \
${bindir}/my_print_defaults \
${bindir}/myisamchk \
${bindir}/myisamlog \
${bindir}/myisampack \
${bindir}/mysql_convert_table_format \
${bindir}/mariadb-convert-table-format \
${bindir}/mysql_install_db \
${bindir}/mysql_secure_installation \
${bindir}/mariadb-secure-installation \
${bindir}/mysql_setpermission \
${bindir}/mariadb-setpermission \
${bindir}/mysql-systemd-start \
${bindir}/mysql_tzinfo_to_sql \
${bindir}/mariadb-tzinfo-to-sql \
${bindir}/mysql_upgrade \
${bindir}/mariadb-upgrade \
${bindir}/mysql_plugin \
${bindir}/mariadb-plugin \
${bindir}/mysqlbinlog \
${bindir}/mariadb-binlog \
${bindir}/mysqld_multi \
${bindir}/mariadbd-multi \
${bindir}/mariadbd-safe \
${bindir}/mysqld_safe \
${bindir}/mysqld_safe_helper \
${bindir}/mariadbd-safe-helper \
${bindir}/mysqlhotcopy \
${bindir}/mariadb-hotcopy \
${bindir}/mysqltest \
${bindir}/mariadb-test \
${bindir}/perror \
${bindir}/replace \
${bindir}/resolve_stack_dump \
${bindir}/resolveip \
${libexecdir}/mysqld \
${sbindir}/mysqld \
${sbindir}/mariadbd \
${libdir}/plugin/*.so \
${libdir}/security/*.so \
${libdir}/plugin/auth_pam_tool_dir/auth_pam_tool \
${datadir}/mysql/ \
${localstatedir}/mysql/ \
${sysconfdir}/init.d/mysqld \
${sysconfdir}/my.cnf \
${sysconfdir}/my.cnf.d/server.cnf \
${sysconfdir}/security/user_map.conf \
${sysconfdir}/tmpfiles.d"
DESCRIPTION:${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
FILES:${PN}-leftovers = "/"

View File

@@ -0,0 +1,95 @@
From 6e376601c990abaa5e261d1311f92acb3b370b8f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 24 Jan 2023 21:40:43 -0800
Subject: [PATCH] Add missing includes <cstdint> and <cstdio>
This is needed with GCC 13 and newer [1]
[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h | 1 +
storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h | 1 +
.../rocksdb/rocksdb/table/block_based/data_block_hash_index.h | 1 +
storage/rocksdb/rocksdb/util/slice.cc | 1 +
storage/rocksdb/rocksdb/util/string_util.h | 1 +
tpool/aio_linux.cc | 1 +
6 files changed, 6 insertions(+)
diff --git a/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h b/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
index 963c1d8eb49..73487edd96d 100644
--- a/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
+++ b/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
@@ -5,6 +5,7 @@
#pragma once
+#include <cstdint>
#include "rocksdb/rocksdb_namespace.h"
struct CompactionIterationStats {
diff --git a/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h b/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
index c7f93b4cfcd..3c2ab80535a 100644
--- a/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
+++ b/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
@@ -8,6 +8,7 @@
#pragma once
#ifndef ROCKSDB_LITE
+#include <cstdint>
#include <string>
#include <vector>
#include "rocksdb/status.h"
diff --git a/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h b/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
index f356395f329..3215221755d 100644
--- a/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
+++ b/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
@@ -5,6 +5,7 @@
#pragma once
+#include <cstdint>
#include <string>
#include <vector>
diff --git a/storage/rocksdb/rocksdb/util/slice.cc b/storage/rocksdb/rocksdb/util/slice.cc
index 6db11cc947a..c26b6a21a57 100644
--- a/storage/rocksdb/rocksdb/util/slice.cc
+++ b/storage/rocksdb/rocksdb/util/slice.cc
@@ -8,6 +8,7 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <algorithm>
+#include <cstdint>
#include "rocksdb/slice_transform.h"
#include "rocksdb/slice.h"
#include "util/string_util.h"
diff --git a/storage/rocksdb/rocksdb/util/string_util.h b/storage/rocksdb/rocksdb/util/string_util.h
index a761be66c52..064d059f08f 100644
--- a/storage/rocksdb/rocksdb/util/string_util.h
+++ b/storage/rocksdb/rocksdb/util/string_util.h
@@ -6,6 +6,7 @@
#pragma once
+#include <cstdint>
#include <sstream>
#include <string>
#include <unordered_map>
diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc
index 10234e0e46a..a6adf1af257 100644
--- a/tpool/aio_linux.cc
+++ b/tpool/aio_linux.cc
@@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
# include <thread>
# include <atomic>
+# include <cstdio>
# include <libaio.h>
# include <sys/syscall.h>
--
2.39.1

View File

@@ -0,0 +1,31 @@
From f15fbdf1244ca9ce01c5507660a86d685ed88bcf Mon Sep 17 00:00:00 2001
From: Sumit Garg <sumit.garg@linaro.org>
Date: Mon, 21 Mar 2022 15:08:40 +0800
Subject: [PATCH] Fix library LZ4 lookup.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
cmake/FindLZ4.cmake | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake
index eebd859..094241c 100644
--- a/cmake/FindLZ4.cmake
+++ b/cmake/FindLZ4.cmake
@@ -1,5 +1,10 @@
-find_path(LZ4_INCLUDE_DIRS NAMES lz4.h)
-find_library(LZ4_LIBRARIES NAMES lz4)
+find_path(LZ4_INCLUDE_DIR
+ NAMES lz4.h
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+
+find_library(LZ4_LIBRARIES
+ NAMES lz4
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
if(LZ4_INCLUDE_DIRS AND EXISTS "${LZ4_INCLUDE_DIRS}/lz4.h")
file(STRINGS "${LZ4_INCLUDE_DIRS}/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_[MR]")
--
2.25.1

View File

@@ -0,0 +1,43 @@
From 0a3222338efc108c831fbdd719a47d35f4b0adcd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 18 Aug 2021 06:49:25 +0000
Subject: [PATCH] aio_linux: Check if syscall exists before using it
Return -ENOSYS if not implememented, fixes build on arches like RISCV32
Fixes
tpool/aio_linux.cc:63:20: error: '__NR_io_getevents' was not declared in this scope; did you mean 'io_getevents'?
63 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
| ^~~~~~~~~~~~~~~~~
| io_getevents
Upstream-Staus: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tpool/aio_linux.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc
index 4abc213..da75411 100644
--- a/tpool/aio_linux.cc
+++ b/tpool/aio_linux.cc
@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
*/
static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
{
+#ifdef __NR_io_getevents
int saved_errno= errno;
int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
min_nr, nr, ev, 0);
@@ -67,6 +68,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
errno= saved_errno;
}
return ret;
+#else
+ return -ENOSYS;
+#endif
}
--
2.29.2

View File

@@ -0,0 +1,37 @@
From d611f78198dee64bb6a05933d200b544e2510b76 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 14 Nov 2020 14:37:13 -0800
Subject: [PATCH] innobase: Define __NR_futex if it does not exist
__NR_futex is not defines by newer architectures e.g. arc, riscv32 as
they only have 64bit variant of time_t. Glibc defines SYS_futex interface based
on
__NR_futex, since this is used in applications, such applications start
to fail to build for these newer architectures. This patch defines a
fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps
working
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
storage/innobase/log/log0sync.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/storage/innobase/log/log0sync.cc b/storage/innobase/log/log0sync.cc
index 7799e605..4fab8f74 100644
--- a/storage/innobase/log/log0sync.cc
+++ b/storage/innobase/log/log0sync.cc
@@ -66,6 +66,9 @@ Note that if write operation is very fast, a) or b) can be fine as alternative.
#ifdef __linux__
#include <linux/futex.h>
#include <sys/syscall.h>
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+# define SYS_futex SYS_futex_time64
+#endif
#endif
#include <atomic>
--
2.29.2

View File

@@ -0,0 +1,69 @@
From f92f657973997df30afdb0032c88ad3a14ead46b Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Fri, 23 Sep 2022 15:48:21 +0800
Subject: [PATCH] sql/CMakeLists.txt: fix gen_lex_hash not found
Fix the below do_compile issue in cross-compiling env.
| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_hash', needed by 'sql/lex_hash.h'. Stop.
| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_token', needed by 'sql/lex_token.h'. Stop.
Upstream-Status: Inappropriate [oe build specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
sql/CMakeLists.txt | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 241b482..27a3991 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -60,11 +60,18 @@ ${CMAKE_BINARY_DIR}/sql
${CMAKE_SOURCE_DIR}/tpool
)
-ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
- COMMAND gen_lex_token > lex_token.h
- DEPENDS gen_lex_token
+IF(NOT CMAKE_CROSSCOMPILING)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
+ COMMAND gen_lex_token > lex_token.h
+ DEPENDS gen_lex_token
+)
+ELSE()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
+ COMMAND gen_lex_token > lex_token.h
)
+ENDIF()
FIND_PACKAGE(BISON 2.4)
@@ -372,11 +379,18 @@ IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
ENDIF()
-ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
- COMMAND gen_lex_hash > lex_hash.h
- DEPENDS gen_lex_hash
+IF(NOT CMAKE_CROSSCOMPILING)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
+ COMMAND gen_lex_hash > lex_hash.h
+ DEPENDS gen_lex_hash
+)
+ELSE()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
+ COMMAND gen_lex_hash > lex_hash.h
)
+ENDIF()
MYSQL_ADD_EXECUTABLE(mariadb-tzinfo-to-sql tztime.cc)
SET_TARGET_PROPERTIES(mariadb-tzinfo-to-sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
--
2.25.1

View File

@@ -0,0 +1,40 @@
From 24e2b0edc2612acefcc48414bb6f0aeb086061a9 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Tue, 26 Feb 2019 23:57:06 -0800
Subject: [PATCH] configure.cmake: fix valgrind
Check valgrind headers only if WITH_VALGRIND is set.
mariadb uses two macros for valgrind compilations:
HAVE_valgrind - valgrind is installed and can be set by configure option -DWITH_VALGRIND
HAVE_VALGRIND - valgrind debug libraries is installed, set by auto check
We would like to set them both by the configure option so that we can use
PACKAGECONFIG to decide if valgrind is needed or not.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
configure.cmake | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/configure.cmake b/configure.cmake
index 3cfc4b31..d017b3b3 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -930,10 +930,9 @@ HAVE_GCC_C11_ATOMICS)
IF(WITH_VALGRIND)
SET(HAVE_valgrind 1)
-ENDIF()
-
-CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h"
+ CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h"
HAVE_VALGRIND_MEMCHECK_H)
+ENDIF()
#--------------------------------------------------------------------
# Check for IPv6 support

View File

@@ -0,0 +1,34 @@
From 80be37351d995654f86b838f6b5ed47e8a90261b Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Fri, 23 Sep 2022 12:05:17 +0800
Subject: [PATCH] CMakeLists.txt: not include import_executables.cmake
building failed since native does not generate import_executables.cmake
In fact, our building system will export the needed commands.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9e2b1b..34924ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -394,11 +394,6 @@ CHECK_LIBFMT()
ADD_SUBDIRECTORY(tpool)
CHECK_SYSTEMD()
-IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
- SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
- INCLUDE(${IMPORT_EXECUTABLES})
-ENDIF()
-
#
# Setup maintainer mode options. Platform checks are
# not run with the warning options as to not perturb fragile checks
--
2.25.1

View File

@@ -0,0 +1,34 @@
From f447aca534d1a12809eeb146e8220d305cc3884d Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Thu, 9 Apr 2020 14:07:19 +0800
Subject: [PATCH] build_rocksdb.cmake: fix atomic support on arm
Check to link with libatomic to enable C11 atomics support
to fix below build error on arm:
| /build/tmp/work/armv5e-wrs-linux-gnueabi/mariadb/10.3.13-r0/recipe-sysroot-native/usr/bin/arm-wrs-linux-gnueabi/../../libexec/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/8.3.0/ld.bfd: librocksdblib.a(env_posix.cc.o): in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
| /usr/include/c++/8.3.0/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
Upstream-Status: Pending
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
storage/rocksdb/build_rocksdb.cmake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index d7895b0..3bcd52a 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -470,6 +470,9 @@ list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ TARGET_LINK_LIBRARIES(rocksdblib atomic)
+ENDIF()
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -Wno-error")
endif()
--
2.7.4

View File

@@ -0,0 +1,13 @@
#! /bin/sh
case "$1" in
start)
echo "Starting to install database for mariadb"
/usr/bin/mysql-systemd-start pre
echo "done."
;;
*)
echo "Usage: /etc/init.d/install_db start"
exit 1
esac
exit 0

View File

@@ -0,0 +1,17 @@
#
# Simple install MySQL database service file
# It shoulb be done before mysqld.service
[Unit]
Description=Install MySQL Community Server Database
After=network.target
After=syslog.target
Before=mysqld.service
[Install]
WantedBy=multi-user.target
[Service]
Type=oneshot
ExecStart=@BINDIR@/mysql-systemd-start pre

View File

@@ -0,0 +1,19 @@
--- a/storage/connect/os.h
+++ b/storage/connect/os.h
@@ -2,13 +2,15 @@
#ifndef _OS_H_INCLUDED
#define _OS_H_INCLUDED
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || (defined(__linux__) && !defined(__GLIBC__))
typedef off_t off64_t;
#define lseek64(fd, offset, whence) lseek((fd), (offset), (whence))
#define open64(path, flags, mode) open((path), (flags), (mode))
#define ftruncate64(fd, length) ftruncate((fd), (length))
+#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
+#endif
#ifdef _AIX
#ifndef O_LARGEFILE

View File

@@ -0,0 +1,11 @@
--- a/storage/rocksdb/rocksdb/port/jemalloc_helper.h
+++ b/storage/rocksdb/rocksdb/port/jemalloc_helper.h
@@ -5,7 +5,7 @@
#pragma once
-#if defined(__clang__)
+#if defined(__clang__) && defined(__GLIBC__)
// glibc's `posix_memalign()` declaration specifies `throw()` while clang's
// declaration does not. There is a hack in clang to make its re-declaration
// compatible with glibc's if they are declared consecutively. That hack breaks

View File

@@ -0,0 +1,25 @@
[client]
#password = password
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld_safe]
[mysqld]
user = mysql
port = 3306
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysqld.pid
log-error = /var/log/mysqld.log
basedir = /usr
datadir = /var/lib/mysql
skip-external-locking
skip-networking
ignore-builtin-innodb
default-storage-engine = myisam
bind-address = localhost
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

View File

@@ -0,0 +1,66 @@
#! /bin/sh
#
# Needed argument: pre | post
#
# pre mode : try to run mysql_install_db and fix perms and SELinux contexts
# post mode : ping server until answer is received
#
get_option () {
local section=$1
local option=$2
local default=$3
ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
[ -z $ret ] && ret=$default
echo $ret
}
install_db () {
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
datadir=$(get_option mysqld datadir "/var/lib/mysql")
# Restore log, dir, perms and SELinux contexts
[ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
log=/var/log/mysqld.log
[ -e $log ] || touch $log
chmod 0640 $log
chown mysql:mysql $log || exit 1
if [ -x /usr/sbin/restorecon ]; then
/usr/sbin/restorecon "$datadir"
/usr/sbin/restorecon $log
fi
# If special mysql dir is in place, skip db install
[ -d "$datadir/mysql" ] && exit 0
# Create initial db
/usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
exit 0
}
pinger () {
# Wait for ping to answer to signal startup completed,
# might take a while in case of e.g. crash recovery
# MySQL systemd service will timeout script if no answer
datadir=$(get_option mysqld datadir "/var/lib/mysql")
socket=$(get_option mysqld socket "$datadir/mysql.sock")
case $socket in
/*) adminsocket="$socket" ;;
*) adminsocket="$datadir/$socket" ;;
esac
while /bin/true ; do
sleep 1
mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break
done
exit 0
}
# main
case $1 in
"pre") install_db ;;
"post") pinger ;;
esac
exit 0

View File

@@ -0,0 +1,25 @@
[Unit]
Description=MariaDB database server
After=syslog.target
After=network.target
[Service]
PIDFile=/var/lib/mysql/mysqld.pid
Type=simple
User=mysql
Group=mysql
# Execute post scripts as root
PermissionsStartOnly=true
# Start main service
ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@
# Don't signal startup success before a ping works
ExecStartPost=@BINDIR@/mysql-systemd-start post
TimeoutSec=300
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,41 @@
Remove glibc specific function dependencies
Sourced from: https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
diff --git a/include/my_cpu.h b/include/my_cpu.h
index f2e26fca..94599b74 100644
--- a/include/my_cpu.h
+++ b/include/my_cpu.h
@@ -24,17 +24,16 @@
*/
#ifdef _ARCH_PWR8
-#include <sys/platform/ppc.h>
/* Very low priority */
-#define HMT_very_low() __ppc_set_ppr_very_low()
+#define HMT_very_low() asm volatile("or 31,31,31")
/* Low priority */
-#define HMT_low() __ppc_set_ppr_low()
+#define HMT_low() asm volatile ("or 1,1,1")
/* Medium low priority */
-#define HMT_medium_low() __ppc_set_ppr_med_low()
+#define HMT_medium_low() asm volatile ("or 6,6,6")
/* Medium priority */
-#define HMT_medium() __ppc_set_ppr_med()
+#define HMT_medium() asm volatile ("or 2,2,2")
/* Medium high priority */
-#define HMT_medium_high() __ppc_set_ppr_med_high()
+#define HMT_medium_high() asm volatile("or 5,5,5")
/* High priority */
#define HMT_high() asm volatile("or 3,3,3")
#else
@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void)
__asm__ __volatile__ ("pause");
#endif
#elif defined(_ARCH_PWR8)
- __ppc_get_timebase();
+ __builtin_ppc_get_timebase();
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
/* Mainly, prevent the compiler from optimizing away delay loops */
__asm__ __volatile__ ("":::"memory");

View File

@@ -0,0 +1,15 @@
ssize_t comes from sys/types.h therefore include it
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/wsrep-lib/include/wsrep/gtid.hpp
+++ b/wsrep-lib/include/wsrep/gtid.hpp
@@ -25,7 +25,7 @@
#include "compiler.hpp"
#include <iosfwd>
-
+#include <sys/types.h>
/**
* Minimum number of bytes guaratneed to store GTID string representation,
* terminating '\0' not included (36 + 1 + 20).

View File

@@ -0,0 +1,34 @@
From 4ac5b555d058d4d489f25a3806a787b7b2465d09 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 27 Feb 2019 22:41:26 -0800
Subject: [PATCH] support-files/CMakeLists.txt: fix do_populate_sysroot issue
Comment out the logic which for suse as it introduces
below do_populate_sysroot error:
ERROR: mariadb-native-10.3.13-r0 do_populate_sysroot: sstate found an absolute path symlink /build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/sysroot-destdir/build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/recipe-sysroot-native/usr/sbin/rcmysql pointing at /build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/recipe-sysroot-native/etc/init.d/mysql. Please replace this with a relative link.
Upstream-Status: Inappropriate [oe build specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
support-files/CMakeLists.txt | 7 -------
1 file changed, 7 deletions(-)
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index b5767432..56733de1 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -165,12 +165,5 @@ IF(UNIX)
INSTALL(FILES rpm/enable_encryption.preset DESTINATION ${INSTALL_SYSCONF2DIR}
COMPONENT IniFiles)
ENDIF()
-
- # This is for SuSE:
- INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
- ${INSTALL_SYSCONFDIR}/init.d/mysql
- ${INSTALL_SBINDIR}/rcmysql
- WORKING_DIRECTORY \$ENV{DESTDIR}${prefix})"
- COMPONENT SupportFiles)
ENDIF(INSTALL_SYSCONFDIR)
ENDIF()

View File

@@ -0,0 +1,23 @@
Use SYS_futex for syscall
glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there
is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/storage/innobase/sync/srw_lock.cc
+++ b/storage/innobase/sync/srw_lock.cc
@@ -210,6 +210,12 @@ void ssux_lock_low::wake() { WakeByAddre
# ifdef __linux__
# include <linux/futex.h>
# include <sys/syscall.h>
+/** Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and
+ therefore do not define __NR_futex */
+# if !defined(SYS_futex) && defined(SYS_futex_time64)
+# define SYS_futex SYS_futex_time64
+# endif
+
# define SRW_FUTEX(a,op,n) \
syscall(SYS_futex, a, FUTEX_ ## op ## _PRIVATE, n, nullptr, nullptr, 0)
# elif defined __OpenBSD__

View File

@@ -0,0 +1,26 @@
require mariadb.inc
DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
PROVIDES += "mysql5 libmysqlclient"
RPROVIDES:${PN} += "mysql5"
RREPLACES:${PN} += "mysql5"
RCONFLICTS:${PN} += "mysql5"
RPROVIDES:${PN}-dbg += "mysql5-dbg"
RREPLACES:${PN}-dbg += "mysql5-dbg"
RCONFLICTS:${PN}-dbg += "mysql5-dbg"
RPROVIDES:${PN}-leftovers += "mysql5-leftovers"
RREPLACES:${PN}-leftovers += "mysql5-leftovers"
RCONFLICTS:${PN}-leftovers += "mysql5-leftovers"
RPROVIDES:${PN}-client += "mysql5-client"
RREPLACES:${PN}-client += "mysql5-client"
RCONFLICTS:${PN}-client += "mysql5-client"
RPROVIDES:${PN}-server += "mysql5-server"
RREPLACES:${PN}-server += "mysql5-server"
RCONFLICTS:${PN}-server += "mysql5-server"

View File

@@ -0,0 +1,34 @@
From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 6 Mar 2019 00:16:17 -0800
Subject: [PATCH] _mysql.c: fix compilation with MariaDB 10.3.13
Use standard API function MYSQL_OPT_RECONNECT
instead of direct modification of internal structures
which does not work for MariaDB.
Upstream-Status: Pending
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
_mysql.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/_mysql.c
+++ b/_mysql.c
@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
int r, reconnect = -1;
if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
check_connection(self);
- if ( reconnect != -1 ) self->connection.reconnect = reconnect;
+ if ( reconnect != -1 ) {
+#if MYSQL_VERSION_ID >= 50013
+ my_bool recon = reconnect;
+ mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
+#else
+ self->connection.reconnect = reconnect;
+#endif
+ }
Py_BEGIN_ALLOW_THREADS
r = mysql_ping(&(self->connection));
Py_END_ALLOW_THREADS

View File

@@ -0,0 +1,26 @@
SUMMARY = "Python interface to MySQL"
HOMEPAGE = "https://github.com/farcepest/MySQLdb1"
SECTION = "devel/python"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "mysql5"
SRCNAME = "MySQL-python"
SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \
file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
"
SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
S = "${WORKDIR}/${SRCNAME}-${PV}"
SKIP_RECIPE[mysql-python] ?= "${@bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', '', 'python2 is out of support for long time, read https://www.python.org/doc/sunset-python-2/ https://python3statement.org/ and if you really have to temporarily use this, then set I_SWEAR_TO_MIGRATE_TO_PYTHON3 to "yes"', d)}"
inherit ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "setuptools", "", d)}
python() {
if 'meta-python2' not in d.getVar('BBFILE_COLLECTIONS').split():
raise bb.parse.SkipRecipe('Requires meta-python2 to be present.')
}

View File

@@ -0,0 +1,42 @@
From 780fd27ea6f7f2c446c46a7a5e26d94106c67efd Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 20 Nov 2016 15:04:52 +0000
Subject: [PATCH] Add support for RISC-V.
The architecture is sufficiently similar to aarch64 that simply
extending the existing aarch64 macro works.
---
src/include/storage/s_lock.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 4d3ffc7..22e27bf 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -317,11 +317,12 @@ tas(volatile slock_t *lock)
/*
* On ARM and ARM64, we use __sync_lock_test_and_set(int *, int) if available.
+ * On RISC-V, the same.
*
* We use the int-width variant of the builtin because it works on more chips
* than other widths.
*/
-#if defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(__aarch64)
+#if defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(__aarch64) || defined(__riscv)
#ifdef HAVE_GCC__SYNC_INT32_TAS
#define HAS_TEST_AND_SET
@@ -355,8 +356,7 @@ spin_delay(void)
#endif /* __aarch64__ || __aarch64 */
#endif /* HAVE_GCC__SYNC_INT32_TAS */
-#endif /* __arm__ || __arm || __aarch64__ || __aarch64 */
-
+#endif /* __arm__ || __arm || __aarch64__ || __aarch64 || __riscv */
/* S/390 and S/390x Linux (32- and 64-bit zSeries) */
#if defined(__s390__) || defined(__s390x__)
--
2.34.1

View File

@@ -0,0 +1,41 @@
From bbba8a5261a99e79c9cd4693ef56021014a9856b Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 28 Dec 2020 16:38:21 +0800
Subject: [PATCH] Improve reproducibility,
Remove build patch from binaries which pg_config do
not record var-CC, var-CFLAGS, and configure
$ /usr/bin/pg_config --cc
not recorded
$ /usr/bin/pg_config --configure
not recorded
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
update patch for v13.1
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
src/common/Makefile | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/common/Makefile b/src/common/Makefile
index 880722f..7a9b9d4 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -31,9 +31,6 @@ include $(top_builddir)/src/Makefile.global
# don't include subdirectory-path-dependent -I and -L switches
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
-override CPPFLAGS += -DVAL_CC="\"$(CC)\""
-override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
--
2.34.1

View File

@@ -0,0 +1,119 @@
From b92eebe8b0760fee7bd55c6c22318620c2c07579 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Mon, 1 Aug 2022 15:44:38 +0800
Subject: [PATCH] config_info.c: not expose build info
Don't collect the build information to fix the buildpaths issue.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
configure.ac | 2 +-
src/common/config_info.c | 68 ----------------------------------------
2 files changed, 1 insertion(+), 69 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0eb595b..508487b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ AC_COPYRIGHT([Copyright (c) 1996-2021, PostgreSQL Global Development Group])
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
AC_CONFIG_AUX_DIR(config)
AC_PREFIX_DEFAULT(/usr/local/pgsql)
-AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure])
+AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["ac_configure_args"], [Saved arguments from configure])
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
[PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`]
diff --git a/src/common/config_info.c b/src/common/config_info.c
index e72e729..b482c20 100644
--- a/src/common/config_info.c
+++ b/src/common/config_info.c
@@ -38,7 +38,7 @@
int i = 0;
/* Adjust this to match the number of items filled below */
- *configdata_len = 23;
+ *configdata_len = 14;
configdata = (ConfigData *) palloc(*configdata_len * sizeof(ConfigData));
configdata[i].name = pstrdup("BINDIR");
@@ -123,74 +123,6 @@
configdata[i].setting = pstrdup(path);
i++;
- configdata[i].name = pstrdup("CONFIGURE");
- configdata[i].setting = pstrdup(CONFIGURE_ARGS);
- i++;
-
- configdata[i].name = pstrdup("CC");
-#ifdef VAL_CC
- configdata[i].setting = pstrdup(VAL_CC);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("CPPFLAGS");
-#ifdef VAL_CPPFLAGS
- configdata[i].setting = pstrdup(VAL_CPPFLAGS);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("CFLAGS");
-#ifdef VAL_CFLAGS
- configdata[i].setting = pstrdup(VAL_CFLAGS);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("CFLAGS_SL");
-#ifdef VAL_CFLAGS_SL
- configdata[i].setting = pstrdup(VAL_CFLAGS_SL);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("LDFLAGS");
-#ifdef VAL_LDFLAGS
- configdata[i].setting = pstrdup(VAL_LDFLAGS);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("LDFLAGS_EX");
-#ifdef VAL_LDFLAGS_EX
- configdata[i].setting = pstrdup(VAL_LDFLAGS_EX);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("LDFLAGS_SL");
-#ifdef VAL_LDFLAGS_SL
- configdata[i].setting = pstrdup(VAL_LDFLAGS_SL);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
- configdata[i].name = pstrdup("LIBS");
-#ifdef VAL_LIBS
- configdata[i].setting = pstrdup(VAL_LIBS);
-#else
- configdata[i].setting = pstrdup(_("not recorded"));
-#endif
- i++;
-
configdata[i].name = pstrdup("VERSION");
configdata[i].setting = pstrdup("PostgreSQL " PG_VERSION);
i++;
--
2.25.1

View File

@@ -0,0 +1,30 @@
From 5f9dedc91a0a9710033fa155ea759f765ce5b58b Mon Sep 17 00:00:00 2001
From: Yi Fan Yu <yifan.yu@windriver.com>
Date: Fri, 5 Feb 2021 17:15:42 -0500
Subject: [PATCH] configure.ac: bypass autoconf 2.69 version check
for upgrade to autoconf 2.71
Upstream-Status: Inappropriate [disable feature]
Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
---
configure.ac | 4 ----
1 file changed, 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 998ff31..912e490 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
AC_INIT([PostgreSQL], [15.3], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
-Untested combinations of 'autoconf' and PostgreSQL versions are not
-recommended. You can remove the check from 'configure.ac' but it is then
-your responsibility whether the result works or not.])])
AC_COPYRIGHT([Copyright (c) 1996-2022, PostgreSQL Global Development Group])
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
AC_CONFIG_AUX_DIR(config)

View File

@@ -0,0 +1,42 @@
From 9f81377dddfe32d950844d7053020a36b40fce08 Mon Sep 17 00:00:00 2001
From: Manoj Saun <manojsingh.saun@windriver.com>
Date: Wed, 22 Mar 2023 08:07:26 +0000
Subject: [PATCH] postgresql: fix ptest failure of sysviews
The patch "0001-config_info.c-not-expose-build-info.patch" hides the debug info
in pg_config table which reduces the count of rows from pg_config and leads to
sysviews test failure.
To fix it we need to reduce the count of parameters in sysviews test.
Also we need to reduce the row count in expected result of sysview test
to make the test output shown as pass.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Manoj Saun <manojsingh.saun@windriver.com>
---
src/test/regress/expected/sysviews.out | 2 +-
src/test/regress/sql/sysviews.sql | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -29,7 +29,7 @@ select name, ident, parent, level, total
(1 row)
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) > 13 as ok from pg_config;
ok
----
t
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -18,7 +18,7 @@ select name, ident, parent, level, total
from pg_backend_memory_contexts where level = 0;
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) > 13 as ok from pg_config;
-- We expect no cursors in this test; see also portals.sql
select count(*) = 0 as ok from pg_cursors;

View File

@@ -0,0 +1,37 @@
From 56b830edecff1cac5f8a8a956e7a7eeef2aa7c17 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 27 Nov 2018 13:25:15 +0800
Subject: [PATCH] not check libperl under cross compiling
Upstream-Status: Inappropriate [configuration]
libperl ldflags returned by PGAC_CHECK_PERL_EMBED_LDFLAGS are native,
can not be used to check target library.
postpresql has the dependency on perl, so not need to check libperl
again, like in postgresql-9.2.4
Signed-off-by: Roy Li <rongqing.li@windriver.com>
update patch to version 11.1
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index fba79ee..7170f26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2261,7 +2261,7 @@ Use --without-tcl to disable building PL/Tcl.])
fi
# check for <perl.h>
-if test "$with_perl" = yes; then
+if test "$with_perl" = yes && test "$cross_compiling" = no; then
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $perl_includespec"
AC_CHECK_HEADER(perl.h, [], [AC_MSG_ERROR([header file <perl.h> is required for Perl])],
--
2.34.1

View File

@@ -0,0 +1,4 @@
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/postgresql/data
export PGDATA

View File

@@ -0,0 +1,73 @@
#!/bin/sh
#
# postgresql-setup Initialization operation for PostgreSQL
# For SELinux we need to use 'runuser' not 'su'
if [ -x /sbin/runuser ]
then
SU=runuser
else
SU=su
fi
PGENGINE=/usr/bin
PGDATA=/var/lib/postgresql/data
PGLOG=/var/lib/postgresql/pgstartup.log
script_result=0
initdb(){
if [ -f "$PGDATA/PG_VERSION" ]
then
echo -n "Data directory is not empty!"
echo -n " [FAILED] "
echo
script_result=1
else
echo -n "Initializing database: "
if [ ! -e "$PGDATA" -a ! -h "$PGDATA" ]
then
mkdir -p "$PGDATA" || exit 1
chown postgres:postgres "$PGDATA"
chmod go-rwx "$PGDATA"
fi
# Clean up SELinux tagging for PGDATA
[ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA"
# Make sure the startup-time log file is OK, too
if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ]
then
touch "$PGLOG" || exit 1
chown postgres:postgres "$PGLOG"
chmod go-rwx "$PGLOG"
[ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG"
fi
# Initialize the database
$SU -l postgres -c "$PGENGINE/initdb --pgdata='$PGDATA' --auth='ident'" >> "$PGLOG" 2>&1 < /dev/null
# Create directory for postmaster log
mkdir "$PGDATA/pg_log"
chown postgres:postgres "$PGDATA/pg_log"
chmod go-rwx "$PGDATA/pg_log"
if [ -f "$PGDATA/PG_VERSION" ]
then
echo -n " [ OK ] "
else
echo -n " [FAILED] "
script_result=1
fi
echo
fi
}
case "$1" in
initdb)
initdb
;;
*)
echo "Usage: $0 initdb"
exit 2
esac
exit $script_result

View File

@@ -0,0 +1,193 @@
#!/bin/sh
#
# postgresql This is the init script for starting up the PostgreSQL
# server.
#
# chkconfig: - 64 36
# description: PostgreSQL database server.
# processname: postmaster
# pidfile: /var/run/postmaster.PORT.pid
# This script is slightly unusual in that the name of the daemon (postmaster)
# is not the same as the name of the subsystem (postgresql)
# PGVERSION is the full package version, e.g., 8.4.0
# Note: the specfile inserts the correct value during package build
PGVERSION=9.2.4
# PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION)
PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\).*$/\1/'`
# Source function library.
. /etc/init.d/functions
# Find the name of the script
NAME=`basename $0`
if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]
then
NAME=${NAME:3}
fi
# For SELinux we need to use 'runuser' not 'su'
if [ -x /sbin/runuser ]
then
SU=runuser
else
SU=su
fi
# Set defaults for configuration variables
PGENGINE=/usr/bin
PGPORT=5432
PGDATA=/var/lib/postgresql/data
PGLOG=/var/lib/postgresql/pgstartup.log
# Value to set as postmaster process's oom_adj
PG_OOM_ADJ=-17
# Override defaults from /etc/sysconfig/postgresql if file is present
[ -f /etc/default/postgresql/${NAME} ] && . /etc/default/postgresql/${NAME}
export PGDATA
export PGPORT
lockfile="/var/lock/subsys/${NAME}"
pidfile="/var/run/postmaster.${PGPORT}.pid"
script_result=0
start(){
[ -x "$PGENGINE/postmaster" ] || exit 5
PSQL_START=$"Starting ${NAME} service: "
# Make sure startup-time log file is valid
if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ]
then
touch "$PGLOG" || exit 4
chown postgres:postgres "$PGLOG"
chmod go-rwx "$PGLOG"
[ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG"
fi
# Check for the PGDATA structure
if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]
then
# Check version of existing PGDATA
if [ x`cat "$PGDATA/PG_VERSION"` != x"$PGMAJORVERSION" ]
then
SYSDOCDIR="(Your System's documentation directory)"
if [ -d "/usr/doc/postgresql-$PGVERSION" ]
then
SYSDOCDIR=/usr/doc
fi
if [ -d "/usr/share/doc/postgresql-$PGVERSION" ]
then
SYSDOCDIR=/usr/share/doc
fi
if [ -d "/usr/doc/packages/postgresql-$PGVERSION" ]
then
SYSDOCDIR=/usr/doc/packages
fi
if [ -d "/usr/share/doc/packages/postgresql-$PGVERSION" ]
then
SYSDOCDIR=/usr/share/doc/packages
fi
echo
echo $"An old version of the database format was found."
echo $"You need to upgrade the data format before using PostgreSQL."
echo $"See $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information."
exit 1
fi
else
# No existing PGDATA! Warn the user to initdb it.
echo
echo "$PGDATA is missing. Use \"postgresql-setup initdb\" to initialize the cluster first."
echo -n " [FAILED] "
echo
exit 1
fi
echo -n "$PSQL_START"
test x"$PG_OOM_ADJ" != x && echo "$PG_OOM_ADJ" > /proc/self/oom_score_adj
$SU -l postgres -c "$PGENGINE/postmaster -p '$PGPORT' -D '$PGDATA' ${PGOPTS} &" >> "$PGLOG" 2>&1 < /dev/null
sleep 2
pid=`head -n 1 "$PGDATA/postmaster.pid" 2>/dev/null`
if [ "x$pid" != x ]
then
echo -n " [ OK ]"
touch "$lockfile"
echo $pid > "$pidfile"
echo
else
echo -n " [FAILED]"
echo
script_result=1
fi
}
stop(){
echo -n $"Stopping ${NAME} service: "
if [ -e "$lockfile" ]
then
$SU -l postgres -c "$PGENGINE/pg_ctl stop -D '$PGDATA' -s -m fast" > /dev/null 2>&1 < /dev/null
ret=$?
if [ $ret -eq 0 ]
then
echo -n " [ OK ] "
rm -f "$pidfile"
rm -f "$lockfile"
else
echo -n " [FAILED] "
script_result=1
fi
else
# not running; per LSB standards this is "ok"
echo -n " [ OK ] "
fi
echo
}
restart(){
stop
start
}
condrestart(){
[ -e "$lockfile" ] && restart || :
}
reload(){
$SU -l postgres -c "$PGENGINE/pg_ctl reload -D '$PGDATA' -s" > /dev/null 2>&1 < /dev/null
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status postmaster
script_result=$?
;;
restart)
restart
;;
condrestart|try-restart)
condrestart
;;
reload)
reload
;;
force-reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $script_result

View File

@@ -0,0 +1,4 @@
#%PAM-1.0
auth include common-auth
account include common-account
password include common-password

View File

@@ -0,0 +1,27 @@
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
# Port number for server to listen on
Environment=PGPORT=5432
# Location of database directory
Environment=PGDATA=/var/lib/postgresql/data
# Disable OOM kill on the postmaster
OOMScoreAdjust=-17
ExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
ExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=@BINDIR@/pg_ctl reload -D ${PGDATA} -s
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,375 @@
SUMMARY = "PostgreSQL is a powerful, open source relational database system."
DESCRIPTION = "\
PostgreSQL is an advanced Object-Relational database management system \
(DBMS) that supports almost all SQL constructs (including \
transactions, subselects and user-defined types and functions). The \
postgresql package includes the client programs and libraries that \
you'll need to access a PostgreSQL DBMS server. These PostgreSQL \
client programs are programs that directly manipulate the internal \
structure of PostgreSQL databases on a PostgreSQL server. These client \
programs can be located on the same machine with the PostgreSQL \
server, or may be on a remote machine which accesses a PostgreSQL \
server over a network connection. This package contains the docs \
in HTML for the whole package, as well as command-line utilities for \
managing PostgreSQL databases on a PostgreSQL server. \
\
If you want to manipulate a PostgreSQL database on a local or remote \
PostgreSQL server, you need this package. You also need to install \
this package if you're installing the postgresql-server package. \
"
HOMEPAGE = "http://www.postgresql.com"
LICENSE = "0BSD"
DEPENDS = "libnsl2 readline tzcode-native"
ARM_INSTRUCTION_SET = "arm"
SRC_URI = "https://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \
file://postgresql.init \
file://postgresql-profile \
file://postgresql.pam \
file://postgresql-setup \
file://postgresql.service \
"
LEAD_SONAME = "libpq.so"
# LDFLAGS for shared libraries
export LDFLAGS_SL = "${LDFLAGS}"
inherit autotools pkgconfig perlnative python3native python3targetconfig useradd update-rc.d systemd gettext cpan-base multilib_header
CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR} -I${STAGING_INCDIR}/tcl8.6"
SYSTEMD_SERVICE:${PN} = "postgresql.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
pkg_postinst:${PN} () {
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then
if [ -n "$D" ]; then
OPTS="--root=$D"
fi
systemctl $OPTS mask postgresql-server.service
fi
}
PACKAGECONFIG ??= " \
${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \
openssl python uuid libxml tcl perl zlib \
"
PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl tcl-native,"
PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl"
PACKAGECONFIG[python] = "--with-python,--without-python,python3,python3"
PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd systemd-systemctl-native"
PACKAGECONFIG[uuid] = "--with-uuid=e2fs,--without-uuid,util-linux"
PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2"
PACKAGECONFIG[libxslt] = "--with-libxslt,--without-libxslt,libxslt"
PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4"
PACKAGECONFIG[openssl] = "--with-ssl=openssl,ac_cv_file__dev_urandom=yes,openssl"
EXTRA_OECONF += "--enable-thread-safety --disable-rpath \
--datadir=${datadir}/${BPN} \
--sysconfdir=${sysconfdir}/${BPN} \
"
EXTRA_OECONF:sh4 += "--disable-spinlocks"
DEBUG_OPTIMIZATION:remove:mips = " -Og"
DEBUG_OPTIMIZATION:append:mips = " -O"
BUILD_OPTIMIZATION:remove:mips = " -Og"
BUILD_OPTIMIZATION:append:mips = " -O"
DEBUG_OPTIMIZATION:remove:mipsel = " -Og"
DEBUG_OPTIMIZATION:append:mipsel = " -O"
BUILD_OPTIMIZATION:remove:mipsel = " -Og"
BUILD_OPTIMIZATION:append:mipsel = " -O"
PACKAGES_DYNAMIC += "^${PN}-plperl \
^${PN}-pltcl \
^${PN}-plpython \
"
python populate_packages:prepend() {
def fill_more(name):
if name is None or name.strip() == "":
return
fpack=d.getVar('PACKAGES', False) or ""
fpack="${PN}-" + name + " " + fpack
d.setVar('PACKAGES', fpack)
conf=(d.getVar('PACKAGECONFIG') or "").split()
pack=d.getVar('PACKAGES', False) or ""
bb.debug(1, "PACKAGECONFIG=%s" % conf)
bb.debug(1, "PACKAGES1=%s" % pack )
if "perl" in conf :
fill_more("plperl")
if "tcl" in conf:
fill_more("pltcl")
if "python" in conf:
fill_more("plpython")
pack=d.getVar('PACKAGES') or ""
bb.debug(1, "PACKAGES2=%s" % pack)
}
# This will make native perl use target settings (for include dirs etc.)
export PERLCONFIGTARGET = "${@is_target(d)}"
export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
do_configure() {
# do_configure
autotools_do_configure
# do_configure:append
# workaround perl package related bugs
sed -i -e "s:-L/usr/local/lib:-L=/usr/local/lib:g" \
${B}/src/Makefile.global
LIBPNA="\${STAGING_LIBDIR_NATIVE}/perl-native"
LIBNA="\${STAGING_LIBDIR_NATIVE}"
BLIBNA="\${STAGING_BASE_LIBDIR_NATIVE}"
sed -i -e "/^perl_archlibexp/s:${LIBPNA}:${STAGING_LIBDIR}:g" \
${B}/src/Makefile.global
sed -i -e "/^perl_privlibexp/s:${libdir}:${STAGING_LIBDIR}:g" \
${B}/src/Makefile.global
# remove the rpath, replace with correct lib path
sed -i \
-e "/^perl_embed_ldflags/s:-Wl,-rpath,${LIBNA}::g" \
-e "/^perl_embed_ldflags/s:-Wl,-rpath,${BLIBNA}::g" \
-e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${LIBNA}::g" \
-e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${BLIBNA}::g" \
-e "/^perl_embed_ldflags/s:${LIBPNA}:${STAGING_LIBDIR}:g" \
-e "/^perl_embed_ldflags/s:${LIBNA}:${STAGING_LIBDIR}:g" \
-e "/^perl_embed_ldflags/s:${BLIBNA}:${STAGING_BASELIBDIR}:g" \
-e "/^TCLSH/s:=.*:= ${bindir}/tclsh:g" \
${B}/src/Makefile.global
if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then
# workaround perl package's libperl.so problem
# we are using perlnative so this perl should have same version
perl_version=`perl -v 2>/dev/null | \
sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
if [ ! -h "${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so" -a \
! -h "${STAGING_LIBDIR}/libperl.so" ]; then
ln -sf ../../../libperl.so.5 \
${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so
fi
fi
}
do_compile:append() {
oe_runmake -C contrib all
}
# server needs to configure user and group
usernum = "28"
groupnum = "28"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \
-s /bin/sh -c 'PostgreSQL Server' -u ${usernum} postgres"
GROUPADD_PARAM:${PN} = "-g ${groupnum} -o -r postgres"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "${BPN}-server"
INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
do_install:append() {
# install contrib
oe_runmake DESTDIR=${D} -C contrib install
oe_multilib_header pg_config.h pg_config_ext.h ecpg_config.h postgresql/server/pg_config.h postgresql/server/pg_config_ext.h
# install tutorial
install -d -m 0755 ${D}${libdir}/${BPN}/tutorial
install ${B}/src/tutorial/* ${D}${libdir}/${BPN}/tutorial
# install COPYRIGHT README HISTORY
install -d -m 0755 ${D}${docdir}/${BPN}
for i in ${B}/COPYRIGHT ${B}/README ${B}/HISTORY ${B}/doc/KNOWN_BUGS ${B}/doc/MISSING_FEATURES ${B}/doc/README* ${B}/doc/bug.template; do
[ -f $i ] && install $i ${D}${docdir}/${BPN}
done
# install dirs and server init
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN}-server
sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" ${D}${sysconfdir}/init.d/${BPN}-server
install -m 0755 ${WORKDIR}/${BPN}-setup ${D}${bindir}/${BPN}-setup
install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data
install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups
install -m 644 ${WORKDIR}/${BPN}-profile ${D}${localstatedir}/lib/${BPN}/.profile
chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN}
# multiple server config directory
install -d -m 700 ${D}${sysconfdir}/default/${BPN}
if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/pam.d
install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql
fi
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/postgresql.service ${D}${systemd_unitdir}/system
sed -i -e 's,@BINDIR@,${bindir},g' \
${D}${systemd_unitdir}/system/postgresql.service
# Remove the build path
if [ -f ${D}${libdir}/${BPN}/pgxs/src/Makefile.global ]; then
sed -i -e 's#${RECIPE_SYSROOT}##g' \
-e 's#${RECIPE_SYSROOT_NATIVE}##g' \
-e 's#${WORKDIR}##g' \
-e 's#${TMPDIR}##g' \
${D}${libdir}/${BPN}/pgxs/src/Makefile.global
fi
}
SSTATE_SCAN_FILES += "Makefile.global"
SSTATE_SCAN_FILES:remove = "*_config"
PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \
libecpg-compat libecpg-compat-dev \
libecpg libecpg-dev libecpg-staticdev libecpg-doc \
libpq libpq-dev libpq-staticdev \
libpgtypes libpgtypes-staticdev libpgtypes-dev \
${PN}-contrib \
"
RPROVIDES:${PN}-dbg += "libecpg-compat-dbg \
libecpg-dbg \
libpq-dbg \
libpgtypes-dbg \
${PN}-contrib-dbg \
${PN}-pltcl-dbg \
${PN}-plpython-dbg \
${PN}-plperl-dbg \
"
FILES:${PN} += "${sysconfdir}/init.d/${BPN}-server \
${localstatedir}/lib/${BPN}/data ${localstatedir}/lib/${BPN}/backups \
${localstatedir}/lib/${BPN}/.profile ${sysconfdir}/default/${BPN} \
${libdir}/${BPN}/dict_snowball.so ${libdir}/${BPN}/plpgsql.so \
${libdir}/${BPN}/euc2004_sjis2004.so \
${libdir}/${BPN}/libpqwalreceiver.so \
${libdir}/${BPN}/*_and_*.so \
${@'${sysconfdir}/pam.d/postgresql' \
if 'pam' == d.getVar('enable_pam') \
else ''} \
"
FILES:${PN}-client = "${bindir}/clusterdb \
${bindir}/createdb \
${bindir}/createuser \
${bindir}/dropdb \
${bindir}/dropuser \
${bindir}/pg_dump \
${bindir}/pg_dumpall \
${bindir}/pg_restore \
${bindir}/psql \
${bindir}/reindexdb \
${bindir}/vacuumdb \
${bindir}/vacuumlo \
${datadir}/${BPN}/psqlrc.sample \
"
FILES:${PN}-client-doc = "${mandir}/man1/clusterdb.* \
${mandir}/man1/createdb.* ${mandir}/man1/createlang.* \
${mandir}/man1/createuser.* ${mandir}/man1/dropdb.* \
${mandir}/man1/droplang.* ${mandir}/man1/dropuser.* \
${mandir}/man1/pg_dump.* ${mandir}/man1/pg_dumpall.* \
${mandir}/man1/pg_restore.* ${mandir}/man1/psql.* \
${mandir}/man1/reindexdb.* ${mandir}/man1/vacuumdb.* \
${mandir}/man7/* \
"
FILES:${PN}-doc += "${docdir}/${BPN}/html ${libdir}/${BPN}/tutorial/ \
${mandir}/man1/initdb.* ${mandir}/man1/pg_controldata.* \
${mandir}/man1/pg_ctl.* ${mandir}/man1/pg_resetxlog.* \
${mandir}/man1/postgres.* ${mandir}/man1/postmaster.* \
"
FILES:${PN}-timezone = "${datadir}/${BPN}/timezone \
${datadir}/${BPN}/timezonesets \
"
RDEPENDS:${PN} += "${PN}-timezone"
FILES:${PN}-server-dev = "${includedir}/${BPN}/server \
${libdir}/${BPN}/pgxs \
"
FILES:libecpg = "${libdir}/libecpg*${SOLIBS}"
FILES:libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \
${libdir}/libpgtypes*${SOLIBSDEV} \
${includedir}/ecpg*.h ${includedir}/${BPN}/ecpg*.h \
${includedir}/pgtypes*.h ${includedir}/${BPN}/informix \
${includedir}/sql3types.h ${includedir}/sqlca.h \
"
FILES:libecpg-doc = "${mandir}/man1/ecpg.*"
FILES:libecpg-staticdev = "${libdir}/libecpg*.a"
SECTION:libecpg-staticdev = "devel"
RDEPENDS:libecpg-staticdev = "libecpg-dev (= ${EXTENDPKGV})"
FILES:libpq = "${libdir}/libpq*${SOLIBS}"
FILES:libpq-dev = "${libdir}/libpq*${SOLIBSDEV} \
${includedir} \
"
FILES:libpq-staticdev = "${libdir}/libpq*.a ${libdir}/libpgport.a"
SECTION:libpq-staticdev = "devel"
RDEPENDS:libpq-staticdev = "libpq-dev (= ${EXTENDPKGV})"
FILES:libecpg-compat = "${libdir}/libecpg_compat*${SOLIBS}"
FILES:libecpg-compat-dev = "${libdir}/libecpg_compat*${SOLIBS}"
FILES:libpgtypes = "${libdir}/libpgtypes*${SOLIBS}"
FILES:libpgtypes-staticdev = "${libdir}/libpgtypes*.a"
FILES:libpgtypes-dev = "${libdir}/libpgtypes*${SOLIBS} ${includedir}/pgtypes*.h"
FILES:${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \
${bindir}/pgbench \
${S}/contrib/spi/*.example \
${libdir}/${BPN}/_int.so ${libdir}/${BPN}/adminpack.so \
${libdir}/${BPN}/autoinc.so ${libdir}/${BPN}/auto_explain.so \
${libdir}/${BPN}/auth_delay.so ${libdir}/${BPN}/btree_gin.so \
${libdir}/${BPN}/btree_gist.so ${libdir}/${BPN}/.so \
${libdir}/${BPN}/chkpass.so ${libdir}/${BPN}/citext.so \
${libdir}/${BPN}/cube.so ${libdir}/${BPN}/dblink.so \
${libdir}/${BPN}/dict_int.so ${libdir}/${BPN}/dict_xsyn.so \
${libdir}/${BPN}/dummy_seclabel.so ${libdir}/${BPN}/earthdistance.so \
${libdir}/${BPN}/file_fdw.so ${libdir}/${BPN}/fuzzystrmatch.so \
${libdir}/${BPN}/hstore.so ${libdir}/${BPN}/insert_username.so \
${libdir}/${BPN}/isn.so ${libdir}/${BPN}/lo.so \
${libdir}/${BPN}/ltree.so ${libdir}/${BPN}/moddatetime.so \
${libdir}/${BPN}/pageinspect.so ${libdir}/${BPN}/pg_buffercache.so \
${libdir}/${BPN}/pg_freespacemap.so ${libdir}/${BPN}/pg_trgm.so \
${libdir}/${BPN}/pgcrypto.so ${libdir}/${BPN}/pgrowlocks.so \
${libdir}/${BPN}/pgstattuple.so ${libdir}/${BPN}/pg_stat_statements.so \
${libdir}/${BPN}/refint.so ${libdir}/${BPN}/seg.so \
${libdir}/${BPN}/sslinfo.so \
${libdir}/${BPN}/tablefunc.so \
${libdir}/${BPN}/test_parser.so ${libdir}/${BPN}/timetravel.so \
${libdir}/${BPN}/uuid-ossp.so \
${libdir}/${BPN}/pgxml.so ${libdir}/${BPN}/passwordcheck.so \
${libdir}/${BPN}/pg_upgrade_support.so ${libdir}/${BPN}/.so \
${libdir}/${BPN}/unaccent.so \
"
DESCRIPTION:${PN}-contrib = "The postgresql-contrib package contains \
contributed packages that are included in the PostgreSQL distribution."
FILES:${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \
${binddir}/pltcl_listmod ${bindir}/pltcl_loadmod \
${datadir}/${BPN}/unknown.pltcl"
SUMMARY:${PN}-pltcl = "The Tcl procedural language for PostgreSQL"
DESCRIPTION:${PN}-pltcl = "PostgreSQL is an advanced Object-Relational \
database management system. The postgresql-pltcl package contains the PL/Tcl \
procedural language for the backend."
FILES:${PN}-plperl = "${libdir}/${BPN}/plperl.so"
SUMMARY:${PN}-plperl = "The Perl procedural language for PostgreSQL"
DESCRIPTION:${PN}-plperl = "PostgreSQL is an advanced Object-Relational \
database management system. The postgresql-plperl package contains the \
PL/Perl procedural language for the backend."
# In version 8, it will be plpython.so
# In version 9, it might be plpython{2,3}.so depending on python2 or 3
FILES:${PN}-plpython = "${libdir}/${BPN}/plpython*.so"
SUMMARY:${PN}-plpython = "The Python procedural language for PostgreSQL"
DESCRIPTION:${PN}-plpython = "PostgreSQL is an advanced Object-Relational \
database management system. The postgresql-plpython package contains \
the PL/Python procedural language for the backend."

View File

@@ -0,0 +1,18 @@
require postgresql.inc
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=c31f662bb2bfb3b4187fe9a53e0ffe7c"
SRC_URI += "\
file://not-check-libperl.patch \
file://0001-Add-support-for-RISC-V.patch \
file://0001-Improve-reproducibility.patch \
file://0001-configure.ac-bypass-autoconf-2.69-version-check.patch \
file://0001-config_info.c-not-expose-build-info.patch \
file://0001-postgresql-fix-ptest-failure-of-sysviews.patch \
"
SRC_URI[sha256sum] = "ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932"
CVE_CHECK_IGNORE += "\
CVE-2017-8806 \
"

View File

@@ -0,0 +1,27 @@
From 8f3ed8df4721991958a5becf75a69493d67e7514 Mon Sep 17 00:00:00 2001
From: "Roy.Li" <rongqing.li@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] [PATCH] do not use the hardcode libdir
Upstream-Status: Pending
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 00b359e..ba50e6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,7 +114,7 @@ if test "$with_libpq" != yes; then
if test -d "$with_libpq"; then
PATH="$with_libpq/bin:$PATH"
CPPFLAGS="$CPPFLAGS -I$with_libpq/include -I$with_libpq/include/postgresql/internal"
- LDFLAGS="$LDFLAGS -L$with_libpq/lib"
+ LDFLAGS="$LDFLAGS -L$with_libpq/${base_libdir}"
else
if test -x "$with_libpq"; then
PG_CONFIG=$with_libpq

View File

@@ -0,0 +1,129 @@
From 96896b88776d0080609ec830cf9538d2babe665a Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] psqlodbc: fixes for ptest support
* Fix the LIBODBC since we don't use ODBC_CONFIG.
* Fix the path for driver.
* Add the default info of postgresql server.
* Fix the output format for ptest.
* Fix the results and exe dir.
Upstream-Status: Inappropriate [OE ptest specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
test/Makefile.in | 2 +-
test/odbcini-gen.sh | 8 ++++----
test/runsuite.c | 20 ++++++++++----------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 3f9a9af..09406ae 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -19,7 +19,7 @@ CPPFLAGS = @CPPFLAGS@ -I.. # config.h
ODBC_CONFIG = @ODBC_CONFIG@
PROVE = @PROVE@
-LIBODBC = @LIBODBC@
+LIBODBC = -lodbc
all: $(TESTBINS) runsuite reset-db
diff --git a/test/odbcini-gen.sh b/test/odbcini-gen.sh
index 2eaba35..6555cdb 100755
--- a/test/odbcini-gen.sh
+++ b/test/odbcini-gen.sh
@@ -6,7 +6,7 @@
outini=odbc.ini
outinstini=odbcinst.ini
-drvr=../.libs/psqlodbcw
+drvr=@LIBDIR@/psqlodbca
driver=${drvr}.so
if test ! -e $driver ; then
driver=${drvr}.dll
@@ -52,10 +52,10 @@ Driver = PostgreSQL Unicode
Trace = No
TraceFile =
Database = contrib_regression
-Servername =
-Username =
+Servername = localhost
+Username = postgres
Password =
-Port =
+Port = 5432
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
diff --git a/test/runsuite.c b/test/runsuite.c
index 3be5732..cd842dc 100644
--- a/test/runsuite.c
+++ b/test/runsuite.c
@@ -55,7 +55,7 @@ bailout(const char *fmt, ...)
/* Given a test program's name, get the test name */
void
-parse_argument(const char *in, char *testname, char *binname)
+parse_argument(const char *in, char *testname, char *binname, const char *inputdir)
{
const char *basename;
#ifdef WIN32
@@ -69,7 +69,7 @@ parse_argument(const char *in, char *testname, char *binname)
if (strchr(in, DIR_SEP) == NULL)
{
strcpy(testname, in);
- sprintf(binname, "exe%c%s-test", DIR_SEP, in);
+ sprintf(binname, "%s%cexe%c%s-test", inputdir, DIR_SEP, DIR_SEP, in);
return;
}
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
failures = 0;
for (i = 1, j = 1; i <= numtests; i++, j++)
{
- parse_argument(argv[j], testname, binname);
+ parse_argument(argv[j], testname, binname, inputdir);
if (runtest(binname, testname, i, inputdir) != 0)
failures++;
}
@@ -161,29 +161,29 @@ runtest(const char *binname, const char *testname, int testno, const char *input
#ifndef WIN32
snprintf(cmdline, sizeof(cmdline),
"ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini "
- "%s > results/%s.out",
- binname, testname);
+ "%s > %s/results/%s.out",
+ binname, inputdir, testname);
#else
snprintf(cmdline, sizeof(cmdline),
- "%s > results\\%s.out",
- binname, testname);
+ "%s > %s/results\\%s.out",
+ binname, inputdir, testname);
#endif
rc = system(cmdline);
diff = rundiff(testname, inputdir);
if (rc != 0)
{
- printf("not ok %d - %s test returned %d\n", testno, testname, rc);
+ printf("FAIL: %d - %s\n\ttest returned %d\n", testno, testname, rc);
ret = 1;
}
else if (diff != 0)
{
- printf("not ok %d - %s test output differs\n", testno, testname);
+ printf("FAIL: %d - %s\n\ttest output differs\n", testno, testname);
ret = 1;
}
else
{
- printf("ok %d - %s\n", testno, testname);
+ printf("PASS: %d - %s\n", testno, testname);
ret = 0;
}
fflush(stdout);

View File

@@ -0,0 +1,134 @@
From 8ca6b0c72b6b933642ec7c4ebb83734244fec46f Mon Sep 17 00:00:00 2001
From: "Song.Li" <Song.Li@windriver.com>
Date: Tue, 5 Sep 2017 10:24:10 +0800
Subject: [PATCH] remove some checks for cross-compiling
some lib check is not suitable for
cross-compiling, so remove them.
Upstream-Status: Inappropriate [not a real bug,just for cross-compiling]
Signed-off-by: Song.Li <Song.Li@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
configure.ac | 80 +++++-----------------------------------------------
1 file changed, 7 insertions(+), 73 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7f79563..00b359e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,71 +57,20 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas
if test "$with_iodbc" != no; then
with_unixodbc=no
AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support])
- if test "$with_iodbc" = yes; then
- AC_PATH_PROGS(ODBC_CONFIG, iodbc-config)
- else
- ODBC_CONFIG=$with_iodbc
- fi
- if test ! -x "${ODBC_CONFIG}/bin/iodbc-config"; then
- if test ! -x "${ODBC_CONFIG}"; then
- AC_MSG_ERROR([iodbc-config not found (required for iODBC build)])
- fi
- else
- ODBC_CONFIG=${ODBC_CONFIG}/bin/iodbc-config
- fi
fi
wo_odbc_config=__without_odbc_config
if test "$with_unixodbc" != no; then
AC_DEFINE(WITH_UNIXODBC, 1,
[Define to 1 to build with unixODBC support])
- if test "$with_unixodbc" = yes; then
- AC_PATH_PROGS(ODBC_CONFIG, odbc_config)
- else
- ODBC_CONFIG=$with_unixodbc
- fi
- if test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then
- :
- elif test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then
- if test ! -x "${ODBC_CONFIG}"; then
- AC_MSG_ERROR([odbc_config not found (required for unixODBC build)])
- fi
- else
- ODBC_CONFIG=${ODBC_CONFIG}/bin/odbc_config
- fi
fi
#
# ODBC include and library
#
-
-if test "$ODBC_CONFIG" != ""; then
- if test "$with_iodbc" != no; then
- ODBC_INCLUDE=`${ODBC_CONFIG} --cflags`
- CPPFLAGS="$CPPFLAGS ${ODBC_INCLUDE}"
- # Linking libiodoc is rather problematic
- [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`]
- LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}"
- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test
- elif test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then
- ODBC_INCLUDE=/usr/include
- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}"
- ODBC_LIBDiR=""
- LIBODBC="-lodbc" # for regression test
- else
- ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix`
- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}"
- # Linking libodbc is rather problematic
- ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix`
- if test "${ODBC_LIBDIR}" != ""; then
- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}"
- fi
- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test
- fi
- AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR])
- AC_MSG_NOTICE([using $LIBODBC for regression test])
-fi
-AC_SUBST(LIBODBC)
+ODBC_LIBS="-lodbcinst"
+LIBS="$LIBS ${ODBC_LIBS}"
+AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS])
#
# SQLCOLATTRIBUTE_SQLLEN check
@@ -190,19 +139,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes,
# Find libpq headers and libraries
#
-if test -z "$PG_CONFIG"; then
- AC_PATH_PROGS(PG_CONFIG, pg_config)
-fi
-
-if test -n "$PG_CONFIG"; then
- pg_includedir=`"$PG_CONFIG" --includedir`
- pg_pkg_includedir=`"$PG_CONFIG" --pkgincludedir`
- pg_libdir=`"$PG_CONFIG" --libdir`
- CPPFLAGS="$CPPFLAGS -I$pg_includedir -I$pg_pkg_includedir/internal"
- LDFLAGS="$LDFLAGS -L$pg_libdir"
-fi
-
-
+pg_includedir=""
+pg_libdir=""
+CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$LDFLAGS"
# 1. Programs
@@ -226,12 +166,6 @@ if test "$with_iodbc" != no; then
[AC_MSG_ERROR([iODBC library "iodbcinst" not found])])
fi
-if test "$enable_pthreads" = yes; then
- AC_CHECK_LIB(pthreads, pthread_create,
- [],
- [AC_CHECK_LIB(pthread, pthread_create)])
-fi
-
AC_CHECK_LIB(pq, PQsetSingleRowMode, [],
[AC_MSG_ERROR([libpq library version >= 9.2 is required])])

View File

@@ -0,0 +1,46 @@
#!/bin/sh
BASEDIR="$(dirname $(readlink -f $0))"
# init and start postgresql server for testing
PGDATA="/var/lib/postgresql/data"
if [ -f "${PGDATA}/PG_VERSION" ]; then
echo "Data directory is not empty! Skip initdb."
else
echo "Initializing database: "
chown -R postgres:postgres ${PGDATA}
su -l postgres -c "/usr/bin/initdb --pgdata='$PGDATA'"
fi
SYSV_INIT="/etc/init.d/postgresql-server"
if [ -e ${SYSV_INIT} ]; then
RESTART_POSTGRESQL="${SYSV_INIT} restart"
STOP_POSTGRESQL="${SYSV_INIT} stop"
else
RESTART_POSTGRESQL="systemctl restart postgresql"
STOP_POSTGRESQL="systemctl stop postgresql"
fi
${RESTART_POSTGRESQL} || echo "Failed to restart postgresql, skip the tests."
if [ ! -d ${BASEDIR}/results ]; then
mkdir ${BASEDIR}/results
fi
# Generate odbc config files and reset db
${BASEDIR}/odbcini-gen.sh || echo "FAIL: Generate odbc config files"
ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini \
${BASEDIR}/reset-db < ${BASEDIR}/sampletables.sql \
|| echo "FAIL: reset db with sample tables"
# Run the actual tests
TESTS=
for i in `ls ${BASEDIR}/exe/*-test`; do
TESTS="$TESTS $(basename ${i%-test})"
done
${BASEDIR}/runsuite ${TESTS} --inputdir=${BASEDIR}
# Cleanup
${STOP_POSTGRESQL}
rm -f regression.diffs odbcinst.ini odbc.ini

View File

@@ -0,0 +1,62 @@
SUMMARY = "ODBC driver for PostgreSQL"
DESCRIPTION = "\
This package provides a driver that allows ODBC-enabled applications to \
access PostgreSQL databases. ODBC is an abstraction layer that allows \
applications written for that layer to access databases in a manner \
that is relatively independent of the particular database management \
system. \
. \
You need to install this package if you want to use an application that \
provides database access through ODBC and you want that application to \
access a PostgreSQL database. This package would need to be installed \
on the same machine as that client application; the PostgreSQL database \
server can be on a different machine and does not need any additional \
software to accept ODBC clients. \
"
SECTION = "libs"
HOMEPAGE = "https://odbc.postgresql.org/"
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://license.txt;md5=6db3822fc7512e83087ba798da013692"
SRC_URI = "http://ftp.postgresql.org/pub/odbc/versions/src/${BPN}-${PV}.tar.gz \
file://psqlodbc-remove-some-checks-for-cross-compiling.patch \
file://psqlodbc-donot-use-the-hardcode-libdir.patch \
file://psqlodbc-fix-for-ptest-support.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "b39b7e5c41fd6475c551112fa724bf57c4a446175ec4188a90e2844cc1612585"
DEPENDS += "postgresql unixodbc"
EXTRA_OECONF = "\
ac_cv_lib_ltdl_lt_dlopen=no \
ac_cv_lib_pq_PQconnectdb=yes \
--with-unixodbc=yes \
--with-libpq=${STAGING_LIBDIR}/.. \
--enable-pthreads \
LIBS='-lpthread' \
"
inherit autotools pkgconfig ptest
do_compile_ptest() {
oe_runmake -C ${B}/test
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}
cp -a --no-preserve=ownership ${B}/test/exe ${S}/test/expected ${D}${PTEST_PATH}
install -m 0755 ${B}/test/reset-db ${D}${PTEST_PATH}
install -m 0755 ${B}/test/runsuite ${D}${PTEST_PATH}
install -m 0755 ${S}/test/odbcini-gen.sh ${D}${PTEST_PATH}
install -m 0755 ${S}/test/sampletables.sql ${D}${PTEST_PATH}
sed -i -e 's|@LIBDIR@|${libdir}|' ${D}${PTEST_PATH}/odbcini-gen.sh
}
FILES:${PN} += "${libdir}"
# The tests need a local PostgreSQL server running
RDEPENDS:${PN}-ptest = "postgresql"

View File

@@ -0,0 +1,70 @@
From 6e376601c990abaa5e261d1311f92acb3b370b8f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 24 Jan 2023 21:40:43 -0800
Subject: [PATCH] Add missing includes <cstdint> and <cstdio>
This is needed with GCC 13 and newer [1]
[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
Upstream-Status: Backport [https://github.com/facebook/rocksdb/commit/88edfbfb5e1cac228f7cc31fbec24bb637fe54b1]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h | 1 +
storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h | 1 +
.../rocksdb/rocksdb/table/block_based/data_block_hash_index.h | 1 +
storage/rocksdb/rocksdb/util/slice.cc | 1 +
storage/rocksdb/rocksdb/util/string_util.h | 1 +
tpool/aio_linux.cc | 1 +
6 files changed, 6 insertions(+)
--- a/db/compaction/compaction_iteration_stats.h
+++ b/db/compaction/compaction_iteration_stats.h
@@ -7,6 +7,7 @@
#include <cstdint>
+#include <cstdint>
#include "rocksdb/rocksdb_namespace.h"
namespace ROCKSDB_NAMESPACE {
--- a/include/rocksdb/utilities/checkpoint.h
+++ b/include/rocksdb/utilities/checkpoint.h
@@ -8,6 +8,7 @@
#pragma once
#ifndef ROCKSDB_LITE
+#include <cstdint>
#include <string>
#include <vector>
--- a/table/block_based/data_block_hash_index.h
+++ b/table/block_based/data_block_hash_index.h
@@ -5,6 +5,7 @@
#pragma once
+#include <cstdint>
#include <string>
#include <vector>
--- a/util/slice.cc
+++ b/util/slice.cc
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <algorithm>
+#include <cstdint>
#include "rocksdb/convenience.h"
#include "rocksdb/slice_transform.h"
--- a/util/string_util.h
+++ b/util/string_util.h
@@ -6,6 +6,7 @@
#pragma once
+#include <cstdint>
#include <sstream>
#include <string>
#include <unordered_map>

View File

@@ -0,0 +1,114 @@
From cf168ae0b7bceab8432d096719b331f18428fe39 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 18 Mar 2020 15:10:37 -0700
Subject: [PATCH] cmake: Add check for atomic support
Detect if libatomic should be linked in or compiler and platform can
provide the needed atomic instrinsics, this helps build on certain
platforms like mips or clang/i386
Fixes
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_exchange_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_or_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_compare_exchange_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_sub_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_load_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_store_8'
| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_add_8'
Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/6555]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
CMakeLists.txt | 5 +++
cmake/modules/CheckAtomic.cmake | 69 +++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 cmake/modules/CheckAtomic.cmake
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1057,7 +1057,12 @@ set(ROCKSDB_SHARED_LIB rocksdb-shared${A
if(WIN32)
set(SYSTEM_LIBS ${SYSTEM_LIBS} shlwapi.lib rpcrt4.lib)
else()
+ # check if linking against libatomic is necessary
+ include(CheckAtomic)
set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT})
+ if(HAVE_CXX_ATOMIC_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} atomic)
+ endif()
endif()
set(ROCKSDB_PLUGIN_EXTERNS "")
--- /dev/null
+++ b/cmake/modules/CheckAtomic.cmake
@@ -0,0 +1,69 @@
+# Checks if atomic operations are supported natively or if linking against
+# libatomic is needed.
+
+# Check inspired by LLVMs cmake/modules/CheckAtomic.cmake
+
+INCLUDE(CheckCXXSourceCompiles)
+INCLUDE(CheckLibraryExists)
+
+function(check_working_cxx_atomics varname)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11")
+ CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+std::atomic<int> x;
+int main() {
+ return x;
+}
+" ${varname})
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics)
+
+function(check_working_cxx_atomics64 varname)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
+ CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+#include <cstdint>
+std::atomic<uint64_t> x (0);
+std::atomic<double> y (0);
+int main() {
+ uint64_t i = x.load(std::memory_order_relaxed);
+ return int(y);
+}
+" ${varname})
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics64)
+
+# Check if atomics work without libatomic
+check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
+
+if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+ check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
+ if( HAVE_LIBATOMIC )
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB)
+ if (NOT HAVE_CXX_ATOMICS_WITH_LIB)
+ message(FATAL_ERROR "Host compiler must support std::atomic!")
+ endif()
+ else()
+ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+ endif()
+endif()
+
+# Check if 64bit atomics work without libatomic
+check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+ check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
+ if(HAVE_CXX_LIBATOMICS64)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
+ if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
+ message(FATAL_ERROR "Host compiler must support std::atomic!")
+ endif()
+ else()
+ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+ endif()
+endif()
+

View File

@@ -0,0 +1,33 @@
From cedc84a8db468d0b6652e78a8a6667e655586b53 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 26 Jan 2023 13:00:43 -0800
Subject: [PATCH] cmake: Do not add -msse4.2 -mpclmul on clang
When testcase is compiled with clang and -msse4.2 -mpclmul is added to
cxxflags then clang -m32 still ends up compiling the test case which is
not correct for i386, therefore depend on yocto to pass the right flags
from environemnt via cflags rather than manufecture them here
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbef059028..981545a4e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -290,7 +290,7 @@ endif()
include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-if(NOT MSVC)
+if(NOT MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul")
endif()
--
2.39.1

View File

@@ -0,0 +1,29 @@
From 46a4e585175cac8d76bd0b64f0fc27c9e22f04a1 Mon Sep 17 00:00:00 2001
From: Pascal Bach <pascal.bach@nextrem.ch>
Date: Mon, 12 Oct 2020 21:22:46 +0200
Subject: [PATCH] cmake: Use exported target for bz2
Without this change, CMake puts the entire path into the generated file.
This is not portable and makes it fail in environment like Yocto.
Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/7541]
---
CMakeLists.txt | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,12 +154,7 @@ else()
if(WITH_BZ2)
find_package(BZip2 REQUIRED)
add_definitions(-DBZIP2)
- if(BZIP2_INCLUDE_DIRS)
- include_directories(${BZIP2_INCLUDE_DIRS})
- else()
- include_directories(${BZIP2_INCLUDE_DIR})
- endif()
- list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
+ list(APPEND THIRDPARTY_LIBS BZip2::BZip2)
endif()
if(WITH_LZ4)

View File

@@ -0,0 +1,59 @@
From 114c42fba3fc86119710e8dd1bb2b7a9e39e3064 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 17 Jun 2021 19:35:01 -0700
Subject: [PATCH] replace old sync with new atomic builtin equivalents
Helps compiling with gcc on newer arches e.g. riscv32 where these
__sync* builtins are not implemented atleast for 64bit values
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../range/range_tree/lib/portability/toku_atomic.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h
@@ -77,37 +77,37 @@ template <typename T, typename U>
__attribute__((always_inline)) static inline T toku_sync_fetch_and_add(T *addr,
U diff) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_fetch_and_add(addr, diff);
+ return __atomic_fetch_add(addr, diff, 5);
}
template <typename T, typename U>
__attribute__((always_inline)) static inline T toku_sync_add_and_fetch(T *addr,
U diff) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_add_and_fetch(addr, diff);
+ return __atomic_add_fetch(addr, diff, 5);
}
template <typename T, typename U>
__attribute__((always_inline)) static inline T toku_sync_fetch_and_sub(T *addr,
U diff) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_fetch_and_sub(addr, diff);
+ return __atomic_fetch_sub(addr, diff, 5);
}
template <typename T, typename U>
__attribute__((always_inline)) static inline T toku_sync_sub_and_fetch(T *addr,
U diff) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_sub_and_fetch(addr, diff);
+ return __atomic_sub_fetch(addr, diff, 5);
}
template <typename T, typename U, typename V>
__attribute__((always_inline)) static inline T toku_sync_val_compare_and_swap(
T *addr, U oldval, V newval) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_val_compare_and_swap(addr, oldval, newval);
+ return __atomic_compare_exchange(addr, oldval, newval);
}
template <typename T, typename U, typename V>
__attribute__((always_inline)) static inline bool
toku_sync_bool_compare_and_swap(T *addr, U oldval, V newval) {
paranoid_invariant(!crosses_boundary(addr, sizeof *addr));
- return __sync_bool_compare_and_swap(addr, oldval, newval);
+ return static_cast<bool>(__atomic_compare_exchange(addr, oldval, newval));
}
// in case you include this but not toku_portability.h

View File

@@ -0,0 +1,26 @@
implement timer for arm >= v6
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -164,6 +164,20 @@ static inline tokutime_t toku_time_now(v
struct timeval tv;
gettimeofday(&tv, nullptr);
return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
+#elif (__ARM_ARCH >= 6)
+ uint32_t pmccntr;
+ uint32_t pmuseren;
+ uint32_t pmcntenset;
+ // Read the user mode perf monitor counter access permissions.
+ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
+ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code.
+ asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
+ if (pmcntenset & 0x80000000ul) { // Is it counting?
+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
+ // The counter is set up to count every 64th cycle
+ return (uint64_t)pmccntr * 64; // Should optimize to << 6
+ }
+ }
#else
#error No timer implementation for this platform
#endif

View File

@@ -0,0 +1,18 @@
implement timer implementation for mips platform
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -158,6 +158,12 @@ static inline tokutime_t toku_time_now(v
uint64_t cycles;
asm volatile("rdcycle %0" : "=r"(cycles));
return cycles;
+#elif defined(__mips__)
+ // mips apparently only allows rdtsc for superusers, so we fall
+ // back to gettimeofday. It's possible clock_gettime would be better.
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
#else
#error No timer implementation for this platform
#endif

View File

@@ -0,0 +1,28 @@
implement support for musl/ppc64
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or
#include <stdint.h>
#include <sys/time.h>
#include <time.h>
-#if defined(__powerpc__)
+#if defined(__powerpc__) && defined(__GLIBC__)
#include <sys/platform/ppc.h>
#endif
@@ -131,8 +131,12 @@ static inline tokutime_t toku_time_now(v
uint64_t result;
__asm __volatile__("mrs %[rt], cntvct_el0" : [rt] "=r"(result));
return result;
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
return __ppc_get_timebase();
+#elif defined(__powerpc64__) || defined(__ppc64__)
+ uint64_t result;
+ asm volatile("mfspr %0, 268" : "=r"(result));
+ return result;
#elif defined(__s390x__)
uint64_t result;
asm volatile("stckf %0" : "=Q"(result) : : "cc");

View File

@@ -0,0 +1,57 @@
SUMMARY = "RocksDB an embeddable, persistent key-value store"
DESCRIPTION = "RocksDB is library that provides an embeddable, persistent key-value store for fast storage."
HOMEPAGE = "http://rocksdb.org/"
LICENSE = "(Apache-2.0 | GPL-2.0-only) & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.Apache;md5=3b83ef96387f14655fc854ddc3c6bd57 \
file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://LICENSE.leveldb;md5=fb04ff57a14f308f2eed4a9b87d45837"
SRCREV = "444b3f4845dd01b0d127c4b420fdd3b50ad56682"
SRCBRANCH = "7.9.fb"
SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=https \
file://0001-cmake-Add-check-for-atomic-support.patch \
file://0001-cmake-Use-exported-target-for-bz2.patch \
file://0001-Add-missing-includes-cstdint-and-cstdio.patch \
file://0001-cmake-Do-not-add-msse4.2-mpclmul-on-clang.patch \
file://ppc64.patch \
file://mips.patch \
file://arm.patch \
"
SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
SRC_URI:append:mips = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
SRC_URI:append:powerpc = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
S = "${WORKDIR}/git"
inherit cmake
PACKAGECONFIG ??= "bzip2 zlib lz4 gflags"
PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2"
PACKAGECONFIG[lz4] = "-DWITH_LZ4=ON,-DWITH_LZ4=OFF,lz4"
PACKAGECONFIG[zlib] = "-DWITH_ZLIB=ON,-DWITH_ZLIB=OFF,zlib"
PACKAGECONFIG[zstd] = "-DWITH_ZSTD=ON,-DWITH_ZSTD=OFF,zstd"
PACKAGECONFIG[lite] = "-DROCKSDB_LITE=ON,-DROCKSDB_LITE=OFF"
PACKAGECONFIG[gflags] = "-DWITH_GFLAGS=ON,-DWITH_GFLAGS=OFF,gflags"
# Tools and tests currently don't compile on armv5 so we disable them
EXTRA_OECMAKE = "\
-DPORTABLE=ON \
-DWITH_TESTS=OFF \
-DWITH_BENCHMARK_TOOLS=OFF \
-DWITH_TOOLS=OFF \
-DFAIL_ON_WARNINGS=OFF \
"
do_install:append() {
# fix for qa check buildpaths
sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake
}
LDFLAGS:append:riscv64 = " -pthread"
# Need toku_time_now() implemented for ppc/musl
# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
COMPATIBLE_HOST:libc-musl:powerpc = "null"

View File

@@ -0,0 +1,32 @@
From e5f72c656829402c6f70e7416039bc18f0c26485 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 30 Aug 2022 22:17:14 -0700
Subject: [PATCH] Do not use std::shuffle with clang 15
This fails to compile although its preferred approach for c++11 and
newer
See
https://github.com/SOCI/soci/issues/984
Upstream-Status: Inappropriate [Workaround]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cmake/SociConfig.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmake/SociConfig.cmake b/cmake/SociConfig.cmake
index 492e1837..f24fd9a6 100644
--- a/cmake/SociConfig.cmake
+++ b/cmake/SociConfig.cmake
@@ -94,6 +94,7 @@ else()
set(SOCI_CXX11 ON)
set(SOCI_CXX_VERSION_FLAGS "-std=c++11")
add_definitions(-DCATCH_CONFIG_CPP11_NO_IS_ENUM)
+ add_definitions(-DCATCH_CONFIG_CPP11_NO_SHUFFLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS} ${SOCI_CXX_VERSION_FLAGS}")
--
2.37.3

View File

@@ -0,0 +1,28 @@
Define SOCI_LIBDIR only if its not passed via environemnt. In OE we
want to set it per our choice since we use 'lib' for 64bit unless we
are using multilib
-Khem
Index: soci-3.2.2/CMakeLists.txt
===================================================================
--- soci-3.2.2.orig/CMakeLists.txt
+++ soci-3.2.2/CMakeLists.txt
@@ -69,11 +69,12 @@ include(SociDependencies)
###############################################################################
# Installation
###############################################################################
-
-if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(SOCI_LIBDIR "lib")
-else()
- set(SOCI_LIBDIR "lib64")
+if(NOT DEFINED SOCI_LIBDIR)
+ if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(SOCI_LIBDIR "lib")
+ else()
+ set(SOCI_LIBDIR "lib")
+ endif()
endif()
set(BINDIR "bin" CACHE PATH "The directory to install binaries into.")

View File

@@ -0,0 +1,45 @@
DESCRIPTION = "The C++ Database Access Library"
HOMEPAGE = "http://soci.sourceforge.net"
LICENSE = "BSL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
SECTION = "libs"
DEPENDS = "boost"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BP}/${BP}.tar.gz \
file://0001-Do-not-use-std-shuffle-with-clang-15.patch \
"
SRC_URI[sha256sum] = "615e5f7e4b52007f3a3b4050a99aadf6346b56b5098eb08b3a650836083c6a33"
TESTCONFIG = '-DSOCI_TEST_EMPTY_CONNSTR="dummy" -DSOCI_TEST_SQLITE3_CONNSTR="test.db" \
-DSOCI_TEST_POSTGRESQL_CONNSTR:STRING="dbname=soci_test" \
-DSOCI_TEST_MYSQL_CONNSTR:STRING="db=soci_test user=oe password=oe"'
OBASEDIR ?= "/opt/oracle"
OINCDIR = "rdbms/public"
OLIBDIR = "lib"
PACKAGECONFIG[sqlite3] = "-DSOCI_SQLITE3=ON,-DSOCI_SQLITE3=OFF,sqlite3,"
PACKAGECONFIG[mysql] = "-DSOCI_MYSQL=ON,-DSOCI_MYSQL=OFF,mariadb,"
PACKAGECONFIG[postgresql] = "-DSOCI_POSTGRESQL=ON,-DSOCI_POSTGRESQL=OFF,postgresql,"
PACKAGECONFIG[odbc] = "-DSOCI_ODBC=ON,-DSOCI_ODBC=OFF,,"
PACKAGECONFIG[empty] = "-DSOCI_EMPTY=ON,-DSOCI_EMPTY=OFF,,"
PACKAGECONFIG[oracle] = "-DWITH_ORACLE=ON --with-oracle-include=${OINCDIR} --with-oracle-lib=${OLIBDIR},-DWITH_ORACLE=OFF,,"
PACKAGECONFIG[firebird] = "-DWITH_FIREBIRD=ON,-DWITH_FIREBIRD=OFF,,"
PACKAGECONFIG[ptest] = "${TESTCONFIG},,,"
# enable your backend by default we enable 'empty'
PACKAGECONFIG ??= "empty"
# Take the flags added by PACKAGECONFIG and pass them to cmake.
EXTRA_OECMAKE = "${EXTRA_OECONF} -DSOCI_LIBDIR=${libdir}"
DISABLE_STATIC = ""
inherit dos2unix cmake
PACKAGES += "${PN}-sqlite3 ${PN}-mysql ${PN}-postgresql ${PN}-odbc ${PN}-oracle"
FILES:${PN}-sqlite3 = "${libdir}/lib${BPN}_sqlite3.so.*"
FILES:${PN}-mysql = "${libdir}/lib${BPN}_mysql.so.*"
FILES:${PN}-postgresql = "${libdir}/lib${BPN}_postgresql.so.*"
FILES:${PN}-odbc = "${libdir}/lib${BPN}_odbc.so.*"
FILES:${PN}-oracle = "${libdir}/lib${BPN}_oracle.so.*"