Add ports to the Sortix repository.

This change imports the ports collection from the former porttix and srctix
repositories and converts them to port(5) files with metadata pointing to
the upstream release tarballs with patches checked into this repository.
Ports are now developed and versioned along with the operating system and
are automatically built per the PACKAGES environment variable. The patches
are licensed under the same license as the relevant ports.

Tix has gained support for the new port(5) format. tix-port(8) is the new
high level ports build even point that handles downloading pstream releases
into the new mirror cache directory, applying the patches, building the port
with the lower-level tix-build(8), and finally installing the binary
package. The new tix-vars(8) program parses port(5) files and the new
tix-rmdiff(8) program produces input for tix-rmpatch(8).

The old doc/ directory is discontinued in favor of manual pages documenting
the new ports system.

The obsolete porttix-create(8) and srctix-create(8) programs are removed.
This commit is contained in:
Jonas 'Sortie' Termansen 2022-06-13 22:29:53 +02:00
parent 81978ae938
commit 9588b0d3db
220 changed files with 23392 additions and 2422 deletions

8
.gitignore vendored
View File

@ -5,10 +5,12 @@
/*.so
/*.a
builds
mirror
ports/*/*/
ports/*/*.version
release
repository
sysroot
sysroot.destdir
sysroot-overlay
sysroot-overlay-*
release
ports
repository

View File

@ -1,4 +1,4 @@
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Copyright 2011-2022 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@ -26,7 +26,8 @@ software. There is no code under the GNU GPL or variants.
The Sortix ports collection contains third party code which is licensed
independently of the Sortix base systems. Such code may have licenses that
impose restrictions, such as requiring also providing the corresponding source
code when providing compiled program code to others.
code when providing compiled program code to others. Patches to ports are
licensed under the same license as the relevant port.
Official Sortix releases contain the binary packages from the ports collection
and thus may contain code whose licenses impose restrictions. Official Sortix

View File

@ -4,7 +4,6 @@ include build-aux/compiler.mak
include build-aux/version.mak
MODULES=\
doc \
libc \
libm \
dispd \
@ -43,11 +42,14 @@ ifndef SYSROOT_OVERLAY
endif
SORTIX_BUILDS_DIR?=builds
SORTIX_MIRROR_DIR?=mirror
SORTIX_PORTS_DIR?=ports
SORTIX_RELEASE_DIR?=release
SORTIX_REPOSITORY_DIR?=repository
SORTIX_ISO_COMPRESSION?=xz
SORTIX_PORTS_MIRROR?=https://pub.sortix.org/mirror
SORTIX_INCLUDE_SOURCE_GIT_REPO?=$(shell test -d .git && echo "file://`pwd`")
SORTIX_INCLUDE_SOURCE_GIT_REPO:=$(SORTIX_INCLUDE_SOURCE_GIT_REPO)
SORTIX_INCLUDE_SOURCE_GIT_ORIGIN?=
@ -225,15 +227,56 @@ endif
grep -E '^/src(/.*)?$$' | \
LC_ALL=C sort > "$(SYSROOT)/tix/manifest/src"
.PHONY: sysroot-ports
sysroot-ports: sysroot-fsh sysroot-base-headers sysroot-system sysroot-source
@SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
.PHONY: available-ports
available-ports:
@for port in $$(build-aux/list-packages.sh PACKAGES); do \
build-aux/upgrade-port.sh ports/$$port/$$port.port available; \
done
.PHONY: upgrade-ports
upgrade-ports:
@for port in $$(build-aux/list-packages.sh PACKAGES); do \
build-aux/upgrade-port.sh ports/$$port/$$port.port upgrade; \
done
.PHONY: mirror
mirror:
@SORTIX_MIRROR_DIR="$(SORTIX_MIRROR_DIR)" \
SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
SORTIX_PORTS_MIRROR="$(SORTIX_PORTS_MIRROR)" \
SYSROOT="$(SYSROOT)" \
BUILD="$(BUILD)" \
HOST="$(HOST)" \
MAKE="$(MAKE)" \
MAKEFLAGS="$(MAKEFLAGS)" \
build-aux/build-ports.sh
build-aux/build-ports.sh download
.PHONY: extract-ports
extract-ports:
@SORTIX_MIRROR_DIR="$(SORTIX_MIRROR_DIR)" \
SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
SORTIX_PORTS_MIRROR="$(SORTIX_PORTS_MIRROR)" \
SYSROOT="$(SYSROOT)" \
BUILD="$(BUILD)" \
HOST="$(HOST)" \
MAKE="$(MAKE)" \
MAKEFLAGS="$(MAKEFLAGS)" \
build-aux/build-ports.sh extract
.PHONY: sysroot-ports
sysroot-ports: sysroot-fsh sysroot-base-headers sysroot-system sysroot-source
@SORTIX_MIRROR_DIR="$(SORTIX_MIRROR_DIR)" \
SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
SORTIX_PORTS_MIRROR="$(SORTIX_PORTS_MIRROR)" \
SYSROOT="$(SYSROOT)" \
BUILD="$(BUILD)" \
HOST="$(HOST)" \
MAKE="$(MAKE)" \
MAKEFLAGS="$(MAKEFLAGS)" \
build-aux/build-ports.sh build
.PHONY: sysroot
sysroot: sysroot-system sysroot-source sysroot-ports
@ -248,10 +291,13 @@ $(SORTIX_REPOSITORY_DIR)/$(HOST): $(SORTIX_REPOSITORY_DIR)
clean-core:
(for D in $(MODULES); do $(MAKE) clean -C $$D || exit $$?; done)
.PHONY: clean-mirror
clean-mirror:
rm -rf "$(SORTIX_MIRROR_DIR)"
.PHONY: clean-ports
clean-ports:
@SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
HOST="$(HOST)" \
MAKE="$(MAKE)" \
MAKEFLAGS="$(MAKEFLAGS)" \
build-aux/clean-ports.sh
@ -277,11 +323,18 @@ clean-sysroot:
.PHONY: clean
clean: clean-core clean-ports
.PHONY: distclean-ports
distclean-ports:
@SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
MAKE="$(MAKE)" \
MAKEFLAGS="$(MAKEFLAGS)" \
build-aux/clean-ports.sh distclean
.PHONY: mostlyclean
mostlyclean: clean-core clean-ports clean-builds clean-release clean-sysroot
mostlyclean: clean-core distclean-ports clean-builds clean-release clean-sysroot
.PHONY: distclean
distclean: clean-core clean-ports clean-builds clean-release clean-repository clean-sysroot
distclean: clean-core distclean-ports clean-builds clean-release clean-mirror clean-repository clean-sysroot
.PHONY: most-things
most-things: sysroot iso
@ -340,7 +393,13 @@ $(LIVE_INITRD): sysroot
mkdir -p $(LIVE_INITRD).d/home
mkdir -p $(LIVE_INITRD).d/root -m 700
cp -RT "$(SYSROOT)/etc/skel" $(LIVE_INITRD).d/root
cp doc/welcome $(LIVE_INITRD).d/root
(echo "You can view the documentation for new users by typing:" && \
echo && \
echo " man user-guide" && \
echo && \
echo "You can view the installation instructions by typing:" && \
echo && \
echo " man installation") > $(LIVE_INITRD).d/root/welcome
tix-collection $(LIVE_INITRD).d create --platform=$(HOST) --prefix= --generation=2
mkinitrd --format=sortix-initrd-2 $(LIVE_INITRD).d -o $(LIVE_INITRD)
rm -rf $(LIVE_INITRD).d
@ -491,7 +550,8 @@ $(SORTIX_RELEASE_DIR)/$(RELEASE)/repository/$(HOST):
.PHONY: release-repository
release-repository: sysroot $(SORTIX_RELEASE_DIR)/$(RELEASE)/repository/$(HOST)
for port in `LC_ALL=C ls "$(SYSROOT)/tix/tixinfo"`; do \
cp $(SORTIX_REPOSITORY_DIR)/$(HOST)/$$port.tix.tar.xz $(SORTIX_RELEASE_DIR)/$(RELEASE)/repository/$(HOST); \
cp $(SORTIX_REPOSITORY_DIR)/$(HOST)/$$port.tix.tar.xz $(SORTIX_RELEASE_DIR)/$(RELEASE)/repository/$(HOST) && \
cp $(SORTIX_REPOSITORY_DIR)/$(HOST)/$$port.version $(SORTIX_RELEASE_DIR)/$(RELEASE)/repository/$(HOST); \
done
.PHONY: release-scripts

View File

@ -1,4 +1,5 @@
#!/bin/sh -e
#!/bin/sh
set -e
make_dir_path_absolute() {
(cd "$1" && pwd)
@ -8,6 +9,18 @@ has_command() {
which "$1" > /dev/null
}
# Determine what's supposed to happen.
if [ $# = 0 ]; then
echo "$0: usage: $0 <operation>" >&2
exit 1
fi
OPERATION="$1"
case "$OPERATION" in
download|extract|build) ;;
*) echo "$0: error: Invalid operation: $OPERATION" >&2
exit 1
esac
# Detect if the environment isn't set up properly.
if [ -z "$HOST" ]; then
echo "$0: error: You need to set \$HOST" >&2
@ -18,25 +31,37 @@ elif [ -z "$SYSROOT" ]; then
elif [ -z "$SORTIX_PORTS_DIR" ]; then
echo "$0: error: You need to set \$SORTIX_PORTS_DIR" >&2
exit 1
elif [ -z "$SORTIX_MIRROR_DIR" ]; then
echo "$0: error: You need to set \$SORTIX_MIRROR_DIR" >&2
exit 1
elif [ -z "$SORTIX_REPOSITORY_DIR" ]; then
echo "$0: error: You need to set \$SORTIX_REPOSITORY_DIR" >&2
exit 1
elif ! [ -d "$SORTIX_PORTS_DIR" ]; then
echo "Warning: No ports directory found, third party software will not be built"
exit 0
elif ! has_command tix-collection ||
! has_command tix-build ||
! has_command tix-install; then
elif ! has_command tix-rmdiff; then
echo "$0: error: You need to have installed Tix locally to compile ports." >&2
exit 1
fi
# Create the mirror directory for downloaded archives.
mkdir -p "$SORTIX_MIRROR_DIR"
# Add the platform triplet to the binary repository path.
SORTIX_REPOSITORY_DIR="$SORTIX_REPOSITORY_DIR/$HOST"
mkdir -p "$SORTIX_REPOSITORY_DIR"
# Create the system root if absent.
if [ "$OPERATION" = build ]; then
mkdir -p "$SYSROOT"
fi
# Make paths absolute for later use.
SYSROOT=$(make_dir_path_absolute "$SYSROOT")
if [ "$OPERATION" = build ]; then
SYSROOT=$(make_dir_path_absolute "$SYSROOT")
fi
SORTIX_MIRROR_DIR=$(make_dir_path_absolute "$SORTIX_MIRROR_DIR")
SORTIX_PORTS_DIR=$(make_dir_path_absolute "$SORTIX_PORTS_DIR")
SORTIX_REPOSITORY_DIR=$(make_dir_path_absolute "$SORTIX_REPOSITORY_DIR")
@ -52,119 +77,71 @@ CXXFLAGS="$CXXFLAGS -Werror=format -Wno-error=format-contains-nul"
export CFLAGS
export CXXFLAGS
# Create the system root if absent.
mkdir -p "$SYSROOT"
# Create the binary package repository.
mkdir -p "$SORTIX_REPOSITORY_DIR"
# Initialize Tix package management in the system root if absent.
[ -e "$SYSROOT/tix/collection.conf" ] ||
tix-collection "$SYSROOT" create --platform=$HOST --prefix= --generation=2
# Detect all packages.
get_all_packages() {
for PACKAGE in $(ls "$SORTIX_PORTS_DIR"); do
! [ -f "$SORTIX_PORTS_DIR/$PACKAGE/tixbuildinfo" ] ||
echo $PACKAGE
done
}
# Detect which packages are available if not specified.
if [ -z "${PACKAGES+x}" ]; then
PACKAGES=$(get_all_packages | sort -R)
if [ "$OPERATION" = build ]; then
if [ ! -e "$SYSROOT/tix/collection.conf" ]; then
tix-collection "$SYSROOT" create --platform=$HOST --prefix= --generation=2
fi
fi
PACKAGES="$("$(dirname -- "$0")"/list-packages.sh PACKAGES)"
# Simply stop if there is no packages available.
if [ -z "$PACKAGES" ]; then
exit 0
fi
# Detect the build-time dependencies for a package.
get_package_dependencies_raw() {(
PACKAGE_DIR=$(echo $1 | grep -Eo '^[^\.]*')
! [ -f "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" ] ||
grep -E "^(pkg\.build-libraries|pkg\.alias-of)=.*" "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" | \
sed 's/^[^=]*=//'
)}
# Detect the build-time dependencies for a package with missing optional
# dependencies removed.
get_package_dependencies() {(
PRINTED_ANY=false
for DEPENDENCY in $(get_package_dependencies_raw $1); do
if [ "$DEPENDENCY" != "${DEPENDENCY%\?}" ]; then
DEPENDENCY="${DEPENDENCY%\?}"
FOUND=false
for PACKAGE in $PACKAGES; do
if [ "$PACKAGE" = "$DEPENDENCY" ]; then
FOUND=true
break
fi
done
if ! $FOUND; then
continue
fi
fi
if $PRINTED_ANY; then printf ' '; fi
printf "%s" "$DEPENDENCY"
PRINTED_ANY=true
done
if $PRINTED_ANY; then echo; fi
)}
# Decide the order the packages are built in according to their dependencies.
DEPENDENCY_MAKEFILE=$(mktemp)
(for PACKAGE in $PACKAGES; do
echo "$PACKAGE: $(get_package_dependencies $PACKAGE)"
echo " @echo $PACKAGE"
done;
printf ".PHONY:"
for PACKAGE in $PACKAGES; do
printf " $PACKAGE"
done;
echo) > "$DEPENDENCY_MAKEFILE"
if [ "$OPERATION" = build ]; then
PACKAGES="$(echo "$PACKAGES" | tr ' ' '\n' | sort -R)"
DEPENDENCY_MAKEFILE=$(mktemp)
(for PACKAGE in $PACKAGES; do
DEPENDENCIES="$(PACKAGES="$PACKAGES" \
"$(dirname -- "$0")"/list-packages.sh \
--dependencies $PACKAGE)"
echo "$PACKAGE: $(echo "$DEPENDENCIES" | tr '\n' ' ' | sed -E 's/ +$/\n/')"
echo " @echo $PACKAGE"
done;
printf ".PHONY:"
for PACKAGE in $PACKAGES; do
printf " $PACKAGE"
done;
echo) > "$DEPENDENCY_MAKEFILE"
BUILD_LIST=$(unset MAKE;
unset MFLAGS;
unset MAKEFLAGS;
make -Bs -f "$DEPENDENCY_MAKEFILE" $PACKAGES)
rm -f "$DEPENDENCY_MAKEFILE"
PACKAGES="$BUILD_LIST"
BUILD_LIST=$(unset MAKE;
unset MFLAGS;
unset MAKEFLAGS;
make -Bs -f "$DEPENDENCY_MAKEFILE" $PACKAGES)
rm -f "$DEPENDENCY_MAKEFILE"
PACKAGES="$BUILD_LIST"
fi
# TODO: This adds another decompression and compression to the build time, this
# should be done as a tix post installation step. Also this might miss
# programs in unusual locations, so need a thorough search and strip.
strip_tix() {
DIR=$(mktemp -d)
tar -C "$DIR" -xf "$1"
$HOST-strip -d "$DIR/data/bin/"* 2>/dev/null || true
$HOST-strip -d "$DIR/data/lib/"* 2>/dev/null || true
$HOST-strip -d "$DIR/data/libexec"* 2>/dev/null || true
$HOST-strip -d "$DIR/data/libexec/git-core/"* 2>/dev/null || true
$HOST-strip -d "$DIR/data/sbin/"* 2>/dev/null || true
(cd "$DIR" && tar --numeric-owner --owner=0 --group=0 -cJf port.tar.tix.xz tix data)
cp "$DIR/port.tar.tix.xz" "$1"
rm -rf "$DIR"
}
unset CACHE_PACKAGE
unset END
if [ "$OPERATION" = download ]; then
END=download
elif [ "$OPERATION" = extract ]; then
END=extract
else
CACHE_PACKAGE=--cache-package
fi
# Build all the packages (if needed) and otherwise install them.
# Build and install all the packages.
for PACKAGE in $PACKAGES; do
if ! [ -f "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" ]; then
SOURCE_PACKAGE=$(grep -E "^pkg.source-package=" "$SORTIX_PORTS_DIR/$PACKAGE/tixbuildinfo" | \
sed 's/^[^=]*=//')
tix-build \
--sysroot="$SYSROOT" \
--host=$HOST \
--prefix= \
--destination="$SORTIX_REPOSITORY_DIR" \
--generation=2 \
${SOURCE_PACKAGE:+--source-package "$SORTIX_PORTS_DIR/$SOURCE_PACKAGE"} \
"$SORTIX_PORTS_DIR/$PACKAGE"
strip_tix "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz"
fi
tix-install \
SOURCE_PORT=$(tix-vars -d '' $SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.port \
SOURCE_PORT)
tix-port \
${BUILD:+--build="$BUILD"} \
$CACHE_PACKAGE \
--collection="$SYSROOT" \
--reinstall \
"$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz"
--destination="$SORTIX_REPOSITORY_DIR" \
${END:+--end="$END"} \
--generation=2 \
--host=$HOST \
${SORTIX_PORTS_MIRROR:+--mirror="$SORTIX_PORTS_MIRROR"} \
--mirror-directory="$SORTIX_MIRROR_DIR" \
--prefix= \
${SOURCE_PORT:+--source-port="$SORTIX_PORTS_DIR/$SOURCE_PORT/$SOURCE_PORT"} \
--sysroot="$SYSROOT" \
"$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE"
done

View File

@ -15,7 +15,7 @@ if [ -z "$SORTIX_PORTS_DIR" ]; then
elif ! [ -d "$SORTIX_PORTS_DIR" ] ||
[ "$(ls "$SORTIX_PORTS_DIR") | wc -l" = 0 ]; then
exit 0
elif ! has_command tix-build; then
elif ! has_command tix-vars; then
echo "$0: warning: Can't clean ports directory without Tix locally installed." >&2
exit 0
fi
@ -23,23 +23,41 @@ fi
# Make paths absolute for later use.
SORTIX_PORTS_DIR=$(make_dir_path_absolute "$SORTIX_PORTS_DIR")
# Detect all packages.
get_all_packages() {
for PACKAGE in $(ls "$SORTIX_PORTS_DIR"); do
! [ -f "$SORTIX_PORTS_DIR/$PACKAGE/tixbuildinfo" ] ||
echo $PACKAGE
done
}
# Clean all the packages.
for PACKAGE in $(get_all_packages); do
[ -f "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" ] ||
tix-build \
--sysroot="/" \
--host=$HOST \
--prefix= \
--destination="/" \
--start=clean \
--end=clean \
"$SORTIX_PORTS_DIR/$PACKAGE"
for PACKAGE in $("$(dirname -- "$0")"/list-packages.sh 'all!'); do
if [ "$1" = distclean ]; then
DEVELOPMENT=$(tix-vars -d false $SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.port \
DEVELOPMENT)
if [ "$DEVELOPMENT" = true ]; then
case "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.version" in
*.development)
echo "Port is in development: '$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE'"
continue
;;
esac
fi
if [ -e "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE" ]; then
echo "Removing '$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE'"
fi
rm -rf "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE"
rm -rf "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.upstream"
rm -f "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.version"
rm -f "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.version.new"
fi
if [ -e "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.version" -o \
-e "$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.version.new" ]; then
SOURCE_PORT=$(tix-vars -d '' $SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE.port \
SOURCE_PORT)
if [ -z "$SOURCE_PORT" ] ||
[ -e "$SORTIX_PORTS_DIR/$SOURCE_PORT/$SOURCE_PORT" ]; then
tix-build \
--sysroot="/" \
--prefix= \
--destination="/" \
--start=clean \
--end=clean \
${SOURCE_PORT:+--source-port "$SORTIX_PORTS_DIR/$SOURCE_PORT/$SOURCE_PORT"} \
"$SORTIX_PORTS_DIR/$PACKAGE/$PACKAGE"
fi
fi
done

View File

@ -115,7 +115,9 @@ live_initrd=$(maybe_compressed boot/live.initrd)
overlay_initrd=$(maybe_compressed boot/overlay.initrd)
src_initrd=$(maybe_compressed boot/src.initrd)
system_initrd=$(maybe_compressed boot/system.initrd)
ports=$(ls repository | sed 's/\.tix\.tar\.xz//')
ports=$(ls repository |
grep -E '\.tix\.tar\.xz$' |
sed -E 's/\.tix\.tar\.xz$//')
mkdir -p boot/grub
exec > boot/grub/grub.cfg

View File

@ -1,4 +1,5 @@
#!/bin/sh -e
#!/bin/sh
set -e
# Detect if the environment isn't set up properly.
if [ -z "$HOST" ]; then
@ -17,12 +18,11 @@ if ! [ -d "$SORTIX_REPOSITORY_DIR" ]; then
exit 0
fi
PACKAGES="$("$(dirname -- "$0")"/list-packages.sh PACKAGES)"
mkdir -p "$1"
if [ -z "${PACKAGES+x}" ]; then
cp -RT "$SORTIX_REPOSITORY_DIR" "$1"
else
for PACKAGE in $PACKAGES; do
cp "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" "$1"
done
fi
for PACKAGE in $PACKAGES; do
cp "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" "$1"
cp "$SORTIX_REPOSITORY_DIR/$PACKAGE.version" "$1"
done

108
build-aux/list-packages.sh Executable file
View File

@ -0,0 +1,108 @@
#!/bin/sh
set -e
if [ -z "$SORTIX_PORTS_DIR" ]; then
SORTIX_PORTS_DIR="$(dirname -- "$0")/../ports"
fi
# Load the ports sets.
. "$(dirname -- "$0")/ports.conf"
get_all_packages() {(
for package in $(ls "$SORTIX_PORTS_DIR"); do
if [ -f "$SORTIX_PORTS_DIR/$package/$package.port" ]; then
echo $package
fi
done
)}
get_package_dependencies_raw() {(
if [ -f "$SORTIX_PORTS_DIR/$1/$1.port" ]; then
tix-vars -d '' "$SORTIX_PORTS_DIR/$1/$1.port" BUILD_LIBRARIES
elif [ "$1" = "all" ]; then
get_all_packages
else
for set in $sets; do
if [ $set = $1 ]; then
echo $(eval echo \$set_$set)
fi
done
fi
)}
# TODO: This algorithm scales extremely poorly.
get_package_dependencies_recursive() {(
for dependency in $(get_package_dependencies_raw $1); do
want=false
if [ "$2" = "!!" ]; then
want=true
else
case "$dependency" in
*"?") ;;
*) want=true ;;
esac
fi
if $want; then
dependency=$(echo "$dependency" | tr -d '?')
# Optional dependencies might not exist yet.
if [ -f "$SORTIX_PORTS_DIR/$dependency/$dependency.port" ]; then
echo "$dependency"
get_package_dependencies_recursive "$dependency" "$2"
fi
fi
done
)}
list_dependencies() {(
package="$1"
for dependency in $(get_package_dependencies_raw "$package"); do
if [ "$dependency" != "${dependency%\?}" ]; then
dependency="${dependency%\?}"
for candidate in $PACKAGES; do
if [ "$candidate" = "$dependency" ]; then
echo "$dependency"
break
fi
done
else
echo "$dependency"
fi
done
)}
list_package() {(
package="$1"
# Fast path for listing all packages.
if [ "$package" = "all!" -o "$package" = "all!!" ]; then
get_all_packages
exit
fi
recursion=$(echo "$package" | grep -Eo '!*$')
package=$(echo "$package" | grep -Eo '^[^!]*')
# TODO: Better way of detecting if a port is a set.
if [ -f "$SORTIX_PORTS_DIR/$package/$package.port" ]; then
echo "$package"
fi
if [ -n "$recursion" ]; then
get_package_dependencies_recursive "$package" "$recursion"
fi
)}
if [ "$1" = "--dependencies" ]; then
shift
PACKAGES=$("$0" PACKAGES)
for package; do
list_dependencies "$package"
done | sort -u
exit
fi
for package; do
if [ "$package" = PACKAGES ]; then
for package in ${PACKAGES-all!}; do
list_package "$package"
done
else
list_package "$1"
fi
done | sort -u

103
build-aux/upgrade-port.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/sh
set -e
NAME=$(tix-vars -d '' "$1" NAME)
COMPRESSION=$(tix-vars -d '' "$1" COMPRESSION)
DISTNAME_REGEX=$(tix-vars -d '' "$1" DISTNAME_REGEX)
RELEASE_SEARCH_PAGE=$(tix-vars -d '' "$1" RELEASE_SEARCH_PAGE)
RELEASE_SEARCH_REGEX=$(tix-vars -d '' "$1" RELEASE_SEARCH_REGEX)
UPSTREAM_ARCHIVE=$(tix-vars -d '' "$1" UPSTREAM_ARCHIVE)
UPSTREAM_SITE=$(tix-vars -d '' "$1" UPSTREAM_SITE)
VERSION=$(tix-vars -d '' "$1" VERSION)
VERSION_REGEX=$(tix-vars -d '' "$1" VERSION_REGEX)
if [ -z "$UPSTREAM_ARCHIVE" ]; then exit; fi
escape_regex() {
echo "$1" | sed -E 's,[\\+*?.{}<>],\\\0,g'
}
TAR_REGEX="(\.tar(\.(gz|bz2|xz)))"
if [ -z "$RELEASE_SEARCH_PAGE" ]; then
case "$UPSTREAM_SITE" in
https://github.com/*/releases/*)
RELEASE_SEARCH_PAGE=$(echo "$UPSTREAM_SITE" | grep -Eo '.*/releases/');;
*) RELEASE_SEARCH_PAGE="$UPSTREAM_SITE/";;
esac
fi
if [ -z "$VERSION_REGEX" ]; then
VERSION_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)"
fi
if [ -z "$DISTNAME_REGEX" ]; then
DISTNAME_REGEX=$(echo "$UPSTREAM_ARCHIVE" |
sed -E 's,\+,\\+,g' |
sed -E "s,$VERSION_REGEX(\.tar.*),$(escape_regex "$VERSION_REGEX"),")
fi
if [ -z "$RELEASE_SEARCH_REGEX" ]; then
RELEASE_SEARCH_REGEX="\<$DISTNAME_REGEX$TAR_REGEX\>"
fi
upgrade_version() {
sed -E -e "s,^(VERSION_MAJOR)=.*,\\1=$(echo "$2" | sed -E 's,([0-9]+)\.([0-9]+)(\.([0-9]+))?.*,\1,')," \
-e "s,^(VERSION_MINOR)=.*,\\1=$(echo "$2" | sed -E 's,([0-9]+)\.([0-9]+)(\.([0-9]+))?.*,\2,')," \
-e "s,^(VERSION_PATCH)=.*,\\1=$(echo "$2" | sed -E 's,([0-9]+)\.([0-9]+)(\.([0-9]+))?.*,\4,')," \
-e "s/^(VERSION)=[^$]*$/\\1=$2/" \
-e "s/^(COMPRESSION)=.*/\1=$COMPRESSION/" \
"$1"
}
instantiate() {
upgrade_version "$1" "$2" | tix-vars - "$3"
}
LATEST=$(curl -Ls "$RELEASE_SEARCH_PAGE" | grep -Eo "$RELEASE_SEARCH_REGEX" | sort -Vu | tail -1)
case "$LATEST" in
*.tar) COMPRESSION=tar;;
*.tar.gz) COMPRESSION=tar.gz;;
*.tar.bz2) COMPRESSION=tar.bz2;;
*.tar.xz) COMPRESSION=tar.xz;;
esac
NEW_VERSION="$(echo "$LATEST" | sed -E "s,$RELEASE_SEARCH_REGEX,\1,")"
if [ -t 1 ]; then
RED='\033[91m'
GREEN='\033[92m'
RESET='\033[m'
else
RED=''
GREEN=''
RESET=''
fi
if [ -z "$NEW_VERSION" ]; then
printf "$RED%s$RESET\n" "$UPSTREAM_ARCHIVE failed to find available versions: $RELEASE_SEARCH_PAGE | grep -E '$RELEASE_SEARCH_REGEX'"
exit 1
fi
NEW_UPSTREAM_SITE=$(instantiate "$1" "$NEW_VERSION" "UPSTREAM_SITE")
NEW_UPSTREAM_ARCHIVE=$(instantiate "$1" "$NEW_VERSION" "UPSTREAM_ARCHIVE")
if ! wget -q "$NEW_UPSTREAM_SITE/$NEW_UPSTREAM_ARCHIVE" -O /dev/null; then
printf "$RED%s$RESET\n" "$NAME failed to download: $NEW_UPSTREAM_SITE/$NEW_UPSTREAM_ARCHIVE"
exit 1
fi
if [ "$VERSION" = "$NEW_VERSION" ]; then
echo "$NAME $VERSION is up to date"
exit
fi
if [ "$2" = upgrade ]; then
if [ "$(tix-vars -d false "$1" DEVELOPMENT)" = true ]; then
echo "$0: warning: Not upgrading $1 in DEVELOPMENT=true mode" >&2
exit
fi
(upgrade_version "$1" "$NEW_VERSION" && echo DEVELOPMENT=true) > "$1.new"
mv "$1.new" "$1"
fi
printf "$GREEN%s$RESET\n" "$NAME $VERSION -> $NEW_VERSION $NEW_UPSTREAM_SITE/$NEW_UPSTREAM_ARCHIVE"

View File

@ -93,7 +93,7 @@ verify_source() {
# TODO: Some of these patterns should also apply to build-aux, and maybe also
# partially to libm. Makefile and kblayout should also not have whitespace
# problems.
for MODULE in $(git ls-files | grep / | sed 's,/.*,,' | sort -u | grep -Ev '^(build-aux|doc|etc|libm|share)$'); do
for MODULE in $(git ls-files | grep / | sed 's,/.*,,' | sort -u | grep -Ev '^(build-aux|etc|libm|ports|share)$'); do
cd "$MODULE"
for FILE in $(git ls-files | grep -Ev '^include/' | grep -Ev '((^|/)(Makefile|\.gitignore|tixbuildinfo)|\.([0-9]|kblayout|f16|rgb))$'); do
verify_source "$FILE"

1
doc/.gitignore vendored
View File

@ -1 +0,0 @@
index.html

View File

@ -1,21 +0,0 @@
include ../build-aux/platform.mak
include ../build-aux/compiler.mak
include ../build-aux/version.mak
include ../build-aux/dirs.mak
DOCUMENTS:=\
cross-compilation-sins \
obsolete-stuff \
porting-guide \
posix-divergence \
welcome \
all: $(BINARIES)
.PHONY: all install clean
install: all
mkdir -p $(DESTDIR)$(DOCDIR)
cp -t $(DESTDIR)$(DOCDIR) $(DOCUMENTS)
clean:

View File

@ -1,268 +0,0 @@
Cross Compilation Sins
======================
Cross-compilation is the act of compiling a program for execution on another
machine that is different from the current machine. The other machine can have
another processor, another operating system, or just another directory structure
with different programs and libraries installed. The important part is that the
cross-compiled program is not meant to be executed on the build machine and
cannot be assumed to execute correctly on the build machine.
Cross-compilation works in concept simply by substituting the usual compiler
with a special cross-compiler targeting the host machine rather than the build
machine. The development headers and libraries would then already be installed
in the system root used by the cross-compiler. The program will then be built
normally and the result is a binary for the host machine.
Unfortunately, a lot of software attempt to be too clever for their own good and
rely on assumptions that are not valid in the face of cross-compilation. This is
a list of such sins that software packages occasionally make that prevent proper
cross-compilation. Almost all software ought to cross-compile cleanly.
Not supporting cross-compilation
--------------------------------
Programs should use a build system that allows cross-compiler, or be stupid and
just use the specified compiler without violating rules in this document. Build
systems should not hard-code a particular compiler, but use a CC or CXX
environmental variable that possibly default to reasonable values, or using the
full ./configure machinery for detecting the correct compiler.
Root is the empty prefix
------------------------
The build system must treat the empty prefix as distinct from the default prefix
(which is usually /usr/local). A prefix is a string of characters that is added
before the usual installation directories such as /bin and /lib. To install a
program into the /bin directory (in the root filesystem), you need add no
characters in front of /lib. Thus, the empty prefix is the root directory. The
root directory is the prefix of /, as that would install the program into //bin.
Indeed //bin is not only ugly, but it actually has a special alternate meaning
than the root directory on some operating systems.
Probing root filesystem
-----------------------
The actual root filesystem of the host machine is not available at build time.
That means that probing system files are out of the question and should be
recoded into a runtime check at program startup. For instance, checking special
directories such as /dev or /proc, or system configuration in /etc, even
manually locating headers in /usr/include and libraries in /usr/lib is not
allowed (when though they would be there in the system root, potentially).
Instead build systems should view things through the eyes of the cross-compiler
that may use exotic strategies to locate the desired resources (perhaps the
cross-compiler is an executable that wraps the real compiler and adds special
-I and --sysroot options, for instance). To check whether a header is available,
the build system should preprocess a file that #includes it. To check whether a
library is available, the build system should try to link an executable against
it.
This discussion even covers looking at the configured prefix and other
installation directories, even if prefixed with $DESTDIR, except for the purpose
of installing files there.
Executing cross-compiled programs
---------------------------------
It is not possible to run a cross-compiled program when cross-compiling. The
results vary, maybe the program works, maybe the program loads but does
something unexpected, maybe the program loads and enter an infinite loop, maybe
the program loads and crashes, or maybe the program doesn't even load. The
important part is that the build system should not even attempt to execute any
programs it compiles. Some packages use special configure-time tests to compile
test programs to check the behavior of the host machine, such as whether a
standard function works.
Such tests are fundamentally broken if they require executing the test program;
usually it is sufficient to just check if the program links. This means that
tests about the run-time behavior of programs are not possible on the build
machine. If possible, such tests could be delayed until program startup.
However, such tests are usually to detect broken systems. If testing is not
possible, then the build system should assume that the system is not broken. It
is often just a single operating system that has such a problem and it may be
fixed in later releases. It is acceptable to inconvenience users of broken
operating systems by asking them to pass an --using-broken-os configure option
or something similar, as long as it doesn't inconvenience honest users of good
operating systems.
$DESTDIR
--------
Programs must support the DESTDIR environmental variable at package installation
time. It is an additional temporary prefix that is added to all the installation
directory paths when installing files and directories. It is commonly used for
package management that wishes to stage programs at a temporary location rather
than installing into the final destination immediately. It is also used for
cross-compilation where installation into the local machine's root directory
would be disastrous, where you rather want to use the cross-compilation system
root as DESTDIR.
It is important to understand that the prefix set at configure time is the
location where the program will end up on the host machine, not the installation
directory on the build machine. The installation directory on the build machine
would be the prefix given at configure time prefixed with DESTDIR being the
system root.
If packages do not support DESTDIR, it is possible to work-around the issue by
adding the intended DESTDIR to the prefix given at configure time. This works
only as long as the program doesn't remember the prefix or store it in system
configuration files. The better solution is just to patch in $(DESTDIR) support.
Cross-compiled Build Tools
--------------------------
Programs often need special-purpose build tools to compile some aspects of them
or associated files or documentation. If such a program is local to the project
and not a stand-alone tool on its own right, then it is not uncommon for the
build system to build first the tool and then use the tool during the build of
the real program.
This presents a crucial problem for cross-compilation: Two compilers must be in
play. Otherwise, the build system may helpfully use the cross-compiler to
cross-compile the build tool and attempt to execute the cross-compiled build
tool (which is intended to run on the host machine, not the build machine). This
is a common problem that prevents otherwise cross-compilable programs from
being cross-compilable.
The solution is to detect and use two compilers: The compiler for the build
machine and the compiler for the host machine. This introduces some new
complexity, but autoconf generated ./configure scripts can deal rather easily
with it. There is a problem, though, if the build tool itself has dependencies
on external projects besides the standard library, as that would mean the build
system would need to detect and handle dependencies for both the build and host
machine. I'm not even sure the autoconf configure style --with-foo options are
fine-grained enough to support --with-build-foo and with-host-foo options if
they differ.
A better solution is perhaps to promote the custom build tool to a general
purpose or at least special purpose tool that is installed along with the
program, while allowing the special purpose tool to be built separately and
just that tool. This allows the user wishing to cross-compile to first build the
custom build tool locally on his configure, install it on the build machine, and
then have the tool in $PATH during the actual cross-compilation of the program.
This way the build system doesn't need to have two compilers in play, but at the
cost of essentially splitting the project into two subprojects: The real program
and the custom build tool. This option is preferable if the custom build tool
can be adapted so it is reusable by other projects.
You can also change the implementation language of the build tool to an
interpreted language, such as a shell script, python or anything suitable. It
would be prudent to ensure such interpreted languages can also be cross-compiled
cleanly.
Degrading functionality of program
----------------------------------
Programs should not be partially cross-compilable, with optional parts of the
program not available if cross-compiled. In the event that such optional parts
cannot be cross-compiled, it might be because they are violating rules in this
document or an external dependency does.
Degrading quality of program
----------------------------
Programs that are cross-compiled should be as similar as possible to the case
where they are not cross-compiled. However, it is acceptable if there is a
performance loss if the program needs to do run-time checking when a test is not
possible at compile time or other cases where the build system needs to make a
decision and insufficient data is available and both solutions would work
correctly.
Custom Configure Scripts
------------------------
Some perhaps ship with a custom hand-written ./configure script as opposed to a
script generated by tools such as autoconf. It doesn't matter in what language
a configure script is written (as long as it can be correctly executed) or
whether it is generated or hand-written. However, it is important that it
correctly implement the standard semantics customary with GNU autoconf generated
./configure scripts. In particular, for this discussion, it must support the
--build, --host and --target options, as well as all the standard installation
directory options (--prefix, --exec-prefix, ...). It is also important that it
correctly locate a cross-compiler through the --host option by using it as a
cross-tool prefix. For instance, --host=x86_64-sortix must correctly locate
the x86_64-sortix-gcc compiler.
Remembering the Compiler
------------------------
Unusually, some libraries remember the compiler executable and used compiler
options and store them in special foo-config files or even installed system
headers. This must never be done as the cross-compiler is a temporary tool. The
library is meant to be used on the host system, it would be odd if programs
depending on the library attempted to use a cross-compiler when building such
programs on the host machine. It also violates the principle that which compiler
is used is decided by the user, rather than secretly by the package.
Making cross-compilation needlessly hard
----------------------------------------
Some build systems require the user to answer particular questions about the
host machine, while is perfectly capable of automatically answering such
questions about the build machine. This occasionally takes the form of autoconf
generated ./configure scripts requiring the user to set autoconf cache values
that answer runtime tests. The obvious solution is to do runtime tests at
program startup instead or more careful tests that are possible at compile time.
Other problems include all sorts of miscellaneous situations where the user is
required to jump through hoops to cross-compile a program, when it could have
been much simpler if the build system had followed standard patterns. This is
often a symptom of projects where cross-compilation is considered unusual and
special-purpose, rather than than a natural state of things if you don't assume
particular runtime tests are possible at compile time.
pkg-config
----------
Libraries should install pkg-config files rather than libtool .la files or
foo-config scripts as neither of those approaches support cross-compilation or
system roots, while pkg-config is perfectly aware of such use cases.
Programs should never look for libtool .la files or use foo-config scripts for
the same reasons. It is too possible that the program ends up finding a tool for
the build machine instead, if the installed foo-config script wasn't in the
user's PATH. Fortunately, the invocation of foo-config scripts and pkg-config
are usually similar enough, so it is simple to adapt a build system to use the
pkg-config variant exclusively instead.
The user can build a special cross-pkg-config or wrap an existing pkg-config by
setting special environmental variables. There are some caveats if the program
builds custom build tools that needs dependencies detected through pkg-config.
In that case, the user may need to have a special pkg-config with a tool prefix
or pass a configure option setting the name of the build machine pkg-config
script.
libtool .la files
-----------------
Libraries managed with libtool often install special .la files into the
configured libdir. These files contain information on how to link against the
library and what compiler options to use. Unfortunately they don't support
cross-compilation and system roots. As such, too easily the compile process will
begin attempting to link against files relative to the root directory on the
build machine.
The recommendation is to kill such files on sight and to never generate them in
the first place, and certainly to never install them into the system root. It is
usually safe to delete such files, especially if the library installs pkg-config
files or if you install into well-known system directories.
foo-config
----------
Libraries occasionally install special foo-config scripts into the configured
bindir. These files are executable shell scripts that output the compiler
options that should be used to link against the library. Unfortunately they
don't support cross-compilation and system roots. As such, too easily the
compile process will begin attempting to link against files relative to the root
directory on the build machine.
The recommendation is to kill such files on sight and to never generate them in
the first place, and certainly to never install them into the system root. It is
usually safe to delete such files, especially if the library installs pkg-config
files or if you install into well-known system directories. Watch out for
programs linking against the library that wrongly locate foo-config scripts in
your $PATH (which potentially come from your distribution). Such programs needs
to be patched to use pkg-config instead.

View File

@ -1,342 +0,0 @@
Obsolete Stuff
==============
One of the primary design goals of Sortix is to be a modern Unix system with the
old cruft removed. This means that some features/functions/headers in the C API
has been removed, never implemented in the first place, or is scheduled for
future removal. This is likely inconvenient, as a lot of programs still rely on
these obsolete/broken features, which will have to be fixed. Additionally, it'll
further complicate porting programs to Sortix. However, it is our belief that
ultimately such removals will be beneficial and this is merely a transitional
period. In almost all cases, we have made available superior interfaces that can
be used instead.
It may cause problems for portable programs that these features cannot or should
not be used, as lesser operating systems may not implement the modern
replacements. Either fix such systems or add some feature detection magic.
This is a list of common features that may currently be implemented, but that
you shouldn't use and if you do, then you should fix your program before it
breaks when the feature is finally removed.
You might be tempted to use a preprocessor conditional for __sortix__ to detect
the absence of these obsolete features and the availability of their modern
replacements. Keep in mind that other systems may have the modern replacements
and also may have removed features, and that they may supply other extensions to
replace the features. If you need to be portable, you should use whatever means
to automatically detect the availability of features at compile time, rather
than hardcode cases for each platform, as your software is likely to be ported
to platforms that didn't exist when you wrote your code.
asctime, asctime_r
------------------
This function is fundamentally broken. It doesn't support locales, it adds some
useless newline character at the end, the date format doesn't comply with ISO
standards, asctime is not thread safe, and so on. Actually, the POSIX standard
supplies code that implements the function because the format simply cannot
change. The function was actually already deprecated back in 1989 when the
original C standard was released. The solution is today the same as back then,
simply use the much superior strftime function instead. asctime_r tries to make
the function thread safe, but it doesn't fix the other broken semantics. The
only use of this function is to participate in protocols that somehow manages to
use asctime formatted dates, but then you might as well just paste in the POSIX
example code and hard code it in your program.
Sortix currently implement these functions for compatibility reasons.
creat
-----
Use open() instead of this poorly named function. Additionally, open() has a
similarly poorly named flag O_CREAT that does what you need.
Sortix currently implement this function for compatibility reasons.
clock
-----
The clock() function suffers from overflow issues where it wraps around and the
caller has to handle that, meaning it's not suitable for measuring long
intervals. Converting a clock interval to seconds it also bothersome and
requires division by CLOCKS_PER_SEC.
You should use clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) instead as it has no
overflow issues, provides nanosecond precision if available, and can be combined
with APIs such as Sortix's <timespec.h> for convenient computing.
Sortix currently implements this function for compatibility reasons.
ctime, ctime_r
--------------
These functions are defined in terms of asctime and asctime_r. Therefore they
will need to be removed as well.
Sortix currently implement these functions for compatibility reasons.
F_GETLK, F_SETLK, F_SETLKW
--------------------------
These fcntl commands implement POSIX advisory file locking. Unfortunately, this
standard interface is very poorly designed. In particular, if a process closes
a file descriptor, then all locks the process has for that file is unlocked,
even though there might not be a lock associated with that file descriptor in
the first place. This means that if the main program locks /foo/bar and runs
a library routine that also happen to open /foo/bar, then the advisory lock set
up by the main program is silently gone when when the library routine closes the
file and returns to the main program. Additionally, the locks are attached to
processes, rather than file descriptors. This complicates using them for threads
and passing file locks onto child processes.
Use the flock (not to be confused with lockf) call instead as it works at a file
descriptor level.
ftime
-----
Use clock_gettime instead.
gethostbyname, gethostbyaddr
----------------------------
Use the protocol agnostic functions such as getaddrinfo(). For instance, if you
want a HTTP connection to www.example.com, do you really care how the data get
to and from there? Most of the time you want a reliable transport protocol to a
named host, but don't care much about the low-level details. If you use these
modern networking interfaces, then your program can use without modification
IPv4, IPv6, or whatever new protocol is used in the future.
gethostid, sethostid
--------------------
These functions are built on the assumption that 32-bits are enough such that
each computer has an unique identity. It isn't. These functions are usually
implemented by using the IPv4 address, which already creates conflicts because
multiple systems can have the same LAN address. The functions are silly and any
use of them probably is silly too.
getpgrp
-------
POSIX and BSD disagree on the function prototype for getpgrp. Use getpgid
instead, as everyone agrees on that.
gets
----
Use fgets or getline instead. This function has been removed in the latest C
standard, but most implementations carry it anyways. Curiously it is hated so
much that some compatibility libraries such as gnulib actively use magic to add
deprecation warnings not to use it, but these won't compile because gets isn't
declared in any Sortix headers.
gettimeofday
------------
Use clock_gettime instead.
getwd
-----
Use get_current_dir_name() or getcwd() instead. Don't rely on the existence of
PATH_MAX, but allocate buffers as needed.
isascii
-------
This function is rather pointless. If we use a character encoding that wasn't
ascii compatible, then it doesn't make sense. If we use a sane character
encoding such as UTF-8, then you can simply check if the value is at most 127.
inet_addr
---------
This function only supports IPv4 and it supports a variety of weird ways to type
IPv4 addresses. Use inet_pton instead, which supports other address families as
well and only support standard address notations.
inet_ntoa
---------
This function only supports IPv4 and it isn't thread safe. Use inet_ntop instead
which is thread safe and supports other address families.
lockf
-----
This function implements POSIX advisory locks. It suffers from the same basic
design mistakes that the fnctl advisory lock commands (F_GETLK, F_SETLK,
F_SETLKW) do and should be avoided for the same reasons (see above).
Use the flock (not to be confused with lockf) call instead as it works at a file
descriptor level.
mktemp
------
mktemp(3) (not the mktemp(1) utility) creates a unique path name, but creates no
file, and thus offers no guarantee that is unique with respect to other threads
and system processes. The function is racy and dangerous.
Use mkstemp(3) (or for directories mkdtemp(3)) instead.
PATH_MAX
--------
There is no such limit in Sortix. The kernel might restrict the path lengths at
some point, but that'll just be to protect against misbehaving processes. You
can use pathconf() or fpathconf() to see if a particular path has a limit, but
otherwise you should just allocate strings as much as needed. There should be
functions in place so you can use paths of any length. If you really need a
limit as a hack to fix a broken program, you can do something like:
#if !defined(PATH_MAX) && defined(__sortix__)
#define PATH_MAX 32768
#endif
If there is ever going to be a path limit, it'll probably be either this value
or higher. Ideally, your programs ought to work with paths of any reasonable
length.
putenv
------
This is a poorly designed interface for manipulating the environment which
interacts quite badly with interfaces such as setenv and unsetenv. The major
problem is that putenv makes the input string itself part of the environment,
but setenv makes a copy of the input string part of the environment. This means
that unsetenv (as well as putenv and setenv when changing an existing variable)
has to somehow know whether the a given entry in environ was allocated by setenv
and whether to free it. This isn't helped by the fact that the environ symbol
is publicly accessible and callers of putenv can change the environment by
editing the string the caller inserted. This means that the implementations of
setenv and unsetenv must do a considerable amount of book-keeping behind the
scenes to figure out whether a string was allocated by setenv or face memory
leaks when environment variables are changed or unset. The solution to get rid
of all the needless complexity putenv forces upon the other functions is simply:
Don't provide putenv in the first place and fix any software that uses putenv to
just call setenv instead.
sdl-config
----------
This SDL utility program is basically broken for cross-compilation and seems to
be a poor counterpart to to pkg-config. If you insist on using such config
tools, use pkg-config instead as it causes fewer problems. If you really need a
sdl-config script, implement it using pkg-config:
pkg-config "$@" sdl
The Sortix build system actually injects such a sdl-config into the PATH to make
sure programs don't use the wrong SDL libraries when cross-compiling.
setpgrp
-------
POSIX and BSD disagree on the function prototype for setpgrp. Use setpgid
instead, as everyone agrees on that.
settimeofday
------------
Use clock_settime instead.
select
------
The fd_set system is poorly designed and the FD_SETSIZE is considerably smaller
than INT_MIN on most systems, which violates that the value of the file
descriptor shouldn't matter as long as it is between 0 and INT_MAX. It would be
better to use poll instead. There is also the problem that select uses struct
timeval instead of the superior struct timespec, though pselect solves that
particular problem.
Sortix currently provides this function for compatibility reasons.
sprintf
-------
The sprintf function is dangerous as it can be hard to predict the length of the
output string safely. A mistake can easily end in security vulnerabilities and
undefined behavior. Use the snprintf function instead as it knows the size of
the destination buffer and safely truncates in the error case. Such truncation
can be detected by the caller. Use the asprintf function or another approach
if determining the output length is hard.
Sortix currently provides this function for compatibility reasons.
strings.h
---------
There must have been some confusion back in the day since this header was
created, rather than the functions just added to string.h. In sane
implementations, you can just include string.h that also declares these
functions. The strings.h header exists in Sortix for source-code compatibility,
but don't be surprised if it just includes the regular string.h.
struct timeval
--------------
This microsecond precision data structure has been fully replaced by struct
timespec, which offers nanosecond precision. All kernel APIs use struct timespec
exclusively.
Sortix currently provides this structure for compatibility reasons.
sys/param.h
-----------
This is a BSD header that contains a bunch of BSD-specific stuff and other
miscellaneous junk. The GNU libc implementation contains some useless macros
that doesn't justify its existence. The header inclusion can often be deleted
without any problems, but older systems may require its inclusion.
sys/time.h
----------
You don't need this header and it'll be removed at some point. It is filled with
obsolete functions and macros. The only reason you might want it is to get the
declaration of struct timeval, but that data type has been replaced by struct
timespec.
Sortix currently provides this header for compatibility reasons.
sys/timeb.h
-----------
This is a header that contains the ftime function that has been replaced, this
header has been removed as well.
times
-----
This function is badly designed and the whole clock_t and sysconf(_SC_CLK_TCK)
business is insane. It doesn't help there is problem with potential overflowing
and the accuracy of the function varies between systems. You should avoid this
function in favor of clock_gettime and the Sortix extension clocks that provide
the same information as struct timespec. If you need the atomic semantics of
times, you can use the Sortix extension timens.
Sortix currently provides this function for compatibility reasons.
tmpnam
------
There is an inherently race condition prone and has thread safely issues with a
NULL argument. Use tmpfile() instead if you can do with a file whose name you do
not know. Unfortunately, Sortix has yet no satisfying temporary file creation
function that gives you a file and its name without having to deal with silly
template strings and other problems.
utime
-----
Use utimens instead, or perhaps the more portable utimensat.
Sortix currently provides this function for compatibility reasons.
utimes
------
Use utimens instead, or perhaps the more portable utimensat.

View File

@ -1,85 +0,0 @@
Portability Sins
================
Sortix makes use of third-party software. In many cases porting software and
integrating it into the Sortix ports is a fairly smooth ride. Unfortunately,
this is not always the case if the package is flawed. Such mistakes are usually
not intentional, but are simply accidents, rarely tested code cases or simply
the upstream being unaware of portability issues. We should identify such issues
and report them to the upstream projects.
This is a list of common problems that cause problems when integrating packages
into the Sortix ports build system. Almost all the issues listed here will tend
to get patched in Sortix as we want good ports, not fragile ports that we would
need all sorts of tricks to work around.
TODO: Potentially merge with cross-compilation-sins as a package-sins guide.
Cross-compilation issues
------------------------
See doc/cross-compilation-sins as well.
Don't be different for the sake of it
-------------------------------------
Pay respect to the traditions unless you are strictly better.
distclean is what goes into a release
-------------------------------------
When finishing it's useful to be able to reset the source tree to the state that
you got it in (i.e. no temporary build files left behind) so you can easily diff
it against the upstream tarball. Packages usually have a makefile target called
distclean that cleans the source directory for distribution, ideal for such
purposes. However, in some packages the distclean target doesn't actually do
that: It occasionally deletes files present in the upstream tarball while
leaving other files behind that wasn't in the upstream tarball. This is pretty
annoying. It makes the Sortix patches for a port harder to read as they are
filled with noise (generated XML files are fun), unless manual care is taken.
The ideal is that you can extract a tarball and run configure, make and finally
make distclean. The source directory should then be equal to what is in the
tarball. Otherwise the actual distribution wasn't actually distribution-clean.
Fun examples: Deleting the configure script upon distclean, deleting the license
files upon distclean, calling the target dist-clean instead of distclean.
DESTDIR comes from the environment
----------------------------------
It comes from the environment.
Use setenv instead of putenv
----------------------------
Use the system malloc
Print system types in a portable manner
---------------------------------------
Use the proper casts and large types or Sortix extensions.
64-bit and JIT
--------------
Don't assume that mmap() always returns below 4 GiB and that the distance
between any two memory mappings are always less than 2 GiB. There are no such
guarantees on 64-bit systems, yet many just-in-time virtual machines assumes
this is true and truncate pointers if it is not (leading to obscure crashes).
Don't use seemingly-unused bits in types
----------------------------------------
For instance, on x86-64 the address space is currently actually only 48-bit
and the most significant 16-bits must always equal the 47th bit. Some see this
as 16-bit perfectly usable bits for their own purposes. Don't do this, it's
crazy and you know it. This often comes up in more subtle cases such as telldir
that returns an opaque value that might have any bits set, but usually doesn't,
which looks like bits that can be re-purposed. That is, until the system changes
a bit and the package explodes.
Don't do crazy stuff
--------------------
Just don't.

View File

@ -1,480 +0,0 @@
Porting Guide
=============
This guide documents how to port software to the Sortix operating system and how
to release your port to the Sortix community. Before you get started, you should
get the system source code and the current core set of existing ports and be
comfortable with building the system (with ports) entirely from scratch.
Overview
--------
### `$SORTIX_TOPLEVEL` ###
This is the top-level source directory containing the system source code. This
is actually not a real environmental variable, but just something used in this
document to denote the top-level system source code directory. This is where you
have cloned the Sortix source repository.
### Source Tix ###
A source tix is simply a directory, whose name is the name of a package, and
which contains the source code for the package and a special `tixbuildinfo`
file, which contains instructions for building the source tix into a binary tix.
### `$SORTIX_PORTS_DIR` (default `$SORTIX_TOPLEVEL/ports`) ###
This directory is where the build system will search for source tixes that
will automatically be built along with the rest of the system. Any other files
and sub-directories will be ignored. You can use symbolic links to source tixes
if you wish. You integrate new packages into the build simply by simply putting
the source tix inside this directory as a sub-directory. It will automatically
be built along with the rest of the system during the next system build.
### `.srctix.tar.xz` (Archived Source Tix) ###
Since you cannot publish raw directories, published source tixes are put into
a compressed archive and given the extension `.srctix.tar.xz`. You can easily
install an archived source tix by extracting it using standard tools:
cd $SORTIX_PORTS_DIR &&
tar --extract --file libfoo.srctix.tar.xz
This will install the source tix into the source repository and it will
automatically be built the next time you compile the system and ports.
The archived source tix is simply a tarball that contains a single directory,
which is a source tix as described above.
### `.porttix.tar.xz` (Archived Port Tix) ###
Upstream releases of software cannot be expected to contain a `tixbuildinfo`
file and sometimes they need to be patched. When maintaining a port, it is often
useful to have a copy of the upstream release and the patches applied to it.
The `.porttix.tar.xz` archives contain a copy of the upstream release (as a
compressed archive) and all the patches applied to it. This can automatically be
converted into an archived source tix using the `srctix-create` program. Users
will normally not use this format unless they wish to inspect how a package was
ported or confirm that no malicious alternations were made to the upstream
release.
Can the package be ported?
--------------------------
It's a very good idea to examine the package closely before attempting to port
it, or you might end up wasting a lot of time on something that isn't even
possible in the first place. There's a number of red flags that can prevent the
successful porting of a package, at least not without enhancements to the tix
package management system or to Sortix itself.
The first thing to verify is whether we want such a package on Sortix. Not all
packages are good, some have bad licenses, some have security problems, or bad
code quality -- and so on. Perhaps there is a similar package already ported,
which is technically superior, and it's better to have just one such package on
the system for the sake of purity. Perhaps it's just better to leave this
package behind and focus on the pure Sortix future? Does the philosophy of the
package developers contradict that of the Sortix project?
The second thing to verify is the build system. If it uses GNU autoconf or a
compatible ./configure script things are looking good. If the package has a
custom hand-written ./configure script you will likely have trouble, as the
authors of these tend to be ignorant about many useful ./configure options and
likely don't properly support-cross-compilation. If the package uses some exotic
build system, you might need to write wrapper scripts or teach Tix how to deal
with such build systems. If the package just has a makefile, you will likely run
into trouble if it doesn't follow good makefile conventions and you might end up
heavily patching it or rolling your own makefile. In these bad cases, consider
whether we even want to port such a package to Sortix.
The third thing to check is whether it cross-compiles. A lot of software have
considerable problems with this, and while we are able to work around some of
these problems, sometimes it's just not feasible. It's probably worth searching
around the net to see if other people have cross-compiled it. Perhaps they ran
into similar problems - as you are about to have - but have a fix?
The fourth thing to verify is whether Sortix is ready. Perhaps it uses some API
that Sortix doesn't have yet or depend on kernel features that are missing?
Perhaps the package has dependencies that are not yet satisfies, because nobody
has ported all the dependencies yet. You can often check guides such as "Beyond
Linux from Scratch" which contains a lot of building instructions and
dependency information. Try ask around in the operating system development
community if anyone has ported it before and what their experience was.
Authoring a Source Tix
----------------------
The first step in porting software to Sortix is creating a working source tix
and building it along with the rest of the system. You will need to get a copy
of the software you wish to install. You will need to save a copy of this
original compressed archive in a safe place, as you will need it later when you
create an archived port tix for publishing.
In this example we will pretend to port a fictitious piece of software called
`libfoo`. The latest release of libfoo is released as a compressed tarball with
the filename `libfoo-0.42.tar.xz`. You will save a copy of this original tarball
in a safe location and then proceed to extract it into the `$SORTIX_PORTS_DIR`
directory. This will usually create a `libfoo-0.42` sub-directory, but you need
to rename it to simply `libfoo`.
The next step is to author a `libfoo/tixbuildinfo` file, if libfoo does not ship
with support for Sortix. You will need to examine the package and deduce what
it's build system is and write the file accordingly. As a minimum, you will need
to put this in the file (with no leading spaces):
tix.version=1
tix.class=srctix
pkg.name=libfoo
pkg.build-libraries=libbar libbaz libqux
This is a simple key-value format. You will need to set the `pkg.name` variable
to the exact name of the source tix. The `pkg.build-libraries` variable contains
the build-time dependencies of the package as a space-delimited set. This is the
common key-values that all `tixbuildinfo` files *must* contain. In addition,
they must also contain the `pkg.build-system` variable.
GNU configure scripts
---------------------
The Tix package management system is designed such that it is normally easy to
port a package using autoconf generated `./configure` scripts (or compatible).
In the best case, it will simply suffice to write:
pkg.build-system=configure
### config.sub ###
Most packages contain a copy of the config.sub shell script that recognizes the
platform triplets. While Sortix has been added to the upstream config.sub, some
packages still use an obsolete copy without it. In such cases we will need to
add it ourselves. You can simply search the line that contains the `-aos*`
operating system entry and append `-sortix*` to it:
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
If you don't do this, you will receive mysterious errors about that the package
doesn't know what Sortix is.
### Passing options and variables to configure and make ###
However, some packages are known to be silly and requires further tricks to be
ported. Fortunately, the `tixbuildinfo` file provides control of what arguments
and environmental variables are given to `./configure` and to make:
pkg.configure.args=--enable-bar --without-x
pkg.configure.vars=gt_cv_locale_fr=false gt_cv_locale_ja=false
pkg.make.vars=V=1
It is generally recommended to set V=1 when running Make, if the package is
silly and doesn't actually report the exact executed commands to the terminal
during the compilation. This often happens with packages that use libtool. The
exact used commands are valuable for debugging purposes, if you run into a
compile warning or a compile error.
### Building Out-Of-Directory ###
If the package requires being built outside of the main source directory, you
can easily enable this behaviour:
pkg.configure.use-build-directory=true
### Changing Make Targets ###
By default the make command will be run twice as `make all` and `make install`.
However, in some cases you would want to customize which targets are invoked:
pkg.make.build-target=all-libfoo
pkg.make.install-target=install-libfoo
### Post-Install Command ###
After the make install target has been run, you have the option of running a
custom command, with the working directory being the temporary staging
directory, before the package is fully packaged up. If you need to run multiple
commands at this point, you will need to wrap them in a shell script:
pkg.post-install.cmd=./srctix-post-install.sh
### `.la` files ###
Packages that use libtool have a nasty habit of installing `.la` files into the
system library directory. However, this format doesn't properly support
cross-compilation and have a number of other problems. The better choice is
simply to eradicate such files using a post build command:
pkg.post-install.cmd=tix-eradicate-libtool-la
You should check whether your port produces such `.la` files and use this post
build command if you see any.
### `--with-sysroot`, `--with-build-sysroot` ###
If the package supports the --with-sysroot configure option and it works
correctly for cross-compilation, then you can take advantage of it:
pkg.configure.with-sysroot=true
Otherwise the build system will simply communicate the correct system root to
the compiler through hidden environmental variables and other tricks (such as
the cross-compiler's default system root). If the package supports also the
--with-build-sysroot to support having one system-root at runtime and another
at build-time, then you should enable both options:
pkg.configure.with-sysroot=true
pkg.configure.with-build-sysroot=true
If you are in doubt whether this works, simply disable these options (they are
disabled by default) and the default system-root tricks will do just fine.
### Wrapping configure and make ###
If you are unlucky, the configure script is custom and doesn't support common
options or have other flaws. In that case you best yell a lot at the developers
and question whether we want to port such a package in the first place, if the
developers can't get the build system right. However, you can often work-around
such problems by wrapping the configure and make commands in custom shell
scripts:
pkg.configure.cmd=./srctix-configure.sh
pkg.make.cmd=./srctix-make.sh
You'll need to set the executable bit on these files and these scripts should
emulate the standard configure and make tools and do whatever magic to work
around the broken build system. This should be considered the last resort - you
should check if there are other key-values you can set that works around the
issue or whether patching the software solves the issue.
### CC, CXX ###
If the package somehow fails to detect the correct compiler from the `--build`,
`--host`, and `--target` configure options, but it honours the CC and CXX
environmental variables, then you can set these keys and they will be set:
pkg.make.needed-vars.CC=true
pkg.make.needed-vars.CXX=true
### DESTDIR ###
During the install phase, the DESTDIR environmental variable points to a
temporary staging directory, which the port *must* use as an additional prefix.
If the package does not honour this, please yell a lot at the developers and
question whether we want to port such a package in the first place. You can
possibly work around this by wrapping make and configure.
### make distclean ###
The source tix will automatically be cleaned whenever it is built. If you are
using the configure build system, then the `make distclean` target will be used.
There currently is no way to override this, but you can wrap the make command to
work-around this or add support to `tix-build` for configuration.
Simple Makefile
---------------
Tix can use a conventional Makefile with a default target and an install target.
pkg.build-system=makefile
The appropriate variables such as CC, CFLAGS, PREFIX, DESTDIR and such will be
set and must be honored from the environment.
Testing the Port
----------------
You can now proceed to attempt to compile your port. The simplest solution is
simply to rebuild the system along with all its ports, as usual. Keep in mind
that you will likely run into compile warnings or errors. It might be useful
to pass the `-O` or '--output-sync` option to Make to ensure the output is
consistent, even in the face of parallel execution - if you are using the -j
make option.
If everything goes well, congratulations, you just ported a piece of software to
Sortix. You should test it out and see if it works as expected and whether the
port can be improved -- be sure to follow the rest of the guide and publish it
to the Sortix community.
If things didn't work, it's time to troubleshoot and examine whether the port is
actually possible and what modifications will have to be made, as described in
the next section.
Porting the Software
--------------------
Alright, so things didn't work in the first try. Tough luck. A lot of packages
do the same silly things that makes it harder to port them. You'll have to be
creative to determine the correct strategy for completing the port, sometimes
you will have to implement features in Sortix or add some compatibility. Other
times, you can work around the build system or patch the software.
Try ask around and examine other archived port tixes and see their patches
reveal any useful advice on how to resolve the situation:
Here is a list of common problems:
### Configure fails ###
Try and examine the config.log file inside the build directory. At the bottom,
there is a dump of environmental variables, but just above it is information
about what particular test program failed.
If you examine the ./configure script closely, you will find that most checks
have an associated cache environmental variable. If a particular check fails
erroneously or isn't cross-compilation compatible, you can work around this
issue by modifying the `tixbuildinfo` file such that it declares these
environmental variables.
### Running cross-compiled programs ###
Some packages are silly and think they are always able to execute compiled test
programs, but this is inherently untrue for cross-compilation. Fortunately most
packages know better as cross-compilation is somewhat common. Still -- some
packages still do this, sometimes even as part of the check whether the compiler
works. The result is often that the process hangs, as Sortix executables are
Linux speak for "just hang and do nothing" in many cases. You'll have to fix the
package or somehow work around the problem. Don't forget to yell at the
developers of the package and question whether we really want it.
### Broken Locale Check ###
Some packages (like GNU tar) suffers from a defect where they scan for many
locales by running cross-compiled programs (see above). This can be worked
around by declaring the appropriate cache variables.
### Gnulib ###
Yuck! There's a lot of dirty hacks here and everybody has partial copies of it
integrated into the build system, but people rarely update such copies. As such,
it'll continue to be a pain to repeatedly work around. You should really check
existing ports and see if their patches solve this particular gnulib problem.
The problems here are often nasty, as gnulib occasionally wants to access libc
internals it has no business dealing with to work-around some obscure bug on
long-forgotten systems. You can probably safely `#if defined(__sortix__)` at the
relevant places where there seem to be no better solution.
You may even run into gnulib adding a warning to the gets(3) prototype telling
people to never use it. This ironically fails to compile on Sortix, which has no
gets(3) function in the first place.
### PATH_MAX ###
Sortix has no such limit and programs shouldn't rely on such a limit existing.
Nonetheless, sometimes it's easier to work-around the problem rather than really
fixing the problem:
#if defined(__sortix__) && !defined(PATH_MAX)
#define PATH_MAX 32768
#endif
### Other problems ###
There's lots of problems that can arise when porting packages. While Sortix
itself is at fault for many of them, as it is still young and much remains to be
implemented, a lot of problems is the direct result of poor packages with
cross-compilation problems or not adhering strictly enough to standards. It can
be useful to maintain a branch of the main system, which has had a number of
hacks applied for compatibility. Ideally, this allows the Sortix developers to
know what compatibility problems needs to be addressed. Indeed, many features
originally started out as compatibility hacks.
Be also sure to consult the `obsolete-stuff` document, as it enumerates a list
of problematic APIs that we'd like to remove or refuse to implement - and what
the modern replacement APIs are.
Publishing the Port
-------------------
Now that your port works, it's time to publish it and let the community enjoy
your work.
### Cleaning the Source Directory ###
Your source tix likely have a lot of left-over temporary files as the result of
the testing phase. We'll need to clean the source directory before proceeding:
cd $SORTIX_PORTS_DIR/libfoo &&
./configure &&
make distclean
Or perhaps you'll need to do something else. The important thing is that no
object files and other problematic binary files are left behind. If the source
tree is already configured, you can skip the ./configure step.
### Creating the Normalized Tree ###
Unfortunately, some upstream releases are not actually distcleaned. This is a
problem because the diff between the upstream release and your port will contain
a lot of garbage. We'll then proceed to create a normalized tree that you can
diff cleanly against.
cd $SORTIX_PORTS_DIR &&
tar --extract --file $THAT_SAFE_LOCATION/libfoo-0.42.tar.xz &&
mv libfoo-0.42 libfoo.normalized &
(cd libfoo.original && ./configure && colormake distclean)
This should hopefully ensure that the two trees should be identical, except the
few changes you had to make to port the package. Be mindful if the upstream
developers are silly and don't put a single directory in their tarballs. You can
then proceed to analyse the difference between the two trees:
diff -Naur libfoo.normalized libfoo
If everything went well, you should only see your changes. If there are other
changes, you should resolve the situation by deleting files from the normalized
tree, or by copying files from the normalized tree into the patched tree. Be
mindful that diff(1) and patch(1) doesn't preserve the executable bit. Don't put
a `tixbuildinfo` into the normalized tree, or it might unexpectedly become a
source tix.
### Creating the Archived Port Tix ###
The next step is to create the archived port tix, which contains the upstream
tarball and the patches done to it (including the normalization step). This file
allows others to easily review your port and ensure you have not made any
malicious changes. It will also allow others to recreate the normalized tree
and continue further development of the port. To create the archived port tix,
you simply have to invoke this command:
cd $SORTIX_PORTS_DIR &&
porttix-create --tarball $THAT_SAFE_LOCATION/libfoo-0.42.tar.xz \
--normalized libfoo.normalized \
libfoo
This will create a `libfoo.porttix.tar.xz` file, which is publishable. It is
not, however, ideal for simple extraction as a source tix.
### Creating the Archived Source Tix ###
In concept, it's easy to create an archived source tix: You simply tar up the
source tix you previously created. However, while it is easy to convert an
archived port tix into an archived source tix, it is not possible to go in the
other direction. It is recommended to create a port tix as it forces you to
carefully consider all the applied patches and is respectful to the community.
As mentioned, it is easy to convert the `.porttix.tar.xz` file into the desired
archived source tix:
srctix-create libfoo.porttix.tar.xz
This will create an suitable `libfoo.srctix.tar.xz` in the current directory,
which is an archive containing the normalized tree with all patches applied.
When reviewing, be sure to verify the included tarball in the archived port tix
is entirely identical to the upstream release byte-for-byte to avoid security
problems.
### Publishing ###
Now that you have completed your port and built the archived port tix, it is
time to share your work with the Sortix community. The simplest solution is
sending the archived port tix (not the archived source tix) to the Sortix
developers. They will then review your work and graciously publish your port
through the appropriate channels. Alternatively, you can upload the port tix and
the source tix to your own site and maintain it as a third party port.
Conclusion
----------
This should be a basic walk-through the process of porting a piece of software
to the Sortix operating system. Note how the porting facilities are experimental
and much is subject to change in the near future. Porting software is an
advanced topic and this documentation merely touches the more common situations
and surely important advice is missing from this documentation. It's always a
good idea to consult the Sortix developers for advice.

View File

@ -1,71 +0,0 @@
POSIX Divergence
================
The Sortix operating system cares about compatibility with existing software and
maintaining such software by purging obsolete stuff from the system. Sortix
recognizes the POSIX standard as valuable and embraces it rather than fighting
it. Nonetheless, we don't implement standards for the sake of standards, but for
the benefits we get from complying. Sometimes the standard mandates something
that is broken or we can do considerably better. In those cases it's best to
diverge and fix the design mistakes properly - but we must not forget there is
a considerable compatibility cost we must pay. Don't diverge unless there is a
good reason to and compatibility and an upgrade path must be considered.
That said, Sortix has diverged from full POSIX compliance in the hope such
decisions would be for the better. This document attempts to list where Sortix
has intentionally diverged from POSIX 2008. See doc/obsolete-stuff for a more
detailed rationale of why the interfaces are absent or scheduled for removal.
Mind that Sortix doesn't fully intend to implement the XSI option and violations
of that isn't listed here.
It is worth noting that some particular interfaces scheduled for removal will
likely take a very long time to phase out and wholly remove.
Mandated by POSIX but not implemented in Sortix
----
* POSIX advisory locks (fcntl, lockf) are not implemented.
* getpgrp is not implemented.
* <strings.h> has been merged into <string.h>.
* Numerous namespace violations (will be fixed or documented here).
* Numerous missing features (will be fixed or documented here).
Obsolescent in POSIX but not implemented in Sortix
----
* gets is not implemented (obsolescent in POSIX).
* tmpnam is not implemented (obsolescent in POSIX).
Mandated by POSIX and scheduled for Sortix removal
----
* select is scheduled for removal.
* struct timeval is scheduled for removal.
* times, <sys/times.h> is scheduled for removal.
Obsolescent in POSIX and scheduled for Sortix removal
---
* asctime and asctime_r are scheduled for removal (obsolescent in POSIX).
* ctime, ctime_r are scheduled for removal (obsolescent in POSIX).
* utime, <utime.h> are scheduled for removal (obsolescent in POSIX).
Signal Stacks
-------------
Threads are able to set a recursive signal handling stack using sigaltstack(2)
even if SS_ONSTACK is currently set - while POSIX mandates EPERM in this case.
Such a stack will be used for recursive signals (with SA_ONSTACK set) for the
duration of the signal handler. The original signal stack state will be restored
when the signal handler returns, any edit with sigaltstack will be temporary
(unless the saved ucontext is modified).
Timestamps
----------
The time_t values given by clock_gettime(CLOCK_REALTIME, ...) (and other system
interfaces built upon that) are the number of actual seconds that has passed
since 1970-01-01 00:00:00 UTC. This includes leap seconds, unlike the timestamps
mandated by POSIX. This has the advantage that time_t values are unambiguously
translate to a particular date and time and back and that the values are
continuous and adding an internal to a time_t value actually delays by that
interval. This has the unfortunate consequence that translating to and from
POSIX time requires subtracting the number of leap seconds that has occurred for
that time value. The standard library needs to get some utility functions for
doing such conversion.

View File

@ -1,7 +0,0 @@
You can view the documentation for new users by typing:
man user-guide
You can view the installation instructions by typing:
man installation

60
ports/ag/ag.patch Normal file
View File

@ -0,0 +1,60 @@
diff -Paur --no-dereference -- ag.upstream/config.sub ag/config.sub
--- ag.upstream/config.sub
+++ ag/config.sub
@@ -1373,7 +1373,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- ag.upstream/configure ag/configure
--- ag.upstream/configure
+++ ag/configure
@@ -4992,8 +4992,7 @@
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
- pthread_cleanup_push(routine, 0);
- pthread_cleanup_pop(0) /* ; */
+ /* ; */
;
return 0;
}
@@ -5216,7 +5215,7 @@
# Run CFLAGS="-pg" ./configure if you want debug symbols
-CFLAGS="$CFLAGS $PTHREAD_CFLAGS $PCRE_CFLAGS -Wall -Wextra -Wformat=2 -Wno-format-nonliteral -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -Wno-missing-braces -std=gnu89 -D_GNU_SOURCE -O2"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS $PCRE_CFLAGS -Wall -Wextra -Wformat=2 -Wno-format-nonliteral -Wshadow -Wpointer-arith -Wmissing-prototypes -Wno-missing-braces -std=gnu89 -D_GNU_SOURCE"
LDFLAGS="$LDFLAGS"
case $host in
diff -Paur --no-dereference -- ag.upstream/src/main.c ag/src/main.c
--- ag.upstream/src/main.c
+++ ag/src/main.c
@@ -69,8 +69,10 @@
GetSystemInfo(&si);
num_cores = si.dwNumberOfProcessors;
}
-#else
+#elif defined(_SC_NPROCESSORS_ONLN)
num_cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
+#else
+ num_cores = 1;
#endif
workers_len = num_cores < 8 ? num_cores : 8;
diff -Paur --no-dereference -- ag.upstream/src/options.c ag/src/options.c
--- ag.upstream/src/options.c
+++ ag/src/options.c
@@ -4,7 +4,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>

15
ports/ag/ag.port Normal file
View File

@ -0,0 +1,15 @@
NAME=ag
BUILD_LIBRARIES='libpcre libz xz'
VERSION=0.33.0
DISTNAME=the_silver_searcher-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=8ca680399df5ee8846a509c8a67c10ee1d5fc1a94456806a0ff9dd913b961db3
UPSTREAM_SITE=https://geoff.greer.fm/ag/releases
UPSTREAM_ARCHIVE=$ARCHIVE
RUNTIME_PROGRAMS=git
BUILD_SYSTEM=configure
CONFIGURE_ARGS=
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la
RELEASE_SEARCH_PAGE=https://geoff.greer.fm/ag/

1
ports/ag/ag.rmpatch Normal file
View File

@ -0,0 +1 @@
rm -rf -- 'the_silver_searcher.spec'

View File

@ -0,0 +1,18 @@
NAME=binutils
BUILD_LIBRARIES=gettext
VERSION=1.1-rc1
DISTNAME=sortix-binutils-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=c7ee1a05728882a2da6c2658d3cd3099e45525e3d3d0d9b29477ed0486f59f30
UPSTREAM_SITE=https://pub.sortix.org/sortix/toolchain
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_WITH_SYSROOT=true
CONFIGURE_WITH_SYSROOT_LD_BUG=true
CONFIGURE_WITH_BUILD_SYSROOT=true
CONFIGURE_ARGS=--disable-werror
CONFIGURE_USE_BUILD_DIRECTORY=true
MAKE_ARGS='tooldir="$(EXEC_PREFIX)"'
POST_INSTALL=../binutils.post-install
VERSION_REGEX='([0-9]+\.[0-9]+(\.[0-9]+)*(-rc[0-9]+)?)'

View File

@ -0,0 +1,9 @@
#!/bin/sh -e
tix-eradicate-libtool-la
programs=$(ls "$TIX_INSTALL_DIR$EXEC_PREFIX/bin")
for program in $programs; do
if [ ! -e "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/$TARGET-$program" ]; then
ln "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/$program" \
"$TIX_INSTALL_DIR$EXEC_PREFIX/bin/$TARGET-$program"
fi
done

270
ports/bison/bison.patch Normal file
View File

@ -0,0 +1,270 @@
diff -Paur --no-dereference -- bison.upstream/build-aux/config.sub bison/build-aux/config.sub
--- bison.upstream/build-aux/config.sub
+++ bison/build-aux/config.sub
@@ -1356,7 +1356,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- bison.upstream/configure bison/configure
--- bison.upstream/configure
+++ bison/configure
@@ -1,4 +1,122 @@
#! /bin/sh
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for GNU Bison 3.0.2.
#
diff -Paur --no-dereference -- bison.upstream/lib/spawn_faction_addclose.c bison/lib/spawn_faction_addclose.c
--- bison.upstream/lib/spawn_faction_addclose.c
+++ bison/lib/spawn_faction_addclose.c
@@ -22,10 +22,6 @@
#include <errno.h>
#include <unistd.h>
-#if !_LIBC
-# define __sysconf(open_max) getdtablesize ()
-#endif
-
#if !HAVE_WORKING_POSIX_SPAWN
# include "spawn_int.h"
#endif
@@ -37,7 +33,7 @@
int fd)
#undef posix_spawn_file_actions_addclose
{
- int maxfd = __sysconf (_SC_OPEN_MAX);
+ int maxfd = sysconf (_SC_OPEN_MAX);
/* Test for the validity of the file descriptor. */
if (fd < 0 || fd >= maxfd)
diff -Paur --no-dereference -- bison.upstream/lib/spawn_faction_adddup2.c bison/lib/spawn_faction_adddup2.c
--- bison.upstream/lib/spawn_faction_adddup2.c
+++ bison/lib/spawn_faction_adddup2.c
@@ -22,10 +22,6 @@
#include <errno.h>
#include <unistd.h>
-#if !_LIBC
-# define __sysconf(open_max) getdtablesize ()
-#endif
-
#if !HAVE_WORKING_POSIX_SPAWN
# include "spawn_int.h"
#endif
@@ -37,7 +33,7 @@
int fd, int newfd)
#undef posix_spawn_file_actions_adddup2
{
- int maxfd = __sysconf (_SC_OPEN_MAX);
+ int maxfd = sysconf (_SC_OPEN_MAX);
/* Test for the validity of the file descriptor. */
if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd)
diff -Paur --no-dereference -- bison.upstream/lib/spawn_faction_addopen.c bison/lib/spawn_faction_addopen.c
--- bison.upstream/lib/spawn_faction_addopen.c
+++ bison/lib/spawn_faction_addopen.c
@@ -22,10 +22,6 @@
#include <errno.h>
#include <unistd.h>
-#if !_LIBC
-# define __sysconf(open_max) getdtablesize ()
-#endif
-
#if !HAVE_WORKING_POSIX_SPAWN
# include "spawn_int.h"
#endif
@@ -38,7 +34,7 @@
mode_t mode)
#undef posix_spawn_file_actions_addopen
{
- int maxfd = __sysconf (_SC_OPEN_MAX);
+ int maxfd = sysconf (_SC_OPEN_MAX);
/* Test for the validity of the file descriptor. */
if (fd < 0 || fd >= maxfd)
diff -Paur --no-dereference -- bison.upstream/Makefile.in bison/Makefile.in
--- bison.upstream/Makefile.in
+++ bison/Makefile.in
@@ -2297,7 +2297,7 @@
# Obfuscate with a variable.
doc_bison = doc/bison
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
-CLEANDIRS = doc/bison.t2d doc/figs doc/html
+CLEANDIRS = doc/bison.t2d doc/html
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) \
@@ -4922,6 +4922,8 @@
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf examples/calc++/$(DEPDIR) examples/mfcalc/$(DEPDIR) examples/rpcalc/$(DEPDIR) lib/$(DEPDIR) lib/glthread/$(DEPDIR) lib/uniwidth/$(DEPDIR) src/$(DEPDIR)
+ -rm -f $(INFO_DEPS)
+ -rm -f $(CROSS_OPTIONS_TEXI)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-local distclean-tags
@@ -5145,22 +5147,28 @@
doc/refcard.pdf: doc/refcard.tex
$(AM_V_GEN) cd doc && pdftex $(abs_top_srcdir)/doc/refcard.tex
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
- $(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
- $(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
- $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
+ # PATCH: Nope! You can't run your programs after they have been potentially
+ # cross-compiled so don't even try!
+ #$(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
+ #$(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
+ #$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
+ touch $@
# Depend on configure to get version number changes.
$(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
- $(AM_V_GEN)$(HELP2MAN) \
- --include=$(top_srcdir)/doc/bison.x \
- --output=$@.t src/bison$(EXEEXT)
- $(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
- $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
- touch $@; \
- else \
- mv $@.t $@; \
- fi
- $(AM_V_at)rm -f $@*.t
+ # PATCH: Nope! You can't run your programs after they have been potentially
+ # cross-compiled so don't even try!
+ #$(AM_V_GEN)$(HELP2MAN) \
+ # --include=$(top_srcdir)/doc/bison.x \
+ # --output=$@.t src/bison$(EXEEXT)
+ #$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
+ # $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
+ # touch $@; \
+ #else \
+ # mv $@.t $@; \
+ #fi
+ #$(AM_V_at)rm -f $@*.t
+ touch $@
.gv.eps:
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`

11
ports/bison/bison.port Normal file
View File

@ -0,0 +1,11 @@
NAME=bison
BUILD_LIBRARIES='libstdc++? libiconv?'
VERSION=3.0.2
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=a2c3e8528bdb50567d6fa26deeb493dc5ccd7e277b865251608a9e43ac928f3c
UPSTREAM_SITE=https://ftp.gnu.org/gnu/bison
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
MAKE_VARS='V=1'

View File

@ -0,0 +1,4 @@
rm -rf -- 'doc/bison.info'
rm -rf -- 'doc/cross-options.texi'
rm -rf -- 'doc/stamp-vti'
rm -rf -- 'doc/version.texi'

239
ports/bochs/bochs.patch Normal file
View File

@ -0,0 +1,239 @@
diff -Paur --no-dereference -- bochs.upstream/config.sub bochs/config.sub
--- bochs.upstream/config.sub
+++ bochs/config.sub
@@ -1297,7 +1297,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- bochs.upstream/configure bochs/configure
--- bochs.upstream/configure
+++ bochs/configure
@@ -23755,7 +23755,7 @@
if test "$with_sdl" = yes; then
SOUNDLOW_OBJS="$SOUNDLOW_OBJS soundsdl.o"
if test "$bx_plugins" = 1; then
- SOUND_LINK_OPTS="$SOUND_LINK_OPTS `sdl-config --libs`"
+ SOUND_LINK_OPTS="$SOUND_LINK_OPTS `${PKG_CONFIG:-pkg-config} sdl --libs`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: sdl" >&5
$as_echo "sdl" >&6; }
@@ -24199,7 +24199,7 @@
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SDL)"
# GUI_*FLAGS are added to the compilation of every bochs file, not just
# the files in gui/*.cc.
- SDL_CFLAGS=`sdl-config --cflags`
+ SDL_CFLAGS=`${PKG_CONFIG:-pkg-config} sdl --cflags`
GUI_CFLAGS="$GUI_CFLAGS $SDL_CFLAGS"
GUI_CXXFLAGS="$GUI_CXXFLAGS $SDL_CFLAGS"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SDL)"
diff -Paur --no-dereference -- bochs.upstream/configure.in bochs/configure.in
--- bochs.upstream/configure.in
+++ bochs/configure.in
@@ -1805,7 +1805,7 @@
if test "$with_sdl" = yes; then
SOUNDLOW_OBJS="$SOUNDLOW_OBJS soundsdl.o"
if test "$bx_plugins" = 1; then
- SOUND_LINK_OPTS="$SOUND_LINK_OPTS `sdl-config --libs`"
+ SOUND_LINK_OPTS="$SOUND_LINK_OPTS `${PKG_CONFIG:-pkg-config} sdl --libs`"
fi
AC_MSG_RESULT(sdl)
else
@@ -2102,7 +2102,7 @@
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SDL)"
# GUI_*FLAGS are added to the compilation of every bochs file, not just
# the files in gui/*.cc.
- SDL_CFLAGS=`sdl-config --cflags`
+ SDL_CFLAGS=`${PKG_CONFIG:-pkg-config} sdl --cflags`
GUI_CFLAGS="$GUI_CFLAGS $SDL_CFLAGS"
GUI_CXXFLAGS="$GUI_CXXFLAGS $SDL_CFLAGS"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SDL)"
diff -Paur --no-dereference -- bochs.upstream/cpu/debugstuff.cc bochs/cpu/debugstuff.cc
--- bochs.upstream/cpu/debugstuff.cc
+++ bochs/cpu/debugstuff.cc
@@ -256,8 +256,8 @@
(unsigned) BX_CPU_THIS_PTR cr0.get32(),
(unsigned) BX_CPU_THIS_PTR cr2, (unsigned) BX_CPU_THIS_PTR cr3));
#else
- BX_INFO(("| CR0=0x%08x CR2=0x%08x",
- BX_CPU_THIS_PTR cr0.get32(), BX_CPU_THIS_PTR cr2));
+ BX_INFO(("| CR0=0x%08x CR2=0x%08jx",
+ BX_CPU_THIS_PTR cr0.get32(), (uintmax_t)BX_CPU_THIS_PTR cr2));
BX_INFO(("| CR3=0x%08x CR4=0x%08x",
(unsigned) BX_CPU_THIS_PTR cr3,
(unsigned) BX_CPU_THIS_PTR cr4.get32()));
diff -Paur --no-dereference -- bochs.upstream/cpu/fetchdecode.cc bochs/cpu/fetchdecode.cc
--- bochs.upstream/cpu/fetchdecode.cc
+++ bochs/cpu/fetchdecode.cc
@@ -2010,8 +2010,8 @@
#endif
}
else {
- BX_DEBUG(("%s: instruction not supported - signalling #UD (features bitmask: 0x%08x)",
- get_bx_opcode_name(ia_opcode), BX_CPU_THIS_PTR isa_extensions_bitmask));
+ BX_DEBUG(("%s: instruction not supported - signalling #UD (features bitmask: 0x%08jx)",
+ get_bx_opcode_name(ia_opcode), (uintmax_t)BX_CPU_THIS_PTR isa_extensions_bitmask));
}
exception(BX_UD_EXCEPTION, 0);
diff -Paur --no-dereference -- bochs.upstream/doc/docbook/Makefile.in bochs/doc/docbook/Makefile.in
--- bochs.upstream/doc/docbook/Makefile.in
+++ bochs/doc/docbook/Makefile.in
@@ -15,7 +15,7 @@
TARGZ = bochsdoc.tar.gz
RENDERED_DOC_URL = http://bochs.sf.net/doc/docbook/$(TARGZ)
-DESTDIR=
+DESTDIR?=
# name of the major documentation sections
SECTIONS=user documentation development
diff -Paur --no-dereference -- bochs.upstream/fpu/fpu.cc bochs/fpu/fpu.cc
--- bochs.upstream/fpu/fpu.cc
+++ bochs/fpu/fpu.cc
@@ -582,7 +582,7 @@
f *= fp.fraction*scale_factor;
#endif
float_class_t f_class = floatx80_class(fp);
- fprintf(stderr, "%sFP%d ST%d(%c): raw 0x%04x:%08lx%08lx (%.10f) (%s)\n",
+ fprintf(stderr, "%sFP%d ST%d(%c): raw 0x%04x:%08x%08x (%.10f) (%s)\n",
i==tos?"=>":" ", i, (i-tos)&7,
"v0se"[tag],
fp.exp & 0xffff, GET32H(fp.fraction), GET32L(fp.fraction),
diff -Paur --no-dereference -- bochs.upstream/gui/Makefile.in bochs/gui/Makefile.in
--- bochs.upstream/gui/Makefile.in
+++ bochs/gui/Makefile.in
@@ -69,7 +69,7 @@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS)
-GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs`
+GUI_LINK_OPTS_SDL = `$${PKG_CONFIG:-pkg-config} sdl --cflags --libs`
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
GUI_LINK_OPTS_RFB = @RFB_LIBS@
GUI_LINK_OPTS_AMIGAOS =
diff -Paur --no-dereference -- bochs.upstream/iodev/serial.cc bochs/iodev/serial.cc
--- bochs.upstream/iodev/serial.cc
+++ bochs/iodev/serial.cc
@@ -39,6 +39,18 @@
typedef int SOCKET;
#endif
+#if defined(__sortix__)
+struct hostent
+{
+ char *h_name;
+ char **h_aliases;
+ int h_addrtype;
+ int h_length;
+ char **h_addr_list;
+};
+#define gethostbyname(a) ((void) a, (struct hostent*) NULL)
+#endif
+
#include "iodev.h"
#include "serial.h"
@@ -462,9 +474,9 @@
memset ((char*) &sin, 0, sizeof (sin));
#if BX_HAVE_SOCKADDR_IN_SIN_LEN
- sin.sin_len = sizeof sin;
+ sin.sin_len = sizeof sin;
#endif
- memcpy ((char*) &(sin.sin_addr), hp->h_addr, hp->h_length);
+ memcpy ((char*) &(sin.sin_addr), hp->h_addr_list[0], hp->h_length);
sin.sin_family = hp->h_addrtype;
sin.sin_port = htons (port);
diff -Paur --no-dereference -- bochs.upstream/iodev/vgacore.cc bochs/iodev/vgacore.cc
--- bochs.upstream/iodev/vgacore.cc
+++ bochs/iodev/vgacore.cc
@@ -387,9 +387,9 @@
void bx_vgacore_c::determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth)
{
- int ai[0x20];
+ int ai[20];
int i,h,v;
- for (i = 0 ; i < 0x20 ; i++)
+ for (i = 0 ; i < 20 ; i++)
ai[i] = BX_VGA_THIS s.CRTC.reg[i];
h = (ai[1] + 1) * 8;
diff -Paur --no-dereference -- bochs.upstream/Makefile.in bochs/Makefile.in
--- bochs.upstream/Makefile.in
+++ bochs/Makefile.in
@@ -35,7 +35,7 @@
top_builddir = .
top_srcdir = $(srcdir)
-DESTDIR =
+DESTDIR ?=
VERSION=@VERSION@
VER_STRING=@VER_STRING@
@@ -96,7 +96,7 @@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS)
-GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs`
+GUI_LINK_OPTS_SDL = `$${PKG_CONFIG:-pkg-config} sdl --cflags --libs`
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
GUI_LINK_OPTS_RFB = @RFB_LIBS@
GUI_LINK_OPTS_AMIGAOS =
@@ -623,6 +623,8 @@
@CD_UP_THREE@
@RMCOMMAND@ Makefile
+distclean: dist-clean
+
###########################################
# Build app on MacOS X
###########################################
diff -Paur --no-dereference -- bochs.upstream/memory/misc_mem.cc bochs/memory/misc_mem.cc
--- bochs.upstream/memory/misc_mem.cc
+++ bochs/memory/misc_mem.cc
@@ -158,12 +158,12 @@
const Bit64u block_address = ((Bit64u)block)*BX_MEM_BLOCK_LEN;
if (fseeko64(BX_MEM_THIS overflow_file, block_address, SEEK_SET))
- BX_PANIC(("FATAL ERROR: Could not seek to 0x%lx in memory overflow file!", block_address));
+ BX_PANIC(("FATAL ERROR: Could not seek to 0x%llx in memory overflow file!", (unsigned long long) block_address));
// We could legitimately get an EOF condition if we are reading the last bit of memory.ram
if ((fread(BX_MEM_THIS blocks[block], BX_MEM_BLOCK_LEN, 1, BX_MEM_THIS overflow_file) != 1) &&
(!feof(BX_MEM_THIS overflow_file)))
- BX_PANIC(("FATAL ERROR: Could not read from 0x%lx in memory overflow file!", block_address));
+ BX_PANIC(("FATAL ERROR: Could not read from 0x%llx in memory overflow file!", (unsigned long long) block_address));
}
#endif
@@ -208,9 +208,9 @@
}
// Write swapped out block
if (fseeko64(BX_MEM_THIS overflow_file, address, SEEK_SET))
- BX_PANIC(("FATAL ERROR: Could not seek to 0x%llx in overflow file!", address));
+ BX_PANIC(("FATAL ERROR: Could not seek to 0x%llx in overflow file!", (unsigned long long)address));
if (1 != fwrite (BX_MEM_THIS blocks[BX_MEM_THIS next_swapout_idx], BX_MEM_BLOCK_LEN, 1, BX_MEM_THIS overflow_file))
- BX_PANIC(("FATAL ERROR: Could not write at 0x%llx in overflow file!", address));
+ BX_PANIC(("FATAL ERROR: Could not write at 0x%llx in overflow file!", (unsigned long long)address));
// Mark swapped out block
BX_MEM_THIS blocks[BX_MEM_THIS next_swapout_idx] = BX_MEM_C::swapped_out;
BX_MEM_THIS blocks[block] = buffer;
@@ -245,9 +245,9 @@
{
bx_phy_address address = ((bx_phy_address)idx)*BX_MEM_BLOCK_LEN;
if (fseeko64(fp, address, SEEK_SET))
- BX_PANIC(("FATAL ERROR: Could not seek to 0x%llx in overflow file!", address));
+ BX_PANIC(("FATAL ERROR: Could not seek to 0x%llx in overflow file!", (unsigned long long)address));
if (1 != fwrite (BX_MEM(0)->blocks[idx], BX_MEM_BLOCK_LEN, 1, fp))
- BX_PANIC(("FATAL ERROR: Could not write at 0x%llx in overflow file!", address));
+ BX_PANIC(("FATAL ERROR: Could not write at 0x%llx in overflow file!", (unsigned long long)address));
}
}
}

13
ports/bochs/bochs.port Normal file
View File

@ -0,0 +1,13 @@
NAME=bochs
BUILD_LIBRARIES='libstdc++ libiconv libSDL'
VERSION=2.6
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=65123e44a6d2c1148d741da025d16311b9ccd600ef268b911aba73c67eaf86e1
UPSTREAM_SITE=https://sourceforge.net/projects/bochs/files/bochs/$VERSION
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS='--with-sdl --enable-x86-64'
RELEASE_SEARCH_PAGE=https://sourceforge.net/projects/bochs/files/bochs/
RELEASE_SEARCH_REGEX='([0-9]+\.[0-9]+(\.[0-9]+)*)/'

View File

@ -0,0 +1 @@
chmod +x -- 'make.sortix'

129
ports/bzip2/bzip2.patch Normal file
View File

@ -0,0 +1,129 @@
diff -Paur --no-dereference -- bzip2.upstream/bzip2.c bzip2/bzip2.c
--- bzip2.upstream/bzip2.c
+++ bzip2/bzip2.c
@@ -72,7 +72,9 @@
# include <utime.h>
# include <unistd.h>
# include <sys/stat.h>
+#if !defined(__sortix__)
# include <sys/times.h>
+#endif
# define PATH_SEP '/'
# define MY_LSTAT lstat
diff -Paur --no-dereference -- bzip2.upstream/Makefile bzip2/Makefile
--- bzip2.upstream/Makefile
+++ bzip2/Makefile
@@ -25,6 +25,8 @@
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
+EXEC_PREFIX=$(PREFIX)
+DESTDIR=
OBJS= blocksort.o \
@@ -35,7 +37,7 @@
decompress.o \
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.a bzip2 bzip2recover
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
@@ -70,43 +72,43 @@
@cat words3
install: bzip2 bzip2recover
- if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
- if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
- if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
- cp -f bzip2 $(PREFIX)/bin/bzip2
- cp -f bzip2 $(PREFIX)/bin/bunzip2
- cp -f bzip2 $(PREFIX)/bin/bzcat
- cp -f bzip2recover $(PREFIX)/bin/bzip2recover
- chmod a+x $(PREFIX)/bin/bzip2
- chmod a+x $(PREFIX)/bin/bunzip2
- chmod a+x $(PREFIX)/bin/bzcat
- chmod a+x $(PREFIX)/bin/bzip2recover
- cp -f bzip2.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzip2.1
- cp -f bzlib.h $(PREFIX)/include
- chmod a+r $(PREFIX)/include/bzlib.h
- cp -f libbz2.a $(PREFIX)/lib
- chmod a+r $(PREFIX)/lib/libbz2.a
- cp -f bzgrep $(PREFIX)/bin/bzgrep
- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
- chmod a+x $(PREFIX)/bin/bzgrep
- cp -f bzmore $(PREFIX)/bin/bzmore
- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
- chmod a+x $(PREFIX)/bin/bzmore
- cp -f bzdiff $(PREFIX)/bin/bzdiff
- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
- chmod a+x $(PREFIX)/bin/bzdiff
- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzgrep.1
- chmod a+r $(PREFIX)/man/man1/bzmore.1
- chmod a+r $(PREFIX)/man/man1/bzdiff.1
- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+ if ( test ! -d $(DESTDIR)$(EXEC_PREFIX)/bin ) ; then mkdir -p $(DESTDIR)$(EXEC_PREFIX)/bin ; fi
+ if ( test ! -d $(DESTDIR)$(EXEC_PREFIX)/lib ) ; then mkdir -p $(DESTDIR)$(EXEC_PREFIX)/lib ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/share/man ) ; then mkdir -p $(DESTDIR)$(PREFIX)/share/man ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/share/man/man1 ) ; then mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/include ) ; then mkdir -p $(DESTDIR)$(PREFIX)/include ; fi
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bunzip2
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bzcat
+ cp -f bzip2recover $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2recover
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bunzip2
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzcat
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ chmod a+r $(DESTDIR)$(PREFIX)/share/man/man1/bzip2.1
+ cp -f bzlib.h $(DESTDIR)$(PREFIX)/include
+ chmod a+r $(DESTDIR)$(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(DESTDIR)$(EXEC_PREFIX)/lib
+ chmod a+r $(DESTDIR)$(EXEC_PREFIX)/lib/libbz2.a
+ cp -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzgrep
+ ln -s -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzegrep
+ ln -s -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzfgrep
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzgrep
+ cp -f bzmore $(DESTDIR)$(EXEC_PREFIX)/bin/bzmore
+ ln -s -f bzmore $(DESTDIR)$(EXEC_PREFIX)/bin/bzless
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzmore
+ cp -f bzdiff $(DESTDIR)$(EXEC_PREFIX)/bin/bzdiff
+ ln -s -f bzdiff $(DESTDIR)$(EXEC_PREFIX)/bin/bzcmp
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzdiff
+ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ chmod a+r $(DESTDIR)$(PREFIX)/share/man/man1/bzgrep.1
+ chmod a+r $(DESTDIR)$(PREFIX)/share/man/man1/bzmore.1
+ chmod a+r $(DESTDIR)$(PREFIX)/share/man/man1/bzdiff.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(PREFIX)/share/man/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(PREFIX)/share/man/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(DESTDIR)$(PREFIX)/share/man/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(DESTDIR)$(PREFIX)/share/man/man1/bzcmp.1
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \
diff -Paur --no-dereference -- bzip2.upstream/make.sortix bzip2/make.sortix
--- bzip2.upstream/make.sortix
+++ bzip2/make.sortix
@@ -0,0 +1,10 @@
+#!/bin/sh
+exec "$MAKE" "$@" \
+ PREFIX="$PREFIX" \
+ EXEC_PREFIX="$EXEC_PREFIX" \
+ DESTDIR="$DESTDIR" \
+ CC=${HOST}-gcc \
+ AR=${HOST}-ar \
+ RANLIB=${HOST}-ranlib \
+ BIGFILES= \
+#

11
ports/bzip2/bzip2.port Normal file
View File

@ -0,0 +1,11 @@
NAME=bzip2
BUILD_LIBRARIES=
VERSION=1.0.6
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
UPSTREAM_SITE=https://sourceware.org/pub/bzip2
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=sortix-usual-makefile
MAKE=./make.sortix

View File

@ -0,0 +1,3 @@
rm -rf -- 'manual.html'
rm -rf -- 'manual.pdf'
rm -rf -- 'manual.ps'

100
ports/cut/cut.patch Normal file
View File

@ -0,0 +1,100 @@
diff -Paur --no-dereference -- cut.upstream/cut.c cut/cut.c
--- cut.upstream/cut.c
+++ cut/cut.c
@@ -34,7 +34,7 @@
*/
#include <ctype.h>
-#include <err.h>
+#include <error.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
@@ -43,6 +43,13 @@
#include <string.h>
#include <unistd.h>
+#define err(eval, ...) error(eval, errno, __VA_ARGS__)
+#define errx(eval, ...) error(eval, 0, __VA_ARGS__)
+#define warn(...) error(0, errno, __VA_ARGS__)
+#define warnx(...) error(0, 0, __VA_ARGS__)
+
+#define _POSIX2_LINE_MAX 2048
+
int cflag;
char dchar;
int dflag;
@@ -65,7 +72,7 @@
dchar = '\t'; /* default delimiter is \t */
- /* Since we don't support multi-byte characters, the -c and -b
+ /* Since we don't support multi-byte characters, the -c and -b
options are equivalent, and the -n option is meaningless. */
while ((ch = getopt(argc, argv, "b:c:d:f:sn")) != -1)
switch(ch) {
@@ -187,6 +194,7 @@
void
c_cut(FILE *fp, char *fname)
{
+ (void)fname;
int ch, col;
char *pos;
@@ -215,13 +223,17 @@
void
f_cut(FILE *fp, char *fname)
{
+ (void)fname;
int ch, field, isdelim;
char *pos, *p, sep;
int output;
size_t len;
- char *lbuf, *tbuf;
+ ssize_t slen;
+ size_t lbuf_raw_length = 0;
+ char *lbuf = NULL, *tbuf;
- for (sep = dchar, tbuf = NULL; (lbuf = fgetln(fp, &len));) {
+ for (sep = dchar, tbuf = NULL; 0 <= (slen = getline(&lbuf, &lbuf_raw_length, fp));) {
+ len = slen;
output = 0;
if (lbuf[len - 1] != '\n') {
/* no newline at the end of the last line so add one */
@@ -272,6 +284,7 @@
}
if (tbuf)
free(tbuf);
+ free(lbuf);
}
void
diff -Paur --no-dereference -- cut.upstream/Makefile cut/Makefile
--- cut.upstream/Makefile
+++ cut/Makefile
@@ -0,0 +1,25 @@
+include ../../../build-aux/compiler.mak
+include ../../../build-aux/version.mak
+include ../../../build-aux/dirs.mak
+
+OPTLEVEL?=-g -O2
+CFLAGS?=$(OPTLEVEL)
+
+CFLAGS:=$(CXXFLAGS) -Wall -Wextra
+CPPFLAGS:=$(CPPFLAGS)
+
+BINARY:=cut
+
+all: $(BINARY)
+
+.PHONY: all install clean
+
+%: %.c
+ $(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBS)
+
+install: all
+ mkdir -p $(DESTDIR)$(BINDIR)
+ install $(BINARY) $(DESTDIR)$(BINDIR)
+
+clean:
+ rm -f $(BINARY)

11
ports/cut/cut.port Normal file
View File

@ -0,0 +1,11 @@
NAME=cut
BUILD_LIBRARIES=
VERSION=2014-02-02
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=c1b7374109b8eecaa344be8981297b5ec8cebfcdaab7804cf5d6d4be16f27ab8
UPSTREAM_SITE=https://pub.sortix.org/fork/cut
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=sortix-usual-makefile
VERSION_REGEX='([0-9]{4}-[0-9]{2}-[0-9]{2})'

218
ports/dash/dash.patch Normal file
View File

@ -0,0 +1,218 @@
diff -Paur --no-dereference -- dash.upstream/src/cd.c dash/src/cd.c
--- dash.upstream/src/cd.c
+++ dash/src/cd.c
@@ -252,7 +252,7 @@
STATIC char *
getpwd()
{
-#ifdef __GLIBC__
+#if defined(__GLIBC__) || defined(__sortix__)
char *dir = getcwd(0, 0);
if (dir)
diff -Paur --no-dereference -- dash.upstream/src/exec.c dash/src/exec.c
--- dash.upstream/src/exec.c
+++ dash/src/exec.c
@@ -151,6 +151,9 @@
STATIC void
tryexec(char *cmd, char **argv, char **envp)
{
+#if defined(__sortix__)
+ execvpe((const char*) cmd, argv, envp);
+#else
char *const path_bshell = _PATH_BSHELL;
repeat:
@@ -166,6 +169,7 @@
*argv = cmd = path_bshell;
goto repeat;
}
+#endif
}
diff -Paur --no-dereference -- dash.upstream/src/histedit.c dash/src/histedit.c
--- dash.upstream/src/histedit.c
+++ dash/src/histedit.c
@@ -32,7 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
diff -Paur --no-dereference -- dash.upstream/src/jobs.c dash/src/jobs.c
--- dash.upstream/src/jobs.c
+++ dash/src/jobs.c
@@ -40,7 +40,6 @@
#include <paths.h>
#endif
#include <sys/types.h>
-#include <sys/param.h>
#ifdef BSD
#include <sys/wait.h>
#include <sys/time.h>
@@ -207,7 +206,7 @@
mflag = on = 0;
goto close;
}
- if (pgrp == getpgrp())
+ if (pgrp == getpgid(0))
break;
killpg(0, SIGTTIN);
} while (1);
@@ -457,7 +456,7 @@
if (mode & SHOW_PGID) {
/* just output process (group) id of pipeline */
- outfmt(out, "%d\n", ps->pid);
+ outfmt(out, "%jd\n", (intmax_t) ps->pid);
return;
}
@@ -470,7 +469,7 @@
s[col - 2] = '-';
if (mode & SHOW_PID)
- col += fmtstr(s + col, 16, "%d ", ps->pid);
+ col += fmtstr(s + col, 16, "%jd ", (intmax_t) ps->pid);
psend = ps + jp->nprocs;
@@ -490,7 +489,7 @@
do {
/* for each process */
- col = fmtstr(s, 48, " |\n%*c%d ", indent, ' ', ps->pid) - 3;
+ col = fmtstr(s, 48, " |\n%*c%jd ", indent, ' ', (intmax_t) ps->pid) - 3;
start:
outfmt(
@@ -1136,7 +1135,7 @@
do {
gotsigchld = 0;
- err = wait3(status, flags, NULL);
+ err = waitpid(-1, status, flags);
if (err || !block)
break;
diff -Paur --no-dereference -- dash.upstream/src/Makefile.in dash/src/Makefile.in
--- dash.upstream/src/Makefile.in
+++ dash/src/Makefile.in
@@ -170,9 +170,9 @@
AM_CFLAGS = $(COMMON_CFLAGS)
AM_CPPFLAGS = $(COMMON_CPPFLAGS)
AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS)
-AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS)
+AM_CPPFLAGS_FOR_BUILD = -DBSD=1 -DSHELL -DIFS_BROKEN
COMPILE_FOR_BUILD = \
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \
+ unset HOST_SYSTEM_ROOT && $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \
$(CPPFLAGS_FOR_BUILD) \
$(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
@@ -542,7 +542,11 @@
info-am:
-install-data-am: install-man
+install-data-am: install-man install-proper-shells
+
+install-proper-shells:
+ mkdir -p "$(DESTDIR)$(sysconfdir)/proper-shells"
+ echo dash > "$(DESTDIR)$(sysconfdir)/proper-shells/dash"
install-dvi: install-dvi-am
diff -Paur --no-dereference -- dash.upstream/src/miscbltin.c dash/src/miscbltin.c
--- dash.upstream/src/miscbltin.c
+++ dash/src/miscbltin.c
@@ -37,7 +37,6 @@
*/
#include <sys/types.h> /* quad_t */
-#include <sys/param.h> /* BSD4_4 */
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
diff -Paur --no-dereference -- dash.upstream/src/output.c dash/src/output.c
--- dash.upstream/src/output.c
+++ dash/src/output.c
@@ -44,7 +44,6 @@
*/
#include <sys/types.h> /* quad_t */
-#include <sys/param.h> /* BSD4_4 */
#include <sys/ioctl.h>
#include <stdio.h> /* defines BUFSIZ */
diff -Paur --no-dereference -- dash.upstream/src/parser.c dash/src/parser.c
--- dash.upstream/src/parser.c
+++ dash/src/parser.c
@@ -32,10 +32,6 @@
* SUCH DAMAGE.
*/
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
#include <stdlib.h>
#include "shell.h"
@@ -1090,10 +1086,12 @@
if (len) {
char *str;
- str = alloca(len + 1);
+ str = ckmalloc(len + 1);
*(char *)mempcpy(str, p, len) = 0;
pushstring(str, NULL);
+
+ ckfree(str);
}
}
}
@@ -1300,7 +1298,7 @@
str = NULL;
savelen = out - (char *)stackblock();
if (savelen > 0) {
- str = alloca(savelen);
+ str = ckmalloc(savelen);
memcpy(str, stackblock(), savelen);
}
if (oldstyle) {
@@ -1400,6 +1398,7 @@
if (str) {
memcpy(out, str, savelen);
STADJUST(savelen, out);
+ ckfree(str);
}
USTPUTC(CTLBACKQ, out);
if (oldstyle)
diff -Paur --no-dereference -- dash.upstream/src/redir.c dash/src/redir.c
--- dash.upstream/src/redir.c
+++ dash/src/redir.c
@@ -34,7 +34,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/param.h> /* PIPE_BUF */
#include <signal.h>
#include <string.h>
#include <fcntl.h>
diff -Paur --no-dereference -- dash.upstream/src/shell.h dash/src/shell.h
--- dash.upstream/src/shell.h
+++ dash/src/shell.h
@@ -49,8 +49,6 @@
* a quit signal will generate a core dump.
*/
-#include <sys/param.h>
-
#ifndef JOBS
#define JOBS 1
#endif

10
ports/dash/dash.port Normal file
View File

@ -0,0 +1,10 @@
NAME=dash
BUILD_LIBRARIES=
VERSION=0.5.7
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=ae89fa9f1145b7748cf0740e1df04cd52fdf8a285da4911dd0f04983efba4e39
UPSTREAM_SITE='http://gondor.apana.org.au/~herbert/dash/files'
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure

View File

@ -0,0 +1,11 @@
NAME=diffutils
BUILD_LIBRARIES='libiconv? libintl?'
VERSION=3.8
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=a6bdd7d1b31266d11c4f4de6c1b748d4607ab0231af5188fc2533d0ae2438fec
UPSTREAM_SITE=https://ftp.gnu.org/gnu/diffutils
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
MAKE_VARS='V=1'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
NAME=e2fsprogs
BUILD_LIBRARIES='libiconv gettext'
VERSION=1.42.13
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=e16474b5a3a30f9197160c4b91bd48d5a463583049c0fcc405b6f0f7075aa0c7
UPSTREAM_SITE=https://kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$VERSION
UPSTREAM_ARCHIVE=$ARCHIVE
# Requires gettext (otherwise bundled copy is used)
BUILD_SYSTEM=configure
CONFIGURE_ARGS=--disable-e2initrd-helper
MAKE_ARGS='RDYNAMIC= V=1'
RELEASE_SEARCH_PAGE=https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
RELEASE_SEARCH_REGEX='v([0-9]+\.[0-9]+(\.[0-9]+)*)/'

View File

@ -0,0 +1 @@
rm -rf -- 'e2fsprogs.spec'

64
ports/ed/ed.patch Normal file
View File

@ -0,0 +1,64 @@
diff -Paur --no-dereference -- ed.upstream/main.c ed/main.c
--- ed.upstream/main.c
+++ ed/main.c
@@ -60,6 +60,10 @@
#include "ed.h"
+#if defined(__sortix__) && !defined(PATH_MAX)
+#define PATH_MAX 4096
+#endif
+
void signal_hup(int);
void signal_int(int);
void handle_winch(int);
@@ -129,8 +133,10 @@
int c, n;
int status = 0;
+#if 0
if (pledge("stdio rpath wpath cpath proc exec tty", NULL) == -1)
err(1, "pledge");
+#endif
home = getenv("HOME");
diff -Paur --no-dereference -- ed.upstream/Makefile ed/Makefile
--- ed.upstream/Makefile
+++ ed/Makefile
@@ -0,0 +1,35 @@
+include ../../../build-aux/platform.mak
+include ../../../build-aux/compiler.mak
+include ../../../build-aux/version.mak
+include ../../../build-aux/dirs.mak
+
+OPTLEVEL?=$(DEFAULT_OPTLEVEL)
+CFLAGS?=$(OPTLEVEL)
+
+CFLAGS:=$(CXXFLAGS) -Wall -Wextra -Wno-logical-not-parentheses -Wno-unused-parameter
+CPPFLAGS:=$(CPPFLAGS) -DBACKWARDS
+
+PROGRAM=ed
+MANPAGE=ed.1
+
+OBJS=buf.o glbl.o io.o main.o re.o sub.o undo.o
+
+.PHONY: all
+all: $(PROGRAM)
+
+$(PROGRAM): $(OBJS)
+ $(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS)
+
+%: %.c
+ $(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBS)
+
+.PHONY: clean
+clean:
+ rm -f $(PROGRAM) $(OBJS)
+
+.PHONY: install
+install: all
+ mkdir -p $(DESTDIR)$(BINDIR)
+ install $(PROGRAM) $(DESTDIR)$(BINDIR)
+ mkdir -p $(DESTDIR)$(MANDIR)/man1
+ install $(MANPAGE) $(DESTDIR)$(MANDIR)/man1

11
ports/ed/ed.port Normal file
View File

@ -0,0 +1,11 @@
NAME=ed
BUILD_LIBRARIES=
VERSION=2016-10-11
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=c6a46496473b6982f1f4a92ec09b3216c7d9a690aa5675f4ced12ec5a21a1164
UPSTREAM_SITE=https://pub.sortix.org/fork/ed
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=makefile
VERSION_REGEX='([0-9]{4}-[0-9]{2}-[0-9]{2})'

634
ports/emacs/emacs.patch Normal file
View File

@ -0,0 +1,634 @@
diff -Paur --no-dereference -- emacs.upstream/configure emacs/configure
--- emacs.upstream/configure
+++ emacs/configure
@@ -1,4 +1,124 @@
#! /bin/sh
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes # Not needed since February 2015
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypotl_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
+export ac_cv_func_realloc_0_nonnull=yes # TODO: Investigate this, found in flex.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for GNU Emacs 26.2.
#
@@ -626,6 +746,7 @@
ac_header_list=
gl_getopt_required=POSIX
ac_subst_vars='gltests_LTLIBOBJS
+cross_compiling
gltests_LIBOBJS
gl_LTLIBOBJS
gl_LIBOBJS
@@ -3979,11 +4100,11 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_MAKE" >&5
$as_echo "$ac_cv_path_MAKE" >&6; }
-$ac_path_MAKE_found || {
-as_fn_error $? "Building Emacs requires GNU Make, at least version 3.81.
-If you have it installed under another name, configure with 'MAKE=...'.
-For example, run '$0 MAKE=gnu-make'." "$LINENO" 5
-}
+#$ac_path_MAKE_found || {
+#as_fn_error $? "Building Emacs requires GNU Make, at least version 3.81.
+#If you have it installed under another name, configure with 'MAKE=...'.
+#For example, run '$0 MAKE=gnu-make'." "$LINENO" 5
+#}
MAKE=$ac_cv_path_MAKE
export MAKE
@@ -4791,6 +4912,11 @@
opsys=openbsd
;;
+ ## Sortix ports
+ *-sortix)
+ opsys=sortix
+ ;;
+
## Apple Darwin / macOS
*-apple-darwin* )
case "${canonical}" in
@@ -9190,6 +9316,7 @@
test "x$CANNOT_DUMP" = "x" && CANNOT_DUMP=no
case "$opsys" in
nacl) CANNOT_DUMP=yes ;;
+ sortix) CANNOT_DUMP=yes ;;
esac
if test "$CANNOT_DUMP" = "yes"; then
@@ -11306,8 +11433,8 @@
fi
# Does the opsystem file prohibit the use of the GNU malloc?
-# Assume not, until told otherwise.
-GNU_MALLOC=yes
+GNU_MALLOC_reason=" because that would undermine the system malloc's improvements"
+GNU_MALLOC=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc is Doug Lea style" >&5
$as_echo_n "checking whether malloc is Doug Lea style... " >&6; }
@@ -15813,8 +15940,10 @@
test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
fi
-test "${with_gnutls}" != "no" && test "${HAVE_GNUTLS}" != "yes" &&
- MISSING="$MISSING gnutls" && WITH_NO="$WITH_NO --with-gnutls=no"
+# PATCH: Emacs works without libgnutls and there's an option --with-gnutls=no,
+# so this hard error is just in the way, so this patch removes the error.
+#test "${with_gnutls}" != "no" && test "${HAVE_GNUTLS}" != "yes" &&
+# MISSING="$MISSING gnutls" && WITH_NO="$WITH_NO --with-gnutls=no"
if test "X${MISSING}" != X; then
as_fn_error $? "The following required libraries were not found:
$MISSING
@@ -18588,7 +18717,7 @@
;;
- gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
+ gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl | sortix )
if test "x$ac_cv_func_grantpt" = xyes; then
$as_echo "#define UNIX98_PTYS 1" >>confdefs.h
@@ -18598,7 +18727,7 @@
$as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, \"%s\", ptyname); }" >>confdefs.h
if test "x$ac_cv_func_posix_openpt" = xyes; then
- $as_echo "#define PTY_OPEN do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)" >>confdefs.h
+ $as_echo "#define PTY_OPEN do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); } while (false)" >>confdefs.h
$as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
diff -Paur --no-dereference -- emacs.upstream/lib-src/emacsclient.c emacs/lib-src/emacsclient.c
--- emacs.upstream/lib-src/emacsclient.c
+++ emacs/lib-src/emacsclient.c
@@ -1008,7 +1008,8 @@
}
server->sin_family = AF_INET;
- server->sin_addr.s_addr = inet_addr (dotted);
+ /* PATCH: Sortix only has the modern inet_pton. */
+ inet_pton (AF_INET, dotted, &server->sin_addr.s_addr);
server->sin_port = htons (atoi (port));
if (! fread (authentication, AUTH_KEY_LENGTH, 1, config))
@@ -1029,13 +1030,18 @@
struct sockaddr_in server;
struct linger l_arg = {1, 1};
char auth_string[AUTH_KEY_LENGTH + 1];
+ char addr[INET_ADDRSTRLEN];
if (! get_server_config (local_server_file, &server, auth_string))
return INVALID_SOCKET;
- if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet)
- message (false, "%s: connected to remote socket at %s\n",
- progname, inet_ntoa (server.sin_addr));
+ /* PATCH: Sortix doesn't have inet_addr and this is a constant anyway. */
+ if (server.sin_addr.s_addr != INADDR_LOOPBACK && !quiet)
+ {
+ inet_ntop (AF_INET, &server.sin_addr, addr, sizeof(addr));
+ message (false, "%s: connected to remote socket at %s\n",
+ progname, addr);
+ }
/* Open up an AF_INET socket. */
if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
@@ -1179,7 +1185,7 @@
handle_sigcont (int signalnum)
{
int old_errno = errno;
- pid_t pgrp = getpgrp ();
+ pid_t pgrp = getpgid (0);
pid_t tcpgrp = tcgetpgrp (1);
if (tcpgrp == pgrp)
@@ -1704,7 +1710,7 @@
#ifndef WINDOWSNT
if (tty)
{
- pid_t pgrp = getpgrp ();
+ pid_t pgrp = getpgid (0);
pid_t tcpgrp = tcgetpgrp (1);
if (0 <= tcpgrp && tcpgrp != pgrp)
kill (-pgrp, SIGTTIN);
diff -Paur --no-dereference -- emacs.upstream/lib-src/Makefile.in emacs/lib-src/Makefile.in
--- emacs.upstream/lib-src/Makefile.in
+++ emacs/lib-src/Makefile.in
@@ -20,13 +20,20 @@
SHELL = @SHELL@
+cross_compiling = @cross_compiling@
+
# Following ../lisp/Makefile.in.
+ifeq ($(cross_compiling),yes)
+EMACS = emacs
+else
EMACS = ../src/emacs${EXEEXT}
+endif
EMACSOPT = -batch --no-site-file --no-site-lisp
# ==================== Things 'configure' will edit ====================
CC=@CC@
+CC_FOR_BUILD?=cc
CFLAGS=@CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
@@ -389,7 +396,7 @@
$(NTLIB) $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o $@
make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
- $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@
+ $(AM_V_CCLD)$(CC_FOR_BUILD) -std=gnu11 ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@
movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
diff -Paur --no-dereference -- emacs.upstream/lib-src/movemail.c emacs/lib-src/movemail.c
--- emacs.upstream/lib-src/movemail.c
+++ emacs/lib-src/movemail.c
@@ -58,7 +58,9 @@
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef MAIL_USE_FLOCK
#include <sys/file.h>
+#endif
#include <stdlib.h>
#include <errno.h>
#include <time.h>
@@ -76,6 +78,10 @@
#include "pop.h"
#endif
+#if defined(__sortix__)
+#define setregid(a, b) (0 <= (a) ? setgid(a) : setgid(b))
+#endif
+
#ifdef MSDOS
#undef access
#endif /* MSDOS */
diff -Paur --no-dereference -- emacs.upstream/lib-src/pop.c emacs/lib-src/pop.c
--- emacs.upstream/lib-src/pop.c
+++ emacs/lib-src/pop.c
@@ -240,7 +240,11 @@
{
if (! (flags & POP_NO_GETPASS))
{
+#if defined(__sortix__)
+ password = NULL;
+#else
password = getpass ("Enter POP password:");
+#endif
}
if (! password)
{
diff -Paur --no-dereference -- emacs.upstream/lisp/Makefile.in emacs/lisp/Makefile.in
--- emacs.upstream/lisp/Makefile.in
+++ emacs/lisp/Makefile.in
@@ -56,7 +56,12 @@
# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier. If we need to change
# directory, we can use emacs --chdir.
+cross_compiling = @cross_compiling@
+ifeq ($(cross_compiling),yes)
+EMACS = emacs
+else
EMACS = ../src/emacs${EXEEXT}
+endif
# Command line flags for Emacs.
@@ -458,6 +463,7 @@
distclean:
-rm -f ./Makefile $(lisp)/loaddefs.el~
+ -rm -f leim/leim-list.el
maintainer-clean: distclean bootstrap-clean
rm -f TAGS
diff -Paur --no-dereference -- emacs.upstream/Makefile.in emacs/Makefile.in
--- emacs.upstream/Makefile.in
+++ emacs/Makefile.in
@@ -687,9 +687,6 @@
dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \
(cd "$${thisdir}"; \
${INSTALL_DATA} ${mansrcdir}/$${page} "$(DESTDIR)${man1dir}/$${dest}"); \
- [ -n "${GZIP_PROG}" ] || continue ; \
- rm -f "$(DESTDIR)${man1dir}/$${dest}.gz"; \
- ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
done
## Install those items from etc/ that need to end up elsewhere.
@@ -712,16 +709,7 @@
${srcdir}/etc/emacs.appdata.xml > $${tmp}; \
${INSTALL_DATA} $${tmp} "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"; \
rm -f $${tmp}
- umask 022; $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
- tmp=etc/emacs.tmpservice; rm -f $${tmp}; \
- client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
- sed -e '/^##/d' \
- -e "/^Documentation/ s/emacs(1)/${EMACS_NAME}(1)/" \
- -e "/^ExecStart/ s|emacs|${bindir}/${EMACS}|" \
- -e "/^ExecStop/ s|emacsclient|${bindir}/$${client_name}|" \
- ${srcdir}/etc/emacs.service > $${tmp}; \
- $(INSTALL_DATA) $${tmp} "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"; \
- rm -f $${tmp}
+ # Patch: Don't install systemd emacs.service.
thisdir=`/bin/pwd`; \
cd ${iconsrcdir} || exit 1; umask 022 ; \
for dir in */*/apps */*/mimetypes; do \
diff -Paur --no-dereference -- emacs.upstream/src/buffer.c emacs/src/buffer.c
--- emacs.upstream/src/buffer.c
+++ emacs/src/buffer.c
@@ -22,7 +22,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff -Paur --no-dereference -- emacs.upstream/src/callproc.c emacs/src/callproc.c
--- emacs.upstream/src/callproc.c
+++ emacs/src/callproc.c
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <unistd.h>
-#include <sys/file.h>
#include <fcntl.h>
#include "lisp.h"
diff -Paur --no-dereference -- emacs.upstream/src/doc.c emacs/src/doc.c
--- emacs.upstream/src/doc.c
+++ emacs/src/doc.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <sys/types.h>
-#include <sys/file.h> /* Must be after sys/types.h for USG. */
#include <fcntl.h>
#include <unistd.h>
diff -Paur --no-dereference -- emacs.upstream/src/emacs.c emacs/src/emacs.c
--- emacs.upstream/src/emacs.c
+++ emacs/src/emacs.c
@@ -25,7 +25,6 @@
#include <fcntl.h>
#include <stdlib.h>
-#include <sys/file.h>
#include <unistd.h>
#include <close-stream.h>
@@ -2081,7 +2080,7 @@
/* If we are controlling the terminal, reset terminal modes. */
#ifndef DOS_NT
{
- pid_t pgrp = getpgrp ();
+ pid_t pgrp = getpgid (0);
pid_t tpgrp = tcgetpgrp (0);
if ((tpgrp != -1) && tpgrp == pgrp)
{
diff -Paur --no-dereference -- emacs.upstream/src/filelock.c emacs/src/filelock.c
--- emacs.upstream/src/filelock.c
+++ emacs/src/filelock.c
@@ -33,7 +33,6 @@
#include <pwd.h>
#endif
-#include <sys/file.h>
#include <fcntl.h>
#include <unistd.h>
diff -Paur --no-dereference -- emacs.upstream/src/fns.c emacs/src/fns.c
--- emacs.upstream/src/fns.c
+++ emacs/src/fns.c
@@ -4526,7 +4526,8 @@
else if (FLOATP (args[i]) && 0 < (float) (XFLOAT_DATA (args[i]) - 1))
rehash_size = (float) (XFLOAT_DATA (args[i]) - 1);
else
- signal_error ("Invalid hash table rehash size", args[i]);
+ /*signal_error ("Invalid hash table rehash size", args[i]);*/
+ rehash_size = make_float (DEFAULT_REHASH_SIZE);
/* Look for `:rehash-threshold THRESHOLD'. */
i = get_key_arg (QCrehash_threshold, nargs, args, used);
@@ -4534,7 +4535,8 @@
: !FLOATP (args[i]) ? 0
: (float) XFLOAT_DATA (args[i]));
if (! (0 < rehash_threshold && rehash_threshold <= 1))
- signal_error ("Invalid hash table rehash threshold", args[i]);
+ /*signal_error ("Invalid hash table rehash threshold", args[i]);*/
+ rehash_threshold = make_float (DEFAULT_REHASH_THRESHOLD);
/* Look for `:weakness WEAK'. */
i = get_key_arg (QCweakness, nargs, args, used);
diff -Paur --no-dereference -- emacs.upstream/src/keyboard.c emacs/src/keyboard.c
--- emacs.upstream/src/keyboard.c
+++ emacs/src/keyboard.c
@@ -7073,7 +7073,7 @@
return 0;
if (n_to_read > sizeof cbuf)
n_to_read = sizeof cbuf;
-#elif defined USG || defined CYGWIN
+#elif defined USG || defined CYGWIN || defined (__sortix__)
/* Read some input if available, but don't wait. */
n_to_read = sizeof cbuf;
fcntl (fileno (tty->input), F_SETFL, O_NONBLOCK);
@@ -7107,7 +7107,7 @@
#endif
#ifndef USABLE_FIONREAD
-#if defined (USG) || defined (CYGWIN)
+#if defined (USG) || defined (CYGWIN) || defined (__sortix__)
fcntl (fileno (tty->input), F_SETFL, 0);
#endif /* USG or CYGWIN */
#endif /* no FIONREAD */
diff -Paur --no-dereference -- emacs.upstream/src/lread.c emacs/src/lread.c
--- emacs.upstream/src/lread.c
+++ emacs/src/lread.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/file.h>
#include <errno.h>
#include <math.h>
#include <stat-time.h>
diff -Paur --no-dereference -- emacs.upstream/src/Makefile.in emacs/src/Makefile.in
--- emacs.upstream/src/Makefile.in
+++ emacs/src/Makefile.in
@@ -25,6 +25,8 @@
SHELL = @SHELL@
+cross_compiling = @cross_compiling@
+
# Here are the things that we expect ../configure to edit.
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
srcdir = @srcdir@
@@ -501,7 +503,11 @@
## in practice this rule was always run anyway.
$(srcdir)/macuvs.h $(lispsource)/international/charprop.el: \
bootstrap-emacs$(EXEEXT) FORCE
+ifeq ($(cross_compiling),yes)
+ $(MAKE) -C ../admin/unidata all EMACS=emacs
+else
$(MAKE) -C ../admin/unidata all EMACS="../$(bootstrap_exe)"
+endif
## We require charprop.el to exist before ucs-normalize.el is
## byte-compiled, because ucs-normalize.el needs to load 2 uni-*.el files.
diff -Paur --no-dereference -- emacs.upstream/src/process.c emacs/src/process.c
--- emacs.upstream/src/process.c
+++ emacs/src/process.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h> /* Some typedefs are used in sys/file.h. */
-#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
@@ -2821,7 +2820,7 @@
#ifdef SO_BINDTODEVICE
case SOPT_IFNAME:
{
- char devname[IFNAMSIZ + 1];
+ char devname[IF_NAMESIZE + 1];
/* This is broken, at least in the Linux 2.4 kernel.
To unbind, the arg must be a zero integer, not the empty string.
@@ -2830,13 +2829,13 @@
if (STRINGP (val))
{
char *arg = SSDATA (val);
- int len = min (strlen (arg), IFNAMSIZ);
+ int len = min (strlen (arg), IF_NAMESIZE);
memcpy (devname, arg, len);
}
else if (!NILP (val))
error ("Bad option value for %s", name);
ret = setsockopt (s, sopt->optlevel, sopt->optnum,
- devname, IFNAMSIZ);
+ devname, IF_NAMESIZE);
break;
}
#endif
diff -Paur --no-dereference -- emacs.upstream/src/sysdep.c emacs/src/sysdep.c
--- emacs.upstream/src/sysdep.c
+++ emacs/src/sysdep.c
@@ -87,8 +87,6 @@
#include "msdos.h"
#endif
-#include <sys/param.h>
-#include <sys/file.h>
#include <fcntl.h>
#include "systty.h"
@@ -96,7 +94,6 @@
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
-#include <memory.h>
#endif /* HAVE_SYS_UTSNAME_H */
#include "keyboard.h"
@@ -529,7 +526,9 @@
#ifdef OLCUC
s.main.c_oflag &= ~OLCUC; /* Disable upcasing on output. */
#endif
+#ifdef TAB3
s.main.c_oflag &= ~TAB3; /* Disable tab expansion */
+#endif
s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */
s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */
s.main.c_cc[VKILL] = CDISABLE; /* disable kill processing */
@@ -877,7 +876,7 @@
void
init_foreground_group (void)
{
- pid_t pgrp = getpgrp ();
+ pid_t pgrp = getpgid (0);
inherited_pgroup = getpid () == pgrp ? 0 : pgrp;
}
@@ -1120,7 +1119,9 @@
tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */
tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL
on output */
+#ifdef TAB3
tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */
+#endif
#ifdef CS8
if (tty_out->meta_key)
{
diff -Paur --no-dereference -- emacs.upstream/src/term.c emacs/src/term.c
--- emacs.upstream/src/term.c
+++ emacs/src/term.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
-#include <sys/file.h>
#include <sys/time.h>
#include <unistd.h>

17
ports/emacs/emacs.port Normal file
View File

@ -0,0 +1,17 @@
NAME=emacs
BUILD_LIBRARIES='libcurses libcairo? libdbus? libfontconfig? libfreetype? libgconf? libgif? libgnutls? libgobject-introspection? libgpm? libgtk? libjpeg? liblcms2? libMagick? libm17t? libotf? libpng? librsvg? libtiff? libxml2? libxpm? libz?'
VERSION=26.2
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=151ce69dbe5b809d4492ffae4a4b153b2778459de6deb26f35691e1281a9c58e
UPSTREAM_SITE=https://ftp.gnu.org/gnu/emacs
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
USE_BOOTSTRAP=true
CONFIGURE_ARGS=--without-x
MAKE_VARS='V=1'
POST_INSTALL=../emacs.post-install
BOOTSTRAP_BUILD_SYSTEM=configure
BOOTSTRAP_CONFIGURE_ARGS=--without-x
BOOTSTRAP_MAKE_VARS='V=1'

4
ports/emacs/emacs.post-install Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
set -e
cd "$TIX_INSTALL_DIR/$PREFIX"
find -type f -name '*.el.gz' -delete

View File

@ -0,0 +1,8 @@
rm -rf -- 'admin/charsets/charsets.stamp'
rm -rf -- 'admin/charsets/jisx2131-filter'
rm -rf -- 'admin/unidata/unidata-gen.elc'
rm -rf -- 'admin/unidata/unidata.txt'
rm -rf -- 'admin/unidata/uvs.elc'
rm -rf -- 'etc/charsets/JISX2131.map'
rm -rf -- 'lisp/leim/leim-list.el'
rm -rf -- 'src/emacs-module.h'

198
ports/ffmpeg/ffmpeg.patch Normal file
View File

@ -0,0 +1,198 @@
diff -Paur --no-dereference -- ffmpeg.upstream/configure ffmpeg/configure
--- ffmpeg.upstream/configure
+++ ffmpeg/configure
@@ -81,10 +81,12 @@
--disable-logging do not log configure debug information
--fatal-warnings fail if any configure warning is generated
--prefix=PREFIX install in PREFIX [$prefix_default]
- --bindir=DIR install binaries in DIR [PREFIX/bin]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+ --bindir=DIR install binaries in DIR [EPREFIX/bin]
--datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
--docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
- --libdir=DIR install libs in DIR [PREFIX/lib]
+ --libdir=DIR install libs in DIR [EPREFIX/lib]
--shlibdir=DIR install shared libs in DIR [LIBDIR]
--incdir=DIR install includes in DIR [PREFIX/include]
--mandir=DIR install man page in DIR [PREFIX/share/man]
@@ -770,7 +772,9 @@
set_default(){
for opt; do
- eval : \${$opt:=\$${opt}_default}
+ if [ -z "$(eval "echo \${${opt}_set}")" ]; then
+ eval : \${$opt:=\$${opt}_default}
+ fi
done
}
@@ -2444,6 +2448,8 @@
"
PATHS_LIST="
+ prefix
+ exec_prefix
bindir
datadir
docdir
@@ -2462,6 +2468,7 @@
arch
as
assert_level
+ build
build_suffix
cc
objcc
@@ -2474,6 +2481,7 @@
env
extra_version
gas
+ host
host_cc
host_cflags
host_extralibs
@@ -2500,6 +2508,7 @@
sws_max_filter_size
sysinclude
sysroot
+ target
target_exec
target_os
target_path
@@ -3714,11 +3723,12 @@
# installation paths
prefix_default="/usr/local"
-bindir_default='${prefix}/bin'
+exec_prefix_default='${prefix}'
+bindir_default='${exec_prefix}/bin'
datadir_default='${prefix}/share/ffmpeg'
docdir_default='${prefix}/share/doc/ffmpeg'
incdir_default='${prefix}/include'
-libdir_default='${prefix}/lib'
+libdir_default='${exec_prefix}/lib'
mandir_default='${prefix}/share/man'
# toolchain
@@ -4075,8 +4085,10 @@
optname="${opt%%=*}"
optname="${optname#--}"
optname=$(echo "$optname" | sed 's/-/_/g')
+ optname_set="${optname}_set"
if is_in $optname $CMDLINE_SET; then
eval $optname='$optval'
+ eval $optname_set=true
elif is_in $optname $CMDLINE_APPEND; then
append $optname "$optval"
else
@@ -4279,6 +4291,16 @@
;;
esac
+# TODO: This is pretty spotty and should be combined with config.sub and
+# possibly also config.guess.
+if [ -n "$build" -a -n "$host" -a "$build" != "$host" ]; then
+ cross_prefix=${host}-
+ arch=$(echo "$host" | grep -o '^[^-]*')
+ if echo "$host" | grep -- "-sortix$" > /dev/null; then
+ target_os="sortix"
+ fi
+fi
+
if test -n "$cross_prefix"; then
test -n "$arch" && test -n "$target_os" ||
die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
@@ -5541,6 +5563,9 @@
;;
minix)
;;
+ sortix)
+ add_cppflags -D_SORTIX_SOURCE -D_POSIX_SOURCE=200809L
+ ;;
none)
;;
*)
@@ -7214,6 +7239,7 @@
if test "$quiet" != "yes"; then
echo "install prefix $prefix"
+echo "install exec-prefix $exec_prefix"
echo "source path $source_path"
echo "C compiler $cc"
echo "C library $libc_type"
@@ -7367,6 +7393,7 @@
FFMPEG_CONFIG_MAK=1
FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
prefix=$prefix
+exec_prefix=$exec_prefix
LIBDIR=\$(DESTDIR)$libdir
SHLIBDIR=\$(DESTDIR)$shlibdir
INCDIR=\$(DESTDIR)$incdir
@@ -7628,6 +7655,7 @@
shared=$shared
build_suffix=$build_suffix
prefix=$prefix
+exec_prefix=$exec_prefix
libdir=$libdir
incdir=$incdir
rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
diff -Paur --no-dereference -- ffmpeg.upstream/ffbuild/pkgconfig_generate.sh ffmpeg/ffbuild/pkgconfig_generate.sh
--- ffmpeg.upstream/ffbuild/pkgconfig_generate.sh
+++ ffmpeg/ffbuild/pkgconfig_generate.sh
@@ -28,7 +28,7 @@
cat <<EOF > $name/$fullname.pc
prefix=$prefix
-exec_prefix=\${prefix}
+exec_prefix=$exec_prefix
libdir=$libdir
includedir=$incdir
diff -Paur --no-dereference -- ffmpeg.upstream/fftools/Makefile ffmpeg/fftools/Makefile
--- ffmpeg.upstream/fftools/Makefile
+++ ffmpeg/fftools/Makefile
@@ -30,6 +30,8 @@
all: $(AVPROGS)
+progs: $(AVPROGS)
+
fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
OUTDIRS += fftools
diff -Paur --no-dereference -- ffmpeg.upstream/libavformat/codec2.c ffmpeg/libavformat/codec2.c
--- ffmpeg.upstream/libavformat/codec2.c
+++ ffmpeg/libavformat/codec2.c
@@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <memory.h>
#include "libavcodec/codec2utils.h"
#include "libavutil/intreadwrite.h"
#include "avio_internal.h"
diff -Paur --no-dereference -- ffmpeg.upstream/libavformat/udp.c ffmpeg/libavformat/udp.c
--- ffmpeg.upstream/libavformat/udp.c
+++ ffmpeg/libavformat/udp.c
@@ -252,7 +252,9 @@
struct sockaddr_storage *sources,
int nb_sources, int include)
{
+#if HAVE_STRUCT_IP_MREQ_SOURCE && defined(IP_BLOCK_SOURCE)
int i;
+#endif
if (addr->sa_family != AF_INET) {
#if HAVE_STRUCT_GROUP_SOURCE_REQ && defined(MCAST_BLOCK_SOURCE)
/* For IPv4 prefer the old approach, as that alone works reliably on
@@ -791,8 +793,10 @@
if (dscp >= 0) {
dscp <<= 2;
+#ifdef IP_TOS
if (setsockopt (udp_fd, IPPROTO_IP, IP_TOS, &dscp, sizeof(dscp)) != 0)
goto fail;
+#endif
}
/* If multicast, try binding the multicast address first, to avoid

15
ports/ffmpeg/ffmpeg.port Normal file
View File

@ -0,0 +1,15 @@
NAME=ffmpeg
BUILD_LIBRARIES='libavcodec libGL? libSDL? libSDL2?'
VERSION=4.3.1
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=ad009240d46e307b4e03a213a0f49c11b650e445b1f8be0dda2a9212b34d2ffb
UPSTREAM_SITE=https://ffmpeg.org/releases
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
DIRTY_FILE=ffbuild/config.mak
CONFIGURE_ARGS='--disable-x86asm --enable-version3 --optflags=" " --disable-debug'
MAKE_VARS='V=1'
MAKE_TARGET=progs
MAKE_INSTALL_TARGET='install-progs install-data'

65
ports/flex/flex.patch Normal file
View File

@ -0,0 +1,65 @@
diff -Paur --no-dereference -- flex.upstream/build-aux/config.sub flex/build-aux/config.sub
--- flex.upstream/build-aux/config.sub
+++ flex/build-aux/config.sub
@@ -1373,7 +1373,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- flex.upstream/configure flex/configure
--- flex.upstream/configure
+++ flex/configure
@@ -1,4 +1,6 @@
#! /bin/sh
+export ac_cv_func_malloc_0_nonnull=yes
+export ac_cv_func_realloc_0_nonnull=yes
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for the fast lexical analyser generator 2.6.0.
#
diff -Paur --no-dereference -- flex.upstream/Makefile.in flex/Makefile.in
--- flex.upstream/Makefile.in
+++ flex/Makefile.in
@@ -227,7 +227,7 @@
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = $(SUBDIRS_REAL)
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
@@ -444,15 +444,16 @@
.indent.pro \
autogen.sh
+# PATCH: Building documentation and test causes problems when cross-compiling.
SUBDIRS = \
lib \
src \
- doc \
examples \
po \
- tests \
tools
+SUBDIRS_REAL = lib src doc examples po tests tools
+
all: all-recursive
.SUFFIXES:
diff -Paur --no-dereference -- flex.upstream/src/main.c flex/src/main.c
--- flex.upstream/src/main.c
+++ flex/src/main.c
@@ -364,7 +364,7 @@
/* Setup the filter chain. */
output_chain = filter_create_int(NULL, filter_tee_header, headerfilename);
if ( !(m4 = getenv("M4")))
- m4 = M4;
+ m4 = "m4";
filter_create_ext(output_chain, m4, "-P", 0);
filter_create_int(output_chain, filter_fix_linedirs, NULL);

12
ports/flex/flex.port Normal file
View File

@ -0,0 +1,12 @@
NAME=flex
BUILD_LIBRARIES='libiconv? gettext?'
VERSION=2.6.0
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=d39b15a856906997ced252d76e9bfe2425d7503c6ed811669665627b248e4c73
UPSTREAM_SITE=https://sourceforge.net/projects/flex/files
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la

131
ports/gawk/gawk.patch Normal file
View File

@ -0,0 +1,131 @@
diff -Paur --no-dereference -- gawk.upstream/builtin.c gawk/builtin.c
--- gawk.upstream/builtin.c
+++ gawk/builtin.c
@@ -1192,10 +1192,18 @@
* Use snprintf return value to tell if there
* is enough room in the buffer or not.
*/
+/* PATCH: Until Sortix has floating point printing. */
+#if defined(__sortix__) && !__SORTIX_HAS_FLOAT_PARSE__
+ while ((i = snprintf(cpbufs[1].buf,
+ cpbufs[1].bufsize, "%lld",
+ (long long)tmpval)) >=
+ cpbufs[1].bufsize) {
+#else
while ((i = snprintf(cpbufs[1].buf,
cpbufs[1].bufsize, "%.0f",
tmpval)) >=
cpbufs[1].bufsize) {
+#endif
if (cpbufs[1].buf == cpbufs[1].stackbuf)
cpbufs[1].buf = NULL;
if (i > 0) {
diff -Paur --no-dereference -- gawk.upstream/extension/filefuncs.c gawk/extension/filefuncs.c
--- gawk.upstream/extension/filefuncs.c
+++ gawk/extension/filefuncs.c
@@ -414,8 +414,12 @@
/* for block and character devices, add rdev, major and minor numbers */
if (S_ISBLK(sbuf->st_mode) || S_ISCHR(sbuf->st_mode)) {
array_set_numeric(array, "rdev", sbuf->st_rdev);
+#ifdef major
array_set_numeric(array, "major", major(sbuf->st_rdev));
+#endif
+#ifdef minor
array_set_numeric(array, "minor", minor(sbuf->st_rdev));
+#endif
}
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
diff -Paur --no-dereference -- gawk.upstream/io.c gawk/io.c
--- gawk.upstream/io.c
+++ gawk/io.c
@@ -39,6 +39,8 @@
#include <sys/ioctl.h>
#endif /* HAVE_SYS_IOCTL_H */
+#include <sys/select.h>
+
#ifndef O_ACCMODE
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif
diff -Paur --no-dereference -- gawk.upstream/main.c gawk/main.c
--- gawk.upstream/main.c
+++ gawk/main.c
@@ -984,13 +984,7 @@
update_PROCINFO_num("api_minor", GAWK_API_MINOR_VERSION);
#endif
-#ifdef GETPGRP_VOID
-#define getpgrp_arg() /* nothing */
-#else
-#define getpgrp_arg() getpid()
-#endif
-
- value = getpgrp(getpgrp_arg());
+ value = getpgid(0);
update_PROCINFO_num("pgrpid", value);
/*
diff -Paur --no-dereference -- gawk.upstream/node.c gawk/node.c
--- gawk.upstream/node.c
+++ gawk/node.c
@@ -860,6 +860,8 @@
n->flags &= ~WSTRCUR;
}
+/* PATCH: Sortix doesn't have putwc(3) and this function is unused. */
+#if 0
static void __attribute__ ((unused))
dump_wstr(FILE *fp, const wchar_t *str, size_t len)
{
@@ -869,6 +871,7 @@
for (; len--; str++)
putwc(*str, fp);
}
+#endif
/* wstrstr --- walk haystack, looking for needle, wide char version */
diff -Paur --no-dereference -- gawk.upstream/support/getopt.c gawk/support/getopt.c
--- gawk.upstream/support/getopt.c
+++ gawk/support/getopt.c
@@ -55,18 +55,9 @@
#ifndef ELIDE_CODE
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#if defined (__GNU_LIBRARY__) || defined (__CYGWIN__) || defined(__DJGPP__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__sun) /* Illumos */
-/* Don't include stdlib.h for
- * non-GNU C libraries
- * non-Cygwin
- * non-DJGPP
- * non-MinGW
- * because some of them contain conflicting prototypes for getopt. */
+/* PATCH: #&%!ing gnu portability: You need stdlib.h for malloc. */
# include <stdlib.h>
# include <unistd.h>
-#endif /* GNU C library. */
#include <string.h>
diff -Paur --no-dereference -- gawk.upstream/support/getopt.h gawk/support/getopt.h
--- gawk.upstream/support/getopt.h
+++ gawk/support/getopt.h
@@ -1,3 +1,16 @@
+/* PATCH: Gawk doesn't seem to work with Sortix libc's getopt for some reason.
+ Gawk wants to use GNU getopt unconditionally. This causes conflicting
+ symbols, so rename gawk's replacements to avoid collisions. */
+#if defined(__sortix__)
+#define getopt gawk_getopt
+#define optarg gawk_optarg
+#define optind gawk_optind
+#define opterr gawk_opterr
+#define optopt gawk_optopt
+#define getopt_long gawk_getopt_long
+#define getopt_long_only gawk_getopt_long_only
+#define option gawk_option
+#endif
/* Declarations for getopt.
Copyright (C) 1989-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.

11
ports/gawk/gawk.port Normal file
View File

@ -0,0 +1,11 @@
NAME=gawk
BUILD_LIBRARIES='libiconv? libintl? libgmp? libmpfr? libreadline?'
VERSION=4.2.0
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=d4f3cd31c001fd0ed52832d4fbfbdfeaa38ad541c182f80ff8fdf87324a6a9f2
UPSTREAM_SITE=https://ftp.gnu.org/gnu/gawk
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
POST_INSTALL=tix-eradicate-libtool-la

19
ports/gcc/gcc.port Normal file
View File

@ -0,0 +1,19 @@
NAME=gcc
BUILD_LIBRARIES='libstdc++ libiconv? libgmp libmpfr libmpc libz'
VERSION=1.1-rc3
DISTNAME=sortix-gcc-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=4d90fe38a67cddab81dc34265009cde508338072ec9b0083010d46647f9c6320
UPSTREAM_SITE=https://pub.sortix.org/sortix/toolchain
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_WITH_SYSROOT=true
CONFIGURE_WITH_SYSROOT_LD_BUG=true
CONFIGURE_WITH_BUILD_SYSROOT=true
CONFIGURE_ARGS='--enable-languages=c,c++ --with-system-zlib'
CONFIGURE_USE_BUILD_DIRECTORY=true
MAKE_BUILD_TARGET='all-gcc all-target-libgcc'
MAKE_INSTALL_TARGET='install-gcc install-target-libgcc'
POST_INSTALL=../gcc.post-install
VERSION_REGEX='([0-9]+\.[0-9]+(\.[0-9]+)*(-rc[0-9]+)?)'

6
ports/gcc/gcc.post-install Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh -e
tix-eradicate-libtool-la
if [ -e "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/gcc" ]; then
ln "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/gcc" "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/cc"
fi
ln "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/$TARGET-gcc" "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/$TARGET-cc"

700
ports/gettext/gettext.patch Normal file
View File

@ -0,0 +1,700 @@
diff -Paur --no-dereference -- gettext.upstream/gettext-runtime/configure gettext/gettext-runtime/configure
--- gettext.upstream/gettext-runtime/configure
+++ gettext/gettext-runtime/configure
@@ -1,4 +1,124 @@
#! /bin/sh
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes # Not needed since February 2015
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypotl_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
+export ac_cv_func_realloc_0_nonnull=yes # TODO: Investigate this, found in flex.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gettext-runtime 0.19.8.
#
@@ -18912,6 +19032,8 @@
static char buf[100];
int main ()
{
+ /* PATCH: Never replace Sortix printf even if it doesn't have this feature. */
+ return 0;
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}
diff -Paur --no-dereference -- gettext.upstream/gettext-runtime/gnulib-lib/propername.c gettext/gettext-runtime/gnulib-lib/propername.c
--- gettext.upstream/gettext-runtime/gnulib-lib/propername.c
+++ gettext/gettext-runtime/gnulib-lib/propername.c
@@ -168,10 +168,10 @@
else
{
/* Return "TRANSLATION (NAME)". */
- char *result =
- XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+ size_t size = strlen (translation) + 2 + strlen (name) + 1 + 1;
+ char *result = XNMALLOC (size, char);
- sprintf (result, "%s (%s)", translation, name);
+ snprintf (result, size, "%s (%s)", translation, name);
return result;
}
}
@@ -270,10 +270,10 @@
else
{
/* Return "TRANSLATION (NAME)". */
- char *result =
- XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+ size_t size = strlen (translation) + 2 + strlen (name) + 1 + 1;
+ char *result = XNMALLOC (size, char);
- sprintf (result, "%s (%s)", translation, name);
+ snprintf (result, size, "%s (%s)", translation, name);
if (alloc_name_converted != NULL)
free (alloc_name_converted);
diff -Paur --no-dereference -- gettext.upstream/gettext-runtime/intl/dcigettext.c gettext/gettext-runtime/intl/dcigettext.c
--- gettext.upstream/gettext-runtime/intl/dcigettext.c
+++ gettext/gettext-runtime/intl/dcigettext.c
@@ -997,6 +997,8 @@
resultlen = domain->trans_sysdep_tab[act - nstrings].length;
}
+#if 0 /* PATCH: Disable iconv dependency to produce smaller programs. With luck
+ anything that matters at this time is already UTF-8. */
#if defined _LIBC || HAVE_ICONV
# ifdef IN_LIBGLOCALE
if (encoding != NULL)
@@ -1406,6 +1408,7 @@
/* The result string is converted. */
#endif /* _LIBC || HAVE_ICONV */
+#endif
*lengthp = resultlen;
return result;
diff -Paur --no-dereference -- gettext.upstream/gettext-runtime/libasprintf/configure gettext/gettext-runtime/libasprintf/configure
--- gettext.upstream/gettext-runtime/libasprintf/configure
+++ gettext/gettext-runtime/libasprintf/configure
@@ -18352,6 +18352,8 @@
static char buf[100];
int main ()
{
+ /* PATCH: Never replace Sortix printf even if it doesn't have this feature. */
+ return 0;
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/configure gettext/gettext-tools/configure
--- gettext.upstream/gettext-tools/configure
+++ gettext/gettext-tools/configure
@@ -1,4 +1,124 @@
#! /bin/sh
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes # Not needed since February 2015
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypotl_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
+export ac_cv_func_realloc_0_nonnull=yes # TODO: Investigate this, found in flex.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gettext-tools 0.19.8.
#
@@ -21267,6 +21387,8 @@
static char buf[100];
int main ()
{
+ /* PATCH: Never replace Sortix printf even if it doesn't have this feature. */
+ return 0;
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}
@@ -44404,7 +44526,9 @@
- use_additional=yes
+ # PATCH: It's just plain wrong to search for libxml2 in the prefix rather
+ # than using the pkg-config, or at least using the system root.
+ use_additional=no
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
@@ -44424,6 +44548,7 @@
if test "X$withval" = "Xno"; then
use_additional=no
else
+ use_additional=yes
if test "X$withval" = "X"; then
acl_save_prefix="$prefix"
@@ -44858,6 +44983,8 @@
+ LIBXML2="$LIBXML2 $(${PKG_CONFIG-pkg-config} --libs libxml-2.0)"
+ LTLIBXML2="$LTLIBXML2 $(${PKG_CONFIG-pkg-config} --libs libxml-2.0)"
LIBS="$gl_save_LIBS $LIBXML2 $LIBICONV"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -50550,6 +50677,8 @@
static char buf[100];
int main ()
{
+ /* PATCH: Never replace Sortix printf even if it doesn't have this feature. */
+ return 0;
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}
@@ -54324,6 +54453,8 @@
static char buf[100];
int main ()
{
+ /* PATCH: Never replace Sortix printf even if it doesn't have this feature. */
+ return 0;
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/backupfile.c gettext/gettext-tools/gnulib-lib/backupfile.c
--- gettext.upstream/gettext-tools/gnulib-lib/backupfile.c
+++ gettext/gettext-tools/gnulib-lib/backupfile.c
@@ -90,14 +90,15 @@
size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4;
char *s;
const char *suffix = simple_backup_suffix;
+ size_t ssize;
/* Allow room for simple or '.~N~' backups. */
backup_suffix_size_max = strlen (simple_backup_suffix) + 1;
if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max)
backup_suffix_size_max = numbered_suffix_size_max;
- s = (char *) malloc (file_len + backup_suffix_size_max
- + numbered_suffix_size_max);
+ ssize = file_len + backup_suffix_size_max + numbered_suffix_size_max;
+ s = (char *) malloc (ssize);
if (s)
{
strcpy (s, file);
@@ -112,8 +113,10 @@
highest_backup = max_backup_version (file + dir_len, s);
if (! (backup_type == numbered_existing && highest_backup == 0))
{
- char *numbered_suffix = s + (file_len + backup_suffix_size_max);
- sprintf (numbered_suffix, ".~%d~", highest_backup + 1);
+ size_t off = file_len + backup_suffix_size_max;
+ size_t rem = ssize - off;
+ char *numbered_suffix = s + off;
+ snprintf (numbered_suffix, rem, ".~%d~", highest_backup + 1);
suffix = numbered_suffix;
}
strcpy (s, file);
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/html-ostream.c gettext/gettext-tools/gnulib-lib/html-ostream.c
--- gettext.upstream/gettext-tools/gnulib-lib/html-ostream.c
+++ gettext/gettext-tools/gnulib-lib/html-ostream.c
@@ -178,7 +178,7 @@
/* Output non-ASCII characters in #&nnn;
notation. */
char bytes[32];
- sprintf (bytes, "&#%d;", (int) uc);
+ snprintf (bytes, sizeof(bytes), "&#%d;", (int) uc);
ostream_write_str (stream->destination, bytes);
}
break;
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/html-ostream.oo.c gettext/gettext-tools/gnulib-lib/html-ostream.oo.c
--- gettext.upstream/gettext-tools/gnulib-lib/html-ostream.oo.c
+++ gettext/gettext-tools/gnulib-lib/html-ostream.oo.c
@@ -177,7 +177,7 @@
/* Output non-ASCII characters in #&nnn;
notation. */
char bytes[32];
- sprintf (bytes, "&#%d;", (int) uc);
+ snprintf (bytes, sizeof(bytes), "&#%d;", (int) uc);
ostream_write_str (stream->destination, bytes);
}
break;
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/propername.c gettext/gettext-tools/gnulib-lib/propername.c
--- gettext.upstream/gettext-tools/gnulib-lib/propername.c
+++ gettext/gettext-tools/gnulib-lib/propername.c
@@ -168,10 +168,10 @@
else
{
/* Return "TRANSLATION (NAME)". */
- char *result =
- XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+ size_t size = strlen (translation) + 2 + strlen (name) + 1 + 1;
+ char *result = XNMALLOC (size, char);
- sprintf (result, "%s (%s)", translation, name);
+ snprintf (result, size, "%s (%s)", translation, name);
return result;
}
}
@@ -270,10 +270,10 @@
else
{
/* Return "TRANSLATION (NAME)". */
- char *result =
- XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+ size_t size = strlen (translation) + 2 + strlen (name) + 1 + 1;
+ char *result = XNMALLOC (size, char);
- sprintf (result, "%s (%s)", translation, name);
+ snprintf (result, size, "%s (%s)", translation, name);
if (alloc_name_converted != NULL)
free (alloc_name_converted);
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/tmpdir.c gettext/gettext-tools/gnulib-lib/tmpdir.c
--- gettext.upstream/gettext-tools/gnulib-lib/tmpdir.c
+++ gettext/gettext-tools/gnulib-lib/tmpdir.c
@@ -154,6 +154,7 @@
}
memcpy (tmpl, dir, dlen);
- sprintf (tmpl + dlen, &"/%.*sXXXXXX"[!add_slash], (int) plen, pfx);
+ snprintf (tmpl + dlen, 1 + tmpl_len - dlen, &"/%.*sXXXXXX"[!add_slash],
+ (int) plen, pfx);
return 0;
}
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/tparm.c gettext/gettext-tools/gnulib-lib/tparm.c
--- gettext.upstream/gettext-tools/gnulib-lib/tparm.c
+++ gettext/gettext-tools/gnulib-lib/tparm.c
@@ -496,7 +496,7 @@
char *s;
if (popstring (&s))
return OOPS;
- sprintf (sbuf, fmt, s);
+ snprintf (sbuf, sizeof(sbuf), fmt, s);
}
else
{
@@ -512,7 +512,7 @@
if (i == 0 && conv_char == 'c')
strcpy (sbuf, "\000");
else
- sprintf (sbuf, fmt, i);
+ snprintf (sbuf, sizeof(sbuf), fmt, i);
}
}
sp++;
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/gnulib-lib/uniname/uniname.c gettext/gettext-tools/gnulib-lib/uniname/uniname.c
--- gettext.upstream/gettext-tools/gnulib-lib/uniname/uniname.c
+++ gettext/gettext-tools/gnulib-lib/uniname/uniname.c
@@ -284,8 +284,8 @@
small. */
/* buf needs to have at least 19 + 3 bytes here. */
- sprintf (buf, "VARIATION SELECTOR-%d",
- c <= 0xFE0F ? c - 0xFE00 + 1 : c - 0xE0100 + 17);
+ snprintf (buf, UNINAME_MAX, "VARIATION SELECTOR-%d",
+ c <= 0xFE0F ? c - 0xFE00 + 1 : c - 0xE0100 + 17);
return buf;
}
else
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/cldr-plurals.c gettext/gettext-tools/src/cldr-plurals.c
--- gettext.upstream/gettext-tools/src/cldr-plurals.c
+++ gettext/gettext-tools/src/cldr-plurals.c
@@ -162,7 +162,7 @@
buffer = (char *) xrealloc (buffer, bufmax);
}
- sprintf (buffer + buflen, "%s: %s; ", count, content);
+ snprintf (buffer + buflen, bufmax - buflen, "%s: %s; ", count, content);
xmlFree (count);
xmlFree (content);
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/format.c gettext/gettext-tools/src/format.c
--- gettext.upstream/gettext-tools/src/format.c
+++ gettext/gettext-tools/src/format.c
@@ -110,7 +110,7 @@
if (msgid_plural != NULL)
{
- sprintf (buf, "msgstr[%u]", j);
+ snprintf (buf, sizeof(buf), "msgstr[%u]", j);
pretty_msgstr = buf;
}
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/read-mo.c gettext/gettext-tools/src/read-mo.c
--- gettext.upstream/gettext-tools/src/read-mo.c
+++ gettext/gettext-tools/src/read-mo.c
@@ -184,7 +184,8 @@
if (!(ss_length > 0 && bfp->data[ss_end - 1] == '\0'))
{
char location[30];
- sprintf (location, "sysdep_segment[%u]", (unsigned int) sysdepref);
+ snprintf (location, sizeof (location),
+ "sysdep_segment[%u]", (unsigned int) sysdepref);
error (EXIT_FAILURE, 0,
_("file \"%s\" contains a not NUL terminated string, at %s"),
bfp->filename, location);
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/search-path.c gettext/gettext-tools/src/search-path.c
--- gettext.upstream/gettext-tools/src/search-path.c
+++ gettext/gettext-tools/src/search-path.c
@@ -142,7 +142,7 @@
gettextdatadirs = getenv ("XDG_DATA_DIRS");
if (gettextdatadirs != NULL)
foreach_elements (gettextdatadirs, fill, &array);
- free (array.sub);
+ free ((char *)array.sub);
/* Append version specific directory. */
base = xasprintf ("%s%s", gettextdatadir, PACKAGE_SUFFIX);
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/write-csharp.c gettext/gettext-tools/src/write-csharp.c
--- gettext.upstream/gettext-tools/src/write-csharp.c
+++ gettext/gettext-tools/src/write-csharp.c
@@ -716,10 +716,10 @@
{
char *class_name_part1 = construct_class_name (resource_name);
char *p;
+ size_t size = strlen (class_name_part1) + 1 + strlen (culture_name) + 1;
- class_name =
- XNMALLOC (strlen (class_name_part1) + 1 + strlen (culture_name) + 1, char);
- sprintf (class_name, "%s_%s", class_name_part1, culture_name);
+ class_name = XNMALLOC (size, char);
+ snprintf (class_name, size, "%s_%s", class_name_part1, culture_name);
for (p = class_name + strlen (class_name_part1) + 1; *p != '\0'; p++)
if (*p == '-')
*p = '_';
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/write-po.c gettext/gettext-tools/src/write-po.c
--- gettext.upstream/gettext-tools/src/write-po.c
+++ gettext/gettext-tools/src/write-po.c
@@ -78,16 +78,16 @@
case possible:
if (debug)
{
- sprintf (result, "possible-%s-format", lang);
+ snprintf (result, sizeof(result), "possible-%s-format", lang);
break;
}
/* FALLTHROUGH */
case yes_according_to_context:
case yes:
- sprintf (result, "%s-format", lang);
+ snprintf (result, sizeof(result), "%s-format", lang);
break;
case no:
- sprintf (result, "no-%s-format", lang);
+ snprintf (result, sizeof(result), "no-%s-format", lang);
break;
default:
/* The others have already been filtered out by significant_format_p. */
@@ -399,7 +399,7 @@
|| pp->line_number == (size_t)(-1))
buffer[0] = '\0';
else
- sprintf (buffer, ":%ld", (long) pp->line_number);
+ snprintf (buffer, sizeof (buffer), ":%ld", (long) pp->line_number);
len = strlen (cp) + strlen (buffer) + 1;
if (column > 2 && column + len > page_width)
{
@@ -1375,7 +1375,7 @@
p < mp->msgstr + mp->msgstr_len;
p += strlen (p) + 1, i++)
{
- sprintf (prefix_buf, "msgstr[%u]", i);
+ snprintf (prefix_buf, sizeof (prefix_buf), "msgstr[%u]", i);
wrap (mp, stream, NULL, extra_indent, class_msgstr, prefix_buf, p,
mp->do_wrap, page_width, charset);
}
@@ -1499,7 +1499,7 @@
p < mp->msgstr + mp->msgstr_len;
p += strlen (p) + 1, i++)
{
- sprintf (prefix_buf, "msgstr[%u]", i);
+ snprintf (prefix_buf, sizeof (prefix_buf), "msgstr[%u]", i);
wrap (mp, stream, "#~ ", extra_indent, class_msgstr, prefix_buf, p,
mp->do_wrap, page_width, charset);
}
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/write-properties.c gettext/gettext-tools/src/write-properties.c
--- gettext.upstream/gettext-tools/src/write-properties.c
+++ gettext/gettext-tools/src/write-properties.c
@@ -96,7 +96,7 @@
else if (uc < 0x10000)
{
/* Single UCS-2 'char' */
- sprintf (newstr, "\\u%c%c%c%c",
+ snprintf (newstr, length + 1 - (newstr - result), "\\u%c%c%c%c",
hexdigit[(uc >> 12) & 0x0f], hexdigit[(uc >> 8) & 0x0f],
hexdigit[(uc >> 4) & 0x0f], hexdigit[uc & 0x0f]);
newstr += 6;
@@ -106,11 +106,11 @@
/* UTF-16 surrogate: two 'char's. */
ucs4_t uc1 = 0xd800 + ((uc - 0x10000) >> 10);
ucs4_t uc2 = 0xdc00 + ((uc - 0x10000) & 0x3ff);
- sprintf (newstr, "\\u%c%c%c%c",
+ snprintf (newstr, length + 1 - (newstr - result), "\\u%c%c%c%c",
hexdigit[(uc1 >> 12) & 0x0f], hexdigit[(uc1 >> 8) & 0x0f],
hexdigit[(uc1 >> 4) & 0x0f], hexdigit[uc1 & 0x0f]);
newstr += 6;
- sprintf (newstr, "\\u%c%c%c%c",
+ snprintf (newstr, length + 1 - (newstr - result), "\\u%c%c%c%c",
hexdigit[(uc2 >> 12) & 0x0f], hexdigit[(uc2 >> 8) & 0x0f],
hexdigit[(uc2 >> 4) & 0x0f], hexdigit[uc2 & 0x0f]);
newstr += 6;
diff -Paur --no-dereference -- gettext.upstream/gettext-tools/src/xgettext.c gettext/gettext-tools/src/xgettext.c
--- gettext.upstream/gettext-tools/src/xgettext.c
+++ gettext/gettext-tools/src/xgettext.c
@@ -2321,7 +2321,7 @@
if (line_number == (size_t)(-1))
buffer[0] = '\0';
else
- sprintf (buffer, ":%ld", (long) line_number);
+ snprintf (buffer, sizeof (buffer), ":%ld", (long) line_number);
switch (lcontext)
{
@@ -2441,7 +2441,7 @@
if (pos->line_number == (size_t)(-1))
buffer[0] = '\0';
else
- sprintf (buffer, ":%ld", (long) pos->line_number);
+ snprintf (buffer, sizeof (buffer), ":%ld", (long) pos->line_number);
multiline_warning (xasprintf (_("%s%s: warning: "),
pos->file_name, buffer),
xasprintf (is_format[i] == yes_according_to_context
@@ -2474,7 +2474,7 @@
if (pos->line_number == (size_t)(-1))
buffer[0] = '\0';
else
- sprintf (buffer, ":%ld", (long) pos->line_number);
+ snprintf (buffer, sizeof (buffer), ":%ld", (long) pos->line_number);
multiline_warning (xasprintf (_("%s%s: warning: "),
pos->file_name, buffer),
xasprintf (_("\
@@ -2539,7 +2539,7 @@
if (pos->line_number == (size_t)(-1))
buffer[0] = '\0';
else
- sprintf (buffer, ":%ld", (long) pos->line_number);
+ snprintf (buffer, sizeof (buffer), ":%ld", (long) pos->line_number);
multiline_warning (xasprintf (_("%s%s: warning: "), pos->file_name,
buffer),
xstrdup (_("\

View File

@ -0,0 +1,15 @@
NAME=gettext
BUILD_LIBRARIES='libiconv libintl libxml2 libcroco? libcurses? libexpat? libunistring?'
VERSION=0.19.8
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=9c1781328238caa1685d7bc7a2e1dcf1c6c134e86b42ed554066734b621bd12f
UPSTREAM_SITE=https://ftp.gnu.org/gnu/gettext
UPSTREAM_ARCHIVE=$ARCHIVE
# TODO: libcroco and libunistring are bundled and are only marked as optional
# here as there's no official port yet. Finish those and then remove
# them as optional.
SUBDIR=gettext-tools
BUILD_SYSTEM=configure
POST_INSTALL=tix-eradicate-libtool-la

429
ports/git/git.patch Normal file
View File

@ -0,0 +1,429 @@
diff -Paur --no-dereference -- git.upstream/builtin/log.c git/builtin/log.c
--- git.upstream/builtin/log.c
+++ git/builtin/log.c
@@ -249,7 +249,12 @@
fprintf(rev->diffopt.file, _("Final output: %d %s\n"), nr, stage);
}
+/* PATCH: Sortix does not have obsolescent XSI itimers. */
+#if defined(__sortix__)
+static timer_t early_output_timer;
+#else
static struct itimerval early_output_timer;
+#endif
static void log_show_early(struct rev_info *revs, struct commit_list *list)
{
@@ -297,9 +302,18 @@
* trigger every second even if we're blocked on a
* reader!
*/
+#if defined(__sortix__)
+ struct itimerspec its;
+ its.it_value.tv_sec = 0;
+ its.it_value.tv_nsec = 500000000;
+ its.it_interval.tv_sec = 0;
+ its.it_interval.tv_nsec = 0;
+ timer_settime(early_output_timer, 0, &its, NULL);
+#else
early_output_timer.it_value.tv_sec = 0;
early_output_timer.it_value.tv_usec = 500000;
setitimer(ITIMER_REAL, &early_output_timer, NULL);
+#endif
}
static void early_output(int signal)
@@ -309,6 +323,13 @@
static void setup_early_output(struct rev_info *rev)
{
+#if defined(__sortix__) && !defined(__SORTIX_HAS_RESTARTABLE_SYSCALLS__)
+ /* TODO: Sortix doesn't have restartable system calls at the moment and this
+ feature creates spurious failures, so this feature is disabled for
+ now. */
+ return;
+#endif
+
struct sigaction sa;
/*
@@ -331,13 +352,37 @@
*
* This is a one-time-only trigger.
*/
+#if defined(__sortix__)
+ struct sigevent sev;
+ memset(&sev, 0, sizeof(sev));
+ sev.sigev_notify = SIGEV_SIGNAL;
+ sev.sigev_signo = SIGALRM;
+ timer_create(CLOCK_MONOTONIC, &sev, &early_output_timer);
+ struct itimerspec its;
+ its.it_value.tv_sec = 0;
+ its.it_value.tv_nsec = 100000000;
+ its.it_interval.tv_sec = 0;
+ its.it_interval.tv_nsec = 0;
+ timer_settime(early_output_timer, 0, &its, NULL);
+#else
early_output_timer.it_value.tv_sec = 0;
early_output_timer.it_value.tv_usec = 100000;
setitimer(ITIMER_REAL, &early_output_timer, NULL);
+#endif
}
static void finish_early_output(struct rev_info *rev)
{
+#if defined(__sortix__) && !defined(__SORTIX_HAS_RESTARTABLE_SYSCALLS__)
+ /* TODO: Sortix doesn't have restartable system calls at the moment and this
+ feature creates spurious failures, so this feature is disabled for
+ now. */
+ return;
+#endif
+
+#if defined(__sortix__)
+ timer_delete(early_output_timer);
+#endif
int n = estimate_commit_count(rev, rev->commits);
signal(SIGALRM, SIG_IGN);
show_early_header(rev, "done", n);
diff -Paur --no-dereference -- git.upstream/compat/hstrerror.c git/compat/hstrerror.c
--- git.upstream/compat/hstrerror.c
+++ git/compat/hstrerror.c
@@ -2,6 +2,10 @@
#include <stdio.h>
#include <netdb.h>
+/* PATCH: hstrerror(3) is not used by git when getaddrinfo(3) is available.
+ Sortix has the modern getaddrinfo(3), but does not have the obsolete
+ gethostbyname(3). */
+#ifdef NO_IPV6
const char *githstrerror(int err)
{
static char buffer[48];
@@ -19,3 +23,4 @@
snprintf(buffer, sizeof(buffer), "Name resolution error %d", err);
return buffer;
}
+#endif
diff -Paur --no-dereference -- git.upstream/config.mak.uname git/config.mak.uname
--- git.upstream/config.mak.uname
+++ git/config.mak.uname
@@ -17,6 +17,8 @@
# because maintaining the nesting to match is a pain. If
# we had "elif" things would have been much nicer...
+# PATCH: Assume unknown operating systems have /dev/tty as required by POSIX.
+HAVE_DEV_TTY = YesPlease
ifeq ($(uname_S),OSF1)
# Need this for u_short definitions et al
BASIC_CFLAGS += -D_OSF_SOURCE
diff -Paur --no-dereference -- git.upstream/configure git/configure
--- git.upstream/configure
+++ git/configure
@@ -5315,7 +5315,7 @@
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurl $LIBS"
+LIBS="-lcurl -lssl -lcrypto -lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -5364,52 +5364,13 @@
if test -z "$NO_CURL"; then
-# Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CURL_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CURL_CONFIG"; then
- ac_cv_prog_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CURL_CONFIG="curl-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_CURL_CONFIG" && ac_cv_prog_CURL_CONFIG="no"
-fi
-fi
-CURL_CONFIG=$ac_cv_prog_CURL_CONFIG
-if test -n "$CURL_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_CONFIG" >&5
-$as_echo "$CURL_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-if test $CURL_CONFIG != no; then
+# PATCH: pkg-config must be used instead of the bad curl-config.
config_appended_defs="$config_appended_defs${newline}CURL_CONFIG=${CURL_CONFIG}"
if test -z "${NO_OPENSSL}"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Curl supports SSL" >&5
$as_echo_n "checking if Curl supports SSL... " >&6; }
- if test $(curl-config --features|grep SSL) = SSL; then
+ if test -n "$(${PKG_CONFIG:-pkg-config} libcurl --variable=supported_features|grep SSL)"; then
NEEDS_SSL_WITH_CURL=YesPlease
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -5423,8 +5384,6 @@
fi
fi
-fi
-
#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
diff -Paur --no-dereference -- git.upstream/git-compat-util.h git/git-compat-util.h
--- git.upstream/git-compat-util.h
+++ git/git-compat-util.h
@@ -325,6 +325,10 @@
typedef uintmax_t timestamp_t;
#define PRItime PRIuMAX
#define parse_timestamp strtoumax
+/* PATCH: Avoid conflicting Sortix macro. */
+#ifdef TIME_MAX
+#undef TIME_MAX
+#endif
#define TIME_MAX UINTMAX_MAX
#ifndef PATH_SEP
diff -Paur --no-dereference -- git.upstream/lockfile.c git/lockfile.c
--- git.upstream/lockfile.c
+++ git/lockfile.c
@@ -105,16 +105,10 @@
int n = 1;
int multiplier = 1;
long remaining_ms = 0;
- static int random_initialized = 0;
if (timeout_ms == 0)
return lock_file(lk, path, flags);
- if (!random_initialized) {
- srand((unsigned int)getpid());
- random_initialized = 1;
- }
-
if (timeout_ms > 0)
remaining_ms = timeout_ms;
@@ -133,7 +127,8 @@
backoff_ms = multiplier * INITIAL_BACKOFF_MS;
/* back off for between 0.75*backoff_ms and 1.25*backoff_ms */
- wait_ms = (750 + rand() % 500) * backoff_ms / 1000;
+ /* PATCH: Avoid rand(3) warning and modulo bias. */
+ wait_ms = (750 + arc4random_uniform(500)) * backoff_ms / 1000;
sleep_millisec(wait_ms);
remaining_ms -= wait_ms;
diff -Paur --no-dereference -- git.upstream/Makefile git/Makefile
--- git.upstream/Makefile
+++ git/Makefile
@@ -1176,9 +1176,7 @@
endif
ifdef NEEDS_SSL_WITH_CURL
CURL_LIBCURL += -lssl
- ifdef NEEDS_CRYPTO_WITH_SSL
- CURL_LIBCURL += -lcrypto
- endif
+ CURL_LIBCURL += -lcrypto
endif
ifdef NEEDS_IDN_WITH_CURL
CURL_LIBCURL += -lidn
@@ -1252,6 +1250,12 @@
LIB_4_CRYPTO += -framework Security -framework CoreFoundation
endif
endif
+# PATCH: Link with libintl first so it can statically link with libiconv.
+ifndef NO_GETTEXT
+ifndef LIBC_CONTAINS_LIBINTL
+ EXTLIBS += -lintl
+endif
+endif
ifdef NEEDS_LIBICONV
ifdef ICONVDIR
BASIC_CFLAGS += -I$(ICONVDIR)/include
@@ -1259,19 +1263,11 @@
else
ICONV_LINK =
endif
- ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
- ICONV_LINK += -lintl
- endif
EXTLIBS += $(ICONV_LINK) -liconv
endif
ifdef NEEDS_LIBGEN
EXTLIBS += -lgen
endif
-ifndef NO_GETTEXT
-ifndef LIBC_CONTAINS_LIBINTL
- EXTLIBS += -lintl
-endif
-endif
ifdef NEEDS_SOCKET
EXTLIBS += -lsocket
endif
@@ -2184,8 +2180,10 @@
doc:
$(MAKE) -C Documentation all
+# PATCH: Build manual pages if asciidoc and xmlto are installed.
+all:: man
man:
- $(MAKE) -C Documentation man
+ if which asciidoc 1>/dev/null 2>/dev/null && which xmlto 1>/dev/null 2>/dev/null; then $(MAKE) -C Documentation man; fi
html:
$(MAKE) -C Documentation html
@@ -2502,7 +2500,7 @@
profile-fast-install: profile-fast
$(MAKE) install
-install: all
+install: all install-man
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2570,8 +2568,9 @@
install-doc:
$(MAKE) -C Documentation install
+# PATCH: Install manual pages if asciidoc and xmlto are installed.
install-man:
- $(MAKE) -C Documentation install-man
+ if which asciidoc 1>/dev/null 2>/dev/null && which xmlto 1>/dev/null 2>/dev/null; then $(MAKE) -C Documentation install-man; fi
install-html:
$(MAKE) -C Documentation install-html
@@ -2638,8 +2637,8 @@
### Cleaning rules
+# PATCH: Don't delete configure when making distclean because it is in the dist.
distclean: clean
- $(RM) configure
$(RM) config.log config.status config.cache
$(RM) config.mak.autogen config.mak.append
$(RM) -r autom4te.cache
diff -Paur --no-dereference -- git.upstream/progress.c git/progress.c
--- git.upstream/progress.c
+++ git/progress.c
@@ -39,6 +39,10 @@
uint64_t start_ns;
};
+/* PATCH: Sortix does not have obsolescent XSI itimers. */
+#if defined(__sortix__)
+static timer_t progress_timer;
+#endif
static volatile sig_atomic_t progress_update;
static void progress_interval(int signum)
@@ -48,8 +52,19 @@
static void set_progress_signal(void)
{
+#if defined(__sortix__) && !defined(__SORTIX_HAS_RESTARTABLE_SYSCALLS__)
+ /* TODO: Sortix doesn't have restartable system calls at the moment and this
+ feature creates spurious failures, so this feature is disabled for
+ now. */
+ return;
+#endif
+
struct sigaction sa;
+#if defined(__sortix__)
+ struct itimerspec v;
+#else
struct itimerval v;
+#endif
progress_update = 0;
@@ -59,16 +74,39 @@
sa.sa_flags = SA_RESTART;
sigaction(SIGALRM, &sa, NULL);
+#if defined(__sortix__)
+ struct sigevent sev;
+ memset(&sev, 0, sizeof(sev));
+ sev.sigev_notify = SIGEV_SIGNAL;
+ sev.sigev_signo = SIGALRM;
+ timer_create(CLOCK_MONOTONIC, &sev, &progress_timer);
+ v.it_interval.tv_sec = 1;
+ v.it_interval.tv_nsec = 0;
+ v.it_value = v.it_interval;
+ timer_settime(progress_timer, 0, &v, NULL);
+#else
v.it_interval.tv_sec = 1;
v.it_interval.tv_usec = 0;
v.it_value = v.it_interval;
setitimer(ITIMER_REAL, &v, NULL);
+#endif
}
static void clear_progress_signal(void)
{
+#if defined(__sortix__) && !defined(__SORTIX_HAS_RESTARTABLE_SYSCALLS__)
+ /* TODO: Sortix doesn't have restartable system calls at the moment and this
+ feature creates spurious failures, so this feature is disabled for
+ now. */
+ return;
+#endif
+
+#if defined(__sortix__)
+ timer_delete(progress_timer);
+#else
struct itimerval v = {{0,},};
setitimer(ITIMER_REAL, &v, NULL);
+#endif
signal(SIGALRM, SIG_IGN);
progress_update = 0;
}
diff -Paur --no-dereference -- git.upstream/run-command.c git/run-command.c
--- git.upstream/run-command.c
+++ git/run-command.c
@@ -491,9 +491,12 @@
#else
bug_die(pthread_sigmask(SIG_SETMASK, &all, &as->old),
"blocking all signals");
+/* PATCH: Sortix doesn't have pthread cancelation. */
+#ifdef PTHREAD_CANCEL_DISABLE
bug_die(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &as->cs),
"disabling cancellation");
#endif
+#endif
}
static void atfork_parent(struct atfork_state *as)
@@ -502,8 +505,11 @@
if (sigprocmask(SIG_SETMASK, &as->old, NULL))
die_errno("sigprocmask");
#else
+/* PATCH: Sortix doesn't have pthread cancelation. */
+#ifdef PTHREAD_CANCEL_DISABLE
bug_die(pthread_setcancelstate(as->cs, NULL),
"re-enabling cancellation");
+#endif
bug_die(pthread_sigmask(SIG_SETMASK, &as->old, NULL),
"restoring signal mask");
#endif

22
ports/git/git.port Normal file
View File

@ -0,0 +1,22 @@
NAME=git
BUILD_LIBRARIES='libiconv libz libcurl? libexpat? libintl? libpcre? libssl?'
VERSION=2.14.3
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=5330960dd52467f6e5bf1931b9fd42b76d3f8ce9bc75150b54ecfb57d407151d
UPSTREAM_SITE=https://www.kernel.org/pub/software/scm/git
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_PROGRAMS='asciidoc? dblatex? docbook2x? xmlto?'
BUILD_SYSTEM=configure
DIRTY_FILE=config.mak.autogen
CONFIGURE_ARGS='--with-editor=editor --with-pager=pager --with-shell=sh --with-perl=perl --with-python=python'
CONFIGURE_VARS='ac_cv_fread_reads_directories=no ac_cv_snprintf_returns_bogus=no'
# TODO: We force MAKE to make because I occasionally use a tool called colormake
# that likes to colorize even when the output device is a pipe, which
# causes trouble here. You can safely remove this sortie has learned the
# error of his ways.
# Perl is disabled because Sortix has no perl port at the moment and I'm not
# confident it cross-compiles properly. It also installs stuff into /usr/local
# when prefix is empty and not sure how that happens.
MAKE_VARS='V=1 MAKE=make NO_PERL=NoThanks'

138
ports/grep/grep.patch Normal file
View File

@ -0,0 +1,138 @@
diff -Paur --no-dereference -- grep.upstream/build-aux/config.sub grep/build-aux/config.sub
--- grep.upstream/build-aux/config.sub
+++ grep/build-aux/config.sub
@@ -1360,7 +1360,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- grep.upstream/configure grep/configure
--- grep.upstream/configure
+++ grep/configure
@@ -1,4 +1,122 @@
#! /bin/sh
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.117-1717 for GNU grep 2.20.
#

11
ports/grep/grep.port Normal file
View File

@ -0,0 +1,11 @@
NAME=grep
BUILD_LIBRARIES='libiconv? gettext?'
VERSION=2.20
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=f0af452bc0d09464b6d089b6d56a0a3c16672e9ed9118fbe37b0b6aeaf069a65
UPSTREAM_SITE=https://ftp.gnu.org/gnu/grep
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
MAKE_VARS='V=1'

1
ports/grep/grep.rmpatch Normal file
View File

@ -0,0 +1 @@
rm -rf -- 'doc/stamp-vti'

View File

@ -0,0 +1,2 @@
chmod +x -- '10_sortix'
chmod +x -- 'update-grub'

869
ports/grub/grub.patch Normal file
View File

@ -0,0 +1,869 @@
diff -Paur --no-dereference -- grub.upstream/10_sortix grub/10_sortix
--- grub.upstream/10_sortix
+++ grub/10_sortix
@@ -0,0 +1,70 @@
+#!/bin/sh -e
+! [ -e /etc/sortix-release ] && exit 0
+. /etc/sortix-release
+find_mountpoint() {(
+ FILE="$1"
+ DEVICE=$(grub-probe -t device -- "$FILE")
+ while [ "$FILE" != "/" ]; do
+ PARENT="$(dirname -- "$FILE")"
+ if [ x"$(grub-probe -t device -- "$PARENT")" != x"$DEVICE" ]; then
+ echo "$FILE"
+ exit 0
+ fi
+ FILE="$PARENT"
+ done
+ echo "$FILE"
+ exit 0
+)}
+mountpoint_relative() {(
+ REL=""
+ FILE="$1"
+ DEVICE=$(grub-probe -t device -- "$FILE")
+ while [ "$FILE" != "/" ]; do
+ PARENT="$(dirname -- "$FILE")"
+ if [ x"$(grub-probe -t device -- "$PARENT")" != x"$DEVICE" ]; then
+ echo "$REL"
+ exit 0
+ fi
+ REL="/$(basename -- "$FILE")$REL"
+ FILE="$PARENT"
+ done
+ echo "$REL"
+ exit 0
+)}
+BOOT_MNT=$(find_mountpoint /boot)
+BOOT_REL=$(mountpoint_relative /boot)
+DEVICE=$(grub-probe -t device -- "$BOOT_MNT")
+FS_UUID=$(grub-probe -t fs_uuid -- "$BOOT_MNT")
+HINTS_STRING=$(grub-probe -t hints_string -- "$BOOT_MNT")
+PARTMAP=$(grub-probe -t partmap -- "$BOOT_MNT")
+FS=$(grub-probe -t fs -- "$BOOT_MNT")
+echo "Found $PRETTY_NAME on $DEVICE" >&2
+cat > "$0.cache" << EOF
+menuentry "$PRETTY_NAME (on $DEVICE)" --unrestricted {
+ insmod part_$PARTMAP
+ insmod $FS
+ search --no-floppy --fs-uuid --set=root $HINTS_STRING $FS_UUID
+ if [ -e $BOOT_REL/sortix.bin.xz ]; then
+ insmod xzio
+ multiboot $BOOT_REL/sortix.bin.xz
+ elif [ -e $BOOT_REL/sortix.bin.gz ]; then
+ insmod gzio
+ multiboot $BOOT_REL/sortix.bin.gz
+ else
+ multiboot $BOOT_REL/sortix.bin
+ fi
+ if [ -e $BOOT_REL/random.seed ]; then
+ module $BOOT_REL/random.seed --random-seed
+ fi
+ if [ -e $BOOT_REL/sortix.initrd.xz ]; then
+ insmod xzio
+ module $BOOT_REL/sortix.initrd.xz
+ elif [ -e $BOOT_REL/sortix.initrd.gz ]; then
+ insmod gzio
+ module $BOOT_REL/sortix.initrd.gz
+ else
+ module $BOOT_REL/sortix.initrd
+ fi
+}
+EOF
+cat "$0.cache"
diff -Paur --no-dereference -- grub.upstream/build-aux/config.sub grub/build-aux/config.sub
--- grub.upstream/build-aux/config.sub
+++ grub/build-aux/config.sub
@@ -1354,7 +1354,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- grub.upstream/configure grub/configure
--- grub.upstream/configure
+++ grub/configure
@@ -1,4 +1,126 @@
#! /bin/sh
+# CFLAGS containing -s produces a broken GRUB on boot.
+if [ -n "$CFLAGS" ]; then
+ CFLAGS=$(printf '%s\n' "$CFLAGS" | sed 's/\(^\|[[:space:]]\+\)-s\([[:space:]]\+\|$\)/ /g')
+fi
+# Make gnulib assume the best about unknown operating systems when cross-compiling.
+export ac_cv_func_calloc_0_nonnull=yes
+export ac_cv_func_chown_works=yes
+export ac_cv_func_getgroups_works=yes
+export ac_cv_func_malloc_0_nonnull=yes
+export gl_cv_func_cbrtl_ieee=yes
+export gl_cv_func_ceilf_ieee=yes
+export gl_cv_func_ceil_ieee=yes
+export gl_cv_func_ceill_ieee=yes
+export gl_cv_func_chown_ctime_works=yes
+export gl_cv_func_chown_slash_works=yes
+export gl_cv_func_exp2l_ieee=yes
+export gl_cv_func_expm1_ieee=yes
+export gl_cv_func_fcntl_f_dupfd_works=yes
+export gl_cv_func_fdopendir_works=yes
+export gl_cv_func_floorf_ieee=yes
+export gl_cv_func_fmaf_works=yes
+export gl_cv_func_fmal_works=yes
+export gl_cv_func_fma_works=yes
+export gl_cv_func_fmodf_ieee=yes
+export gl_cv_func_fmod_ieee=yes
+export gl_cv_func_fmodl_ieee=yes
+export gl_cv_func_fpurge_works=yes
+export gl_cv_func_futimens_works=yes
+export gl_cv_func_futimesat_works=yes
+export gl_cv_func_getgroups_works=yes
+export gl_cv_func_gettimeofday_clobber=no
+export gl_cv_func_hypotf_ieee=yes
+export gl_cv_func_hypot_ieee=yes
+export gl_cv_func_isfinitel_works=yes
+export gl_cv_func_isnanl_works=yes
+export gl_cv_func_linkat_slash=yes
+export gl_cv_func_link_works=yes
+export gl_cv_func_log10f_ieee=yes
+export gl_cv_func_log10_ieee=yes
+export gl_cv_func_log1pf_ieee=yes
+export gl_cv_func_log1p_ieee=yes
+export gl_cv_func_log1pl_ieee=yes
+export gl_cv_func_log2f_ieee=yes
+export gl_cv_func_log2_ieee=yes
+export gl_cv_func_logf_ieee=yes
+export gl_cv_func_log_ieee=yes
+export gl_cv_func_lstat_dereferences_slashed_symlink=yes
+export gl_cv_func_mbrlen_empty_input=yes
+export gl_cv_func_mbrtowc_empty_input=yes
+export gl_cv_func_memchr_works=yes
+export gl_cv_func_memmem_works_fast=yes
+export gl_cv_func_mkdir_trailing_dot_works=yes
+export gl_cv_func_mkdir_trailing_slash_works=yes
+export gl_cv_func_mkfifo_works=yes
+export gl_cv_func_mknod_works=yes
+export gl_cv_func_modff_ieee=yes
+export gl_cv_func_modf_ieee=yes
+export gl_cv_func_modfl_ieee=yes
+export gl_cv_func_nanosleep=yes
+export gl_cv_func_open_directory_works=yes
+export gl_cv_func_perror_works=yes
+export gl_cv_func_printf_directive_a=yes
+export gl_cv_func_printf_directive_f=yes
+export gl_cv_func_printf_directive_n=yes
+export gl_cv_func_printf_enomem=yes
+export gl_cv_func_printf_flag_zero=yes
+export gl_cv_func_printf_infinite_long_double=yes
+export gl_cv_func_printf_infinite=yes
+export gl_cv_func_printf_sizes_c99=yes
+export gl_cv_func_pselect_detects_ebadf=yes
+export gl_cv_func_ptsname_sets_errno=yes
+export gl_cv_func_readlink_works=yes
+export gl_cv_func_realpath_works=yes
+export gl_cv_func_remainderf_ieee=yes
+export gl_cv_func_remainder_ieee=yes
+export gl_cv_func_remainderl_ieee=yes
+export gl_cv_func_rename_dest_works=yes
+export gl_cv_func_rename_link_works=yes
+export gl_cv_func_rename_slash_dst_works=yes
+export gl_cv_func_rename_slash_src_works=yes
+export gl_cv_func_rmdir_works=yes
+export gl_cv_func_roundf_ieee=yes
+export gl_cv_func_round_ieee=yes
+export gl_cv_func_select_detects_ebadf=yes
+export gl_cv_func_setenv_works=yes
+export gl_cv_func_signbit_gcc=yes
+export gl_cv_func_signbit=yes
+export gl_cv_func_sleep_works=yes
+export gl_cv_func_snprintf_directive_n=yes
+export gl_cv_func_snprintf_retval_c99=yes
+export gl_cv_func_snprintf_truncation_c99=yes
+export gl_cv_func_stat_dir_slash=yes
+export gl_cv_func_stat_file_slash=yes
+export gl_cv_func_stpncpy=yes
+export gl_cv_func_strcasestr_linear=yes
+export gl_cv_func_strchrnul_works=yes
+export gl_cv_func_strerror_0_works=yes
+export gl_cv_func_strstr_linear=yes
+export gl_cv_func_strtod_works=yes
+export gl_cv_func_svid_putenv=yes
+export gl_cv_func_symlink_works=yes
+export gl_cv_func_tdelete_works=yes
+export gl_cv_func_truncf_ieee=yes
+export gl_cv_func_trunc_ieee=yes
+export gl_cv_func_truncl_ieee=yes
+export gl_cv_func_tzset_clobber=no
+export gl_cv_func_ungetc_works=yes
+export gl_cv_func_unlink_honors_slashes=yes
+export gl_cv_func_unsetenv_works=yes
+export gl_cv_func_usleep_works=yes
+export gl_cv_func_utimensat_works=yes
+export gl_cv_func_vsnprintf_posix=yes
+export gl_cv_func_vsnprintf_zerosize_c99=yes
+export gl_cv_func_vsprintf_posix=yes
+export gl_cv_func_wcwidth_works=yes
+export gl_cv_func_working_getdelim=yes
+export gl_cv_func_working_mkstemp=yes
+export gl_cv_func_working_mktime=yes
+export gl_cv_func_working_strerror=yes
+export ac_cv_func___fseterr=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_func_getcwd_null=yes # Only if the OS actually supports this, Sortix does.
+export gl_cv_struct_dirent_d_ino=yes # Only if the OS actually supports this, Sortix does.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for GRUB 2.02~beta2.
#
@@ -26950,6 +27072,11 @@
fi
fi
+if ${PKG_CONFIG:-pkg-config} --exists freetype2; then
+ ac_cv_prog_FREETYPE="${PKG_CONFIG:-pkg-config} freetype2"
+else
+ ac_cv_prog_FREETYPE=
+fi
FREETYPE=$ac_cv_prog_FREETYPE
if test -n "$FREETYPE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE" >&5
diff -Paur --no-dereference -- grub.upstream/grub-core/lib/libgcrypt-grub/cipher/rijndael.c grub/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
--- grub.upstream/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
+++ grub/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
@@ -180,8 +180,9 @@
static int initialized = 0;
static const char *selftest_failed=0;
int rounds;
- int i,j, r, t, rconpointer = 0;
+ int j, r, t, rconpointer = 0;
int KC;
+ unsigned i;
union
{
PROPERLY_ALIGNED_TYPE dummy;
@@ -226,7 +227,9 @@
KC = 4;
if (0)
- ;
+ {
+ ; /* [-Wempty-body] */
+ }
#ifdef USE_PADLOCK
else if ((_gcry_get_hw_features () & HWF_PADLOCK_AES))
{
@@ -349,7 +352,7 @@
else
{
#define W (ctx->keyschenc)
- for (i = 0; i < keylen; i++)
+ for (i = 0; i < keylen; i++) /* [-Wsign-compare] */
{
k[i >> 2][i & 3] = key[i];
}
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/getroot.c grub/grub-core/osdep/getroot.c
--- grub.upstream/grub-core/osdep/getroot.c
+++ grub/grub-core/osdep/getroot.c
@@ -16,6 +16,8 @@
#include "aros/getroot.c"
#elif defined (__HAIKU__)
#include "haiku/getroot.c"
+#elif defined(__sortix__)
+#include "sortix/getroot.c"
#else
# warning "No getroot OS-specific functions is available for your system. Device detection may not work properly."
#include "basic/getroot.c"
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/hostdisk.c grub/grub-core/osdep/hostdisk.c
--- grub.upstream/grub-core/osdep/hostdisk.c
+++ grub/grub-core/osdep/hostdisk.c
@@ -16,6 +16,8 @@
#include "aros/hostdisk.c"
#elif defined (__HAIKU__)
#include "haiku/hostdisk.c"
+#elif defined(__sortix__)
+#include "sortix/hostdisk.c"
#else
# warning "No hostdisk OS-specific functions is available for your system. Device detection may not work properly."
#include "basic/hostdisk.c"
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/random.c grub/grub-core/osdep/random.c
--- grub.upstream/grub-core/osdep/random.c
+++ grub/grub-core/osdep/random.c
@@ -5,6 +5,8 @@
|| defined (__GNU__) || defined (__NetBSD__) \
|| defined (__APPLE__) || defined(__sun__) || defined (__HAIKU__)
#include "unix/random.c"
+#elif defined(__sortix__)
+#include "sortix/random.c"
#else
#include "basic/random.c"
#endif
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/sortix/getroot.c grub/grub-core/osdep/sortix/getroot.c
--- grub.upstream/grub-core/osdep/sortix/getroot.c
+++ grub/grub-core/osdep/sortix/getroot.c
@@ -0,0 +1,162 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config-util.h>
+#include <config.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <grub/types.h>
+
+#include <grub/util/misc.h>
+
+#include <grub/mm.h>
+#include <grub/misc.h>
+#include <grub/emu/misc.h>
+#include <grub/emu/hostdisk.h>
+#include <grub/emu/getroot.h>
+
+int
+is_sortix_partition_path (const char *path)
+{
+ const char *dev = "/dev/";
+ size_t devlen = strlen (dev);
+ if (memcmp (path, dev, devlen) != 0)
+ return 0;
+ path += devlen;
+ if (!*path || isdigit ((unsigned char)*path))
+ return 0;
+ while (*path && !isdigit ((unsigned char)*path))
+ path++;
+ if (!*path || !isdigit ((unsigned char)*path))
+ return 0;
+ while (*path && isdigit ((unsigned char)*path))
+ path++;
+ if (*path++ != 'p')
+ return 0;
+ if (!*path || !isdigit ((unsigned char)*path))
+ return 0;
+ while (*path && isdigit ((unsigned char)*path))
+ path++;
+ if (*path)
+ return 0;
+ return 1;
+}
+
+char *
+grub_util_part_to_disk (const char *os_dev,
+ struct stat *st,
+ int *is_part)
+{
+ if (! S_ISBLK (st->st_mode))
+ {
+ *is_part = 0;
+ return xstrdup (os_dev);
+ }
+
+ char *path = realpath (os_dev, NULL);
+
+ if (is_sortix_partition_path (path))
+ {
+ *strrchr (path, 'p') = '\0';
+ *is_part = 1;
+ return path;
+ }
+
+ return path;
+}
+
+enum grub_dev_abstraction_types
+grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused)))
+{
+ return GRUB_DEV_ABSTRACTION_NONE;
+}
+
+int
+grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)),
+ enum grub_dev_abstraction_types ab __attribute__ ((unused)))
+{
+ return 0;
+}
+
+char *
+grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused)))
+{
+ return NULL;
+}
+
+
+grub_disk_addr_t
+grub_util_find_partition_start_os (const char *dev __attribute__ ((unused)))
+{
+ /* TODO: We need new system support for this in Sortix. */
+ return 0;
+}
+
+static char *
+find_sortix_root_device (const char *path)
+{
+ int fd = open (path, O_RDONLY);
+ if (fd < 0)
+ return 0;
+ ssize_t blob_size = tcgetblob (fd, "device-path", NULL, 0);
+ if (blob_size < 0)
+ return close (fd), (char *)0;
+ char *blob = malloc (blob_size + 1);
+ if (!blob)
+ return close (fd), (char *)0;
+ if (tcgetblob(fd, "device-path", blob, blob_size) != blob_size)
+ return free (blob), close (fd), (char *)0;
+ close (fd);
+ blob[blob_size] = '\0';
+ return blob;
+}
+
+char **
+grub_guess_root_devices (const char *dir)
+{
+ char **os_dev = NULL;
+
+ os_dev = xmalloc (2 * sizeof (os_dev[0]));
+
+ /* Sortix specific function. */
+ os_dev[0] = find_sortix_root_device (dir);
+
+ if (!os_dev[0])
+ {
+ free (os_dev);
+ return 0;
+ }
+
+ os_dev[1] = 0;
+
+ return os_dev;
+}
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/sortix/hostdisk.c grub/grub-core/osdep/sortix/hostdisk.c
--- grub.upstream/grub-core/osdep/sortix/hostdisk.c
+++ grub/grub-core/osdep/sortix/hostdisk.c
@@ -0,0 +1,66 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config-util.h>
+
+#include <grub/disk.h>
+#include <grub/partition.h>
+#include <grub/msdos_partition.h>
+#include <grub/types.h>
+#include <grub/err.h>
+#include <grub/emu/misc.h>
+#include <grub/emu/hostdisk.h>
+#include <grub/emu/getroot.h>
+#include <grub/misc.h>
+#include <grub/i18n.h>
+#include <grub/list.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+grub_int64_t
+grub_util_get_fd_size_os (grub_util_fd_t fd,
+ const char *name,
+ unsigned *log_secsize)
+{
+ struct stat st;
+ if (fstat (fd, &st))
+ return -1;
+ unsigned int sector_size = st.st_blksize;
+ unsigned int log_sector_size;
+ for (log_sector_size = 0;
+ (1 << log_sector_size) < sector_size;
+ log_sector_size++);
+ if (log_secsize)
+ *log_secsize = log_sector_size;
+ return st.st_size;
+}
+
+void
+grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused)))
+{
+}
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/sortix/random.c grub/grub-core/osdep/sortix/random.c
--- grub.upstream/grub-core/osdep/sortix/random.c
+++ grub/grub-core/osdep/sortix/random.c
@@ -0,0 +1,35 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1992-1999,2001,2003,2004,2005,2009,2010,2011,2012,2013 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+
+#include <grub/types.h>
+#include <grub/crypto.h>
+#include <grub/auth.h>
+#include <grub/emu/misc.h>
+#include <grub/util/misc.h>
+#include <grub/i18n.h>
+
+#include <stdlib.h>
+
+int
+grub_get_random (void *out, grub_size_t len)
+{
+ arc4random_buf(out, len);
+ return 0;
+}
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/unix/getroot.c grub/grub-core/osdep/unix/getroot.c
--- grub.upstream/grub-core/osdep/unix/getroot.c
+++ grub/grub-core/osdep/unix/getroot.c
@@ -111,7 +111,8 @@
#include <sys/mount.h>
#endif
-#if !defined (__GNU__)
+/* Sortix implements these in grub-core/osdep/sortix/getroot.c instead. */
+#if !defined (__GNU__) && !defined(__sortix__)
static void
strip_extra_slashes (char *dir)
{
@@ -441,7 +442,7 @@
cwd = xgetcwd ();
res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3);
- sprintf (res,
+ snprintf (res, strlen (cwd) + strlen (ent->d_name) + 3,
#if defined(__NetBSD__) || defined(__OpenBSD__)
/* Convert this block device to its character (raw) device. */
"%s/r%s",
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/unix/hostdisk.c grub/grub-core/osdep/unix/hostdisk.c
--- grub.upstream/grub-core/osdep/unix/hostdisk.c
+++ grub/grub-core/osdep/unix/hostdisk.c
@@ -200,16 +200,7 @@
char *
grub_canonicalize_file_name (const char *path)
{
-#if defined (PATH_MAX)
- char *ret;
-
- ret = xmalloc (PATH_MAX);
- if (!realpath (path, ret))
- return NULL;
- return ret;
-#else
- return realpath (path, NULL);
-#endif
+ return canonicalize_file_name (path);
}
FILE *
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/unix/password.c grub/grub-core/osdep/unix/password.c
--- grub.upstream/grub-core/osdep/unix/password.c
+++ grub/grub-core/osdep/unix/password.c
@@ -37,9 +37,9 @@
grub_refresh ();
/* Disable echoing. Based on glibc. */
- in = fopen ("/dev/tty", "w+c");
+ in = fopen ("/dev/tty", "w+"); /* 'c' on glibc means no thread cancellation */
if (in == NULL)
- in = stdin;
+ return 0;
if (tcgetattr (fileno (in), &t) == 0)
{
diff -Paur --no-dereference -- grub.upstream/grub-core/osdep/unix/platform.c grub/grub-core/osdep/unix/platform.c
--- grub.upstream/grub-core/osdep/unix/platform.c
+++ grub/grub-core/osdep/unix/platform.c
@@ -114,8 +114,14 @@
|| line[sizeof ("Boot") - 1] < '0'
|| line[sizeof ("Boot") - 1] > '9')
continue;
+#if defined(__sortix__)
+/* PATCH: Sortix doesn't have strcasestr yet. */
+ if (!strstr (line, efi_distributor))
+ continue;
+#else
if (!strcasestr (line, efi_distributor))
continue;
+#endif
bootnum = line + sizeof ("Boot") - 1;
bootnum[4] = '\0';
if (!verbosity)
diff -Paur --no-dereference -- grub.upstream/include/grub/emu/getroot.h grub/include/grub/emu/getroot.h
--- grub.upstream/include/grub/emu/getroot.h
+++ grub/include/grub/emu/getroot.h
@@ -101,4 +101,8 @@
grub_util_fprint_full_disk_name (FILE *f,
const char *drive, grub_device_t dev);
+#if defined(__sortix__)
+int is_sortix_partition_path (const char *path);
+#endif
+
#endif /* ! GRUB_UTIL_GETROOT_HEADER */
diff -Paur --no-dereference -- grub.upstream/update-grub grub/update-grub
--- grub.upstream/update-grub
+++ grub/update-grub
@@ -0,0 +1,2 @@
+#!/bin/sh -e
+exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
diff -Paur --no-dereference -- grub.upstream/util/getroot.c grub/util/getroot.c
--- grub.upstream/util/getroot.c
+++ grub/util/getroot.c
@@ -223,7 +223,7 @@
return convert_system_partition_to_system_disk (os_dev, &is_part);
}
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(__sortix__)
/* Context for grub_util_biosdisk_get_grub_dev. */
struct grub_util_biosdisk_get_grub_dev_ctx
{
@@ -314,6 +314,29 @@
return ret;
}
+#elif defined(__sortix__)
+
+ /* Sortix uses "/dev/[a-z]+[0-9]+(p[0-9]+)?". */
+ /*
+ * Note: we do not use the new partition naming scheme as dos_part does not
+ * necessarily correspond to an msdos partition.
+ */
+ {
+ char *dri;
+
+ dri = make_device_name (drive);
+
+ if (is_sortix_partition_path (os_dev))
+ {
+ long part = strtol (strrchr (os_dev, 'p') + 1, NULL, 10);
+ char *ret = xasprintf ("%s,%ld", dri, part);
+ free (dri);
+ return ret;
+ }
+
+ return dri;
+ }
+
#else
/* Linux counts partitions uniformly, whether a BSD partition or a DOS
diff -Paur --no-dereference -- grub.upstream/util/grub.d/00_header.in grub/util/grub.d/00_header.in
--- grub.upstream/util/grub.d/00_header.in
+++ grub/util/grub.d/00_header.in
@@ -27,6 +27,13 @@
. "$pkgdatadir/grub-mkconfig_lib"
+if [ -f "/etc/grubpw" ]; then
+ echo 'insmod password_pbkdf2'
+ echo 'set superusers="root"'
+ echo "password_pbkdf2 root $(cat /etc/grubpw)"
+ echo
+fi
+
# Do this as early as possible, since other commands might depend on it.
# (e.g. the `loadfont' command might need lvm or raid modules)
for i in ${GRUB_PRELOAD_MODULES} ; do
diff -Paur --no-dereference -- grub.upstream/util/grub-fstest.c grub/util/grub-fstest.c
--- grub.upstream/util/grub-fstest.c
+++ grub/util/grub-fstest.c
@@ -753,7 +753,7 @@
{
alloc_root = xmalloc (strlen (default_root) + strlen (root) + 2);
- sprintf (alloc_root, "%s,%s", default_root, root);
+ snprintf (alloc_root, strlen (default_root) + strlen (root) + 2, "%s,%s", default_root, root);
root = alloc_root;
}
}
diff -Paur --no-dereference -- grub.upstream/util/grub-mkconfig.in grub/util/grub-mkconfig.in
--- grub.upstream/util/grub-mkconfig.in
+++ grub/util/grub-mkconfig.in
@@ -102,27 +102,6 @@
esac
done
-if [ "x$EUID" = "x" ] ; then
- EUID=`id -u`
-fi
-
-if [ "$EUID" != 0 ] ; then
- root=f
- case "`uname 2>/dev/null`" in
- CYGWIN*)
- # Cygwin: Assume root if member of admin group
- for g in `id -G 2>/dev/null` ; do
- case $g in
- 0|544) root=t ;;
- esac
- done ;;
- esac
- if [ $root != t ] ; then
- gettext_printf "%s: You must run this as root\n" "$self" >&2
- exit 1
- fi
-fi
-
set $grub_probe dummy
if test -f "$1"; then
:
diff -Paur --no-dereference -- grub.upstream/util/misc.c grub/util/misc.c
--- grub.upstream/util/misc.c
+++ grub/util/misc.c
@@ -68,9 +68,10 @@
grub_util_get_path (const char *dir, const char *file)
{
char *path;
+ size_t path_size = strlen (dir) + 1 + strlen (file) + 1;
- path = (char *) xmalloc (strlen (dir) + 1 + strlen (file) + 1);
- sprintf (path, "%s/%s", dir, file);
+ path = (char *) xmalloc (path_size);
+ snprintf (path, path_size, "%s/%s", dir, file);
return path;
}
diff -Paur --no-dereference -- grub.upstream/util/probe.c grub/util/probe.c
--- grub.upstream/util/probe.c
+++ grub/util/probe.c
@@ -81,6 +81,22 @@
ptr++;
else
ptr = canon;
+#if defined(__sortix__)
+ if (! strncmp(ptr, "ata", strlen ("ata")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ata"))))
+ {
+ int num = strtol(ptr + strlen("ata"), NULL, 10);
+ free (canon);
+ return xasprintf ("hd%d", num);
+ }
+ if (! strncmp(ptr, "ahci", strlen ("ahci")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ahci"))))
+ {
+ int num = strtol(ptr + strlen("ahci"), NULL, 10);
+ free (canon);
+ return xasprintf ("hd%d", num);
+ }
+#endif
if ((ptr[0] == 's' || ptr[0] == 'h') && ptr[1] == 'd')
{
int num = ptr[2] - 'a';
@@ -110,6 +126,22 @@
ptr++;
else
ptr = canon;
+#if defined(__sortix__)
+ if (! strncmp(ptr, "ata", strlen ("ata")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ata"))))
+ {
+ int num = strtol(ptr + strlen("ata"), NULL, 10);
+ free (canon);
+ return xasprintf ("hd%d", num);
+ }
+ if (! strncmp(ptr, "ahci", strlen ("ahci")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ahci"))))
+ {
+ int num = strtol(ptr + strlen("ahci"), NULL, 10);
+ free (canon);
+ return xasprintf ("hd%d", num);
+ }
+#endif
if ((ptr[0] == 's' || ptr[0] == 'h') && ptr[1] == 'd')
{
int num = ptr[2] - 'a';
@@ -139,6 +171,22 @@
ptr++;
else
ptr = canon;
+#if defined(__sortix__)
+ if (! strncmp(ptr, "ata", strlen ("ata")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ata"))))
+ {
+ int num = strtol(ptr + strlen("ata"), NULL, 10);
+ free (canon);
+ return xasprintf ("ata%d", num);
+ }
+ if (! strncmp(ptr, "ahci", strlen ("ahci")) &&
+ isdigit((unsigned char)*(ptr + strlen ("ahci"))))
+ {
+ int num = strtol(ptr + strlen("ahci"), NULL, 10);
+ free (canon);
+ return xasprintf ("ahci%d", num);
+ }
+#endif
if (ptr[0] == 'h' && ptr[1] == 'd')
{
int num = ptr[2] - 'a';
diff -Paur --no-dereference -- grub.upstream/util/resolve.c grub/util/resolve.c
--- grub.upstream/util/resolve.c
+++ grub/util/resolve.c
@@ -172,7 +172,7 @@
else
{
base = xmalloc (strlen (str) + 4 + 1);
- sprintf (base, "%s.mod", str);
+ snprintf (base, strlen (str) + 4 + 1, "%s.mod", str);
}
dir = strchr (str, '/');

13
ports/grub/grub.port Normal file
View File

@ -0,0 +1,13 @@
NAME=grub
BUILD_LIBRARIES='libiconv? gettext? libfreetype? xz?'
VERSION=1.0-rc1
DISTNAME=sortix-grub-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=82ac8faf257fb3476969a0b79a0b5fd53d4cdefb2e2aa5941381477e38c5f9c5
UPSTREAM_SITE=https://pub.sortix.org/sortix/toolchain
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS='--disable-werror --program-prefix='
POST_INSTALL=../grub.post-install
VERSION_REGEX='([0-9]+\.[0-9]+(\.[0-9]+)*(-rc[0-9]+)?)'

10
ports/grub/grub.post-install Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh -e
cp update-grub "$TIX_INSTALL_DIR$EXEC_PREFIX/sbin/update-grub"
cp 10_sortix "$TIX_INSTALL_DIR$PREFIX/etc/grub.d/10_sortix"
if [ ! -e "$TIX_INSTALL_DIR$PREFIX/share/grub/unicode.pf2" ]; then
# Cheat as I'm not sure how to get this when cross-building.
[ -e /share/grub/unicode.pf2 ] &&
cp /share/grub/unicode.pf2 "$TIX_INSTALL_DIR$PREFIX/share/grub/unicode.pf2"
[ -e /usr/share/grub/unicode.pf2 ] &&
cp /usr/share/grub/unicode.pf2 "$TIX_INSTALL_DIR$PREFIX/share/grub/unicode.pf2"
fi

2
ports/grub/grub.rmpatch Normal file
View File

@ -0,0 +1,2 @@
rm -rf -- 'docs/stamp-1'
rm -rf -- 'docs/stamp-vti'

214
ports/gzip/gzip.patch Normal file
View File

@ -0,0 +1,214 @@
diff -Paur --no-dereference -- gzip.upstream/build-aux/config.sub gzip/build-aux/config.sub
--- gzip.upstream/build-aux/config.sub
+++ gzip/build-aux/config.sub
@@ -1348,7 +1348,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- gzip.upstream/gunzip.in gzip/gunzip.in
--- gzip.upstream/gunzip.in
+++ gzip/gunzip.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Uncompress files. This is the inverse of gzip.
# Copyright (C) 2007 Free Software Foundation
diff -Paur --no-dereference -- gzip.upstream/gzexe.in gzip/gzexe.in
--- gzip.upstream/gzexe.in
+++ gzip/gzexe.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# gzexe: compressor for Unix executables.
# Use this only for binaries that you do not use frequently.
#
diff -Paur --no-dereference -- gzip.upstream/lib/fcntl.c gzip/lib/fcntl.c
--- gzip.upstream/lib/fcntl.c
+++ gzip/lib/fcntl.c
@@ -181,7 +181,7 @@
result = dupfd (fd, target, 0);
break;
}
-#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+#elif (FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR) && !defined(__sortix__)
case F_DUPFD:
{
int target = va_arg (arg, int);
diff -Paur --no-dereference -- gzip.upstream/lib/freadahead.c gzip/lib/freadahead.c
--- gzip.upstream/lib/freadahead.c
+++ gzip/lib/freadahead.c
@@ -22,6 +22,10 @@
#include <stdlib.h>
#include "stdio-impl.h"
+#if defined __sortix__
+#include <FILE.h>
+#endif
+
size_t
freadahead (FILE *fp)
{
@@ -84,6 +88,10 @@
if (fp->state == 4 /* WR */ || fp->rp >= fp->wp)
return 0;
return fp->wp - fp->rp;
+#elif defined __sortix__
+ if ( !(fp->flags & _FILE_LAST_READ) )
+ return 0;
+ return fp->amount_input_buffered - fp->offset_input_buffer;
#elif defined SLOW_BUT_NO_HACKS /* users can define this */
abort ();
return 0;
diff -Paur --no-dereference -- gzip.upstream/lib/fseeko.c gzip/lib/fseeko.c
--- gzip.upstream/lib/fseeko.c
+++ gzip/lib/fseeko.c
@@ -99,6 +99,8 @@
#elif defined EPLAN9 /* Plan9 */
if (fp->rp == fp->buf
&& fp->wp == fp->buf)
+#elif defined __sortix__
+ if (0) /* wtf is this shit - sortix handles fseeko just fine. */
#else
#error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
#endif
diff -Paur --no-dereference -- gzip.upstream/lib/fseterr.c gzip/lib/fseterr.c
--- gzip.upstream/lib/fseterr.c
+++ gzip/lib/fseterr.c
@@ -23,6 +23,10 @@
#include "stdio-impl.h"
+#if defined __sortix__
+#include <FILE.h>
+#endif
+
void
fseterr (FILE *fp)
{
@@ -48,6 +52,8 @@
#elif defined EPLAN9 /* Plan9 */
if (fp->state != 0 /* CLOSED */)
fp->state = 5 /* ERR */;
+#elif defined __sortix__
+ fp->flags |= _FILE_STATUS_ERROR;
#elif 0 /* unknown */
/* Portable fallback, based on an idea by Rich Felker.
Wow! 6 system calls for something that is just a bit operation!
diff -Paur --no-dereference -- gzip.upstream/Makefile.am gzip/Makefile.am
--- gzip.upstream/Makefile.am
+++ gzip/Makefile.am
@@ -82,7 +82,6 @@
SUFFIXES = .in
.in:
$(AM_V_GEN)sed \
- -e 's|/bin/sh|$(SHELL)|g' \
-e 's|[@]bindir@|'\''$(bindir)'\''|g' \
-e 's|[@]VERSION@|$(VERSION)|g' \
$(srcdir)/$@.in >$@-t \
diff -Paur --no-dereference -- gzip.upstream/Makefile.in gzip/Makefile.in
--- gzip.upstream/Makefile.in
+++ gzip/Makefile.in
@@ -2102,7 +2102,6 @@
$(AM_V_GEN)./gzip < $(srcdir)/gzip.doc >$@-t && mv $@-t $@
.in:
$(AM_V_GEN)sed \
- -e 's|/bin/sh|$(SHELL)|g' \
-e 's|[@]bindir@|'\''$(bindir)'\''|g' \
-e 's|[@]VERSION@|$(VERSION)|g' \
$(srcdir)/$@.in >$@-t \
diff -Paur --no-dereference -- gzip.upstream/zcat.in gzip/zcat.in
--- gzip.upstream/zcat.in
+++ gzip/zcat.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Uncompress files to standard output.
# Copyright (C) 2007 Free Software Foundation
diff -Paur --no-dereference -- gzip.upstream/zcmp.in gzip/zcmp.in
--- gzip.upstream/zcmp.in
+++ gzip/zcmp.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Compare the uncompressed contents of compressed files, byte by byte.
# Copyright (C) 2007, 2010-2012 Free Software Foundation, Inc.
diff -Paur --no-dereference -- gzip.upstream/zdiff.in gzip/zdiff.in
--- gzip.upstream/zdiff.in
+++ gzip/zdiff.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Copyright (C) 1998, 2002, 2006, 2007, 2009 Free Software Foundation
diff -Paur --no-dereference -- gzip.upstream/zegrep.in gzip/zegrep.in
--- gzip.upstream/zegrep.in
+++ gzip/zegrep.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
bindir=@bindir@
case $1 in
--__bindir) bindir=${2?}; shift; shift;;
diff -Paur --no-dereference -- gzip.upstream/zfgrep.in gzip/zfgrep.in
--- gzip.upstream/zfgrep.in
+++ gzip/zfgrep.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
bindir=@bindir@
case $1 in
--__bindir) bindir=${2?}; shift; shift;;
diff -Paur --no-dereference -- gzip.upstream/zforce.in gzip/zforce.in
--- gzip.upstream/zforce.in
+++ gzip/zforce.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# zforce: force a gz extension on all gzip files so that gzip will not
# compress them twice.
#
diff -Paur --no-dereference -- gzip.upstream/zgrep.in gzip/zgrep.in
--- gzip.upstream/zgrep.in
+++ gzip/zgrep.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# zgrep -- a wrapper around a grep program that decompresses files as needed
# Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
diff -Paur --no-dereference -- gzip.upstream/zless.in gzip/zless.in
--- gzip.upstream/zless.in
+++ gzip/zless.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
diff -Paur --no-dereference -- gzip.upstream/zmore.in gzip/zmore.in
--- gzip.upstream/zmore.in
+++ gzip/zmore.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Copyright (C) 2001, 2002, 2007, 2010 Free Software Foundation
# Copyright (C) 1992, 1993 Jean-loup Gailly
diff -Paur --no-dereference -- gzip.upstream/znew.in gzip/znew.in
--- gzip.upstream/znew.in
+++ gzip/znew.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!sh
# Copyright (C) 1998, 2002, 2004, 2007, 2010 Free Software Foundation
# Copyright (C) 1993 Jean-loup Gailly

12
ports/gzip/gzip.port Normal file
View File

@ -0,0 +1,12 @@
NAME=gzip
BUILD_LIBRARIES=libz
VERSION=1.5
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=9ac20a3841a1246a8bedd800ea1fb93ef76521535d89cb59397d267026b6a173
UPSTREAM_SITE=https://ftp.gnu.org/gnu/gzip
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
MAKE_VARS='V=1'
CONFIGURE_VARS='gt_cv_locale_fr=false gt_cv_locale_ja=false gt_cv_locale_fr_utf8=false gt_cv_locale_ja_utf8=false gt_cv_locale_tr_utf8=false gt_cv_locale_zh_CN=false'

12
ports/hello/hello.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Paur --no-dereference -- hello.upstream/build-aux/config.sub hello/build-aux/config.sub
--- hello.upstream/build-aux/config.sub
+++ hello/build-aux/config.sub
@@ -1342,7 +1342,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \

11
ports/hello/hello.port Normal file
View File

@ -0,0 +1,11 @@
NAME=hello
BUILD_LIBRARIES='libiconv? gettext?'
VERSION=2.8
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=e6b77f81f7cf7daefad4a9f5b65de6cae9c3f13b8cfbaea8cb53bb5ea5460d73
UPSTREAM_SITE=https://ftp.gnu.org/gnu/hello
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_VARS='gt_cv_locale_fr=false gt_cv_locale_ja=false gt_cv_locale_fr_utf8=false gt_cv_locale_ja_utf8=false gt_cv_locale_tr_utf8=false gt_cv_locale_zh_CN=false'

View File

@ -0,0 +1 @@
chmod +x -- 'make.sortix'

12
ports/libSDL/libSDL.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Paur --no-dereference -- libSDL.upstream/make.sortix libSDL/make.sortix
--- libSDL.upstream/make.sortix
+++ libSDL/make.sortix
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+"$MAKE" "$@"
+
+if [ "$1" = "install" ]; then
+rm -fv "$DESTDIR/$EXEC_PREFIX/bin/sdl-config"
+fi

13
ports/libSDL/libSDL.port Normal file
View File

@ -0,0 +1,13 @@
NAME=libSDL
BUILD_LIBRARIES='libstdc++ libiconv libgmp'
VERSION=1.2.15
DISTNAME=sortix-libSDL-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=09e4215a0f8ecad45a36aee04f97bfb662cf9578e3bee55dbd3750a9dd021b12
UPSTREAM_SITE=https://pub.sortix.org/fork/libSDL
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS='--without-x --disable-pulseaudio --enable-video-dispd --disable-pthreads'
MAKE=./make.sortix
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,6 @@
NAME=libavcodec
SOURCE_PORT=ffmpeg
BUILD_SYSTEM=configure
DIRTY_FILE=ffbuild/config.mak
CONFIGURE_ARGS='--disable-x86asm --enable-version3 --optflags=" " --disable-debug --disable-programs'
MAKE_VARS='V=1'

View File

@ -0,0 +1,90 @@
diff -Paur --no-dereference -- libcairo.upstream/build/config.sub libcairo/build/config.sub
--- libcairo.upstream/build/config.sub
+++ libcairo/build/config.sub
@@ -1348,7 +1348,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libcairo.upstream/build/configure.ac.warnings libcairo/build/configure.ac.warnings
--- libcairo.upstream/build/configure.ac.warnings
+++ libcairo/build/configure.ac.warnings
@@ -36,16 +36,6 @@
dnl We also abuse the warning-flag facility to enable other compiler
dnl options. Namely, the following:
-dnl -flto working really needs a test link, not just a compile
-
-safe_MAYBE_WARN="$MAYBE_WARN"
-MAYBE_WARN="$MAYBE_WARN -flto"
-AC_TRY_LINK([],[
- int main(int argc, char **argv) { return 0; }
-],[],[
- MAYBE_WARN="$safe_MAYBE_WARN"
-])
-
MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
dnl Also to turn various gcc/glibc-specific preprocessor checks
diff -Paur --no-dereference -- libcairo.upstream/configure libcairo/configure
--- libcairo.upstream/configure
+++ libcairo/configure
@@ -18159,33 +18159,6 @@
MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \
-erroff=E_ENUM_TYPE_MISMATCH_OP"
-
-
-safe_MAYBE_WARN="$MAYBE_WARN"
-MAYBE_WARN="$MAYBE_WARN -flto"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- int main(int argc, char **argv) { return 0; }
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-else
-
- MAYBE_WARN="$safe_MAYBE_WARN"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
@@ -31800,7 +31773,7 @@
-if pkg-config --exists 'pixman-1 >= 0.27.1'; then
+if ${PKG_CONFIG:-pkg-config} --exists 'pixman-1 >= 0.27.1'; then
$as_echo "#define HAS_PIXMAN_GLYPHS 1" >>confdefs.h
diff -Paur --no-dereference -- libcairo.upstream/configure.ac libcairo/configure.ac
--- libcairo.upstream/configure.ac
+++ libcairo/configure.ac
@@ -662,7 +662,7 @@
image_LIBS=$pixman_LIBS
])
-if pkg-config --exists 'pixman-1 >= 0.27.1'; then
+if ${PKG_CONFIG:-pkg-config} --exists 'pixman-1 >= 0.27.1'; then
AC_DEFINE([HAS_PIXMAN_GLYPHS], 1, [Enable pixman glyph cache])
fi

View File

@ -0,0 +1,13 @@
NAME=libcairo
BUILD_LIBRARIES='libz bzip2 libpng libfreetype libfontconfig? librsvg? libexpat? libpixman libglib?'
VERSION=1.12.14
DISTNAME=cairo-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=96d0d1e3f9b74d2ca3469ff187c5e5f25649b1ad35cf06f4f3a83847dff4ac13
UPSTREAM_SITE=https://www.cairographics.org/releases
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS='--without-x --disable-valgrind --disable-xlib --enable-xlib=no --enable-xcb=no --enable-xlib-xcb=no --enable-xcb-shm=no --enable-glx=no'
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,45 @@
rm -rf -- 'boilerplate/cairo-boilerplate-constructors.c'
rm -rf -- 'doc/public/xml/'
rm -rf -- 'doc/public/xml/api-index-1.0.xml'
rm -rf -- 'doc/public/xml/api-index-1.10.xml'
rm -rf -- 'doc/public/xml/api-index-1.12.xml'
rm -rf -- 'doc/public/xml/api-index-1.2.xml'
rm -rf -- 'doc/public/xml/api-index-1.4.xml'
rm -rf -- 'doc/public/xml/api-index-1.6.xml'
rm -rf -- 'doc/public/xml/api-index-1.8.xml'
rm -rf -- 'doc/public/xml/api-index-TBD.xml'
rm -rf -- 'doc/public/xml/api-index-deprecated.xml'
rm -rf -- 'doc/public/xml/api-index-full.xml'
rm -rf -- 'doc/public/xml/cairo-device.xml'
rm -rf -- 'doc/public/xml/cairo-font-face.xml'
rm -rf -- 'doc/public/xml/cairo-font-options.xml'
rm -rf -- 'doc/public/xml/cairo-ft.xml'
rm -rf -- 'doc/public/xml/cairo-image.xml'
rm -rf -- 'doc/public/xml/cairo-matrix.xml'
rm -rf -- 'doc/public/xml/cairo-paths.xml'
rm -rf -- 'doc/public/xml/cairo-pattern.xml'
rm -rf -- 'doc/public/xml/cairo-pdf.xml'
rm -rf -- 'doc/public/xml/cairo-png.xml'
rm -rf -- 'doc/public/xml/cairo-ps.xml'
rm -rf -- 'doc/public/xml/cairo-quartz-fonts.xml'
rm -rf -- 'doc/public/xml/cairo-quartz.xml'
rm -rf -- 'doc/public/xml/cairo-raster-source.xml'
rm -rf -- 'doc/public/xml/cairo-recording.xml'
rm -rf -- 'doc/public/xml/cairo-region.xml'
rm -rf -- 'doc/public/xml/cairo-scaled-font.xml'
rm -rf -- 'doc/public/xml/cairo-script.xml'
rm -rf -- 'doc/public/xml/cairo-status.xml'
rm -rf -- 'doc/public/xml/cairo-surface.xml'
rm -rf -- 'doc/public/xml/cairo-svg.xml'
rm -rf -- 'doc/public/xml/cairo-text.xml'
rm -rf -- 'doc/public/xml/cairo-transforms.xml'
rm -rf -- 'doc/public/xml/cairo-types.xml'
rm -rf -- 'doc/public/xml/cairo-user-fonts.xml'
rm -rf -- 'doc/public/xml/cairo-version.xml'
rm -rf -- 'doc/public/xml/cairo-win32-fonts.xml'
rm -rf -- 'doc/public/xml/cairo-win32.xml'
rm -rf -- 'doc/public/xml/cairo-xcb.xml'
rm -rf -- 'doc/public/xml/cairo-xlib-xrender.xml'
rm -rf -- 'doc/public/xml/cairo-xlib.xml'
rm -rf -- 'doc/public/xml/cairo.xml'
rm -rf -- 'test/cairo-test-constructors.c'

233
ports/libcurl/libcurl.patch Normal file
View File

@ -0,0 +1,233 @@
diff -Paur --no-dereference -- libcurl.upstream/configure libcurl/configure
--- libcurl.upstream/configure
+++ libcurl/configure
@@ -20065,9 +20065,7 @@
fi
-if test "$HAVE_GETHOSTBYNAME" != "1"; then
- as_fn_error $? "couldn't find libraries for gethostbyname()" "$LINENO" 5
-fi
+# PATCH: gethostbyname is not actually needed.
curl_includes_winsock2="\
@@ -33676,11 +33674,8 @@
int main (void)
{
-#ifdef h_errno
+ /* PATCH: h_errno has nothing to do with getaddrinfo */
return 0;
-#else
- force compilation error
-#endif
}
@@ -45798,107 +45793,9 @@
-## ---------------------------------- ##
-## Start of distclean amending code ##
-## ---------------------------------- ##
-
-for xc_subdir in lib src tests/unit tests/server tests/libtest docs/examples
-do
-
-if test ! -f "$xc_subdir/Makefile"; then
- echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2
- exit 1
-fi
-
-# Fetch dependency tracking file list from Makefile include lines.
-
-xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null`
-xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"`
-
-# --disable-dependency-tracking might have been used, consequently
-# there is nothing to amend without a dependency tracking file list.
-
-if test $xc_cnt_words -gt 0; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: amending $xc_subdir/Makefile" >&5
-$as_echo "$as_me: amending $xc_subdir/Makefile" >&6;}
-
-# Build Makefile specific patch hunk.
-
-xc_p="$xc_subdir/xc_patch.tmp"
-
-xc_rm_depfiles=`echo "$xc_inc_lines" \
- | $SED 's%include% -rm -f%' 2>/dev/null`
-
-xc_dep_subdirs=`echo "$xc_inc_lines" \
- | $SED 's%include[ ][ ]*%%' 2>/dev/null \
- | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \
- | sort | uniq`
-
-echo "$xc_rm_depfiles" >$xc_p
-
-for xc_dep_dir in $xc_dep_subdirs; do
- echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p
- echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p
- echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p
- echo "${xc_tab}fi" >>$xc_p
-done
-
-# Build Makefile patching sed scripts.
-
-xc_s1="$xc_subdir/xc_script_1.tmp"
-xc_s2="$xc_subdir/xc_script_2.tmp"
-xc_s3="$xc_subdir/xc_script_3.tmp"
-
-cat >$xc_s1 <<\_EOT
-/^distclean[ ]*:/,/^[^ ][^ ]*:/{
- s/^.*(DEPDIR)/___xc_depdir_line___/
-}
-/^maintainer-clean[ ]*:/,/^[^ ][^ ]*:/{
- s/^.*(DEPDIR)/___xc_depdir_line___/
-}
-_EOT
-
-cat >$xc_s2 <<\_EOT
-/___xc_depdir_line___$/{
- N
- /___xc_depdir_line___$/D
-}
-_EOT
-
-cat >$xc_s3 <<_EOT
-/^___xc_depdir_line___/{
- r $xc_p
- d
-}
-_EOT
-
-# Apply patch to Makefile and cleanup.
-
-$SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1"
-$SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2"
-$SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3"
-
-if test -f "$xc_subdir/Makefile.tmp3"; then
- mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile"
-fi
-
-test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1"
-test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2"
-test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3"
-
-test -f "$xc_p" && rm -f "$xc_p"
-test -f "$xc_s1" && rm -f "$xc_s1"
-test -f "$xc_s2" && rm -f "$xc_s2"
-test -f "$xc_s3" && rm -f "$xc_s3"
-
-fi
-
-done
-
-## -------------------------------- ##
-## End of distclean amending code ##
-## -------------------------------- ##
+# PATCH: Removed cursed distclean patching logic that somehow produces distclean
+# targets for me with hundreds of thousands of duplicate rm -f commands.
+# The build seems to work fine without it.
diff -Paur --no-dereference -- libcurl.upstream/docs/Makefile.in libcurl/docs/Makefile.in
--- libcurl.upstream/docs/Makefile.in
+++ libcurl/docs/Makefile.in
@@ -461,10 +461,10 @@
# but distribute it (using the relative file name) in the next variable
man_MANS = $(abs_builddir)/curl.1
noinst_man_MANS = curl.1 mk-ca-bundle.1
-dist_man_MANS = curl-config.1
-GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html
-PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf
-MANDISTPAGES = curl.1.dist curl-config.1.dist
+dist_man_MANS =
+GENHTMLPAGES = curl.html mk-ca-bundle.html
+PDFPAGES = curl.pdf mk-ca-bundle.pdf
+MANDISTPAGES = curl.1.dist
HTMLPAGES = $(GENHTMLPAGES) index.html
# Build targets in this file (.) before cmdline-opts to ensure that
diff -Paur --no-dereference -- libcurl.upstream/include/curl/curl.h libcurl/include/curl/curl.h
--- libcurl.upstream/include/curl/curl.h
+++ libcurl/include/curl/curl.h
@@ -68,16 +68,7 @@
#endif
#endif
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on systems that are known to
- require it! */
-#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
- defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
- defined(__CYGWIN__) || \
- (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
-#endif
#if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
diff -Paur --no-dereference -- libcurl.upstream/lib/curl_addrinfo.h libcurl/lib/curl_addrinfo.h
--- libcurl.upstream/lib/curl_addrinfo.h
+++ libcurl/lib/curl_addrinfo.h
@@ -71,6 +71,16 @@
Curl_addrinfo **result);
#endif
+#if defined(__sortix__)
+struct hostent
+{
+ char* h_name;
+ char** h_aliases;
+ int h_addrtype;
+ int h_length;
+ char** h_addr_list;
+};
+#endif
Curl_addrinfo *
Curl_he2ai(const struct hostent *he, int port);
diff -Paur --no-dereference -- libcurl.upstream/lib/mprintf.c libcurl/lib/mprintf.c
--- libcurl.upstream/lib/mprintf.c
+++ libcurl/lib/mprintf.c
@@ -946,7 +946,7 @@
/* NOTE NOTE NOTE!! Not all sprintf implementations return number of
output characters */
- (sprintf)(work, formatbuf, p->data.dnum);
+ (snprintf)(work, sizeof(work), formatbuf, p->data.dnum);
DEBUGASSERT(strlen(work) <= sizeof(work));
for(fptr = work; *fptr; fptr++)
OUTCHAR(*fptr);
diff -Paur --no-dereference -- libcurl.upstream/Makefile.in libcurl/Makefile.in
--- libcurl.upstream/Makefile.in
+++ libcurl/Makefile.in
@@ -652,7 +652,7 @@
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \
$(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ)
-bin_SCRIPTS = curl-config
+bin_SCRIPTS =
SUBDIRS = lib src
DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
pkgconfigdir = $(libdir)/pkgconfig
@@ -1285,6 +1285,12 @@
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
+ -rm -f docs/cmdline-opts/Makefile
+ -rm -rf docs/examples/.deps
+ -rm -f docs/examples/Makefile
+ -rm -f docs/libcurl/Makefile
+ -rm -f docs/libcurl/opts/Makefile
+ -rm -f docs/Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags

View File

@ -0,0 +1,13 @@
NAME=libcurl
BUILD_LIBRARIES='libz? libssl? libidn? libssh2? librtmp? libmetalink? libpsl?'
VERSION=7.69.0
DISTNAME=curl-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=9fadf2f082c127757808a28ddd5ab9d1bc2c7061ca7ddaf85814285e15e3271f
UPSTREAM_SITE=https://curl.se/download
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS='--with-ca-bundle=/etc/ssl/cert.pem --with-ca-path=/etc/ssl/certs'
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,3 @@
rm -rf -- 'Makefile'
rm -rf -- 'docs/curl.1'
rm -rf -- 'src/tool_hugehelp.c'

View File

@ -0,0 +1,905 @@
diff -Paur --no-dereference -- libcurses.upstream/GNUmakefile libcurses/GNUmakefile
--- libcurses.upstream/GNUmakefile
+++ libcurses/GNUmakefile
@@ -1,4 +1,5 @@
-HOSTCC ?= $(CC)
+CC_FOR_BUILD ?= $(CC)
+HOSTCC ?= $(CC_FOR_BUILD)
AWK ?= awk
AR ?= ar
RANLIB ?= ranlib
@@ -11,13 +12,15 @@
PIC = -fPIC
-PREFIX=/usr/local
-BINDIR=$(PREFIX)/bin
-LIBDIR=$(PREFIX)/lib
-INCDIR=$(PREFIX)/include
-MANDIR=$(PREFIX)/share/man
-MAN1DIR=$(MANDIR)/man1
-MAN3DIR=$(MANDIR)/man3
+PREFIX?=/usr/local
+EXEC_PREFIX?=$(PREFIX)
+BINDIR?=$(EXEC_PREFIX)/bin
+LIBDIR?=$(EXEC_PREFIX)/lib
+INCLUDEDIR?=$(PREFIX)/include
+INCDIR?=$(INCLUDEDIR)
+MANDIR?=$(PREFIX)/share/man
+MAN1DIR?=$(MANDIR)/man1
+MAN3DIR?=$(MANDIR)/man3
-include config.mak
@@ -40,6 +43,7 @@
else
STATIC_BINS=0
endif
+STATIC_BINS=1
CFLAGS+=-Werror-implicit-function-declaration
CPPFLAGS+= -I. -I./libterminfo
@@ -166,7 +170,8 @@
TI_LINKLIB=$(TI_LIBA)
endif
-all: $(STALIBS) $(DYNLIBS) $(PROGS)
+#all: $(STALIBS) $(DYNLIBS) $(PROGS)
+all: all-static
all-static: $(STALIBS) $(PROGS)
@@ -181,7 +186,7 @@
install-tput: tput/tput tput/clear.sh
$(INSTALL) -Dm 755 tput/tput $(DESTDIR)$(BINDIR)/tput
- $(INSTALL) -Dm 755 tput/clear.sh $(DESTDIR)$(BINDIR)/clear
+ #$(INSTALL) -Dm 755 tput/clear.sh $(DESTDIR)$(BINDIR)/clear
install-infocmp: infocmp/infocmp
$(INSTALL) -Dm 755 infocmp/infocmp $(DESTDIR)$(BINDIR)/infocmp
@@ -257,7 +262,8 @@
$(LN) -sf $(notdir $<) $(DESTDIR)$(LIBDIR)/$(basename $(notdir $<))w$(SO_SUFFIX)
install-dynlibs: install-dynlib-terminfo install-dynlib-curses install-dynlib-panel install-dynlib-menu install-dynlib-form
-install-libs: install-stalibs install-dynlibs
+#install-libs: install-stalibs install-dynlibs
+install-libs: install-stalibs
install-pc-dir:
$(MKDIR) -p $(DESTDIR)$(LIBDIR)/pkgconfig
@@ -329,7 +335,15 @@
install-manpages: install-prog-manpages install-lib-manpages
-install: install-headers install-libs install-progs install-pcs install-manpages
+install-terminfo: $(TOOL_HOSTTIC)
+ cat terminfo/terminfo terminfo/sortix.terminfo > $(DESTDIR)$(PREFIX)/share/terminfo.tmp
+ $(TOOL_HOSTTIC) -x -o $(DESTDIR)$(PREFIX)/share/terminfo.cdb $(DESTDIR)$(PREFIX)/share/terminfo.tmp
+ rm -f $(DESTDIR)$(PREFIX)/share/terminfo.tmp
+ mkdir -p $(DESTDIR)$(PREFIX)/share/terminfo
+ mkdir -p $(DESTDIR)$(PREFIX)/share/terminfo/s
+ cp terminfo/sortix.terminfo $(DESTDIR)$(PREFIX)/share/terminfo/s/sortix.terminfo
+
+install: install-headers install-libs install-progs install-pcs install-manpages install-terminfo
install-static: install-headers install-progs install-pcs install-stalibs
install-dynamic: TI_LINKLIB=$(TI_LIBSO)
@@ -549,4 +563,4 @@
install-man-infocmp install-man-tabs install-prog-manpages \
install-man-terminfo install-man-curses install-man-panel \
install-man-menu install-man-form install-lib-manpages \
- install-manpages
+ install-manpages install-terminfo
diff -Paur --no-dereference -- libcurses.upstream/libcurses/acs.c libcurses/libcurses/acs.c
--- libcurses.upstream/libcurses/acs.c
+++ libcurses/libcurses/acs.c
@@ -38,7 +38,9 @@
#ifdef HAVE_WCHAR
#include <assert.h>
#include <locale.h>
+#if !defined(__sortix__) || (defined(__has_include) && __has_include(<langinfo.h>))
#include <langinfo.h>
+#endif
#include <strings.h>
cchar_t _wacs_char[ NUM_ACS ];
@@ -156,7 +158,11 @@
/* Add the SUSv2 defaults (those that are not '+') */
if (!strcmp(setlocale(LC_CTYPE, NULL), "C"))
setlocale(LC_CTYPE, "");
+#if !defined(__sortix__) || (defined(__has_include) && __has_include(<langinfo.h>))
lstr = nl_langinfo(CODESET);
+#else
+ lstr = "UTF-8";
+#endif
_DIAGASSERT(lstr);
if (strcasecmp(lstr, "UTF-8")) {
#ifdef DEBUG
diff -Paur --no-dereference -- libcurses.upstream/libcurses/color.c libcurses/libcurses/color.c
--- libcurses.upstream/libcurses/color.c
+++ libcurses/libcurses/color.c
@@ -35,6 +35,8 @@
#include "curses.h"
#include "curses_private.h"
+typedef uint32_t u_int32_t;
+
/* Have we initialised colours? */
int __using_color = 0;
diff -Paur --no-dereference -- libcurses.upstream/libcurses/cur_hash.c libcurses/libcurses/cur_hash.c
--- libcurses.upstream/libcurses/cur_hash.c
+++ libcurses/libcurses/cur_hash.c
@@ -36,6 +36,8 @@
#include "curses.h"
#include "curses_private.h"
+typedef unsigned int u_int;
+
/*
* __hash_more() is "hashpjw" from the Dragon Book, Aho, Sethi & Ullman, p.436.
*/
diff -Paur --no-dereference -- libcurses.upstream/libcurses/get_wch.c libcurses/libcurses/get_wch.c
--- libcurses.upstream/libcurses/get_wch.c
+++ libcurses/libcurses/get_wch.c
@@ -44,6 +44,35 @@
#include "curses_private.h"
#include "keymap.h"
+#ifdef __sortix__
+#include <errno.h>
+#include <stdio_ext.h>
+static wint_t getwchar(void)
+{
+ mbstate_t ps = { 0 };
+ wchar_t wc;
+ while (1) {
+ int ic = getchar();
+ if (ic == EOF) {
+ if (!mbsinit(&ps)) {
+ errno = EILSEQ;
+ __fseterr(stdin);
+ }
+ return WEOF;
+ }
+ char c = ic;
+ size_t bytes = mbrtowc(&wc, &c, 1, &ps);
+ if (bytes == (size_t) -1) {
+ __fseterr(stdin);
+ return WEOF;
+ }
+ if (bytes == (size_t) -2)
+ continue;
+ return wc;
+ }
+}
+#endif
+
#ifdef HAVE_WCHAR
static short wstate; /* state of the wcinkey function */
#endif /* HAVE_WCHAR */
diff -Paur --no-dereference -- libcurses.upstream/libcurses/putchar.c libcurses/libcurses/putchar.c
--- libcurses.upstream/libcurses/putchar.c
+++ libcurses/libcurses/putchar.c
@@ -31,6 +31,8 @@
#include <netbsd_sys/cdefs.h>
+#include <stdlib.h>
+
#include "curses.h"
#include "curses_private.h"
@@ -68,7 +70,18 @@
#ifdef DEBUG
__CTRACE(__CTRACE_OUTPUT, "__cputwchar: 0x%x\n", wch);
#endif
+#ifdef __sortix__
+ mbstate_t ps = { 0 };
+ char mb[MB_CUR_MAX];
+ size_t bytes = wcrtomb(mb, wch, &ps);
+ if (bytes == (size_t) -1)
+ return WEOF;
+ if (fwrite(mb, bytes, 1, _cursesi_screen->outfd) != 1)
+ return WEOF;
+ return wch;
+#else
return (putwc(wch, _cursesi_screen->outfd));
+#endif
}
/*
@@ -85,6 +98,17 @@
__CTRACE(__CTRACE_OUTPUT, "__cputwchar_args: 0x%x on fd %d\n",
wch, outfd->_file);
#endif
+#ifdef __sortix__
+ mbstate_t ps = { 0 };
+ char mb[MB_CUR_MAX];
+ size_t bytes = wcrtomb(mb, wch, &ps);
+ if (bytes == (size_t) -1)
+ return WEOF;
+ if (fwrite(mb, bytes, 1, outfd) != 1)
+ return WEOF;
+ return wch;
+#else
return putwc(wch, outfd);
+#endif
}
#endif /* HAVE_WCHAR */
diff -Paur --no-dereference -- libcurses.upstream/libcurses/refresh.c libcurses/libcurses/refresh.c
--- libcurses.upstream/libcurses/refresh.c
+++ libcurses/libcurses/refresh.c
@@ -37,6 +37,8 @@
#include "curses.h"
#include "curses_private.h"
+typedef unsigned int u_int;
+
static void domvcur(int, int, int, int);
static int makech(int);
static void quickch(void);
diff -Paur --no-dereference -- libcurses.upstream/libcurses/tty.c libcurses/libcurses/tty.c
--- libcurses.upstream/libcurses/tty.c
+++ libcurses/libcurses/tty.c
@@ -63,6 +63,10 @@
#endif
#endif
+#ifndef ONLCR
+#define ONLCR 0
+#endif
+
/*
* baudrate --
* Return the current baudrate
diff -Paur --no-dereference -- libcurses.upstream/libform/field.c libcurses/libform/field.c
--- libcurses.upstream/libform/field.c
+++ libcurses/libform/field.c
@@ -31,7 +31,6 @@
#include <string.h>
#include <stdlib.h>
#include <netbsd_sys/cdefs.h>
-#include <sys/param.h>
#include <stdlib.h>
#include <strings.h>
#include <stdarg.h>
diff -Paur --no-dereference -- libcurses.upstream/libform/type_ipv4.c libcurses/libform/type_ipv4.c
--- libcurses.upstream/libform/type_ipv4.c
+++ libcurses/libform/type_ipv4.c
@@ -79,7 +79,7 @@
hex_val = 0;
mask = 0;
- if ((slash = index(buf, '/')) != NULL)
+ if ((slash = strchr(buf, '/')) != NULL)
style = FORMI_CLASSLESS;
else {
start = _formi_skip_blanks(buf, 0);
diff -Paur --no-dereference -- libcurses.upstream/libterminfo/cdbr.c libcurses/libterminfo/cdbr.c
--- libcurses.upstream/libterminfo/cdbr.c
+++ libcurses/libterminfo/cdbr.c
@@ -59,6 +59,8 @@
#define malloc(size) kmem_alloc(size, KM_SLEEP)
#define free(ptr) kmem_free(ptr, sizeof(struct cdbr))
#else
+/* TODO: Sortix <limits.h> doesn't define everything it should. */
+#include <sys/types.h>
#include <sys/mman.h>
#include <netbsd_sys/cdbr.h>
#include <errno.h>
@@ -142,7 +144,7 @@
size = (size_t)sb.st_size;
- base = mmap(NULL, size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0);
+ base = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
close(fd);
if (base == MAP_FAILED)
diff -Paur --no-dereference -- libcurses.upstream/libterminfo/term.c libcurses/libterminfo/term.c
--- libcurses.upstream/libterminfo/term.c
+++ libcurses/libterminfo/term.c
@@ -52,6 +52,11 @@
#endif
#endif
+/* TODO: Hack. */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
static char database[PATH_MAX];
static char pathbuf[PATH_MAX];
const char *_ti_database;
diff -Paur --no-dereference -- libcurses.upstream/libterminfo/tparm.c libcurses/libterminfo/tparm.c
--- libcurses.upstream/libterminfo/tparm.c
+++ libcurses/libterminfo/tparm.c
@@ -28,11 +28,11 @@
*/
#include <netbsd_sys/cdefs.h>
-#include <sys/param.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff -Paur --no-dereference -- libcurses.upstream/netbsd_sys/cdefs.h libcurses/netbsd_sys/cdefs.h
--- libcurses.upstream/netbsd_sys/cdefs.h
+++ libcurses/netbsd_sys/cdefs.h
@@ -60,5 +60,10 @@
#define __predict_false(exp) (exp)
#endif
+#if defined(__sortix__)
+#define bcopy(src, dest, size) memcpy(dest, src, size)
+#endif
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
#endif
diff -Paur --no-dereference -- libcurses.upstream/terminfo/sortix.terminfo libcurses/terminfo/sortix.terminfo
--- libcurses.upstream/terminfo/sortix.terminfo
+++ libcurses/terminfo/sortix.terminfo
@@ -0,0 +1,230 @@
+# TODO: Decode setab and setaf and see if they are what I want.
+# TODO: Implement BEL \a and add bel=^G,
+# TODO: Add blink support and add blink=\E[5m,
+# TODO: Add backtab support and add cbt=\E[Z, and kcbt=\E[Z,
+# TODO: Support csr=\E[%i%p1%d;%p2%dr,
+# TODO: Support dch=\E[%p1%dP,
+# TODO: dch1=\E[P,
+# TODO: Add faint support and add dim=\E[2m,
+# TODO: dl1=\E[M,
+# TODO: ech=\E[%p1%dX,
+# TODO: hts=\EH,
+# TODO: ich=\E[%p1%d@,
+# TODO: il=\E[%p1%dL,
+# TODO: il1=\E[L,
+# TODO: invis=\E[8m,
+# TODO: Some modifiers for the function keys are missing, like control + alt +
+# shift + f12, kfxx should probably go up to 96. On the other hand,
+# control-alt-fxx switches virtual terminals.
+# TODO: Sequences for key pad presses (with numlock off) such as kb2
+# TODO: Sequences for backspace with modifiers (kbs)?
+# TODO: Support mouse event kmous=\E[M,
+# TODO: Add italicized support sitm=\E[3m, ritm=\E[23m,
+# TODO: rmkx=\E[?1l\E>,
+# TODO: smkx=\E[?1h\E=,
+
+sortix-16color|Sortix with 16 colors,
+ am,
+ bce,
+ km,
+ mc5i,
+ msgr,
+ npc,
+ xenl,
+ colors#16,
+ cols#80,
+ it#8,
+ lines#25,
+ pairs#256,
+ bold=\E[1m,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ cr=^M,
+ cub1=\E[D,
+ cub=\E[%p1%dD,
+ cud1=^J,
+ cud=\E[%p1%dB,
+ cuf1=\E[C,
+ cuf=\E[%p1%dC,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu1=\E[A,
+ cuu=\E[%p1%dA,
+ ed=\E[J,
+ el1=\E[1K,
+ el=\E[K,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ ht=^I,
+ ind=^J,
+ indn=\E[%p1%dS,
+ nel=^J,
+ op=\E[39;49m,
+ rc=\E[u,
+ rev=\E[7m,
+ ri=\E[T,
+ rin=\E[%p1%dT,
+ rmcup=\E[?1049l,
+ rmso=\E[27m,
+ sc=\E[s,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
+ sgr0=\E[m,
+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
+ smcup=\E[?1049h,
+ smso=\E[7m,
+ vpa=\E[%i%p1%dd,
+ kbs=\177,
+ kcub1=\E[D,
+ kLFT=\E[1;2D,
+ kLFT3=\E[1;3D,
+ kLFT4=\E[1;4D,
+ kLFT5=\E[1;5D,
+ kLFT6=\E[1;6D,
+ kLFT7=\E[1;7D,
+ kLFT8=\E[1;8D,
+ kcud1=\E[B,
+ kDN=\E[1;2B,
+ kDN3=\E[1;3B,
+ kDN4=\E[1;4B,
+ kDN5=\E[1;5B,
+ kDN6=\E[1;6B,
+ kDN7=\E[1;7B,
+ kDN8=\E[1;8B,
+ kcuf1=\E[C,
+ kRIT=\E[1;2C,
+ kRIT3=\E[1;3C,
+ kRIT4=\E[1;4C,
+ kRIT5=\E[1;5C,
+ kRIT6=\E[1;6C,
+ kRIT7=\E[1;7C,
+ kRIT8=\E[1;8C,
+ kcuu1=\E[A,
+ kUP=\E[1;2A,
+ kUP3=\E[1;3A,
+ kUP4=\E[1;4A,
+ kUP5=\E[1;5A,
+ kUP6=\E[1;6A,
+ kUP7=\E[1;7A,
+ kUP8=\E[1;8A,
+ kdch1=\E[3~,
+ kDC=\E[3;2~,
+ kDC3=\E[3;3~,
+ kDC4=\E[3;4~,
+ kDC5=\E[3;5~,
+ kDC6=\E[3;6~,
+ kDC7=\E[3;7~,
+ kDC8=\E[3;8~,
+ kend=\E[F,
+ kEND=\E[1;2F,
+ kEND3=\E[1;3F,
+ kEND4=\E[1;4F,
+ kEND5=\E[1;5F,
+ kEND6=\E[1;6F,
+ kEND7=\E[1;7F,
+ kEND8=\E[1;8F,
+ kent=\E0M,
+ kf1=\EOP,
+ kf2=\EOQ,
+ kf3=\EOR,
+ kf4=\EOS,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[1;2P,
+ kf14=\E[1;2Q,
+ kf15=\E[1;2R,
+ kf16=\E[1;2S,
+ kf17=\E[15;2~,
+ kf18=\E[17;2~,
+ kf19=\E[18;2~,
+ kf20=\E[19;2~,
+ kf21=\E[20;2~,
+ kf22=\E[21;2~,
+ kf23=\E[23;2~,
+ kf24=\E[24;2~,
+ kf25=\E[1;5P,
+ kf26=\E[1;5Q,
+ kf27=\E[1;5R,
+ kf28=\E[1;5S,
+ kf29=\E[15;5~,
+ kf30=\E[17;5~,
+ kf31=\E[18;5~,
+ kf32=\E[19;5~,
+ kf33=\E[20;5~,
+ kf34=\E[21;5~,
+ kf35=\E[23;5~,
+ kf36=\E[24;5~,
+ kf37=\E[1;6P,
+ kf38=\E[1;6Q,
+ kf39=\E[1;6R,
+ kf40=\E[1;6S,
+ kf41=\E[15;6~,
+ kf42=\E[17;6~,
+ kf43=\E[18;6~,
+ kf44=\E[19;6~,
+ kf45=\E[20;6~,
+ kf46=\E[21;6~,
+ kf47=\E[23;6~,
+ kf48=\E[24;6~,
+ kf49=\E[1;3P,
+ kf50=\E[1;3Q,
+ kf51=\E[1;3R,
+ kf52=\E[1;3S,
+ kf53=\E[15;3~,
+ kf54=\E[17;3~,
+ kf55=\E[18;3~,
+ kf56=\E[19;3~,
+ kf57=\E[20;3~,
+ kf58=\E[21;3~,
+ kf59=\E[23;3~,
+ kf60=\E[24;3~,
+ kf61=\E[1;4P,
+ kf62=\E[1;4Q,
+ kf63=\E[1;4R,
+ khome=\E[H,
+ kHOM=\E[1;2H,
+ kHOM3=\E[1;3H,
+ kHOM4=\E[1;4H,
+ kHOM5=\E[1;5H,
+ kHOM6=\E[1;6H,
+ kHOM7=\E[1;7H,
+ kHOM8=\E[1;8H,
+ kich1=\E[2~,
+ kIC=\E[2;2~,
+ kIC3=\E[2;3~,
+ kIC4=\E[2;4~,
+ kIC5=\E[2;5~,
+ kIC6=\E[2;6~,
+ kIC7=\E[2;7~,
+ kIC8=\E[2;8~,
+ kind=\E[1;2B,
+ knp=\E[6~,
+ kNXT=\E[6;2~,
+ kNXT3=\E[6;3~,
+ kNXT4=\E[6;4~,
+ kNXT5=\E[6;5~,
+ kNXT6=\E[6;6~,
+ kNXT7=\E[6;7~,
+ kNXT8=\E[6;8~,
+ kpp=\E[5~,
+ kPRV=\E[5;2~,
+ kPRV3=\E[5;3~,
+ kPRV4=\E[5;4~,
+ kPRV5=\E[5;5~,
+ kPRV6=\E[5;6~,
+ kPRV7=\E[5;7~,
+ kPRV8=\E[5;8~,
+ kri=\E[1;2A,
+
+sortix|Sortix,
+ use=sortix-16color,
+ colors#256,
+ pairs#32767,
+ smul=\E[4m,
+ rmul=\E[24m,
diff -Paur --no-dereference -- libcurses.upstream/tic/musl-hsearch.c libcurses/tic/musl-hsearch.c
--- libcurses.upstream/tic/musl-hsearch.c
+++ libcurses/tic/musl-hsearch.c
@@ -0,0 +1,149 @@
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <string.h>
+
+/*
+open addressing hash table with 2^n table size
+quadratic probing is used in case of hash collision
+tab indices and hash are size_t
+after resize fails with ENOMEM the state of tab is still usable
+
+with the posix api items cannot be iterated and length cannot be queried
+*/
+
+#define MINSIZE 8
+#define MAXSIZE ((size_t)-1/2 + 1)
+
+struct __tab {
+ ENTRY *entries;
+ size_t mask;
+ size_t used;
+};
+
+static struct hsearch_data htab;
+
+int __hcreate_r(size_t, struct hsearch_data *);
+void __hdestroy_r(struct hsearch_data *);
+int __hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
+
+static size_t keyhash(char *k)
+{
+ unsigned char *p = (void *)k;
+ size_t h = 0;
+
+ while (*p)
+ h = 31*h + *p++;
+ return h;
+}
+
+static int resize(size_t nel, struct hsearch_data *htab)
+{
+ size_t newsize;
+ size_t i, j;
+ ENTRY *e, *newe;
+ ENTRY *oldtab = htab->__tab->entries;
+ ENTRY *oldend = htab->__tab->entries + htab->__tab->mask + 1;
+
+ if (nel > MAXSIZE)
+ nel = MAXSIZE;
+ for (newsize = MINSIZE; newsize < nel; newsize *= 2);
+ htab->__tab->entries = calloc(newsize, sizeof *htab->__tab->entries);
+ if (!htab->__tab->entries) {
+ htab->__tab->entries = oldtab;
+ return 0;
+ }
+ htab->__tab->mask = newsize - 1;
+ if (!oldtab)
+ return 1;
+ for (e = oldtab; e < oldend; e++)
+ if (e->key) {
+ for (i=keyhash(e->key),j=1; ; i+=j++) {
+ newe = htab->__tab->entries + (i & htab->__tab->mask);
+ if (!newe->key)
+ break;
+ }
+ *newe = *e;
+ }
+ free(oldtab);
+ return 1;
+}
+
+int hcreate(size_t nel)
+{
+ return __hcreate_r(nel, &htab);
+}
+
+void hdestroy(void)
+{
+ __hdestroy_r(&htab);
+}
+
+static ENTRY *lookup(char *key, size_t hash, struct hsearch_data *htab)
+{
+ size_t i, j;
+ ENTRY *e;
+
+ for (i=hash,j=1; ; i+=j++) {
+ e = htab->__tab->entries + (i & htab->__tab->mask);
+ if (!e->key || strcmp(e->key, key) == 0)
+ break;
+ }
+ return e;
+}
+
+ENTRY *hsearch(ENTRY item, ACTION action)
+{
+ ENTRY *e;
+
+ __hsearch_r(item, action, &e, &htab);
+ return e;
+}
+
+int __hcreate_r(size_t nel, struct hsearch_data *htab)
+{
+ int r;
+
+ htab->__tab = calloc(1, sizeof *htab->__tab);
+ if (!htab->__tab)
+ return 0;
+ r = resize(nel, htab);
+ if (r == 0) {
+ free(htab->__tab);
+ htab->__tab = 0;
+ }
+ return r;
+}
+
+void __hdestroy_r(struct hsearch_data *htab)
+{
+ if (htab->__tab) free(htab->__tab->entries);
+ free(htab->__tab);
+ htab->__tab = 0;
+}
+
+int __hsearch_r(ENTRY item, ACTION action, ENTRY **retval, struct hsearch_data *htab)
+{
+ size_t hash = keyhash(item.key);
+ ENTRY *e = lookup(item.key, hash, htab);
+
+ if (e->key) {
+ *retval = e;
+ return 1;
+ }
+ if (action == FIND) {
+ *retval = 0;
+ return 0;
+ }
+ *e = item;
+ if (++htab->__tab->used > htab->__tab->mask - htab->__tab->mask/4) {
+ if (!resize(2*htab->__tab->used, htab)) {
+ htab->__tab->used--;
+ e->key = 0;
+ *retval = 0;
+ return 0;
+ }
+ e = lookup(item.key, hash, htab);
+ }
+ *retval = e;
+ return 1;
+}
diff -Paur --no-dereference -- libcurses.upstream/tic/musl-search.h libcurses/tic/musl-search.h
--- libcurses.upstream/tic/musl-search.h
+++ libcurses/tic/musl-search.h
@@ -0,0 +1,60 @@
+#ifndef _SEARCH_H
+#define _SEARCH_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum { FIND, ENTER } ACTION;
+typedef enum { preorder, postorder, endorder, leaf } VISIT;
+
+typedef struct entry {
+ char *key;
+ void *data;
+} ENTRY;
+
+int hcreate(size_t);
+void hdestroy(void);
+ENTRY *hsearch(ENTRY, ACTION);
+
+#ifdef _GNU_SOURCE
+struct hsearch_data {
+ struct __tab *__tab;
+ unsigned int __unused1;
+ unsigned int __unused2;
+};
+
+int hcreate_r(size_t, struct hsearch_data *);
+void hdestroy_r(struct hsearch_data *);
+int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
+#endif
+
+void insque(void *, void *);
+void remque(void *);
+
+void *lsearch(const void *, void *, size_t *, size_t,
+ int (*)(const void *, const void *));
+void *lfind(const void *, const void *, size_t *, size_t,
+ int (*)(const void *, const void *));
+
+void *tdelete(const void *__restrict, void **__restrict, int(*)(const void *, const void *));
+void *tfind(const void *, void *const *, int(*)(const void *, const void *));
+void *tsearch(const void *, void **, int (*)(const void *, const void *));
+void twalk(const void *, void (*)(const void *, VISIT, int));
+
+#ifdef _GNU_SOURCE
+struct qelem {
+ struct qelem *q_forw, *q_back;
+ char q_data[1];
+};
+
+void tdestroy(void *, void (*)(void *));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -Paur --no-dereference -- libcurses.upstream/tic/tic.c libcurses/tic/tic.c
--- libcurses.upstream/tic/tic.c
+++ libcurses/tic/tic.c
@@ -49,7 +49,12 @@
#include <getopt.h>
#include <limits.h>
#include <fcntl.h>
+#if !defined(__sortix__) || (defined(__has_include) && __has_include(<search.h>))
#include <search.h>
+#else
+#include "musl-search.h"
+#include "musl-hsearch.c"
+#endif
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
diff -Paur --no-dereference -- libcurses.upstream/tset/map.c libcurses/tset/map.c
--- libcurses.upstream/tset/map.c
+++ libcurses/tset/map.c
@@ -73,7 +73,7 @@
char *copy, *p, *termp;
copy = strdup(arg);
- mapp = malloc((u_int)sizeof(MAP));
+ mapp = malloc(sizeof(MAP));
if (copy == NULL || mapp == NULL)
err(1, "malloc");
mapp->next = NULL;
diff -Paur --no-dereference -- libcurses.upstream/tset/set.c libcurses/tset/set.c
--- libcurses.upstream/tset/set.c
+++ libcurses/tset/set.c
@@ -36,7 +36,39 @@
#include <term.h>
#include <termios.h>
#include <unistd.h>
+#if !defined(__sortix__) || (defined(__has_include) && __has_include(<sys/ttydefaults.h>))
#include <sys/ttydefaults.h>
+#else
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+
+#ifdef _POSIX_VDISABLE
+#define CEOL _POSIX_VDISABLE
+#define CSTATUS _POSIX_VDISABLE
+#else
+#define CEOL '\0'
+#define CSTATUS '\0'
+#endif
+
+#define CERASE 0177
+#define CINTR CTRL('c')
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+#endif
#include "extern.h"
#ifndef OXTABS
#define OXTABS 0
diff -Paur --no-dereference -- libcurses.upstream/tset/tset.c libcurses/tset/tset.c
--- libcurses.upstream/tset/tset.c
+++ libcurses/tset/tset.c
@@ -35,7 +35,14 @@
#include <sys/types.h>
#include <sys/ioctl.h>
+#if !defined(__sortix__) || (defined(__has_include) && __has_include(<sys/ttydefaults.h>))
#include <sys/ttydefaults.h>
+#else
+#define CTRL(x) (x&037)
+#define CERASE 0177
+#define CKILL CTRL('u')
+#define CINTR CTRL('c')
+#endif
#include <ctype.h>
#include <err.h>
#include <errno.h>
@@ -47,6 +54,8 @@
#include <unistd.h>
#include "extern.h"
+typedef unsigned int u_int;
+
static void obsolete(char *[]);
static void report(const char *, int, u_int);
__dead static void usage(char*);
@@ -167,7 +176,10 @@
nlines > 0 && columns > 0) {
win.ws_row = nlines;
win.ws_col = ncolumns;
+/* TODO: Remove after TIOCSWINSZ has been merged to Sortix master. */
+#ifdef TIOCSWINSZ
(void)ioctl(STDERR_FILENO, TIOCSWINSZ, &win);
+#endif
}
#endif
set_control_chars(erasechar, intrchar, killchar);

View File

@ -0,0 +1,11 @@
NAME=libcurses
BUILD_LIBRARIES=
VERSION=0.1.0
DISTNAME=netbsd-curses-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=bea4a945c8d0ec6e923bb43882b1d261c544601c3510b73818a6c431dec7756a
UPSTREAM_SITE=https://github.com/sabotage-linux/netbsd-curses/releases/download/v$VERSION
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=makefile
UPSTREAM_SITE=https://ftp.barfooze.de/pub/sabotage/tarballs

176
ports/libdbus/libdbus.patch Normal file
View File

@ -0,0 +1,176 @@
diff -Paur --no-dereference -- libdbus.upstream/bus/activation-helper.c libdbus/bus/activation-helper.c
--- libdbus.upstream/bus/activation-helper.c
+++ libdbus/bus/activation-helper.c
@@ -43,6 +43,10 @@
#include <dbus/dbus-shell.h>
#include <dbus/dbus-marshal-validate.h>
+#if defined(__sortix__)
+#define initgroups(a, b) 0
+#endif
+
static BusDesktopFile *
desktop_file_for_name (BusConfigParser *parser,
const char *name,
diff -Paur --no-dereference -- libdbus.upstream/bus/Makefile.in libdbus/bus/Makefile.in
--- libdbus.upstream/bus/Makefile.in
+++ libdbus/bus/Makefile.in
@@ -1510,7 +1510,6 @@
/bin/rm *.bb *.bbg *.da *.gcov || true
install-data-hook:
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
diff -Paur --no-dereference -- libdbus.upstream/config.sub libdbus/config.sub
--- libdbus.upstream/config.sub
+++ libdbus/config.sub
@@ -1342,7 +1342,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libdbus.upstream/dbus/dbus-sysdeps.h libdbus/dbus/dbus-sysdeps.h
--- libdbus.upstream/dbus/dbus-sysdeps.h
+++ libdbus/dbus/dbus-sysdeps.h
@@ -50,7 +50,7 @@
* DBusPollFD
*/
#ifdef HAVE_POLL
-#include <sys/poll.h>
+#include <poll.h>
#endif
#ifdef DBUS_WINCE
diff -Paur --no-dereference -- libdbus.upstream/dbus/dbus-sysdeps-unix.c libdbus/dbus/dbus-sysdeps-unix.c
--- libdbus.upstream/dbus/dbus-sysdeps-unix.c
+++ libdbus/dbus/dbus-sysdeps-unix.c
@@ -63,7 +63,7 @@
#include <sys/uio.h>
#endif
#ifdef HAVE_POLL
-#include <sys/poll.h>
+#include <poll.h>
#endif
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
@@ -76,6 +76,8 @@
#include <bsm/adt.h>
#endif
+#include <alloca.h>
+
#include "sd-daemon.h"
#ifndef O_BINARY
@@ -276,6 +278,11 @@
*n_fds = 0;
return r;
+#elif defined(__sortix__)
+
+ fprintf(stderr, "%s:%u Warning: Sortix cannot pass fds between processes yet\n", __FILE__, __LINE__);
+ return errno = ENOTSUP, -1;
+
#else
int bytes_read;
int start;
@@ -426,6 +433,12 @@
return _dbus_write_socket_two(fd,
buffer1, start1, len1,
buffer2, start2, len2);
+
+#elif defined(__sortix__)
+
+ fprintf(stderr, "%s:%u Warning: Sortix cannot pass fds between processes yet\n", __FILE__, __LINE__);
+ return errno = ENOTSUP, -1;
+
#else
struct msghdr m;
@@ -734,6 +747,7 @@
#else /* HAVE_WRITEV */
{
int ret1;
+ int ret2;
ret1 = _dbus_write (fd, buffer1, start1, len1);
if (ret1 == len1 && buffer2 != NULL)
diff -Paur --no-dereference -- libdbus.upstream/dbus/dbus-sysdeps-util-unix.c libdbus/dbus/dbus-sysdeps-util-unix.c
--- libdbus.upstream/dbus/dbus-sysdeps-util-unix.c
+++ libdbus/dbus/dbus-sysdeps-util-unix.c
@@ -59,6 +59,11 @@
#define O_BINARY 0
#endif
+#if defined(__sortix__)
+#define setsid() getpid()
+#define setgroups(a, b) 0
+#endif
+
/**
* @addtogroup DBusInternalsUtils
* @{
diff -Paur --no-dereference -- libdbus.upstream/dbus/sd-daemon.c libdbus/dbus/sd-daemon.c
--- libdbus.upstream/dbus/sd-daemon.c
+++ libdbus/dbus/sd-daemon.c
@@ -32,7 +32,7 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>
diff -Paur --no-dereference -- libdbus.upstream/tools/dbus-launch.c libdbus/tools/dbus-launch.c
--- libdbus.upstream/tools/dbus-launch.c
+++ libdbus/tools/dbus-launch.c
@@ -769,7 +769,7 @@
strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS=");
strcat (envvar, bus_address);
- putenv (envvar);
+ setenv ("DBUS_SESSION_BUS_ADDRESS", bus_address, 1);
execvp (runprog, args);
fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno));
diff -Paur --no-dereference -- libdbus.upstream/tools/dbus-monitor.c libdbus/tools/dbus-monitor.c
--- libdbus.upstream/tools/dbus-monitor.c
+++ libdbus/tools/dbus-monitor.c
@@ -104,11 +104,7 @@
return DBUS_HANDLER_RESULT_HANDLED;
}
-#ifdef __APPLE__
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%d"
-#else
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%lu"
-#endif
+#define PROFILE_TIMED_FORMAT "%s\t%lld\t%lu"
#define TRAP_NULL_STRING(str) ((str) ? (str) : "<none>")
typedef enum
@@ -127,7 +123,7 @@
profile_print_with_attrs (const char *type, DBusMessage *message,
struct timeval *t, ProfileAttributeFlags attrs)
{
- printf (PROFILE_TIMED_FORMAT, type, t->tv_sec, t->tv_usec);
+ printf (PROFILE_TIMED_FORMAT, type, (long long)t->tv_sec, t->tv_usec);
if (attrs & PROFILE_ATTRIBUTE_FLAG_SERIAL)
printf ("\t%u", dbus_message_get_serial (message));
@@ -197,7 +193,7 @@
PROFILE_ATTRIBUTE_FLAG_MEMBER);
break;
default:
- printf (PROFILE_TIMED_FORMAT "\n", "tun", t.tv_sec, t.tv_usec);
+ printf (PROFILE_TIMED_FORMAT "\n", "tun", (long long)t.tv_sec, t.tv_usec);
break;
}
}

View File

@ -0,0 +1,14 @@
NAME=libdbus
BUILD_LIBRARIES=libexpat
VERSION=1.6.8
DISTNAME=dbus-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=fc1370ef38abeeb13f55c905ec002e60705fb0bfde3b8d21c8d6eb8056c11bac
UPSTREAM_SITE=https://dbus.freedesktop.org/releases/dbus
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
# TODO: The tests depend on glib, which means we have to disable them, since glib depends on this package.
CONFIGURE_ARGS='--disable-abstract-sockets --without-x --disable-tests'
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,219 @@
diff -Paur --no-dereference -- libevent.upstream/buffer.c libevent/buffer.c
--- libevent.upstream/buffer.c
+++ libevent/buffer.c
@@ -183,7 +183,7 @@
/* this way we can manipulate the buffer to different addresses,
* which is required for mmap for example.
*/
- chain->buffer = EVBUFFER_CHAIN_EXTRA(u_char, chain);
+ chain->buffer = EVBUFFER_CHAIN_EXTRA(unsigned char, chain);
return (chain);
}
@@ -2749,7 +2749,7 @@
if (!chain)
return (-1);
chain->flags |= EVBUFFER_REFERENCE | EVBUFFER_IMMUTABLE;
- chain->buffer = (u_char *)data;
+ chain->buffer = (unsigned char *)data;
chain->buffer_len = datlen;
chain->off = datlen;
diff -Paur --no-dereference -- libevent.upstream/bufferevent_sock.c libevent/bufferevent_sock.c
--- libevent.upstream/bufferevent_sock.c
+++ libevent/bufferevent_sock.c
@@ -63,6 +63,7 @@
#include "event2/util.h"
#include "event2/bufferevent.h"
#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
#include "event2/bufferevent_struct.h"
#include "event2/bufferevent_compat.h"
#include "event2/event.h"
@@ -75,6 +76,7 @@
#endif
/* prototypes */
+void bufferevent_read_pressure_cb(struct evbuffer *, size_t, size_t, void *);
static int be_socket_enable(struct bufferevent *, short);
static int be_socket_disable(struct bufferevent *, short);
static void be_socket_destruct(struct bufferevent *);
@@ -119,6 +121,40 @@
}
}
+static int
+bufferevent_add(struct event *ev, struct timeval timeout)
+{
+ struct timeval *ptv = NULL;
+
+ if (timeout.tv_sec || timeout.tv_usec) {
+ ptv = &timeout;
+ }
+
+ return (event_add(ev, ptv));
+}
+
+/*
+ * This callback is executed when the size of the input buffer changes.
+ * We use it to apply back pressure on the reading side.
+ */
+
+/* This API was needed to port OpenBSD's httpd to Sortix. */
+void
+bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
+ void *arg) {
+ struct bufferevent *bufev = arg;
+ /*
+ * If we are below the watermark then reschedule reading if it's
+ * still enabled.
+ */
+ if (bufev->wm_read.high == 0 || now < bufev->wm_read.high) {
+ evbuffer_setcb(buf, NULL, NULL);
+
+ if (bufev->enabled & EV_READ)
+ bufferevent_add(&bufev->ev_read, bufev->timeout_read);
+ }
+}
+
static void
bufferevent_readcb(evutil_socket_t fd, short event, void *arg)
{
diff -Paur --no-dereference -- libevent.upstream/config.sub libevent/config.sub
--- libevent.upstream/config.sub
+++ libevent/config.sub
@@ -1348,7 +1348,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libevent.upstream/configure libevent/configure
--- libevent.upstream/configure
+++ libevent/configure
@@ -14602,7 +14602,7 @@
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
@@ -14726,8 +14726,8 @@
main ()
{
pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0);
+ pthread_attr_init(0);
+ pthread_create(0,0,0,0);
;
return 0;
}
diff -Paur --no-dereference -- libevent.upstream/evutil.c libevent/evutil.c
--- libevent.upstream/evutil.c
+++ libevent/evutil.c
@@ -2102,11 +2102,7 @@
long
_evutil_weakrand(void)
{
-#ifdef WIN32
- return rand();
-#else
- return random();
-#endif
+ return arc4random() & 0x7FFFFFFF;
}
/**
diff -Paur --no-dereference -- libevent.upstream/evutil_rand.c libevent/evutil_rand.c
--- libevent.upstream/evutil_rand.c
+++ libevent/evutil_rand.c
@@ -174,7 +174,7 @@
void
evutil_secure_rng_add_bytes(const char *buf, size_t n)
{
- arc4random_addrandom((unsigned char*)buf,
- n>(size_t)INT_MAX ? INT_MAX : (int)n);
+ (void) buf;
+ (void) n;
}
diff -Paur --no-dereference -- libevent.upstream/http-internal.h libevent/http-internal.h
--- libevent.upstream/http-internal.h
+++ libevent/http-internal.h
@@ -70,10 +70,10 @@
struct event retry_ev; /* for retrying connects */
char *bind_address; /* address to use for binding the src */
- u_short bind_port; /* local port for binding the src */
+ unsigned short bind_port; /* local port for binding the src */
char *address; /* address to connect to */
- u_short port;
+ unsigned short port;
size_t max_headers_size;
ev_uint64_t max_body_size;
diff -Paur --no-dereference -- libevent.upstream/Makefile.in libevent/Makefile.in
--- libevent.upstream/Makefile.in
+++ libevent/Makefile.in
@@ -537,7 +537,7 @@
@INSTALL_LIBEVENT_TRUE@lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
@INSTALL_LIBEVENT_TRUE@pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
@INSTALL_LIBEVENT_FALSE@noinst_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
-SUBDIRS = . include sample test
+SUBDIRS = . include
@BUILD_WIN32_FALSE@SYS_LIBS =
@BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_5) $(am__append_6) \
@@ -1219,6 +1219,9 @@
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-recursive
+ rm -f sample/Makefile
+ rm -rf test/.deps
+ rm -r test/Makefile
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(DEPDIR) ./$(DEPDIR)
-rm -f Makefile
diff -Paur --no-dereference -- libevent.upstream/poll.c libevent/poll.c
--- libevent.upstream/poll.c
+++ libevent/poll.c
@@ -180,7 +180,7 @@
if (res == 0 || nfds == 0)
return (0);
- i = random() % nfds;
+ i = arc4random_uniform(nfds);
for (j = 0; j < nfds; j++) {
int what;
if (++i == nfds)
diff -Paur --no-dereference -- libevent.upstream/select.c libevent/select.c
--- libevent.upstream/select.c
+++ libevent/select.c
@@ -177,7 +177,7 @@
event_debug(("%s: select reports %d", __func__, res));
check_selectop(sop);
- i = random() % nfds;
+ i = arc4random_uniform(nfds);
for (j = 0; j < nfds; ++j) {
if (++i >= nfds)
i = 0;
diff -Paur --no-dereference -- libevent.upstream/util-internal.h libevent/util-internal.h
--- libevent.upstream/util-internal.h
+++ libevent/util-internal.h
@@ -75,7 +75,7 @@
/* True iff e is an error that means a read/write operation can be retried. */
#define EVUTIL_ERR_RW_RETRIABLE(e) \
- ((e) == EINTR || (e) == EAGAIN)
+ ((e) == EINTR || (e) == EAGAIN || (e) == EWOULDBLOCK)
/* True iff e is an error that means an connect can be retried. */
#define EVUTIL_ERR_CONNECT_RETRIABLE(e) \
((e) == EINTR || (e) == EINPROGRESS)

View File

@ -0,0 +1,13 @@
NAME=libevent
BUILD_LIBRARIES='libz? libssl?'
VERSION=2.0.22-stable
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3
UPSTREAM_SITE=https://github.com/libevent/libevent/releases/download/release-$VERSION
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS=--disable-malloc-replacement
POST_INSTALL=tix-eradicate-libtool-la
VERSION_REGEX='([0-9]+\.[0-9]+(\.[0-9]+)*-stable)'

View File

@ -0,0 +1,45 @@
diff -Paur --no-dereference -- libexpat.upstream/conftools/config.sub libexpat/conftools/config.sub
--- libexpat.upstream/conftools/config.sub
+++ libexpat/conftools/config.sub
@@ -1326,7 +1326,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libexpat.upstream/Makefile.in libexpat/Makefile.in
--- libexpat.upstream/Makefile.in
+++ libexpat/Makefile.in
@@ -45,7 +45,7 @@
APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h
LIBRARY = libexpat.la
-DESTDIR = $(INSTALL_ROOT)
+DESTDIR ?= $(INSTALL_ROOT)
default: buildlib xmlwf/xmlwf@EXEEXT@
diff -Paur --no-dereference -- libexpat.upstream/xmlwf/readfilemap.c libexpat/xmlwf/readfilemap.c
--- libexpat.upstream/xmlwf/readfilemap.c
+++ libexpat/xmlwf/readfilemap.c
@@ -8,17 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
-#ifdef __WATCOMC__
-#ifndef __LINUX__
-#include <io.h>
-#else
#include <unistd.h>
-#endif
-#endif
-
-#ifdef __BEOS__
-#include <unistd.h>
-#endif
#ifndef S_ISREG
#ifndef S_IFREG

View File

@ -0,0 +1,14 @@
NAME=libexpat
BUILD_LIBRARIES=
VERSION_MAJOR=2
VERSION_MINOR=1
VERSION_PATCH=0
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
DISTNAME=expat-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86
UPSTREAM_SITE=https://github.com/libexpat/libexpat/releases/download/R_${VERSION_MAJOR}_${VERSION_MINOR}_${VERSION_PATCH}
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
POST_INSTALL=tix-eradicate-libtool-la

68
ports/libffi/libffi.patch Normal file
View File

@ -0,0 +1,68 @@
diff -Paur --no-dereference -- libffi.upstream/config.sub libffi/config.sub
--- libffi.upstream/config.sub
+++ libffi/config.sub
@@ -1354,7 +1354,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libffi.upstream/configure libffi/configure
--- libffi.upstream/configure
+++ libffi/configure
@@ -20709,7 +20709,7 @@
eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
if grep '^REMOVED,,,' "$ac_top_srcdir/Makefile" >/dev/null
then rm $ac_top_srcdir/Makefile ; fi
- cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING
+ #cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING
fi
if test ! -f "$ac_top_srcdir/Makefile" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5
@@ -20794,7 +20794,7 @@
; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
_EOF
- cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING
+ #cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING
$ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile
if test -f "$ac_top_srcdir/Makefile.mk" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5
@@ -20815,8 +20815,8 @@
# echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
echo "s!^$xxxx [^|]* | *$ax_enable_builddir *\$!$xxxx ...... $ax_enable_builddir!" >$tmp/conftemp.sed
$ax_enable_builddir_sed -f "$tmp/conftemp.sed" "$ac_top_srcdir/Makefile" >$tmp/mkfile.tmp
- cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING
- cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING
+ #cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING
+ #cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING
if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5
$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;}
diff -Paur --no-dereference -- libffi.upstream/include/Makefile.in libffi/include/Makefile.in
--- libffi.upstream/include/Makefile.in
+++ libffi/include/Makefile.in
@@ -314,7 +314,7 @@
AUTOMAKE_OPTIONS = foreign
DISTCLEANFILES = ffitarget.h
EXTRA_DIST = ffi.h.in ffi_common.h
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includesdir = $(includedir)
nodist_includes_HEADERS = ffi.h ffitarget.h
all: all-am
diff -Paur --no-dereference -- libffi.upstream/libffi.pc.in libffi/libffi.pc.in
--- libffi.upstream/libffi.pc.in
+++ libffi/libffi.pc.in
@@ -2,7 +2,7 @@
exec_prefix=@exec_prefix@
libdir=@libdir@
toolexeclibdir=@toolexeclibdir@
-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includedir=@includedir@
Name: @PACKAGE_NAME@
Description: Library supporting Foreign Function Interfaces

11
ports/libffi/libffi.port Normal file
View File

@ -0,0 +1,11 @@
NAME=libffi
BUILD_LIBRARIES=
VERSION=3.2.1
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
UPSTREAM_SITE=https://sourceware.org/pub/libffi
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,261 @@
diff -Paur --no-dereference -- libfontconfig.upstream/fc-blanks/Makefile.in libfontconfig/fc-blanks/Makefile.in
--- libfontconfig.upstream/fc-blanks/Makefile.in
+++ libfontconfig/fc-blanks/Makefile.in
@@ -350,7 +350,8 @@
$(TMPL) \
$(NULL)
-DISTCLEANFILES = $(BLANKS_H)
+# PATCH: fc-blanks.py doesn't work on Sortix (python2 urllib issues).
+DISTCLEANFILES =
all: all-am
.SUFFIXES:
diff -Paur --no-dereference -- libfontconfig.upstream/fontconfig.pc.in libfontconfig/fontconfig.pc.in
--- libfontconfig.upstream/fontconfig.pc.in
+++ libfontconfig/fontconfig.pc.in
@@ -14,5 +14,6 @@
Requires: @PKGCONFIG_REQUIRES@
Requires.private: @PKGCONFIG_REQUIRES_PRIVATELY@
Libs: -L${libdir} -lfontconfig
-Libs.private: @EXPAT_LIBS@ @FREETYPE_LIBS@ @ICONV_LIBS@ @LIBXML2_LIBS@
-Cflags: -I${includedir} @EXPAT_CFLAGS@ @FREETYPE_CFLAGS@ @ICONV_CFLAGS@ @LIBXML2_CFLAGS@
+Libs.private: @ICONV_LIBS@
+# PATCH: These were provided by the above Requires and were not cross safe.
+Cflags: -I${includedir} @ICONV_CFLAGS@
diff -Paur --no-dereference -- libfontconfig.upstream/Makefile.in libfontconfig/Makefile.in
--- libfontconfig.upstream/Makefile.in
+++ libfontconfig/Makefile.in
@@ -434,7 +434,8 @@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = fontconfig fc-blanks fc-case fc-lang fc-glyphname src \
+# PATCH: fc-blanks is a python script that doesn't run on Sortix right now.
+SUBDIRS = fontconfig fc-case fc-lang fc-glyphname src \
fc-cache fc-cat fc-list fc-match fc-pattern fc-query fc-scan \
fc-validate conf.d test $(am__append_1)
ACLOCAL_AMFLAGS = -I m4
diff -Paur --no-dereference -- libfontconfig.upstream/src/fccache.c libfontconfig/src/fccache.c
--- libfontconfig.upstream/src/fccache.c
+++ libfontconfig/src/fccache.c
@@ -38,6 +38,9 @@
#if defined(_WIN32)
#include <sys/locking.h>
#endif
+#if defined(__has_include) && __has_include(<sys/file.h>)
+#include <sys/file.h>
+#endif
#ifndef O_BINARY
#define O_BINARY 0
@@ -1266,7 +1269,11 @@
#if defined(_WIN32)
if (_locking (fd, _LK_LOCK, 1) == -1)
goto bail;
-#else
+/* PATCH: Sortix refuses to implement crap file locking. */
+#elif defined(LOCK_EX)
+ if (flock(fd, LOCK_EX) == -1)
+ goto bail;
+#elif !defined(__sortix__)
struct flock fl;
fl.l_type = F_WRLCK;
@@ -1276,17 +1283,21 @@
fl.l_pid = getpid ();
if (fcntl (fd, F_SETLKW, &fl) == -1)
goto bail;
+#else
+#define FcDirCacheLock_NOBAIL
#endif
break;
}
}
FcStrListDone (list);
return fd;
+#ifndef FcDirCacheLock_NOBAIL
bail:
FcStrListDone (list);
if (fd != -1)
close (fd);
return -1;
+#endif
}
void
@@ -1296,7 +1307,10 @@
{
#if defined(_WIN32)
_locking (fd, _LK_UNLCK, 1);
-#else
+/* PATCH: Sortix refuses to implement crap file locking. */
+#elif defined(LOCK_EX)
+ flock(fd, LOCK_UN);
+#elif !defined(__sortix__)
struct flock fl;
fl.l_type = F_UNLCK;
diff -Paur --no-dereference -- libfontconfig.upstream/src/fccompat.c libfontconfig/src/fccompat.c
--- libfontconfig.upstream/src/fccompat.c
+++ libfontconfig/src/fccompat.c
@@ -164,69 +164,8 @@
int32_t
FcRandom(void)
{
- int32_t result;
-
-#if HAVE_RANDOM_R
- static struct random_data fcrandbuf;
- static char statebuf[256];
- static FcBool initialized = FcFalse;
-#ifdef _AIX
- static char *retval;
- long res;
-#endif
-
- if (initialized != FcTrue)
- {
-#ifdef _AIX
- initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf);
-#else
- initstate_r (time (NULL), statebuf, 256, &fcrandbuf);
-#endif
- initialized = FcTrue;
- }
-
-#ifdef _AIX
- random_r (&res, &fcrandbuf);
- result = (int32_t)res;
-#else
- random_r (&fcrandbuf, &result);
-#endif
-#elif HAVE_RANDOM
- static char statebuf[256];
- char *state;
- static FcBool initialized = FcFalse;
-
- if (initialized != FcTrue)
- {
- state = initstate (time (NULL), statebuf, 256);
- initialized = FcTrue;
- }
- else
- state = setstate (statebuf);
-
- result = random ();
-
- setstate (state);
-#elif HAVE_LRAND48
- result = lrand48 ();
-#elif HAVE_RAND_R
- static unsigned int seed = time (NULL);
-
- result = rand_r (&seed);
-#elif HAVE_RAND
- static FcBool initialized = FcFalse;
-
- if (initialized != FcTrue)
- {
- srand (time (NULL));
- initialized = FcTrue;
- }
- result = rand ();
-#else
-# error no random number generator function available.
-#endif
-
- return result;
+ /* PATCH: Use good random. */
+ return arc4random_uniform (INT32_MAX);
}
#ifdef _WIN32
diff -Paur --no-dereference -- libfontconfig.upstream/src/fcname.c libfontconfig/src/fcname.c
--- libfontconfig.upstream/src/fcname.c
+++ libfontconfig/src/fcname.c
@@ -506,17 +506,17 @@
case FcTypeVoid:
return FcTrue;
case FcTypeInteger:
- sprintf ((char *) temp, "%d", v.u.i);
+ snprintf ((char *) temp, sizeof (temp), "%d", v.u.i);
return FcNameUnparseString (buf, temp, 0);
case FcTypeDouble:
- sprintf ((char *) temp, "%g", v.u.d);
+ snprintf ((char *) temp, sizeof (temp), "%g", v.u.d);
return FcNameUnparseString (buf, temp, 0);
case FcTypeString:
return FcNameUnparseString (buf, v.u.s, escape);
case FcTypeBool:
return FcNameUnparseString (buf, v.u.b ? (FcChar8 *) "True" : (FcChar8 *) "False", 0);
case FcTypeMatrix:
- sprintf ((char *) temp, "%g %g %g %g",
+ snprintf ((char *) temp, sizeof (temp), "%g %g %g %g",
v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
return FcNameUnparseString (buf, temp, 0);
case FcTypeCharSet:
@@ -526,7 +526,7 @@
case FcTypeFTFace:
return FcTrue;
case FcTypeRange:
- sprintf ((char *) temp, "[%g %g)", v.u.r->begin, v.u.r->end);
+ snprintf ((char *) temp, sizeof (temp), "[%g %g)", v.u.r->begin, v.u.r->end);
return FcNameUnparseString (buf, temp, 0);
}
return FcFalse;
diff -Paur --no-dereference -- libfontconfig.upstream/src/fcobjs.c libfontconfig/src/fcobjs.c
--- libfontconfig.upstream/src/fcobjs.c
+++ libfontconfig/src/fcobjs.c
@@ -24,11 +24,12 @@
#include "fcint.h"
+/* TODO: Stick with existing fcobjshash.h regardless of system gperf. */
static unsigned int
-FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len);
+FcObjectTypeHash (register const char *str, register size_t len);
static const struct FcObjectTypeInfo *
-FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len);
+FcObjectTypeLookup (register const char *str, register size_t len);
#include "fcobjshash.h"
diff -Paur --no-dereference -- libfontconfig.upstream/src/Makefile.in libfontconfig/src/Makefile.in
--- libfontconfig.upstream/src/Makefile.in
+++ libfontconfig/src/Makefile.in
@@ -496,7 +496,6 @@
stamp-fcstdint \
fcstdint.h \
stamp-fcobjshash.gperf \
- fcobjshash.h \
fcobjshash.gperf
all: $(BUILT_SOURCES)
@@ -912,9 +911,10 @@
' - > $@.tmp && \
mv -f $@.tmp fcobjshash.gperf && touch $@ || ( $(RM) $@.tmp && false )
-fcobjshash.h: Makefile fcobjshash.gperf
- $(AM_V_GEN) $(GPERF) --pic -m 100 fcobjshash.gperf > $@.tmp && \
- mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
+# PATCH: Sortix doesn't have gperf at the moment.
+#fcobjshash.h: Makefile fcobjshash.gperf
+# $(AM_V_GEN) $(GPERF) --pic -m 100 fcobjshash.gperf > $@.tmp && \
+# mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
@ENABLE_SHARED_TRUE@install-data-local: install-ms-import-lib install-libtool-import-lib
diff -Paur --no-dereference -- libfontconfig.upstream/test/test-migration.c libfontconfig/test/test-migration.c
--- libfontconfig.upstream/test/test-migration.c
+++ libfontconfig/test/test-migration.c
@@ -22,6 +22,8 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/* PATCH: Need HAVE_FOO macros.. */
+#include "../config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -0,0 +1,14 @@
NAME=libfontconfig
BUILD_LIBRARIES='libiconv libexpat libfreetype'
VERSION=2.12.6
DISTNAME=fontconfig-$VERSION
COMPRESSION=tar.bz2
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
UPSTREAM_SITE=https://www.freedesktop.org/software/fontconfig/release
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
# Documentation requires SGMLSpm and texline, doesn't seem to work?
CONFIGURE_ARGS=--disable-docs
POST_INSTALL=tix-eradicate-libtool-la
MAKE_VARS='V=1'

View File

@ -0,0 +1,208 @@
rm -rf -- 'conf.d/README'
rm -rf -- 'doc/FcAtomicCreate.3'
rm -rf -- 'doc/FcAtomicDeleteNew.3'
rm -rf -- 'doc/FcAtomicDestroy.3'
rm -rf -- 'doc/FcAtomicLock.3'
rm -rf -- 'doc/FcAtomicNewFile.3'
rm -rf -- 'doc/FcAtomicOrigFile.3'
rm -rf -- 'doc/FcAtomicReplaceOrig.3'
rm -rf -- 'doc/FcAtomicUnlock.3'
rm -rf -- 'doc/FcBlanksAdd.3'
rm -rf -- 'doc/FcBlanksCreate.3'
rm -rf -- 'doc/FcBlanksDestroy.3'
rm -rf -- 'doc/FcBlanksIsMember.3'
rm -rf -- 'doc/FcCacheCopySet.3'
rm -rf -- 'doc/FcCacheCreateTagFile.3'
rm -rf -- 'doc/FcCacheDir.3'
rm -rf -- 'doc/FcCacheNumFont.3'
rm -rf -- 'doc/FcCacheNumSubdir.3'
rm -rf -- 'doc/FcCacheSubdir.3'
rm -rf -- 'doc/FcCharSetAddChar.3'
rm -rf -- 'doc/FcCharSetCopy.3'
rm -rf -- 'doc/FcCharSetCount.3'
rm -rf -- 'doc/FcCharSetCoverage.3'
rm -rf -- 'doc/FcCharSetCreate.3'
rm -rf -- 'doc/FcCharSetDelChar.3'
rm -rf -- 'doc/FcCharSetDestroy.3'
rm -rf -- 'doc/FcCharSetEqual.3'
rm -rf -- 'doc/FcCharSetFirstPage.3'
rm -rf -- 'doc/FcCharSetHasChar.3'
rm -rf -- 'doc/FcCharSetIntersect.3'
rm -rf -- 'doc/FcCharSetIntersectCount.3'
rm -rf -- 'doc/FcCharSetIsSubset.3'
rm -rf -- 'doc/FcCharSetMerge.3'
rm -rf -- 'doc/FcCharSetNew.3'
rm -rf -- 'doc/FcCharSetNextPage.3'
rm -rf -- 'doc/FcCharSetSubtract.3'
rm -rf -- 'doc/FcCharSetSubtractCount.3'
rm -rf -- 'doc/FcCharSetUnion.3'
rm -rf -- 'doc/FcConfigAppFontAddDir.3'
rm -rf -- 'doc/FcConfigAppFontAddFile.3'
rm -rf -- 'doc/FcConfigAppFontClear.3'
rm -rf -- 'doc/FcConfigBuildFonts.3'
rm -rf -- 'doc/FcConfigCreate.3'
rm -rf -- 'doc/FcConfigDestroy.3'
rm -rf -- 'doc/FcConfigEnableHome.3'
rm -rf -- 'doc/FcConfigFilename.3'
rm -rf -- 'doc/FcConfigGetBlanks.3'
rm -rf -- 'doc/FcConfigGetCache.3'
rm -rf -- 'doc/FcConfigGetCacheDirs.3'
rm -rf -- 'doc/FcConfigGetConfigDirs.3'
rm -rf -- 'doc/FcConfigGetConfigFiles.3'
rm -rf -- 'doc/FcConfigGetCurrent.3'
rm -rf -- 'doc/FcConfigGetFontDirs.3'
rm -rf -- 'doc/FcConfigGetFonts.3'
rm -rf -- 'doc/FcConfigGetRescanInterval.3'
rm -rf -- 'doc/FcConfigGetSysRoot.3'
rm -rf -- 'doc/FcConfigHome.3'
rm -rf -- 'doc/FcConfigParseAndLoad.3'
rm -rf -- 'doc/FcConfigParseAndLoadFromMemory.3'
rm -rf -- 'doc/FcConfigReference.3'
rm -rf -- 'doc/FcConfigSetCurrent.3'
rm -rf -- 'doc/FcConfigSetRescanInterval.3'
rm -rf -- 'doc/FcConfigSetSysRoot.3'
rm -rf -- 'doc/FcConfigSubstitute.3'
rm -rf -- 'doc/FcConfigSubstituteWithPat.3'
rm -rf -- 'doc/FcConfigUptoDate.3'
rm -rf -- 'doc/FcDefaultSubstitute.3'
rm -rf -- 'doc/FcDirCacheClean.3'
rm -rf -- 'doc/FcDirCacheLoad.3'
rm -rf -- 'doc/FcDirCacheLoadFile.3'
rm -rf -- 'doc/FcDirCacheRead.3'
rm -rf -- 'doc/FcDirCacheRescan.3'
rm -rf -- 'doc/FcDirCacheUnlink.3'
rm -rf -- 'doc/FcDirCacheUnload.3'
rm -rf -- 'doc/FcDirCacheValid.3'
rm -rf -- 'doc/FcDirSave.3'
rm -rf -- 'doc/FcDirScan.3'
rm -rf -- 'doc/FcFileIsDir.3'
rm -rf -- 'doc/FcFileScan.3'
rm -rf -- 'doc/FcFini.3'
rm -rf -- 'doc/FcFontList.3'
rm -rf -- 'doc/FcFontMatch.3'
rm -rf -- 'doc/FcFontRenderPrepare.3'
rm -rf -- 'doc/FcFontSetAdd.3'
rm -rf -- 'doc/FcFontSetCreate.3'
rm -rf -- 'doc/FcFontSetDestroy.3'
rm -rf -- 'doc/FcFontSetList.3'
rm -rf -- 'doc/FcFontSetMatch.3'
rm -rf -- 'doc/FcFontSetPrint.3'
rm -rf -- 'doc/FcFontSetSort.3'
rm -rf -- 'doc/FcFontSetSortDestroy.3'
rm -rf -- 'doc/FcFontSort.3'
rm -rf -- 'doc/FcFreeTypeCharIndex.3'
rm -rf -- 'doc/FcFreeTypeCharSet.3'
rm -rf -- 'doc/FcFreeTypeCharSetAndSpacing.3'
rm -rf -- 'doc/FcFreeTypeQuery.3'
rm -rf -- 'doc/FcFreeTypeQueryFace.3'
rm -rf -- 'doc/FcGetDefaultLangs.3'
rm -rf -- 'doc/FcGetLangs.3'
rm -rf -- 'doc/FcGetVersion.3'
rm -rf -- 'doc/FcInit.3'
rm -rf -- 'doc/FcInitBringUptoDate.3'
rm -rf -- 'doc/FcInitLoadConfig.3'
rm -rf -- 'doc/FcInitLoadConfigAndFonts.3'
rm -rf -- 'doc/FcInitReinitialize.3'
rm -rf -- 'doc/FcIsLower.3'
rm -rf -- 'doc/FcIsUpper.3'
rm -rf -- 'doc/FcLangGetCharSet.3'
rm -rf -- 'doc/FcLangNormalize.3'
rm -rf -- 'doc/FcLangSetAdd.3'
rm -rf -- 'doc/FcLangSetCompare.3'
rm -rf -- 'doc/FcLangSetContains.3'
rm -rf -- 'doc/FcLangSetCopy.3'
rm -rf -- 'doc/FcLangSetCreate.3'
rm -rf -- 'doc/FcLangSetDel.3'
rm -rf -- 'doc/FcLangSetDestroy.3'
rm -rf -- 'doc/FcLangSetEqual.3'
rm -rf -- 'doc/FcLangSetGetLangs.3'
rm -rf -- 'doc/FcLangSetHasLang.3'
rm -rf -- 'doc/FcLangSetHash.3'
rm -rf -- 'doc/FcLangSetSubtract.3'
rm -rf -- 'doc/FcLangSetUnion.3'
rm -rf -- 'doc/FcMatrixCopy.3'
rm -rf -- 'doc/FcMatrixEqual.3'
rm -rf -- 'doc/FcMatrixInit.3'
rm -rf -- 'doc/FcMatrixMultiply.3'
rm -rf -- 'doc/FcMatrixRotate.3'
rm -rf -- 'doc/FcMatrixScale.3'
rm -rf -- 'doc/FcMatrixShear.3'
rm -rf -- 'doc/FcNameConstant.3'
rm -rf -- 'doc/FcNameGetConstant.3'
rm -rf -- 'doc/FcNameGetObjectType.3'
rm -rf -- 'doc/FcNameParse.3'
rm -rf -- 'doc/FcNameRegisterConstants.3'
rm -rf -- 'doc/FcNameRegisterObjectTypes.3'
rm -rf -- 'doc/FcNameUnparse.3'
rm -rf -- 'doc/FcNameUnregisterConstants.3'
rm -rf -- 'doc/FcNameUnregisterObjectTypes.3'
rm -rf -- 'doc/FcObjectSetAdd.3'
rm -rf -- 'doc/FcObjectSetBuild.3'
rm -rf -- 'doc/FcObjectSetCreate.3'
rm -rf -- 'doc/FcObjectSetDestroy.3'
rm -rf -- 'doc/FcPatternAdd-Type.3'
rm -rf -- 'doc/FcPatternAdd.3'
rm -rf -- 'doc/FcPatternAddWeak.3'
rm -rf -- 'doc/FcPatternBuild.3'
rm -rf -- 'doc/FcPatternCreate.3'
rm -rf -- 'doc/FcPatternDel.3'
rm -rf -- 'doc/FcPatternDestroy.3'
rm -rf -- 'doc/FcPatternDuplicate.3'
rm -rf -- 'doc/FcPatternEqual.3'
rm -rf -- 'doc/FcPatternEqualSubset.3'
rm -rf -- 'doc/FcPatternFilter.3'
rm -rf -- 'doc/FcPatternFormat.3'
rm -rf -- 'doc/FcPatternGet-Type.3'
rm -rf -- 'doc/FcPatternGet.3'
rm -rf -- 'doc/FcPatternGetWithBinding.3'
rm -rf -- 'doc/FcPatternHash.3'
rm -rf -- 'doc/FcPatternPrint.3'
rm -rf -- 'doc/FcPatternReference.3'
rm -rf -- 'doc/FcPatternRemove.3'
rm -rf -- 'doc/FcRangeCopy.3'
rm -rf -- 'doc/FcRangeCreateDouble.3'
rm -rf -- 'doc/FcRangeCreateInteger.3'
rm -rf -- 'doc/FcRangeDestroy.3'
rm -rf -- 'doc/FcRangeGetDouble.3'
rm -rf -- 'doc/FcStrBasename.3'
rm -rf -- 'doc/FcStrCmp.3'
rm -rf -- 'doc/FcStrCmpIgnoreCase.3'
rm -rf -- 'doc/FcStrCopy.3'
rm -rf -- 'doc/FcStrCopyFilename.3'
rm -rf -- 'doc/FcStrDirname.3'
rm -rf -- 'doc/FcStrDowncase.3'
rm -rf -- 'doc/FcStrFree.3'
rm -rf -- 'doc/FcStrListCreate.3'
rm -rf -- 'doc/FcStrListDone.3'
rm -rf -- 'doc/FcStrListFirst.3'
rm -rf -- 'doc/FcStrListNext.3'
rm -rf -- 'doc/FcStrPlus.3'
rm -rf -- 'doc/FcStrSetAdd.3'
rm -rf -- 'doc/FcStrSetAddFilename.3'
rm -rf -- 'doc/FcStrSetCreate.3'
rm -rf -- 'doc/FcStrSetDel.3'
rm -rf -- 'doc/FcStrSetDestroy.3'
rm -rf -- 'doc/FcStrSetEqual.3'
rm -rf -- 'doc/FcStrSetMember.3'
rm -rf -- 'doc/FcStrStr.3'
rm -rf -- 'doc/FcStrStrIgnoreCase.3'
rm -rf -- 'doc/FcToLower.3'
rm -rf -- 'doc/FcUcs4ToUtf8.3'
rm -rf -- 'doc/FcUtf16Len.3'
rm -rf -- 'doc/FcUtf16ToUcs4.3'
rm -rf -- 'doc/FcUtf8Len.3'
rm -rf -- 'doc/FcUtf8ToUcs4.3'
rm -rf -- 'doc/FcValueDestroy.3'
rm -rf -- 'doc/FcValueEqual.3'
rm -rf -- 'doc/FcValuePrint.3'
rm -rf -- 'doc/FcValueSave.3'
rm -rf -- 'doc/FcWeightFromOpenType.3'
rm -rf -- 'doc/FcWeightToOpenType.3'
rm -rf -- 'doc/fontconfig-devel.pdf'
rm -rf -- 'doc/fontconfig-devel.txt'
rm -rf -- 'doc/fontconfig-user.html'
rm -rf -- 'doc/fontconfig-user.pdf'
rm -rf -- 'doc/fontconfig-user.txt'
rm -rf -- 'doc/fonts-conf.5'
rm -rf -- 'fontconfig.spec'
rm -rf -- 'src/fcstdint.h'

View File

@ -0,0 +1,312 @@
diff -Paur --no-dereference -- libfreetype.upstream/builds/unix/configure libfreetype/builds/unix/configure
--- libfreetype.upstream/builds/unix/configure
+++ libfreetype/builds/unix/configure
@@ -13690,22 +13690,7 @@
libpng_libspriv="$LIBPNG_LIBS"
libpng_libsstaticconf="$LIBPNG_LIBS"
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
- else
- # fall back to config script.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng-config" >&5
-$as_echo_n "checking for libpng-config... " >&6; }
- if which libpng-config > /dev/null 2>&1; then
- LIBPNG_CFLAGS=`libpng-config --cflags`
- LIBPNG_LIBS=`libpng-config --ldflags`
- libpng_libspriv=`libpng-config --static --ldflags`
- libpng_libsstaticconf="$libpng_libspriv"
- have_libpng="yes (libpng-config)"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
+ # PATCH: libpng-config should never be used.
fi
fi
fi
diff -Paur --no-dereference -- libfreetype.upstream/builds/unix/freetype2.in libfreetype/builds/unix/freetype2.in
--- libfreetype.upstream/builds/unix/freetype2.in
+++ libfreetype/builds/unix/freetype2.in
@@ -4,7 +4,7 @@
includedir=%includedir%
Name: FreeType 2
-URL: http://freetype.org
+URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
Version: %ft_version%
Requires:
diff -Paur --no-dereference -- libfreetype.upstream/builds/unix/install.mk libfreetype/builds/unix/install.mk
--- libfreetype.upstream/builds/unix/install.mk
+++ libfreetype/builds/unix/install.mk
@@ -30,15 +30,14 @@
#
# We also remove `$(includedir)/ft2build.h' for the same reason.
#
+# PATCH: freetype-config should never be used.
install: $(PROJECT_LIBRARY)
-$(DELDIR) $(DESTDIR)$(includedir)/freetype2
-$(DELETE) $(DESTDIR)$(includedir)/ft2build.h
$(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
$(DESTDIR)$(libdir)/pkgconfig \
$(DESTDIR)$(includedir)/freetype2/freetype/config \
- $(DESTDIR)$(bindir) \
- $(DESTDIR)$(datadir)/aclocal \
- $(DESTDIR)$(mandir)/man1
+ $(DESTDIR)$(datadir)/aclocal
$(LIBTOOL) --mode=install $(INSTALL) \
$(PROJECT_LIBRARY) $(DESTDIR)$(libdir)
-for P in $(PUBLIC_H) ; do \
@@ -55,23 +54,17 @@
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h
$(INSTALL_DATA) $(OBJ_DIR)/ftmodule.h \
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h
- $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
- $(DESTDIR)$(bindir)/freetype-config
$(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
$(DESTDIR)$(datadir)/aclocal/freetype2.m4
$(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \
$(DESTDIR)$(libdir)/pkgconfig/freetype2.pc
- $(INSTALL_DATA) $(TOP_DIR)/docs/freetype-config.1 \
- $(DESTDIR)$(mandir)/man1/freetype-config.1
uninstall:
-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(LIBRARY).$A
-$(DELDIR) $(DESTDIR)$(includedir)/freetype2
- -$(DELETE) $(DESTDIR)$(bindir)/freetype-config
-$(DELETE) $(DESTDIR)$(datadir)/aclocal/freetype2.m4
-$(DELETE) $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc
- -$(DELETE) $(DESTDIR)$(mandir)/man1/freetype-config.1
check:
diff -Paur --no-dereference -- libfreetype.upstream/src/autofit/afhints.c libfreetype/src/autofit/afhints.c
--- libfreetype.upstream/src/autofit/afhints.c
+++ libfreetype/src/autofit/afhints.c
@@ -16,6 +16,8 @@
/***************************************************************************/
+/* PATCH: Make snprintf available. */
+#define _ISOC99_SOURCE
#include "afhints.h"
#include "aferrors.h"
#include FT_INTERNAL_CALC_H
@@ -223,6 +225,7 @@
static char*
af_print_idx( char* p,
+ size_t len,
int idx )
{
if ( idx == -1 )
@@ -232,7 +235,7 @@
p[2] = '\0';
}
else
- ft_sprintf( p, "%d", idx );
+ snprintf( p, len, "%d", idx );
return p;
}
@@ -338,12 +341,12 @@
AF_DUMP(( " %5d %5s %5s %5s %5s %s"
" %5d %5d %7.2f %7.2f %7.2f %7.2f\n",
point_idx,
- af_print_idx( buf1,
+ af_print_idx( buf1, sizeof(buf1),
af_get_edge_index( hints, segment_idx_1, 1 ) ),
- af_print_idx( buf2, segment_idx_1 ),
- af_print_idx( buf3,
+ af_print_idx( buf2, sizeof(buf2), segment_idx_1 ),
+ af_print_idx( buf3, sizeof(buf3),
af_get_edge_index( hints, segment_idx_0, 0 ) ),
- af_print_idx( buf4, segment_idx_0 ),
+ af_print_idx( buf4, sizeof(buf4), segment_idx_0 ),
( point->flags & AF_FLAG_NEAR )
? " near "
: ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
diff -Paur --no-dereference -- libfreetype.upstream/src/bdf/bdflib.c libfreetype/src/bdf/bdflib.c
--- libfreetype.upstream/src/bdf/bdflib.c
+++ libfreetype/src/bdf/bdflib.c
@@ -31,6 +31,8 @@
/*************************************************************************/
+/* PATCH: Make snprintf available. */
+#define _ISOC99_SOURCE
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -1822,7 +1824,7 @@
if ( bdf_get_font_property( p->font, "FONT_ASCENT" ) == 0 )
{
p->font->font_ascent = p->font->bbx.ascent;
- ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
+ snprintf( nbuf, sizeof ( nbuf ), "%hd", p->font->bbx.ascent );
error = _bdf_add_property( p->font, (char *)"FONT_ASCENT",
nbuf, lineno );
if ( error )
@@ -1835,7 +1837,7 @@
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
{
p->font->font_descent = p->font->bbx.descent;
- ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
+ snprintf( nbuf, sizeof ( nbuf ), "%hd", p->font->bbx.descent );
error = _bdf_add_property( p->font, (char *)"FONT_DESCENT",
nbuf, lineno );
if ( error )
@@ -2164,7 +2166,7 @@
/* Add the two standard X11 properties which are required */
/* for compiling fonts. */
p->font->font_ascent = p->font->bbx.ascent;
- ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
+ snprintf( nbuf, sizeof ( nbuf ), "%hd", p->font->bbx.ascent );
error = _bdf_add_property( p->font, (char *)"FONT_ASCENT",
nbuf, lineno );
if ( error )
@@ -2172,7 +2174,7 @@
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
p->font->font_descent = p->font->bbx.descent;
- ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
+ snprintf( nbuf, sizeof ( nbuf ), "%hd", p->font->bbx.descent );
error = _bdf_add_property( p->font, (char *)"FONT_DESCENT",
nbuf, lineno );
if ( error )
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/adler32.c libfreetype/src/gzip/adler32.c
--- libfreetype.upstream/src/gzip/adler32.c
+++ libfreetype/src/gzip/adler32.c
@@ -1,3 +1,4 @@
+#error no
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/ftzconf.h libfreetype/src/gzip/ftzconf.h
--- libfreetype.upstream/src/gzip/ftzconf.h
+++ libfreetype/src/gzip/ftzconf.h
@@ -1,3 +1,4 @@
+#error no
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infblock.c libfreetype/src/gzip/infblock.c
--- libfreetype.upstream/src/gzip/infblock.c
+++ libfreetype/src/gzip/infblock.c
@@ -1,3 +1,4 @@
+#error no
/* infblock.c -- interpret and process block types to last block
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infblock.h libfreetype/src/gzip/infblock.h
--- libfreetype.upstream/src/gzip/infblock.h
+++ libfreetype/src/gzip/infblock.h
@@ -1,3 +1,4 @@
+#error no
/* infblock.h -- header to use infblock.c
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infcodes.c libfreetype/src/gzip/infcodes.c
--- libfreetype.upstream/src/gzip/infcodes.c
+++ libfreetype/src/gzip/infcodes.c
@@ -1,3 +1,4 @@
+#error no
/* infcodes.c -- process literals and length/distance pairs
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infcodes.h libfreetype/src/gzip/infcodes.h
--- libfreetype.upstream/src/gzip/infcodes.h
+++ libfreetype/src/gzip/infcodes.h
@@ -1,3 +1,4 @@
+#error no
/* infcodes.h -- header to use infcodes.c
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/inffixed.h libfreetype/src/gzip/inffixed.h
--- libfreetype.upstream/src/gzip/inffixed.h
+++ libfreetype/src/gzip/inffixed.h
@@ -1,3 +1,4 @@
+#error no
/* inffixed.h -- table for decoding fixed codes
* Generated automatically by the maketree.c program
*/
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/inflate.c libfreetype/src/gzip/inflate.c
--- libfreetype.upstream/src/gzip/inflate.c
+++ libfreetype/src/gzip/inflate.c
@@ -1,3 +1,4 @@
+#error no
/* inflate.c -- zlib interface to inflate modules
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/inftrees.c libfreetype/src/gzip/inftrees.c
--- libfreetype.upstream/src/gzip/inftrees.c
+++ libfreetype/src/gzip/inftrees.c
@@ -1,3 +1,4 @@
+#error no
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/inftrees.h libfreetype/src/gzip/inftrees.h
--- libfreetype.upstream/src/gzip/inftrees.h
+++ libfreetype/src/gzip/inftrees.h
@@ -1,3 +1,4 @@
+#error no
/* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infutil.c libfreetype/src/gzip/infutil.c
--- libfreetype.upstream/src/gzip/infutil.c
+++ libfreetype/src/gzip/infutil.c
@@ -1,3 +1,4 @@
+#error no
/* inflate_util.c -- data and routines common to blocks and codes
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/infutil.h libfreetype/src/gzip/infutil.h
--- libfreetype.upstream/src/gzip/infutil.h
+++ libfreetype/src/gzip/infutil.h
@@ -1,3 +1,4 @@
+#error no
/* infutil.h -- types and macros common to blocks and codes
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/zlib.h libfreetype/src/gzip/zlib.h
--- libfreetype.upstream/src/gzip/zlib.h
+++ libfreetype/src/gzip/zlib.h
@@ -1,3 +1,4 @@
+#error no
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.1.4, March 11th, 2002
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/zutil.c libfreetype/src/gzip/zutil.c
--- libfreetype.upstream/src/gzip/zutil.c
+++ libfreetype/src/gzip/zutil.c
@@ -1,3 +1,4 @@
+#error no
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/gzip/zutil.h libfreetype/src/gzip/zutil.h
--- libfreetype.upstream/src/gzip/zutil.h
+++ libfreetype/src/gzip/zutil.h
@@ -1,3 +1,4 @@
+#error no
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
diff -Paur --no-dereference -- libfreetype.upstream/src/sfnt/ttload.c libfreetype/src/sfnt/ttload.c
--- libfreetype.upstream/src/sfnt/ttload.c
+++ libfreetype/src/sfnt/ttload.c
@@ -338,7 +338,9 @@
SFNT_HeaderRec sfnt;
FT_Error error;
FT_Memory memory = stream->memory;
- FT_UShort nn, valid_entries;
+ /* PATCH: warning: `valid_entries' may be used uninitialized in this
+ function [-Wmaybe-uninitialized] */
+ FT_UShort nn, valid_entries = 0;
static const FT_Frame_Field offset_table_fields[] =
{

View File

@ -0,0 +1,12 @@
NAME=libfreetype
BUILD_LIBRARIES='libz bzip2? libpng?'
VERSION=2.8.1
DISTNAME=freetype-$VERSION
COMPRESSION=tar.bz2
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=e5435f02e02d2b87bb8e4efdcaa14b1f78c9cf3ab1ed80f94b6382fb6acc7d78
UPSTREAM_SITE=https://download.savannah.gnu.org/releases/freetype
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
DIRTY_FILE=config.log
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,48 @@
rm -rf -- 'docs/reference/'
rm -rf -- 'docs/reference/README'
rm -rf -- 'docs/reference/ft2-auto_hinter.html'
rm -rf -- 'docs/reference/ft2-base_interface.html'
rm -rf -- 'docs/reference/ft2-basic_types.html'
rm -rf -- 'docs/reference/ft2-bdf_fonts.html'
rm -rf -- 'docs/reference/ft2-bitmap_handling.html'
rm -rf -- 'docs/reference/ft2-bzip2.html'
rm -rf -- 'docs/reference/ft2-cache_subsystem.html'
rm -rf -- 'docs/reference/ft2-cff_driver.html'
rm -rf -- 'docs/reference/ft2-cid_fonts.html'
rm -rf -- 'docs/reference/ft2-computations.html'
rm -rf -- 'docs/reference/ft2-error_code_values.html'
rm -rf -- 'docs/reference/ft2-error_enumerations.html'
rm -rf -- 'docs/reference/ft2-font_formats.html'
rm -rf -- 'docs/reference/ft2-gasp_table.html'
rm -rf -- 'docs/reference/ft2-glyph_management.html'
rm -rf -- 'docs/reference/ft2-glyph_stroker.html'
rm -rf -- 'docs/reference/ft2-glyph_variants.html'
rm -rf -- 'docs/reference/ft2-gx_validation.html'
rm -rf -- 'docs/reference/ft2-gzip.html'
rm -rf -- 'docs/reference/ft2-header_file_macros.html'
rm -rf -- 'docs/reference/ft2-header_inclusion.html'
rm -rf -- 'docs/reference/ft2-incremental.html'
rm -rf -- 'docs/reference/ft2-index.html'
rm -rf -- 'docs/reference/ft2-lcd_filtering.html'
rm -rf -- 'docs/reference/ft2-list_processing.html'
rm -rf -- 'docs/reference/ft2-lzw.html'
rm -rf -- 'docs/reference/ft2-mac_specific.html'
rm -rf -- 'docs/reference/ft2-module_management.html'
rm -rf -- 'docs/reference/ft2-multiple_masters.html'
rm -rf -- 'docs/reference/ft2-ot_validation.html'
rm -rf -- 'docs/reference/ft2-outline_processing.html'
rm -rf -- 'docs/reference/ft2-pcf_driver.html'
rm -rf -- 'docs/reference/ft2-pfr_fonts.html'
rm -rf -- 'docs/reference/ft2-quick_advance.html'
rm -rf -- 'docs/reference/ft2-raster.html'
rm -rf -- 'docs/reference/ft2-sfnt_names.html'
rm -rf -- 'docs/reference/ft2-sizes_management.html'
rm -rf -- 'docs/reference/ft2-system_interface.html'
rm -rf -- 'docs/reference/ft2-toc.html'
rm -rf -- 'docs/reference/ft2-truetype_engine.html'
rm -rf -- 'docs/reference/ft2-truetype_tables.html'
rm -rf -- 'docs/reference/ft2-tt_driver.html'
rm -rf -- 'docs/reference/ft2-type1_tables.html'
rm -rf -- 'docs/reference/ft2-user_allocation.html'
rm -rf -- 'docs/reference/ft2-version.html'
rm -rf -- 'docs/reference/ft2-winfnt_fonts.html'

407
ports/libglib/libglib.patch Normal file
View File

@ -0,0 +1,407 @@
diff -Paur --no-dereference -- libglib.upstream/config.sub libglib/config.sub
--- libglib.upstream/config.sub
+++ libglib/config.sub
@@ -1373,7 +1373,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libglib.upstream/configure libglib/configure
--- libglib.upstream/configure
+++ libglib/configure
@@ -22140,8 +22140,9 @@
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
+ glib_cv_long_long_format=ll
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ll" >&5
+$as_echo "ll" >&6; }
fi
elif test x$ac_cv_sizeof___int64 = x8; then :
@@ -22244,6 +22245,7 @@
fi
+# TODO: Remove this check and remove G_HAVE_GROWING_STACK from public API.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for growing stack pointer" >&5
$as_echo_n "checking for growing stack pointer... " >&6; }
if ${glib_cv_stack_grows+:} false; then :
@@ -22251,10 +22253,7 @@
else
if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+ glib_cv_stack_grows=irrevant
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -24149,7 +24148,10 @@
$as_echo "yes" >&6; }
NAMESER_COMPAT_INCLUDE="#include <arpa/nameser_compat.h>"
else
- as_fn_error $? "could not compile test program either way" "$LINENO" 5
+ # PATCH: Sortix doesn't have <arpa/nameser.h> and probably won't by design, so
+ # don't error out here but just report absence.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
@@ -24223,7 +24225,10 @@
$as_echo "in -lbind" >&6; }
NETWORK_LIBS="-lbind $NETWORK_LIBS"
else
- as_fn_error $? "not found" "$LINENO" 5
+ # PATCH: Sortix doesn't have <resolv.h> at this time.
+ #as_fn_error $? "not found" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@@ -24481,7 +24486,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_func_vsnprintf_c99=no
+ ac_cv_func_vsnprintf_c99=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -24546,7 +24551,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_func_printf_unix98=no
+ ac_cv_func_printf_unix98=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -24938,7 +24943,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_func_snprintf_c99=no
+ ac_cv_func_snprintf_c99=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -25249,6 +25254,7 @@
# Check for strlcpy
+# TODO: The runtime check is to detect an ancient solaris bug so remove it.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenBSD strlcpy/strlcat" >&5
$as_echo_n "checking for OpenBSD strlcpy/strlcat... " >&6; }
if ${glib_cv_have_strlcpy+:} false; then :
@@ -25256,7 +25262,7 @@
else
if test "$cross_compiling" = yes; then :
- glib_cv_have_strlcpy=no
+ glib_cv_have_strlcpy=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -25620,10 +25626,7 @@
else
if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+ glib_cv_uscore=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -26980,10 +26983,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+ ac_cv_func_posix_getpwuid_r=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -27071,10 +27071,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+ ac_cv_func_posix_getgrgid_r=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
diff -Paur --no-dereference -- libglib.upstream/gio/gdbusmessage.c libglib/gio/gdbusmessage.c
--- libglib.upstream/gio/gdbusmessage.c
+++ libglib/gio/gdbusmessage.c
@@ -3474,18 +3474,28 @@
fs = g_string_new (NULL);
if (fstat (fds[n], &statbuf) == 0)
{
+#if defined(__sortix__)
+ g_string_append_printf (fs, "%s" "dev=%" PRIuDEV, fs->len > 0 ? "," : "",
+ statbuf.st_dev);
+#else
g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_dev), minor (statbuf.st_dev));
+#endif
g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "",
statbuf.st_mode);
g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_ino);
- g_string_append_printf (fs, "%s" "uid=%u", fs->len > 0 ? "," : "",
- (guint) statbuf.st_uid);
- g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "",
- (guint) statbuf.st_gid);
+ g_string_append_printf (fs, "%s" "uid=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
+ (guint64) statbuf.st_uid);
+ g_string_append_printf (fs, "%s" "gid=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
+ (guint64) statbuf.st_gid);
+#if defined(__sortix__)
+ g_string_append_printf (fs, "%s" "rdev=%" PRIuDEV, fs->len > 0 ? "," : "",
+ statbuf.st_rdev);
+#else
g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_rdev), minor (statbuf.st_rdev));
+#endif
g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
diff -Paur --no-dereference -- libglib.upstream/gio/ginetsocketaddress.c libglib/gio/ginetsocketaddress.c
--- libglib.upstream/gio/ginetsocketaddress.c
+++ libglib/gio/ginetsocketaddress.c
@@ -197,10 +197,10 @@
return FALSE;
}
+ memset (&sock, 0, sizeof(sock));
sock->sin_family = AF_INET;
sock->sin_port = g_htons (addr->priv->port);
memcpy (&(sock->sin_addr.s_addr), g_inet_address_to_bytes (addr->priv->address), sizeof (sock->sin_addr));
- memset (sock->sin_zero, 0, sizeof (sock->sin_zero));
return TRUE;
}
else if (family == AF_INET6)
diff -Paur --no-dereference -- libglib.upstream/gio/gnetworking.h.in libglib/gio/gnetworking.h.in
--- libglib.upstream/gio/gnetworking.h.in
+++ libglib/gio/gnetworking.h.in
@@ -41,13 +41,19 @@
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
+#if __has_include(<resolv.h>)
#include <resolv.h>
+#endif
#include <sys/socket.h>
#include <sys/un.h>
+#if __has_include(<net/if.h>)
#include <net/if.h>
+#endif
#include <arpa/inet.h>
+#if __has_include(<arpa/nameser.h>)
#include <arpa/nameser.h>
+#endif
@NAMESER_COMPAT_INCLUDE@
#ifndef T_SRV
diff -Paur --no-dereference -- libglib.upstream/gio/gresolver.c libglib/gio/gresolver.c
--- libglib.upstream/gio/gresolver.c
+++ libglib/gio/gresolver.c
@@ -323,8 +323,12 @@
* address, so if inet_aton() succeeds, then it's an address we want
* to reject.
*/
+#if defined(__sortix__)
+ if ((void) addr, (void) ip4addr, 0)
+#else
if (inet_aton (hostname, &ip4addr))
#endif
+#endif
{
g_set_error (error, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND,
_("Error resolving '%s': %s"),
diff -Paur --no-dereference -- libglib.upstream/gio/gsocket.c libglib/gio/gsocket.c
--- libglib.upstream/gio/gsocket.c
+++ libglib/gio/gsocket.c
@@ -69,6 +69,39 @@
#include "gwin32networking.h"
#endif
+#if defined(__sortix__)
+#ifndef IP_TTL
+#define IP_TTL (-1)
+#endif
+#ifndef IP_MULTICAST_LOOP
+#define IP_MULTICAST_LOOP (-1)
+#endif
+#ifndef IP_MULTICAST_TTL
+#define IP_MULTICAST_TTL (-1)
+#endif
+#if !defined(IP_ADD_MEMBERSHIP) && !defined(IP_DROP_MEMBERSHIP) && !defined(HAVE_IP_MREQN)
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+#endif
+#ifndef IP_ADD_MEMBERSHIP
+#define IP_ADD_MEMBERSHIP (-1)
+#endif
+#ifndef IP_DROP_MEMBERSHIP
+#define IP_DROP_MEMBERSHIP (-1)
+#endif
+#ifndef SO_NREAD
+#define SO_NREAD (-1)
+#endif
+#ifndef CMSG_DATA
+#define CMSG_DATA(x) ((unsigned char*) x)
+#define CMSG_FIRSTHDR(x) ((struct cmsghdr *) NULL)
+#define CMSG_NXTHDR(x, y) ((struct cmsghdr *) NULL)
+#endif
+#endif
+
/**
* SECTION:gsocket
* @short_description: Low-level socket object
@@ -319,7 +352,7 @@
{
struct sockaddr_storage address;
gint fd;
- guint addrlen;
+ socklen_t addrlen;
int value, family;
int errsv;
@@ -1713,7 +1746,7 @@
GError **error)
{
struct sockaddr_storage buffer;
- guint len = sizeof (buffer);
+ socklen_t len = sizeof (buffer);
g_return_val_if_fail (G_IS_SOCKET (socket), NULL);
@@ -1746,7 +1779,7 @@
GError **error)
{
struct sockaddr_storage buffer;
- guint len = sizeof (buffer);
+ socklen_t len = sizeof (buffer);
g_return_val_if_fail (G_IS_SOCKET (socket), NULL);
@@ -4866,7 +4899,7 @@
gint *value,
GError **error)
{
- guint size;
+ socklen_t size;
g_return_val_if_fail (G_IS_SOCKET (socket), FALSE);
@@ -4891,7 +4924,7 @@
/* If the returned value is smaller than an int then we need to
* slide it over into the low-order bytes of *value.
*/
- if (size != sizeof (gint))
+ if (size < sizeof (gint))
*value = *value >> (8 * (sizeof (gint) - size));
#endif
diff -Paur --no-dereference -- libglib.upstream/gio/gthreadedresolver.c libglib/gio/gthreadedresolver.c
--- libglib.upstream/gio/gthreadedresolver.c
+++ libglib/gio/gthreadedresolver.c
@@ -22,6 +22,7 @@
#include <glib.h>
#include "glibintl.h"
+#include <endian.h>
#include <stdio.h>
#include <string.h>
@@ -263,7 +264,15 @@
#if defined(G_OS_UNIX)
-#ifdef __BIONIC__
+#if defined(__BIONIC__) || defined(__sortix__)
+#if defined(__sortix__)
+static int h_errno;
+typedef unsigned char u_char;
+#define HOST_NOT_FOUND 1
+#define NO_DATA 2
+#define TRY_AGAIN 3
+#define res_query(a, b, c, d, e) ((void) (a), (void) (b), (void) (c), (void) (d), (void) (e), -1)
+#endif
/* Copy from bionic/libc/private/arpa_nameser_compat.h
* and bionic/libc/private/arpa_nameser.h */
typedef struct {
diff -Paur --no-dereference -- libglib.upstream/gio/gunixmounts.c libglib/gio/gunixmounts.c
--- libglib.upstream/gio/gunixmounts.c
+++ libglib/gio/gunixmounts.c
@@ -713,6 +713,20 @@
return return_list;
}
+#elif defined(__sortix__)
+
+static char *
+get_mtab_monitor_file (void)
+{
+ return NULL;
+}
+
+static GList *
+_g_get_unix_mounts (void)
+{
+ return NULL;
+}
+
/* Common code {{{2 */
#else
#error No _g_get_unix_mounts() implementation for system
@@ -1118,6 +1132,14 @@
return _g_get_unix_mounts ();
}
+#elif defined(__sortix__)
+
+static GList *
+_g_get_unix_mount_points (void)
+{
+ return NULL;
+}
+
/* Common code {{{2 */
#else
#error No g_get_mount_table() implementation for system
diff -Paur --no-dereference -- libglib.upstream/Makefile.in libglib/Makefile.in
--- libglib.upstream/Makefile.in
+++ libglib/Makefile.in
@@ -1726,6 +1726,7 @@
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
+ -find . -name '*.pyc' -delete
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-local distclean-tags

View File

@ -0,0 +1,13 @@
NAME=libglib
BUILD_LIBRARIES='libiconv gettext libz libffi xz? libdbus?'
VERSION=2.45.6
DISTNAME=glib-$VERSION
COMPRESSION=tar.xz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=a5710fcf8a073201ceca188c285af14d8da4bb2bbec22bdf6b5e0593d5bc6b77
UPSTREAM_SITE=https://download.gnome.org/sources/glib/2.45
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure
CONFIGURE_ARGS=--disable-gtk-doc
MAKE_VARS='V=1'
POST_INSTALL=tix-eradicate-libtool-la

View File

@ -0,0 +1,585 @@
rm -rf -- 'INSTALL'
rm -rf -- 'README'
rm -rf -- 'build/win32/vs11/README.txt'
rm -rf -- 'build/win32/vs11/gdbus.vcxproj'
rm -rf -- 'build/win32/vs11/gdbus.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gio-querymodules.vcxproj'
rm -rf -- 'build/win32/vs11/gio-querymodules.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gio.vcxproj'
rm -rf -- 'build/win32/vs11/gio.vcxproj.filters'
rm -rf -- 'build/win32/vs11/glib-build-defines.props'
rm -rf -- 'build/win32/vs11/glib-compile-resources.vcxproj'
rm -rf -- 'build/win32/vs11/glib-compile-resources.vcxproj.filters'
rm -rf -- 'build/win32/vs11/glib-compile-schemas.vcxproj'
rm -rf -- 'build/win32/vs11/glib-compile-schemas.vcxproj.filters'
rm -rf -- 'build/win32/vs11/glib-gen-srcs.props'
rm -rf -- 'build/win32/vs11/glib-genmarshal.vcxproj'
rm -rf -- 'build/win32/vs11/glib-genmarshal.vcxproj.filters'
rm -rf -- 'build/win32/vs11/glib-install.props'
rm -rf -- 'build/win32/vs11/glib-install.vcxproj'
rm -rf -- 'build/win32/vs11/glib-version-paths.props'
rm -rf -- 'build/win32/vs11/glib.sln'
rm -rf -- 'build/win32/vs11/glib.vcxproj'
rm -rf -- 'build/win32/vs11/glib.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gmodule.vcxproj'
rm -rf -- 'build/win32/vs11/gmodule.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gobject.vcxproj'
rm -rf -- 'build/win32/vs11/gobject.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gresource.vcxproj'
rm -rf -- 'build/win32/vs11/gresource.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gsettings.vcxproj'
rm -rf -- 'build/win32/vs11/gsettings.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gspawn-win32-helper-console.vcxproj'
rm -rf -- 'build/win32/vs11/gspawn-win32-helper-console.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gspawn-win32-helper.vcxproj'
rm -rf -- 'build/win32/vs11/gspawn-win32-helper.vcxproj.filters'
rm -rf -- 'build/win32/vs11/gthread.vcxproj'
rm -rf -- 'build/win32/vs11/gthread.vcxproj.filters'
rm -rf -- 'build/win32/vs12/README.txt'
rm -rf -- 'build/win32/vs12/gdbus.vcxproj'
rm -rf -- 'build/win32/vs12/gdbus.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gio-querymodules.vcxproj'
rm -rf -- 'build/win32/vs12/gio-querymodules.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gio.vcxproj'
rm -rf -- 'build/win32/vs12/gio.vcxproj.filters'
rm -rf -- 'build/win32/vs12/glib-build-defines.props'
rm -rf -- 'build/win32/vs12/glib-compile-resources.vcxproj'
rm -rf -- 'build/win32/vs12/glib-compile-resources.vcxproj.filters'
rm -rf -- 'build/win32/vs12/glib-compile-schemas.vcxproj'
rm -rf -- 'build/win32/vs12/glib-compile-schemas.vcxproj.filters'
rm -rf -- 'build/win32/vs12/glib-gen-srcs.props'
rm -rf -- 'build/win32/vs12/glib-genmarshal.vcxproj'
rm -rf -- 'build/win32/vs12/glib-genmarshal.vcxproj.filters'
rm -rf -- 'build/win32/vs12/glib-install.props'
rm -rf -- 'build/win32/vs12/glib-install.vcxproj'
rm -rf -- 'build/win32/vs12/glib-version-paths.props'
rm -rf -- 'build/win32/vs12/glib.sln'
rm -rf -- 'build/win32/vs12/glib.vcxproj'
rm -rf -- 'build/win32/vs12/glib.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gmodule.vcxproj'
rm -rf -- 'build/win32/vs12/gmodule.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gobject.vcxproj'
rm -rf -- 'build/win32/vs12/gobject.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gresource.vcxproj'
rm -rf -- 'build/win32/vs12/gresource.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gsettings.vcxproj'
rm -rf -- 'build/win32/vs12/gsettings.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gspawn-win32-helper-console.vcxproj'
rm -rf -- 'build/win32/vs12/gspawn-win32-helper-console.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gspawn-win32-helper.vcxproj'
rm -rf -- 'build/win32/vs12/gspawn-win32-helper.vcxproj.filters'
rm -rf -- 'build/win32/vs12/gthread.vcxproj'
rm -rf -- 'build/win32/vs12/gthread.vcxproj.filters'
rm -rf -- 'config.h.win32'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/ExampleAnimal.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/ExampleCat.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/ExampleObject.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/ExampleObjectManagerClient.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/ch01.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/gdbus-object-manager-example.devhelp2'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/home.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/index.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/index.sgml'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/left-insensitive.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/left.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/pt01.html'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/right-insensitive.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/right.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/style.css'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/up-insensitive.png'
rm -rf -- 'docs/reference/gio/gdbus-object-manager-example/html/up.png'
rm -rf -- 'docs/reference/gio/html/'
rm -rf -- 'docs/reference/gio/html/ExampleAnimal.html'
rm -rf -- 'docs/reference/gio/html/ExampleCat.html'
rm -rf -- 'docs/reference/gio/html/ExampleObject.html'
rm -rf -- 'docs/reference/gio/html/ExampleObjectManagerClient.html'
rm -rf -- 'docs/reference/gio/html/GAction.html'
rm -rf -- 'docs/reference/gio/html/GActionGroup.html'
rm -rf -- 'docs/reference/gio/html/GActionMap.html'
rm -rf -- 'docs/reference/gio/html/GAppInfo.html'
rm -rf -- 'docs/reference/gio/html/GAppInfoMonitor.html'
rm -rf -- 'docs/reference/gio/html/GApplication.html'
rm -rf -- 'docs/reference/gio/html/GApplicationCommandLine.html'
rm -rf -- 'docs/reference/gio/html/GAsyncInitable.html'
rm -rf -- 'docs/reference/gio/html/GAsyncResult.html'
rm -rf -- 'docs/reference/gio/html/GBufferedInputStream.html'
rm -rf -- 'docs/reference/gio/html/GBufferedOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GBytesIcon.html'
rm -rf -- 'docs/reference/gio/html/GCancellable.html'
rm -rf -- 'docs/reference/gio/html/GCharsetConverter.html'
rm -rf -- 'docs/reference/gio/html/GConverter.html'
rm -rf -- 'docs/reference/gio/html/GCredentials.html'
rm -rf -- 'docs/reference/gio/html/GDBusActionGroup.html'
rm -rf -- 'docs/reference/gio/html/GDBusAuthObserver.html'
rm -rf -- 'docs/reference/gio/html/GDBusConnection.html'
rm -rf -- 'docs/reference/gio/html/GDBusInterface.html'
rm -rf -- 'docs/reference/gio/html/GDBusInterfaceSkeleton.html'
rm -rf -- 'docs/reference/gio/html/GDBusMenuModel.html'
rm -rf -- 'docs/reference/gio/html/GDBusMessage.html'
rm -rf -- 'docs/reference/gio/html/GDBusMethodInvocation.html'
rm -rf -- 'docs/reference/gio/html/GDBusObject.html'
rm -rf -- 'docs/reference/gio/html/GDBusObjectManager.html'
rm -rf -- 'docs/reference/gio/html/GDBusObjectManagerClient.html'
rm -rf -- 'docs/reference/gio/html/GDBusObjectManagerServer.html'
rm -rf -- 'docs/reference/gio/html/GDBusObjectProxy.html'
rm -rf -- 'docs/reference/gio/html/GDBusObjectSkeleton.html'
rm -rf -- 'docs/reference/gio/html/GDBusProxy.html'
rm -rf -- 'docs/reference/gio/html/GDBusServer.html'
rm -rf -- 'docs/reference/gio/html/GDataInputStream.html'
rm -rf -- 'docs/reference/gio/html/GDataOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GDrive.html'
rm -rf -- 'docs/reference/gio/html/GEmblem.html'
rm -rf -- 'docs/reference/gio/html/GEmblemedIcon.html'
rm -rf -- 'docs/reference/gio/html/GFile.html'
rm -rf -- 'docs/reference/gio/html/GFileDescriptorBased.html'
rm -rf -- 'docs/reference/gio/html/GFileEnumerator.html'
rm -rf -- 'docs/reference/gio/html/GFileIOStream.html'
rm -rf -- 'docs/reference/gio/html/GFileIcon.html'
rm -rf -- 'docs/reference/gio/html/GFileInfo.html'
rm -rf -- 'docs/reference/gio/html/GFileInputStream.html'
rm -rf -- 'docs/reference/gio/html/GFileMonitor.html'
rm -rf -- 'docs/reference/gio/html/GFileOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GFilenameCompleter.html'
rm -rf -- 'docs/reference/gio/html/GFilterInputStream.html'
rm -rf -- 'docs/reference/gio/html/GFilterOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GIOModule.html'
rm -rf -- 'docs/reference/gio/html/GIOStream.html'
rm -rf -- 'docs/reference/gio/html/GIcon.html'
rm -rf -- 'docs/reference/gio/html/GInetAddress.html'
rm -rf -- 'docs/reference/gio/html/GInetAddressMask.html'
rm -rf -- 'docs/reference/gio/html/GInetSocketAddress.html'
rm -rf -- 'docs/reference/gio/html/GInitable.html'
rm -rf -- 'docs/reference/gio/html/GInputStream.html'
rm -rf -- 'docs/reference/gio/html/GListModel.html'
rm -rf -- 'docs/reference/gio/html/GListStore.html'
rm -rf -- 'docs/reference/gio/html/GLoadableIcon.html'
rm -rf -- 'docs/reference/gio/html/GMemoryInputStream.html'
rm -rf -- 'docs/reference/gio/html/GMemoryOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GMenu.html'
rm -rf -- 'docs/reference/gio/html/GMenuModel.html'
rm -rf -- 'docs/reference/gio/html/GMount.html'
rm -rf -- 'docs/reference/gio/html/GMountOperation.html'
rm -rf -- 'docs/reference/gio/html/GNetworkAddress.html'
rm -rf -- 'docs/reference/gio/html/GNetworkMonitor.html'
rm -rf -- 'docs/reference/gio/html/GNetworkService.html'
rm -rf -- 'docs/reference/gio/html/GNotification.html'
rm -rf -- 'docs/reference/gio/html/GOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GPermission.html'
rm -rf -- 'docs/reference/gio/html/GPollableInputStream.html'
rm -rf -- 'docs/reference/gio/html/GPollableOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GPropertyAction.html'
rm -rf -- 'docs/reference/gio/html/GProxy.html'
rm -rf -- 'docs/reference/gio/html/GProxyAddress.html'
rm -rf -- 'docs/reference/gio/html/GProxyResolver.html'
rm -rf -- 'docs/reference/gio/html/GRemoteActionGroup.html'
rm -rf -- 'docs/reference/gio/html/GResolver.html'
rm -rf -- 'docs/reference/gio/html/GResource.html'
rm -rf -- 'docs/reference/gio/html/GSeekable.html'
rm -rf -- 'docs/reference/gio/html/GSettings.html'
rm -rf -- 'docs/reference/gio/html/GSettingsBackend.html'
rm -rf -- 'docs/reference/gio/html/GSimpleAction.html'
rm -rf -- 'docs/reference/gio/html/GSimpleActionGroup.html'
rm -rf -- 'docs/reference/gio/html/GSimpleAsyncResult.html'
rm -rf -- 'docs/reference/gio/html/GSimpleIOStream.html'
rm -rf -- 'docs/reference/gio/html/GSimplePermission.html'
rm -rf -- 'docs/reference/gio/html/GSimpleProxyResolver.html'
rm -rf -- 'docs/reference/gio/html/GSocket.html'
rm -rf -- 'docs/reference/gio/html/GSocketAddress.html'
rm -rf -- 'docs/reference/gio/html/GSocketClient.html'
rm -rf -- 'docs/reference/gio/html/GSocketConnectable.html'
rm -rf -- 'docs/reference/gio/html/GSocketConnection.html'
rm -rf -- 'docs/reference/gio/html/GSocketControlMessage.html'
rm -rf -- 'docs/reference/gio/html/GSocketListener.html'
rm -rf -- 'docs/reference/gio/html/GSocketService.html'
rm -rf -- 'docs/reference/gio/html/GSrvTarget.html'
rm -rf -- 'docs/reference/gio/html/GSubprocess.html'
rm -rf -- 'docs/reference/gio/html/GSubprocessLauncher.html'
rm -rf -- 'docs/reference/gio/html/GTask.html'
rm -rf -- 'docs/reference/gio/html/GTcpConnection.html'
rm -rf -- 'docs/reference/gio/html/GTcpWrapperConnection.html'
rm -rf -- 'docs/reference/gio/html/GTestDBus.html'
rm -rf -- 'docs/reference/gio/html/GThemedIcon.html'
rm -rf -- 'docs/reference/gio/html/GThreadedSocketService.html'
rm -rf -- 'docs/reference/gio/html/GTlsBackend.html'
rm -rf -- 'docs/reference/gio/html/GTlsCertificate.html'
rm -rf -- 'docs/reference/gio/html/GTlsClientConnection.html'
rm -rf -- 'docs/reference/gio/html/GTlsConnection.html'
rm -rf -- 'docs/reference/gio/html/GTlsDatabase.html'
rm -rf -- 'docs/reference/gio/html/GTlsFileDatabase.html'
rm -rf -- 'docs/reference/gio/html/GTlsInteraction.html'
rm -rf -- 'docs/reference/gio/html/GTlsPassword.html'
rm -rf -- 'docs/reference/gio/html/GTlsServerConnection.html'
rm -rf -- 'docs/reference/gio/html/GUnixConnection.html'
rm -rf -- 'docs/reference/gio/html/GUnixCredentialsMessage.html'
rm -rf -- 'docs/reference/gio/html/GUnixFDList.html'
rm -rf -- 'docs/reference/gio/html/GUnixFDMessage.html'
rm -rf -- 'docs/reference/gio/html/GUnixInputStream.html'
rm -rf -- 'docs/reference/gio/html/GUnixOutputStream.html'
rm -rf -- 'docs/reference/gio/html/GUnixSocketAddress.html'
rm -rf -- 'docs/reference/gio/html/GVfs.html'
rm -rf -- 'docs/reference/gio/html/GVolume.html'
rm -rf -- 'docs/reference/gio/html/GVolumeMonitor.html'
rm -rf -- 'docs/reference/gio/html/GZlibCompressor.html'
rm -rf -- 'docs/reference/gio/html/GZlibDecompressor.html'
rm -rf -- 'docs/reference/gio/html/annotation-glossary.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-18.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-20.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-22.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-24.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-26.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-28.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-30.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-32.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-34.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-36.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-38.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-40.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-42.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-44.html'
rm -rf -- 'docs/reference/gio/html/api-index-2-46.html'
rm -rf -- 'docs/reference/gio/html/api-index-deprecated.html'
rm -rf -- 'docs/reference/gio/html/api-index-full.html'
rm -rf -- 'docs/reference/gio/html/application.html'
rm -rf -- 'docs/reference/gio/html/async.html'
rm -rf -- 'docs/reference/gio/html/ch01.html'
rm -rf -- 'docs/reference/gio/html/ch02.html'
rm -rf -- 'docs/reference/gio/html/ch03.html'
rm -rf -- 'docs/reference/gio/html/ch32.html'
rm -rf -- 'docs/reference/gio/html/ch33.html'
rm -rf -- 'docs/reference/gio/html/ch33s02.html'
rm -rf -- 'docs/reference/gio/html/ch33s03.html'
rm -rf -- 'docs/reference/gio/html/ch34.html'
rm -rf -- 'docs/reference/gio/html/ch34s02.html'
rm -rf -- 'docs/reference/gio/html/ch34s03.html'
rm -rf -- 'docs/reference/gio/html/ch34s04.html'
rm -rf -- 'docs/reference/gio/html/ch34s05.html'
rm -rf -- 'docs/reference/gio/html/ch34s06.html'
rm -rf -- 'docs/reference/gio/html/ch34s07.html'
rm -rf -- 'docs/reference/gio/html/ch35.html'
rm -rf -- 'docs/reference/gio/html/ch35s02.html'
rm -rf -- 'docs/reference/gio/html/ch35s03.html'
rm -rf -- 'docs/reference/gio/html/ch35s04.html'
rm -rf -- 'docs/reference/gio/html/ch35s05.html'
rm -rf -- 'docs/reference/gio/html/conversion.html'
rm -rf -- 'docs/reference/gio/html/data-models.html'
rm -rf -- 'docs/reference/gio/html/extending-gio.html'
rm -rf -- 'docs/reference/gio/html/extending.html'
rm -rf -- 'docs/reference/gio/html/failable_initialization.html'
rm -rf -- 'docs/reference/gio/html/file_mon.html'
rm -rf -- 'docs/reference/gio/html/file_ops.html'
rm -rf -- 'docs/reference/gio/html/gapplication-tool.html'
rm -rf -- 'docs/reference/gio/html/gdbus-codegen.html'
rm -rf -- 'docs/reference/gio/html/gdbus-convenience.html'
rm -rf -- 'docs/reference/gio/html/gdbus-lowlevel.html'
rm -rf -- 'docs/reference/gio/html/gdbus-org.gtk.GDBus.Example.ObjectManager.Animal.html'
rm -rf -- 'docs/reference/gio/html/gdbus-org.gtk.GDBus.Example.ObjectManager.Cat.html'
rm -rf -- 'docs/reference/gio/html/gdbus.html'
rm -rf -- 'docs/reference/gio/html/gio-D-Bus-Addresses.html'
rm -rf -- 'docs/reference/gio/html/gio-D-Bus-Introspection-Data.html'
rm -rf -- 'docs/reference/gio/html/gio-D-Bus-Utilities.html'
rm -rf -- 'docs/reference/gio/html/gio-Desktop-file-based-GAppInfo.html'
rm -rf -- 'docs/reference/gio/html/gio-Extension-Points.html'
rm -rf -- 'docs/reference/gio/html/gio-GActionGroup-exporter.html'
rm -rf -- 'docs/reference/gio/html/gio-GContentType.html'
rm -rf -- 'docs/reference/gio/html/gio-GConverterInputstream.html'
rm -rf -- 'docs/reference/gio/html/gio-GConverterOutputstream.html'
rm -rf -- 'docs/reference/gio/html/gio-GDBusError.html'
rm -rf -- 'docs/reference/gio/html/gio-GFileAttribute.html'
rm -rf -- 'docs/reference/gio/html/gio-GIOError.html'
rm -rf -- 'docs/reference/gio/html/gio-GIOScheduler.html'
rm -rf -- 'docs/reference/gio/html/gio-GMenuModel-exporter.html'
rm -rf -- 'docs/reference/gio/html/gio-GSettingsSchema-GSettingsSchemaSource.html'
rm -rf -- 'docs/reference/gio/html/gio-GWin32InputStream.html'
rm -rf -- 'docs/reference/gio/html/gio-GWin32OutputStream.html'
rm -rf -- 'docs/reference/gio/html/gio-GWin32RegistryKey.html'
rm -rf -- 'docs/reference/gio/html/gio-Owning-Bus-Names.html'
rm -rf -- 'docs/reference/gio/html/gio-TLS-Overview.html'
rm -rf -- 'docs/reference/gio/html/gio-Unix-Mounts.html'
rm -rf -- 'docs/reference/gio/html/gio-Watching-Bus-Names.html'
rm -rf -- 'docs/reference/gio/html/gio-gnetworking.h.html'
rm -rf -- 'docs/reference/gio/html/gio-gpollableutils.html'
rm -rf -- 'docs/reference/gio/html/gio-hierarchy.html'
rm -rf -- 'docs/reference/gio/html/gio-querymodules.html'
rm -rf -- 'docs/reference/gio/html/gio.devhelp2'
rm -rf -- 'docs/reference/gio/html/glib-compile-resources.html'
rm -rf -- 'docs/reference/gio/html/glib-compile-schemas.html'
rm -rf -- 'docs/reference/gio/html/gresource-tool.html'
rm -rf -- 'docs/reference/gio/html/gsettings-tool.html'
rm -rf -- 'docs/reference/gio/html/gvfs-overview.png'
rm -rf -- 'docs/reference/gio/html/highlevel-socket.html'
rm -rf -- 'docs/reference/gio/html/home.png'
rm -rf -- 'docs/reference/gio/html/icons.html'
rm -rf -- 'docs/reference/gio/html/index.html'
rm -rf -- 'docs/reference/gio/html/index.sgml'
rm -rf -- 'docs/reference/gio/html/left-insensitive.png'
rm -rf -- 'docs/reference/gio/html/left.png'
rm -rf -- 'docs/reference/gio/html/menu-example.png'
rm -rf -- 'docs/reference/gio/html/menu-model.png'
rm -rf -- 'docs/reference/gio/html/migrating.html'
rm -rf -- 'docs/reference/gio/html/networking.html'
rm -rf -- 'docs/reference/gio/html/permissions.html'
rm -rf -- 'docs/reference/gio/html/pt01.html'
rm -rf -- 'docs/reference/gio/html/pt02.html'
rm -rf -- 'docs/reference/gio/html/registry.html'
rm -rf -- 'docs/reference/gio/html/resolver.html'
rm -rf -- 'docs/reference/gio/html/resources.html'
rm -rf -- 'docs/reference/gio/html/right-insensitive.png'
rm -rf -- 'docs/reference/gio/html/right.png'
rm -rf -- 'docs/reference/gio/html/running-gio-apps.html'
rm -rf -- 'docs/reference/gio/html/settings.html'
rm -rf -- 'docs/reference/gio/html/streaming.html'
rm -rf -- 'docs/reference/gio/html/style.css'
rm -rf -- 'docs/reference/gio/html/subprocesses.html'
rm -rf -- 'docs/reference/gio/html/testing.html'
rm -rf -- 'docs/reference/gio/html/tls.html'
rm -rf -- 'docs/reference/gio/html/tools.html'
rm -rf -- 'docs/reference/gio/html/types.html'
rm -rf -- 'docs/reference/gio/html/up-insensitive.png'
rm -rf -- 'docs/reference/gio/html/up.png'
rm -rf -- 'docs/reference/gio/html/utils.html'
rm -rf -- 'docs/reference/gio/html/volume_mon.html'
rm -rf -- 'docs/reference/gio/version.xml'
rm -rf -- 'docs/reference/glib/html/'
rm -rf -- 'docs/reference/glib/html/Sorted_binary_tree_breadth-first_traversal.svg'
rm -rf -- 'docs/reference/glib/html/Sorted_binary_tree_inorder.svg'
rm -rf -- 'docs/reference/glib/html/Sorted_binary_tree_postorder.svg'
rm -rf -- 'docs/reference/glib/html/Sorted_binary_tree_preorder.svg'
rm -rf -- 'docs/reference/glib/html/annotation-glossary.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-10.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-12.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-14.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-16.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-18.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-2.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-20.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-22.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-24.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-26.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-28.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-30.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-32.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-34.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-36.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-38.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-4.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-40.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-42.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-44.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-6.html'
rm -rf -- 'docs/reference/glib/html/api-index-2-8.html'
rm -rf -- 'docs/reference/glib/html/api-index-deprecated.html'
rm -rf -- 'docs/reference/glib/html/api-index-full.html'
rm -rf -- 'docs/reference/glib/html/deprecated.html'
rm -rf -- 'docs/reference/glib/html/file-name-encodings.png'
rm -rf -- 'docs/reference/glib/html/glib-Arrays.html'
rm -rf -- 'docs/reference/glib/html/glib-Asynchronous-Queues.html'
rm -rf -- 'docs/reference/glib/html/glib-Atomic-Operations.html'
rm -rf -- 'docs/reference/glib/html/glib-Automatic-String-Completion.html'
rm -rf -- 'docs/reference/glib/html/glib-Balanced-Binary-Trees.html'
rm -rf -- 'docs/reference/glib/html/glib-Base64-Encoding.html'
rm -rf -- 'docs/reference/glib/html/glib-Basic-Types.html'
rm -rf -- 'docs/reference/glib/html/glib-Bookmark-file-parser.html'
rm -rf -- 'docs/reference/glib/html/glib-Byte-Arrays.html'
rm -rf -- 'docs/reference/glib/html/glib-Byte-Order-Macros.html'
rm -rf -- 'docs/reference/glib/html/glib-Caches.html'
rm -rf -- 'docs/reference/glib/html/glib-Character-Set-Conversion.html'
rm -rf -- 'docs/reference/glib/html/glib-Commandline-option-parser.html'
rm -rf -- 'docs/reference/glib/html/glib-Data-Checksums.html'
rm -rf -- 'docs/reference/glib/html/glib-Data-HMACs.html'
rm -rf -- 'docs/reference/glib/html/glib-Datasets.html'
rm -rf -- 'docs/reference/glib/html/glib-Date-and-Time-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-Deprecated-Thread-APIs.html'
rm -rf -- 'docs/reference/glib/html/glib-Double-ended-Queues.html'
rm -rf -- 'docs/reference/glib/html/glib-Doubly-Linked-Lists.html'
rm -rf -- 'docs/reference/glib/html/glib-Dynamic-Loading-of-Modules.html'
rm -rf -- 'docs/reference/glib/html/glib-Error-Reporting.html'
rm -rf -- 'docs/reference/glib/html/glib-File-Utilities.html'
rm -rf -- 'docs/reference/glib/html/glib-GDateTime.html'
rm -rf -- 'docs/reference/glib/html/glib-GTimeZone.html'
rm -rf -- 'docs/reference/glib/html/glib-GVariant.html'
rm -rf -- 'docs/reference/glib/html/glib-GVariantType.html'
rm -rf -- 'docs/reference/glib/html/glib-Glob-style-pattern-matching.html'
rm -rf -- 'docs/reference/glib/html/glib-Hash-Tables.html'
rm -rf -- 'docs/reference/glib/html/glib-Hook-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-Hostname-Utilities.html'
rm -rf -- 'docs/reference/glib/html/glib-I18N.html'
rm -rf -- 'docs/reference/glib/html/glib-IO-Channels.html'
rm -rf -- 'docs/reference/glib/html/glib-Key-value-file-parser.html'
rm -rf -- 'docs/reference/glib/html/glib-Keyed-Data-Lists.html'
rm -rf -- 'docs/reference/glib/html/glib-Lexical-Scanner.html'
rm -rf -- 'docs/reference/glib/html/glib-Memory-Allocation.html'
rm -rf -- 'docs/reference/glib/html/glib-Memory-Slices.html'
rm -rf -- 'docs/reference/glib/html/glib-Message-Logging.html'
rm -rf -- 'docs/reference/glib/html/glib-Miscellaneous-Macros.html'
rm -rf -- 'docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-N-ary-Trees.html'
rm -rf -- 'docs/reference/glib/html/glib-Numerical-Definitions.html'
rm -rf -- 'docs/reference/glib/html/glib-Perl-compatible-regular-expressions.html'
rm -rf -- 'docs/reference/glib/html/glib-Pointer-Arrays.html'
rm -rf -- 'docs/reference/glib/html/glib-Quarks.html'
rm -rf -- 'docs/reference/glib/html/glib-Random-Numbers.html'
rm -rf -- 'docs/reference/glib/html/glib-Relations-and-Tuples.html'
rm -rf -- 'docs/reference/glib/html/glib-Sequences.html'
rm -rf -- 'docs/reference/glib/html/glib-Shell-related-Utilities.html'
rm -rf -- 'docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html'
rm -rf -- 'docs/reference/glib/html/glib-Singly-Linked-Lists.html'
rm -rf -- 'docs/reference/glib/html/glib-Spawning-Processes.html'
rm -rf -- 'docs/reference/glib/html/glib-Standard-Macros.html'
rm -rf -- 'docs/reference/glib/html/glib-String-Chunks.html'
rm -rf -- 'docs/reference/glib/html/glib-String-Utility-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-Strings.html'
rm -rf -- 'docs/reference/glib/html/glib-Testing.html'
rm -rf -- 'docs/reference/glib/html/glib-The-Main-Event-Loop.html'
rm -rf -- 'docs/reference/glib/html/glib-Thread-Pools.html'
rm -rf -- 'docs/reference/glib/html/glib-Threads.html'
rm -rf -- 'docs/reference/glib/html/glib-Timers.html'
rm -rf -- 'docs/reference/glib/html/glib-Trash-Stacks.html'
rm -rf -- 'docs/reference/glib/html/glib-Type-Conversion-Macros.html'
rm -rf -- 'docs/reference/glib/html/glib-UNIX-specific-utilities-and-integration.html'
rm -rf -- 'docs/reference/glib/html/glib-URI-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-Unicode-Manipulation.html'
rm -rf -- 'docs/reference/glib/html/glib-Version-Information.html'
rm -rf -- 'docs/reference/glib/html/glib-Warnings-and-Assertions.html'
rm -rf -- 'docs/reference/glib/html/glib-Windows-Compatibility-Functions.html'
rm -rf -- 'docs/reference/glib/html/glib-building.html'
rm -rf -- 'docs/reference/glib/html/glib-changes.html'
rm -rf -- 'docs/reference/glib/html/glib-compiling.html'
rm -rf -- 'docs/reference/glib/html/glib-core.html'
rm -rf -- 'docs/reference/glib/html/glib-cross-compiling.html'
rm -rf -- 'docs/reference/glib/html/glib-data-types.html'
rm -rf -- 'docs/reference/glib/html/glib-fundamentals.html'
rm -rf -- 'docs/reference/glib/html/glib-gettextize.html'
rm -rf -- 'docs/reference/glib/html/glib-programming.html'
rm -rf -- 'docs/reference/glib/html/glib-regex-syntax.html'
rm -rf -- 'docs/reference/glib/html/glib-resources.html'
rm -rf -- 'docs/reference/glib/html/glib-running.html'
rm -rf -- 'docs/reference/glib/html/glib-utilities.html'
rm -rf -- 'docs/reference/glib/html/glib.devhelp2'
rm -rf -- 'docs/reference/glib/html/glib.html'
rm -rf -- 'docs/reference/glib/html/gtester-report.html'
rm -rf -- 'docs/reference/glib/html/gtester.html'
rm -rf -- 'docs/reference/glib/html/gvariant-format-strings.html'
rm -rf -- 'docs/reference/glib/html/gvariant-text.html'
rm -rf -- 'docs/reference/glib/html/home.png'
rm -rf -- 'docs/reference/glib/html/index.html'
rm -rf -- 'docs/reference/glib/html/index.sgml'
rm -rf -- 'docs/reference/glib/html/left-insensitive.png'
rm -rf -- 'docs/reference/glib/html/left.png'
rm -rf -- 'docs/reference/glib/html/mainloop-states.gif'
rm -rf -- 'docs/reference/glib/html/right-insensitive.png'
rm -rf -- 'docs/reference/glib/html/right.png'
rm -rf -- 'docs/reference/glib/html/style.css'
rm -rf -- 'docs/reference/glib/html/tools.html'
rm -rf -- 'docs/reference/glib/html/up-insensitive.png'
rm -rf -- 'docs/reference/glib/html/up.png'
rm -rf -- 'docs/reference/glib/version.xml'
rm -rf -- 'docs/reference/gobject/html/'
rm -rf -- 'docs/reference/gobject/html/GBinding.html'
rm -rf -- 'docs/reference/gobject/html/GTypeModule.html'
rm -rf -- 'docs/reference/gobject/html/GTypePlugin.html'
rm -rf -- 'docs/reference/gobject/html/annotation-glossary.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-10.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-12.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-14.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-18.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-2.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-22.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-24.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-26.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-28.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-30.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-32.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-34.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-36.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-38.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-4.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-40.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-42.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-44.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-6.html'
rm -rf -- 'docs/reference/gobject/html/api-index-2-8.html'
rm -rf -- 'docs/reference/gobject/html/api-index-deprecated.html'
rm -rf -- 'docs/reference/gobject/html/api-index-full.html'
rm -rf -- 'docs/reference/gobject/html/ch01s02.html'
rm -rf -- 'docs/reference/gobject/html/chapter-gobject.html'
rm -rf -- 'docs/reference/gobject/html/chapter-gtype.html'
rm -rf -- 'docs/reference/gobject/html/chapter-intro.html'
rm -rf -- 'docs/reference/gobject/html/chapter-signal.html'
rm -rf -- 'docs/reference/gobject/html/glib-genmarshal.html'
rm -rf -- 'docs/reference/gobject/html/glib-mkenums.html'
rm -rf -- 'docs/reference/gobject/html/glue.png'
rm -rf -- 'docs/reference/gobject/html/gobject-Boxed-Types.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Closures.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Enumeration-and-Flag-Types.html'
rm -rf -- 'docs/reference/gobject/html/gobject-GParamSpec.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Generic-values.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Signals.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Standard-Parameter-and-Value-Types.html'
rm -rf -- 'docs/reference/gobject/html/gobject-The-Base-Object-Type.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Type-Information.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Value-arrays.html'
rm -rf -- 'docs/reference/gobject/html/gobject-Varargs-Value-Collection.html'
rm -rf -- 'docs/reference/gobject/html/gobject-memory.html'
rm -rf -- 'docs/reference/gobject/html/gobject-properties.html'
rm -rf -- 'docs/reference/gobject/html/gobject-query.html'
rm -rf -- 'docs/reference/gobject/html/gobject.devhelp2'
rm -rf -- 'docs/reference/gobject/html/gtype-conventions.html'
rm -rf -- 'docs/reference/gobject/html/gtype-instantiable-classed.html'
rm -rf -- 'docs/reference/gobject/html/gtype-non-instantiable-classed.html'
rm -rf -- 'docs/reference/gobject/html/gtype-non-instantiable.html'
rm -rf -- 'docs/reference/gobject/html/home.png'
rm -rf -- 'docs/reference/gobject/html/howto-gobject-chainup.html'
rm -rf -- 'docs/reference/gobject/html/howto-gobject-code.html'
rm -rf -- 'docs/reference/gobject/html/howto-gobject-construction.html'
rm -rf -- 'docs/reference/gobject/html/howto-gobject-destruction.html'
rm -rf -- 'docs/reference/gobject/html/howto-gobject-methods.html'
rm -rf -- 'docs/reference/gobject/html/howto-gobject.html'
rm -rf -- 'docs/reference/gobject/html/howto-interface-implement.html'
rm -rf -- 'docs/reference/gobject/html/howto-interface-override.html'
rm -rf -- 'docs/reference/gobject/html/howto-interface-prerequisite.html'
rm -rf -- 'docs/reference/gobject/html/howto-interface-properties.html'
rm -rf -- 'docs/reference/gobject/html/howto-interface.html'
rm -rf -- 'docs/reference/gobject/html/howto-signals.html'
rm -rf -- 'docs/reference/gobject/html/index.html'
rm -rf -- 'docs/reference/gobject/html/index.sgml'
rm -rf -- 'docs/reference/gobject/html/left-insensitive.png'
rm -rf -- 'docs/reference/gobject/html/left.png'
rm -rf -- 'docs/reference/gobject/html/pr01.html'
rm -rf -- 'docs/reference/gobject/html/pt01.html'
rm -rf -- 'docs/reference/gobject/html/pt02.html'
rm -rf -- 'docs/reference/gobject/html/pt03.html'
rm -rf -- 'docs/reference/gobject/html/right-insensitive.png'
rm -rf -- 'docs/reference/gobject/html/right.png'
rm -rf -- 'docs/reference/gobject/html/rn01.html'
rm -rf -- 'docs/reference/gobject/html/rn02.html'
rm -rf -- 'docs/reference/gobject/html/signal.html'
rm -rf -- 'docs/reference/gobject/html/style.css'
rm -rf -- 'docs/reference/gobject/html/tools-ginspector.html'
rm -rf -- 'docs/reference/gobject/html/tools-gob.html'
rm -rf -- 'docs/reference/gobject/html/tools-gtkdoc.html'
rm -rf -- 'docs/reference/gobject/html/tools-refdb.html'
rm -rf -- 'docs/reference/gobject/html/tools-vala.html'
rm -rf -- 'docs/reference/gobject/html/up-insensitive.png'
rm -rf -- 'docs/reference/gobject/html/up.png'
rm -rf -- 'docs/reference/gobject/version.xml'
rm -rf -- 'gio/gconstructor_as_data.h'
rm -rf -- 'gio/gdbus-2.0/codegen/config.py'
rm -rf -- 'gio/gdbus-daemon-generated.c'
rm -rf -- 'gio/gdbus-daemon-generated.h'
rm -rf -- 'gio/gio.rc'
rm -rf -- 'gio/gioenumtypes.c'
rm -rf -- 'gio/gioenumtypes.h'
rm -rf -- 'gio/tests/plugin_resources.c'
rm -rf -- 'glib/glib.rc'
rm -rf -- 'glib/glibconfig.h.win32'
rm -rf -- 'glib/makefile.msc'
rm -rf -- 'gmodule/gmodule.rc'
rm -rf -- 'gmodule/makefile.msc'
rm -rf -- 'gobject/gobject.rc'
rm -rf -- 'gobject/makefile.msc'
rm -rf -- 'gthread/gthread.rc'
rm -rf -- 'gthread/makefile.msc'
rm -rf -- 'tests/gobject/testmarshal.c'
rm -rf -- 'tests/gobject/testmarshal.h'
rm -rf -- 'tests/makefile.msc'

60
ports/libgmp/libgmp.patch Normal file
View File

@ -0,0 +1,60 @@
diff -Paur --no-dereference -- libgmp.upstream/configfsf.sub libgmp/configfsf.sub
--- libgmp.upstream/configfsf.sub
+++ libgmp/configfsf.sub
@@ -1356,7 +1356,7 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff -Paur --no-dereference -- libgmp.upstream/configure libgmp/configure
--- libgmp.upstream/configure
+++ libgmp/configure
@@ -6224,6 +6224,8 @@
1666 to segfault with e.g., -O2 -mpowerpc64. */
#if defined (__GNUC__) && ! defined (__cplusplus)
+h();
+g();
typedef unsigned long long t1;typedef t1*t2;
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
@@ -6288,6 +6290,7 @@
1666 to get an ICE with -O1 -mpowerpc64. */
#if defined (__GNUC__) && ! defined (__cplusplus)
+g();
f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
g(){}
#else
@@ -7777,6 +7780,8 @@
1666 to segfault with e.g., -O2 -mpowerpc64. */
#if defined (__GNUC__) && ! defined (__cplusplus)
+h();
+g();
typedef unsigned long long t1;typedef t1*t2;
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
@@ -7841,6 +7846,7 @@
1666 to get an ICE with -O1 -mpowerpc64. */
#if defined (__GNUC__) && ! defined (__cplusplus)
+g();
f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
g(){}
#else
diff -Paur --no-dereference -- libgmp.upstream/gmp-h.in libgmp/gmp-h.in
--- libgmp.upstream/gmp-h.in
+++ libgmp/gmp-h.in
@@ -254,6 +254,7 @@
/* For reference, "defined(EOF)" cannot be used here. In g++ 2.95.4,
<iostream> defines EOF but not FILE. */
#if defined (FILE) \
+ || defined (stdout) \
|| defined (H_STDIO) \
|| defined (_H_STDIO) /* AIX */ \
|| defined (_STDIO_H) /* glibc, Sun, SCO */ \

Some files were not shown because too many files have changed in this diff Show More