import chromeos stuff

This commit is contained in:
Brandon Philips 2013-02-08 11:12:07 -08:00
parent 1db2fb44e8
commit 3647fa4544
2574 changed files with 190368 additions and 0 deletions

View File

@ -0,0 +1,74 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for Chromium OS.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl and git cl.
"""
import difflib
import os
import re
_EBUILD_FILES = (
r".*\.ebuild",
)
def _IsCrosWorkonEbuild(ebuild_contents):
pattern = re.compile('^ *inherit[-\._a-z0-9 ]*cros-workon')
for line in ebuild_contents:
if pattern.match(line):
return True
return False
def Check9999Updated(input_api, output_api, source_file_filter=None):
"""Checks that the 9999 ebuild was also modified."""
output = []
inconsistent = set()
missing_9999 = set()
for f in input_api.AffectedSourceFiles(source_file_filter):
ebuild_contents = f.NewContents()
# only look at non-9999
if f.LocalPath().endswith('-9999.ebuild'):
continue
if _IsCrosWorkonEbuild(ebuild_contents):
dir = os.path.dirname(f.AbsoluteLocalPath())
ebuild = os.path.basename(dir)
devebuild_path = os.path.join(dir, ebuild + '-9999.ebuild')
# check if 9999 ebuild exists
if not os.path.isfile(devebuild_path):
missing_9999.add(ebuild)
continue
diff = difflib.ndiff(ebuild_contents,
open(devebuild_path).read().splitlines())
for line in diff:
if line.startswith('+') or line.startswith('-'):
# ignore empty-lines
if len(line) == 2:
continue
if not (line[2:].startswith('KEYWORDS=') or
line[2:].startswith('CROS_WORKON_COMMIT=')):
inconsistent.add(f.LocalPath())
if missing_9999:
output.append(output_api.PresubmitPromptWarning(
'Missing 9999 for these cros-workon ebuilds:', items=missing_9999))
if inconsistent:
output.append(output_api.PresubmitPromptWarning(
'Following ebuilds are inconsistent with 9999:', items=inconsistent))
return output
def CheckChange(input_api, output_api, committing):
ebuilds = lambda x: input_api.FilterSourceFile(x, white_list=_EBUILD_FILES)
results = []
results += Check9999Updated(input_api, output_api,
source_file_filter=ebuilds)
return results
def CheckChangeOnUpload(input_api, output_api):
return CheckChange(input_api, output_api, False)
def CheckChangeOnCommit(input_api, output_api):
return CheckChange(input_api, output_api, True)

View File

@ -0,0 +1,211 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for Chromium OS.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl and git cl.
"""
import re
_EXCLUDED_PATHS = (
r"^inherit-review-settings-ok$",
r".*[\\\/]debian[\\\/]rules$",
)
# These match files that should contain tabs as indentation.
_TAB_OK_PATHS = (
r"/src/third_party/kernel/",
r"/src/third_party/kernel-next/",
r"/src/third_party/u-boot/",
r"/src/third_party/u-boot-next/",
r".*\.ebuild$",
r".*\.eclass$",
)
# These match files that are part of out "next" developemnt flow and as such
# do not require a valid BUG= field to commit, but it's still a good idea.
_NEXT_PATHS = (
r"/src/third_party/kernel-next",
r"/src/third_party/u-boot-next",
)
_LICENSE_HEADER = (
r".*? Copyright \(c\) 20[-0-9]{2,7} The Chromium OS Authors\. All rights "
r"reserved\." "\n"
r".*? Use of this source code is governed by a BSD-style license that can "
"be\n"
r".*? found in the LICENSE file\."
"\n"
)
def CheckAndShowLicense(input_api, output_api, source_file_filter=None):
"""Check that the source files have a valid License header.
The license header must matches our template. If not also show the
header that should have been used.
"""
results = []
license_check = input_api.canned_checks.CheckLicense(
input_api, output_api, _LICENSE_HEADER, source_file_filter)
results.extend(license_check)
if license_check:
results.extend([output_api.PresubmitNotifyResult(
"License header should match the following:",
long_text=_LICENSE_HEADER)])
return results
def CheckChangeHasMandatoryBugField(input_api,
output_api,
source_file_filter=None):
"""Check that the commit contains a valid BUG= field."""
msg = ('Changelist must reference a bug number using BUG=\n'
'For example, BUG=chromium-os:8205\n'
'BUG=none is allowed.')
if (not input_api.AffectedSourceFiles(source_file_filter) or
input_api.change.BUG):
return []
else:
return [output_api.PresubmitError(msg)]
def CheckChangeHasBugField(input_api, output_api, source_file_filter=None):
# This function is required because the canned BugField check doesn't
# take a source filter.
return input_api.canned_checks.CheckChangeHasBugField(input_api,
output_api)
def CheckChangeHasTestField(input_api, output_api, source_file_filter=None):
# This function is required because the canned TestField check doesn't
# take a source filter.
return input_api.canned_checks.CheckChangeHasTestField(input_api,
output_api)
def CheckTreeIsOpen(input_api, output_api, source_file_filter=None):
"""Make sure the tree is 'open'. If not, don't submit."""
return input_api.canned_checks.CheckTreeIsOpen(
input_api,
output_api,
json_url='http://chromiumos-status.appspot.com/current?format=json')
def CheckBuildbotPendingBuilds(input_api, output_api, source_file_filter=None):
"""Check to see if there's a backlog on the pending CL queue"""
return input_api.canned_checks.CheckBuildbotPendingBuilds(
input_api,
output_api,
'http://build.chromium.org/p/chromiumos/json/builders?filter=1',
6,
[])
def FilterAbsoluteSourceFile(input_api, affected_file, white_list, black_list):
"""Filters out files that aren't considered "source file".
The lists will be compiled as regular expression and
AffectedFile.AbsoluteLocalPath() needs to pass both list.
Note: This function was coppied from presubmit_support.py and modified to
check against (AbsoluteLocalPath - PresubmitLocalPath) instead of LocalPath
because LocalPath doesn't contain enough information to disambiguate kernel,
u-boot and -next files from the rest of ChromiumOS.
"""
presubmit_local_path = input_api.PresubmitLocalPath()
def RelativePath(affected_file):
absolute_local_path = affected_file.AbsoluteLocalPath()
assert absolute_local_path.startswith(presubmit_local_path)
return absolute_local_path[len(presubmit_local_path):]
def Find(relative_path, items):
for item in items:
if re.match(item, relative_path):
return True
return False
relative_path = RelativePath(affected_file)
return (Find(relative_path, white_list) and
not Find(relative_path, black_list))
def RunChecklist(input_api, output_api, checklist):
"""Run through a set of checks provided in a checklist.
The checklist is a list of tuples, each of which contains the check to run
and a list of regular expressions of paths to ignore for this check
"""
results = []
for check, paths in checklist:
white_list = input_api.DEFAULT_WHITE_LIST
# Construct a black list from the DEFAULT_BLACK_LIST supplied by
# depot_tools and the paths that this check should not be applied to.
#
# We also remove the third_party rule here because our paterns are
# matching against the entire path from the root of the ChromiumOS
# project. We use the rooted paths because we want to be able to apply
# some of the presubmit checks to things like the kernel and u-boot that
# live in the third_party directory.
black_list = list(input_api.DEFAULT_BLACK_LIST)
black_list.remove(r".*\bthird_party[\\\/].*")
black_list.extend(paths)
sources = lambda path: FilterAbsoluteSourceFile(input_api,
path,
white_list,
black_list)
results.extend(check(input_api, output_api, source_file_filter=sources))
return results
def MakeCommonChecklist(input_api):
return [(input_api.canned_checks.CheckLongLines, _EXCLUDED_PATHS),
(input_api.canned_checks.CheckChangeHasNoStrayWhitespace,
_EXCLUDED_PATHS),
(CheckChangeHasTestField, _EXCLUDED_PATHS),
(CheckAndShowLicense, _EXCLUDED_PATHS),
(input_api.canned_checks.CheckChangeHasNoTabs,
_EXCLUDED_PATHS + _TAB_OK_PATHS)]
def MakeUploadChecklist(input_api):
return [(CheckChangeHasBugField, _EXCLUDED_PATHS)]
def MakeCommitChecklist(input_api):
return [(CheckChangeHasMandatoryBugField, _EXCLUDED_PATHS),
(CheckTreeIsOpen, _EXCLUDED_PATHS),
(CheckBuildbotPendingBuilds, _EXCLUDED_PATHS)]
def CheckChangeOnUpload(input_api, output_api):
"""On upload we check against the common and upload lists."""
return RunChecklist(input_api,
output_api,
MakeCommonChecklist(input_api) +
MakeUploadChecklist(input_api))
def CheckChangeOnCommit(input_api, output_api):
"""On commit we check against the common and commit lists."""
return RunChecklist(input_api,
output_api,
MakeCommonChecklist(input_api) +
MakeCommitChecklist(input_api))
def GetPreferredTrySlaves():
return ['ChromiumOS x86']

View File

@ -0,0 +1,28 @@
# See http://dev.chromium.org/developers/contributing-code/watchlists for
# a description of this file's format.
# Please keep these keys in alphabetical order.
{
'WATCHLIST_DEFINITIONS': {
'all': {
'filepath': '.',
},
'fonts': {
'filepath': 'media-fonts/|media-libs/(fontconfig|freetype)/',
},
'chromeos-image' : {
'filepath': 'chromeos-base/chromeos(/|-dev|-test)',
},
'xorg' : {
'filepath': 'chromeos-base/xorg-conf/|x11-(base|drivers|libs|misc)/',
},
},
'WATCHLISTS': {
'all': ['adlr+crosoverlay@chromium.org',
'msb+crosoverlay@chromium.org',
'anush@chromium.org'],
'chromeos-image' : ['petkov@chromium.org', 'sosa@chromium.org'],
'fonts' : ['derat@chromium.org'],
'xorg' : ['derat@chromium.org', 'marcheu@chromium.org'],
},
}

View File

@ -0,0 +1,30 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-mesa/eselect-mesa-0.0.8.ebuild,v 1.2 2010/11/28 15:37:34 chithanh Exp $
EAPI=3
DESCRIPTION="Utility to change the Mesa OpenGL driver being used"
HOMEPAGE="http://www.gentoo.org/"
SRC_URI="mirror://gentoo/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc x86 ~x86-fbsd"
IUSE=""
DEPEND=""
RDEPEND=">=app-admin/eselect-1.2.4"
src_install() {
insinto /usr/share/eselect/modules
doins mesa.eselect || die
}
pkg_postinst() {
if has_version ">=media-libs/mesa-7.9" && \
! [ -f "${EROOT}"/usr/share/mesa/eselect-mesa.conf ]; then
eerror "Rebuild media-libs/mesa for ${PN} to work."
fi
}

View File

@ -0,0 +1,39 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# NOTE: This is based on the bootchart found in Ubuntu, which is a re-working
# of the bootchart project to use a C-based collector daemon. There wasn't a
# good link to a source tarball to use in the ebuild and all we need are the
# collector and gather files from it so they are inlined in the FILESDIR.
inherit toolchain-funcs
DESCRIPTION="Performance analysis and visualization of the system boot process"
HOMEPAGE="http://packages.ubuntu.com/lucid/bootchart"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE=""
DEPEND=""
RDEPEND=""
src_unpack() {
mkdir "${S}"
cp "${FILESDIR}/bootchart-collector.c" "${S}/collector.c"
cp "${FILESDIR}/bootchart-gather.sh" "${S}/gather"
cp "${FILESDIR}/bootchart.conf" "${S}"
}
src_compile() {
$(tc-getCC) ${CFLAGS} -o collector collector.c ||
die "Unable to compile bootchart collector."
}
src_install() {
exeinto /lib/bootchart
doexe collector gather
insinto /etc/init
doins bootchart.conf
}

View File

@ -0,0 +1,438 @@
/* bootchart-collector
*
* Copyright © 2009 Canonical Ltd.
* Author: Scott James Remnant <scott@netsplit.com>.
*
* This program 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, version 3 of the License.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <assert.h>
#include <dirent.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define BUFSIZE 524288
int append_buf (const char *str, size_t len,
int outfd, char *outbuf, size_t *outlen);
int copy_buf (int fd, int outfd, char *outbuf, size_t *outlen);
int flush_buf (int outfd, char *outbuf, size_t *outlen);
int read_file (int fd, const char *uptime, size_t uptimelen,
int outfd, char *outbuf, size_t *outlen);
int read_proc (DIR *proc, const char *uptime, size_t uptimelen,
int outfd, char *outbuf, size_t *outlen);
unsigned long get_uptime (int fd);
void sig_handler (int signum);
int
append_buf (const char *str,
size_t len,
int outfd,
char *outbuf,
size_t *outlen)
{
assert (len <= BUFSIZE);
if (*outlen + len > BUFSIZE)
if (flush_buf (outfd, outbuf, outlen) < 0)
return -1;
memcpy (outbuf + *outlen, str, len);
*outlen += len;
return 0;
}
int
copy_buf (int fd,
int outfd,
char *outbuf,
size_t *outlen)
{
for (;;) {
ssize_t len;
if (*outlen == BUFSIZE)
if (flush_buf (outfd, outbuf, outlen) < 0)
return -1;
len = read (fd, outbuf + *outlen, BUFSIZE - *outlen);
if (len < 0) {
perror ("read");
return -1;
} else if (len == 0)
break;
*outlen += len;
}
return 0;
}
int
flush_buf (int outfd,
char *outbuf,
size_t *outlen)
{
size_t writelen = 0;
while (writelen < *outlen) {
ssize_t len;
len = write (outfd, outbuf + writelen, *outlen - writelen);
if (len < 0) {
perror ("write");
exit (1);
}
writelen += len;
}
*outlen = 0;
return 0;
}
int
read_file (int fd,
const char *uptime,
size_t uptimelen,
int outfd,
char *outbuf,
size_t *outlen)
{
lseek (fd, SEEK_SET, 0);
if (append_buf (uptime, uptimelen, outfd, outbuf, outlen) < 0)
return -1;
if (copy_buf (fd, outfd, outbuf, outlen) < 0)
return -1;
if (append_buf ("\n", 1, outfd, outbuf, outlen) < 0)
return -1;
return 0;
}
int
read_proc (DIR *proc,
const char *uptime,
size_t uptimelen,
int outfd,
char *outbuf,
size_t *outlen)
{
struct dirent *ent;
rewinddir (proc);
if (append_buf (uptime, uptimelen, outfd, outbuf, outlen) < 0)
return -1;
while ((ent = readdir (proc)) != NULL) {
char filename[PATH_MAX];
int fd;
if ((ent->d_name[0] < '0') || (ent->d_name[0] > '9'))
continue;
sprintf (filename, "/proc/%s/stat", ent->d_name);
fd = open (filename, O_RDONLY);
if (fd < 0)
continue;
if (copy_buf (fd, outfd, outbuf, outlen) < 0)
;
if (close (fd) < 0)
continue;
}
if (append_buf ("\n", 1, outfd, outbuf, outlen) < 0)
return -1;
return 0;
}
unsigned long
get_uptime (int fd)
{
char buf[80];
ssize_t len;
unsigned long u1, u2;
lseek (fd, SEEK_SET, 0);
len = read (fd, buf, sizeof buf);
if (len < 0) {
perror ("read");
return 0;
}
buf[len] = '\0';
if (sscanf (buf, "%lu.%lu", &u1, &u2) != 2) {
perror ("sscanf");
return 0;
}
return u1 * 100 + u2;
}
void
sig_handler (int signum)
{
}
int
main (int argc,
char *argv[])
{
struct sigaction act;
sigset_t mask, oldmask;
struct rlimit rlim;
struct timespec timeout;
const char *output_dir = ".";
char filename[PATH_MAX];
int sfd, dfd, ufd;
DIR *proc;
int statfd, diskfd, procfd;
char statbuf[BUFSIZE], diskbuf[BUFSIZE], procbuf[BUFSIZE];
size_t statlen = 0, disklen = 0, proclen = 0;
unsigned long reltime = 0;
int arg = 1, rel = 0;
if ((argc > arg) && (! strcmp (argv[arg], "-r"))) {
rel = 1;
arg++;
}
if (argc <= arg) {
fprintf (stderr, "Usage: %s [-r] HZ [DIR]\n", argv[0]);
exit (1);
}
if (argc > arg) {
unsigned long hz;
char *endptr;
hz = strtoul (argv[arg], &endptr, 10);
if (*endptr) {
fprintf (stderr, "%s: HZ not an integer\n", argv[0]);
exit (1);
}
if (hz > 1) {
timeout.tv_sec = 0;
timeout.tv_nsec = 1000000000 / hz;
} else {
timeout.tv_sec = 1;
timeout.tv_nsec = 0;
}
arg++;
}
if (argc > arg) {
output_dir = argv[arg];
arg++;
}
sigemptyset (&mask);
sigaddset (&mask, SIGTERM);
sigaddset (&mask, SIGINT);
if (sigprocmask (SIG_BLOCK, &mask, &oldmask) < 0) {
perror ("sigprocmask");
exit (1);
}
act.sa_handler = sig_handler;
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
if (sigaction (SIGTERM, &act, NULL) < 0) {
perror ("sigaction SIGTERM");
exit (1);
}
if (sigaction (SIGINT, &act, NULL) < 0) {
perror ("sigaction SIGINT");
exit (1);
}
/* Drop cores if we go wrong */
if (chdir ("/"))
;
rlim.rlim_cur = RLIM_INFINITY;
rlim.rlim_max = RLIM_INFINITY;
setrlimit (RLIMIT_CORE, &rlim);
proc = opendir ("/proc");
if (! proc) {
perror ("opendir /proc");
exit (1);
}
sfd = open ("/proc/stat", O_RDONLY);
if (sfd < 0) {
perror ("open /proc/stat");
exit (1);
}
dfd = open ("/proc/diskstats", O_RDONLY);
if (dfd < 0) {
perror ("open /proc/diskstats");
exit (1);
}
ufd = open ("/proc/uptime", O_RDONLY);
if (ufd < 0) {
perror ("open /proc/uptime");
exit (1);
}
sprintf (filename, "%s/proc_stat.log", output_dir);
statfd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (statfd < 0) {
perror ("open proc_stat.log");
exit (1);
}
sprintf (filename, "%s/proc_diskstats.log", output_dir);
diskfd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (diskfd < 0) {
perror ("open proc_diskstats.log");
exit (1);
}
sprintf (filename, "%s/proc_ps.log", output_dir);
procfd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (procfd < 0) {
perror ("open proc_ps.log");
exit (1);
}
if (rel) {
reltime = get_uptime (ufd);
if (! reltime)
exit (1);
}
for (;;) {
char uptime[80];
size_t uptimelen;
unsigned long u;
u = get_uptime (ufd);
if (! u)
exit (1);
uptimelen = sprintf (uptime, "%lu\n", u - reltime);
if (read_file (sfd, uptime, uptimelen,
statfd, statbuf, &statlen) < 0)
exit (1);
if (read_file (dfd, uptime, uptimelen,
diskfd, diskbuf, &disklen) < 0)
exit (1);
if (read_proc (proc, uptime, uptimelen,
procfd, procbuf, &proclen) < 0)
exit (1);
if (pselect (0, NULL, NULL, NULL, &timeout, &oldmask) < 0) {
if (errno == EINTR) {
break;
} else {
perror ("pselect");
exit (1);
}
}
}
if (flush_buf (statfd, statbuf, &statlen) < 0)
exit (1);
if (close (statfd) < 0) {
perror ("close proc_stat.log");
exit (1);
}
if (flush_buf (diskfd, diskbuf, &disklen) < 0)
exit (1);
if (close (diskfd) < 0) {
perror ("close proc_diskstats.log");
exit (1);
}
if (flush_buf (procfd, procbuf, &proclen) < 0)
exit (1);
if (close (procfd) < 0) {
perror ("close proc_ps.log");
exit (1);
}
if (close (ufd) < 0) {
perror ("close /proc/uptime");
exit (1);
}
if (close (dfd) < 0) {
perror ("close /proc/diskstats");
exit (1);
}
if (close (sfd) < 0) {
perror ("close /proc/stat");
exit (1);
}
if (closedir (proc) < 0) {
perror ("close /proc");
exit (1);
}
return 0;
}

View File

@ -0,0 +1,63 @@
#!/bin/sh -e
# bootchart-gather
#
# Copyright © 2009 Canonical Ltd.
# Author: Scott James Remnant <scott@netsplit.com>.
#
# This program 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, version 3 of the License.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
# Gather output of the bootchart collector into a tarball that bootchart
# can process itself.
TARBALL="$1"
if [ -z "$TARBALL" ]; then
echo "Usage: $0 TARBALL [DIR]" 1>&2
exit 1
fi
if [ "${TARBALL#/}" = "$TARBALL" ]; then
TARBALL="$(pwd)/$TARBALL"
fi
DIR="$2"
[ -n "$DIR" ] || DIR="."
cd $DIR
# Output the header file with information about the system
{
echo "version = $(dpkg-query -f'${Version}' -W bootchart)"
echo "title = Boot chart for $(hostname) ($(date))"
echo "system.uname = $(uname -srvm)"
echo "system.release = $(lsb_release -sd)"
case `uname -m` in
arm*)
echo -n "system.cpu = $(grep '^Processor' /proc/cpuinfo)"
if [ `grep -c '^processor' /proc/cpuinfo` -gt 0 ]; then
echo " ($(grep -c '^processor' /proc/cpuinfo))"
else
echo " (1)"
fi
;;
*)
echo "system.cpu = $(grep '^model name' /proc/cpuinfo)"\
"($(grep -c '^model name' /proc/cpuinfo))"
;;
esac
echo "system.kernel.options = $(sed q /proc/cmdline)"
} > header
# Create a tarball of the logs and header which can be parsed into the chart
tar czf $TARBALL header proc_stat.log proc_diskstats.log proc_ps.log
exit 0

View File

@ -0,0 +1,27 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Collects boot data and optionally creates a chart"
author "chromium-os-dev@chromium.org"
start on startup
stop on started system-services
env BC_RUN=/dev/.bootchart
env BC_LOG=/var/log/bootchart
pre-start exec mkdir -p "$BC_RUN"
exec /lib/bootchart/collector 25 "$BC_RUN"
pre-stop exec sleep 10
post-stop script
BC_DATA="${BC_LOG}/boot-$(date +%Y%m%d-%H%M%S).tgz"
mkdir -p "$BC_LOG"
/lib/bootchart/gather "$BC_DATA" "$BC_RUN"
rm -rf "$BC_RUN"
end script

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
<email>taysom@google.com</email>
<name>Paul Taysom</name>
</maintainer>
<longdescription>
Punybench exercises the file system with a set of simple micro-benchmarks.
Each of the more than 60 benchmarks focus on just one aspect of the
file system.
</longdescription>
</pkgmetadata>

View File

@ -0,0 +1,37 @@
#
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=2
CROS_WORKON_COMMIT="57224245adf877c44b884e1d38c5a5b1c7af554f"
CROS_WORKON_TREE="82e2c58d5dd033f61d396db341daca182448c8ad"
CROS_WORKON_PROJECT="chromiumos/platform/punybench"
CROS_WORKON_LOCALNAME="../platform/punybench"
inherit toolchain-funcs cros-workon
DESCRIPTION="A set of file system microbenchmarks"
HOMEPAGE="http://git.chromium.org/gitweb/?s=punybench"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE=""
##DEPEND="sys-libs/ncurses"
src_compile() {
tc-export CC
if [ "${ARCH}" == "amd64" ]; then
PUNYARCH="x86_64"
else
PUNYARCH=${ARCH}
fi
emake BOARD="${PUNYARCH}"
}
src_install() {
emake install BOARD="${PUNYARCH}" DESTDIR="${D}"
}

View File

@ -0,0 +1,35 @@
#
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=2
CROS_WORKON_PROJECT="chromiumos/platform/punybench"
CROS_WORKON_LOCALNAME="../platform/punybench"
inherit toolchain-funcs cros-workon
DESCRIPTION="A set of file system microbenchmarks"
HOMEPAGE="http://git.chromium.org/gitweb/?s=punybench"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
##DEPEND="sys-libs/ncurses"
src_compile() {
tc-export CC
if [ "${ARCH}" == "amd64" ]; then
PUNYARCH="x86_64"
else
PUNYARCH=${ARCH}
fi
emake BOARD="${PUNYARCH}"
}
src_install() {
emake install BOARD="${PUNYARCH}" DESTDIR="${D}"
}

View File

@ -0,0 +1,33 @@
--- mozilla/security/coreconf/SunOS5.mk.orig 2009-10-02 10:51:26.617090950 +0200
+++ mozilla/security/coreconf/SunOS5.mk 2009-10-02 10:53:39.756260510 +0200
@@ -37,6 +37,9 @@
include $(CORE_DEPTH)/coreconf/UNIX.mk
+NS_USE_GCC = 1
+GCC_USE_GNU_LD = 1
+
#
# Temporary define for the Client; to be removed when binary release is used
#
@@ -104,7 +107,7 @@
endif
endif
-INCLUDES += -I/usr/dt/include -I/usr/openwin/include
+#INCLUDES += -I/usr/dt/include -I/usr/openwin/include
RANLIB = echo
CPU_ARCH = sparc
@@ -114,11 +117,6 @@
NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
MKSHLIB = $(CC) $(DSO_LDOPTS) $(RPATH)
-ifdef NS_USE_GCC
-ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1)))
- GCC_USE_GNU_LD = 1
-endif
-endif
ifdef MAPFILE
ifdef NS_USE_GCC
ifdef GCC_USE_GNU_LD

View File

@ -0,0 +1,245 @@
diff -urN nss-3.12.5-orig/mozilla/security/nss/config/Makefile nss-3.12.5/mozilla/security/nss/config/Makefile
--- nss-3.12.5-orig/mozilla/security/nss/config/Makefile 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12.5/mozilla/security/nss/config/Makefile 2009-09-14 21:45:45.619639265 -0500
@@ -0,0 +1,40 @@
+CORE_DEPTH = ../..
+DEPTH = ../..
+
+include $(CORE_DEPTH)/coreconf/config.mk
+
+NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
+NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
+NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
+PREFIX = /usr
+
+all: export libs
+
+export:
+ # Create the nss.pc file
+ mkdir -p $(DIST)/lib/pkgconfig
+ sed -e "s,@prefix@,$(PREFIX)," \
+ -e "s,@exec_prefix@,\$${prefix}," \
+ -e "s,@libdir@,\$${prefix}/gentoo/nss," \
+ -e "s,@includedir@,\$${prefix}/include/nss," \
+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
+ nss.pc.in > nss.pc
+ chmod 0644 nss.pc
+ ln -sf ../../../../../security/nss/config/nss.pc $(DIST)/lib/pkgconfig
+
+ # Create the nss-config script
+ mkdir -p $(DIST)/bin
+ sed -e "s,@prefix@,$(PREFIX)," \
+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
+ nss-config.in > nss-config
+ chmod 0755 nss-config
+ ln -sf ../../../../security/nss/config/nss-config $(DIST)/bin
+
+libs:
+
+dummy: all export libs
+
diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in nss-3.12.5/mozilla/security/nss/config/nss-config.in
--- nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12.5/mozilla/security/nss/config/nss-config.in 2009-09-14 21:47:45.190638078 -0500
@@ -0,0 +1,145 @@
+#!/bin/sh
+
+prefix=@prefix@
+
+major_version=@NSS_MAJOR_VERSION@
+minor_version=@NSS_MINOR_VERSION@
+patch_version=@NSS_PATCH_VERSION@
+
+usage()
+{
+ cat <<EOF
+Usage: nss-config [OPTIONS] [LIBRARIES]
+Options:
+ [--prefix[=DIR]]
+ [--exec-prefix[=DIR]]
+ [--includedir[=DIR]]
+ [--libdir[=DIR]]
+ [--version]
+ [--libs]
+ [--cflags]
+Dynamic Libraries:
+ nss
+ ssl
+ smime
+ nssutil
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1 1>&2
+fi
+
+lib_ssl=yes
+lib_smime=yes
+lib_nss=yes
+lib_nssutil=yes
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --includedir=*)
+ includedir=$optarg
+ ;;
+ --includedir)
+ echo_includedir=yes
+ ;;
+ --libdir=*)
+ libdir=$optarg
+ ;;
+ --libdir)
+ echo_libdir=yes
+ ;;
+ --version)
+ echo ${major_version}.${minor_version}.${patch_version}
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ ssl)
+ lib_ssl=yes
+ ;;
+ smime)
+ lib_smime=yes
+ ;;
+ nss)
+ lib_nss=yes
+ ;;
+ nssutil)
+ lib_nssutil=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
+ esac
+ shift
+done
+
+# Set variables that may be dependent upon other variables
+if test -z "$exec_prefix"; then
+ exec_prefix=`pkg-config --variable=exec_prefix nss`
+fi
+if test -z "$includedir"; then
+ includedir=`pkg-config --variable=includedir nss`
+fi
+if test -z "$libdir"; then
+ libdir=`pkg-config --variable=libdir nss`
+fi
+
+if test "$echo_prefix" = "yes"; then
+ echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+ echo $exec_prefix
+fi
+
+if test "$echo_includedir" = "yes"; then
+ echo $includedir
+fi
+
+if test "$echo_libdir" = "yes"; then
+ echo $libdir
+fi
+
+if test "$echo_cflags" = "yes"; then
+ echo -I$includedir
+fi
+
+if test "$echo_libs" = "yes"; then
+ libdirs="-Wl,-R$libdir -L$libdir"
+ if test -n "$lib_ssl"; then
+ libdirs="$libdirs -lssl${major_version}"
+ fi
+ if test -n "$lib_smime"; then
+ libdirs="$libdirs -lsmime${major_version}"
+ fi
+ if test -n "$lib_nss"; then
+ libdirs="$libdirs -lnss${major_version}"
+ fi
+ if test -n "$lib_nssutil"; then
+ libdirs="$libdirs -lnssutil${major_version}"
+ fi
+ echo $libdirs
+fi
+
diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss.pc.in nss-3.12.5/mozilla/security/nss/config/nss.pc.in
--- nss-3.12.5-orig/mozilla/security/nss/config/nss.pc.in 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12.5/mozilla/security/nss/config/nss.pc.in 2009-09-14 21:45:45.653637310 -0500
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: NSS
+Description: Network Security Services
+Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
+Requires: nspr >= 4.8
+Libs: -L${libdir} -lssl3 -lsmime3 -lnssutil3 -lnss3 -Wl,-R${libdir}
+Cflags: -I${includedir}
+
diff -urN nss-3.12.5-orig/mozilla/security/nss/Makefile nss-3.12.5/mozilla/security/nss/Makefile
--- nss-3.12.5-orig/mozilla/security/nss/Makefile 2008-12-02 17:24:39.000000000 -0600
+++ nss-3.12.5/mozilla/security/nss/Makefile 2009-09-14 21:45:45.678657145 -0500
@@ -78,7 +78,7 @@
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
-nss_build_all: build_coreconf build_nspr build_dbm all
+nss_build_all: build_coreconf build_dbm all
nss_clean_all: clobber_coreconf clobber_nspr clobber_dbm clobber
@@ -140,12 +140,6 @@
--with-dist-prefix='$(NSPR_PREFIX)' \
--with-dist-includedir='$(NSPR_PREFIX)/include'
-build_nspr: $(NSPR_CONFIG_STATUS)
- cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE)
-
-clobber_nspr: $(NSPR_CONFIG_STATUS)
- cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE) clobber
-
build_dbm:
ifndef NSS_DISABLE_DBM
cd $(CORE_DEPTH)/dbm ; $(MAKE) export libs
diff -urN nss-3.12.5-orig/mozilla/security/nss/manifest.mn nss-3.12.5/mozilla/security/nss/manifest.mn
--- nss-3.12.5-orig/mozilla/security/nss/manifest.mn 2008-04-04 15:36:59.000000000 -0500
+++ nss-3.12.5/mozilla/security/nss/manifest.mn 2009-09-14 21:45:45.703656167 -0500
@@ -42,6 +42,6 @@
RELEASE = nss
-DIRS = lib cmd
+DIRS = lib cmd config

View File

@ -0,0 +1,10 @@
--- nss-3.12.6b/mozilla/security/coreconf/Linux.mk-old 2010-02-11 12:43:26.000000000 -0600
+++ nss-3.12.6b/mozilla/security/coreconf/Linux.mk 2010-02-14 09:13:53.962449644 -0600
@@ -120,6 +120,7 @@
ifdef MOZ_DEBUG_SYMBOLS
OPTIMIZER += -gstabs+
endif
+OPTIMIZER += -fno-strict-aliasing
endif

View File

@ -0,0 +1,11 @@
diff -rupN nss-3.12.8/mozilla/security/nss/lib/certdb/certdb.c nss-3.12.8_patched/mozilla/security/nss/lib/certdb/certdb.c
--- nss-3.12.8/mozilla/security/nss/lib/certdb/certdb.c 2010-09-02 00:52:02.000000000 +0000
+++ nss-3.12.8_patched/mozilla/security/nss/lib/certdb/certdb.c 2012-04-02 20:58:31.821621891 +0000
@@ -3030,6 +3030,7 @@ cert_InitLocks(void)
PORT_Assert(certTrustLock != NULL);
if (!certTrustLock) {
PZ_DestroyLock(certRefCountLock);
+ certRefCountLock = NULL;
return SECFailure;
}
}

View File

@ -0,0 +1,23 @@
--- mozilla/security/nss/cmd/shlibsign/Makefile-old 2009-10-21 01:48:57.000000000 +0000
+++ mozilla/security/nss/cmd/shlibsign/Makefile 2009-10-21 01:55:08.000000000 +0@@ -105,6 +105,7 @@
include ../platrules.mk
SRCDIR = $(call core_abspath,.)
+SHLIBSIGN =
%.chk: %.$(DLL_SUFFIX)
ifeq ($(OS_TARGET), OS2)
@@ -112,9 +113,13 @@
$(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
$(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
else
+ifeq ($(SHLIBSIGN),)
cd $(OBJDIR) ; sh $(SRCDIR)/sign.sh $(call core_abspath,$(DIST)) \
$(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
$(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
+else
+ cd $(OBJDIR) ; $(SHLIBSIGN) -v -i $(call core_abspath,$<)
+endif
endif
libs install :: $(CHECKLOC)

View File

@ -0,0 +1,245 @@
diff -urN a/mozilla/security/nss/config/Makefile b/mozilla/security/nss/config/Makefile
--- a/mozilla/security/nss/config/Makefile 1969-12-31 18:00:00.000000000 -0600
+++ b/mozilla/security/nss/config/Makefile 2009-09-14 21:45:45.619639265 -0500
@@ -0,0 +1,40 @@
+CORE_DEPTH = ../..
+DEPTH = ../..
+
+include $(CORE_DEPTH)/coreconf/config.mk
+
+NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
+NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
+NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
+PREFIX = /usr
+
+all: export libs
+
+export:
+ # Create the nss.pc file
+ mkdir -p $(DIST)/lib/pkgconfig
+ sed -e "s,@prefix@,$(PREFIX)," \
+ -e "s,@exec_prefix@,\$${prefix}," \
+ -e "s,@libdir@,\$${prefix}/gentoo/nss," \
+ -e "s,@includedir@,\$${prefix}/include/nss," \
+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
+ nss.pc.in > nss.pc
+ chmod 0644 nss.pc
+ ln -sf ../../../../../security/nss/config/nss.pc $(DIST)/lib/pkgconfig
+
+ # Create the nss-config script
+ mkdir -p $(DIST)/bin
+ sed -e "s,@prefix@,$(PREFIX)," \
+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
+ nss-config.in > nss-config
+ chmod 0755 nss-config
+ ln -sf ../../../../security/nss/config/nss-config $(DIST)/bin
+
+libs:
+
+dummy: all export libs
+
diff -urN a/mozilla/security/nss/config/nss-config.in b/mozilla/security/nss/config/nss-config.in
--- a/mozilla/security/nss/config/nss-config.in 1969-12-31 18:00:00.000000000 -0600
+++ b/mozilla/security/nss/config/nss-config.in 2009-09-14 21:47:45.190638078 -0500
@@ -0,0 +1,145 @@
+#!/bin/sh
+
+prefix=@prefix@
+
+major_version=@NSS_MAJOR_VERSION@
+minor_version=@NSS_MINOR_VERSION@
+patch_version=@NSS_PATCH_VERSION@
+
+usage()
+{
+ cat <<EOF
+Usage: nss-config [OPTIONS] [LIBRARIES]
+Options:
+ [--prefix[=DIR]]
+ [--exec-prefix[=DIR]]
+ [--includedir[=DIR]]
+ [--libdir[=DIR]]
+ [--version]
+ [--libs]
+ [--cflags]
+Dynamic Libraries:
+ nss
+ ssl
+ smime
+ nssutil
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1 1>&2
+fi
+
+lib_ssl=yes
+lib_smime=yes
+lib_nss=yes
+lib_nssutil=yes
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --includedir=*)
+ includedir=$optarg
+ ;;
+ --includedir)
+ echo_includedir=yes
+ ;;
+ --libdir=*)
+ libdir=$optarg
+ ;;
+ --libdir)
+ echo_libdir=yes
+ ;;
+ --version)
+ echo ${major_version}.${minor_version}.${patch_version}
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ ssl)
+ lib_ssl=yes
+ ;;
+ smime)
+ lib_smime=yes
+ ;;
+ nss)
+ lib_nss=yes
+ ;;
+ nssutil)
+ lib_nssutil=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
+ esac
+ shift
+done
+
+# Set variables that may be dependent upon other variables
+if test -z "$exec_prefix"; then
+ exec_prefix=`pkg-config --variable=exec_prefix nss`
+fi
+if test -z "$includedir"; then
+ includedir=`pkg-config --variable=includedir nss`
+fi
+if test -z "$libdir"; then
+ libdir=`pkg-config --variable=libdir nss`
+fi
+
+if test "$echo_prefix" = "yes"; then
+ echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+ echo $exec_prefix
+fi
+
+if test "$echo_includedir" = "yes"; then
+ echo $includedir
+fi
+
+if test "$echo_libdir" = "yes"; then
+ echo $libdir
+fi
+
+if test "$echo_cflags" = "yes"; then
+ echo -I$includedir
+fi
+
+if test "$echo_libs" = "yes"; then
+ libdirs="-Wl,-R$libdir -L$libdir"
+ if test -n "$lib_ssl"; then
+ libdirs="$libdirs -lssl${major_version}"
+ fi
+ if test -n "$lib_smime"; then
+ libdirs="$libdirs -lsmime${major_version}"
+ fi
+ if test -n "$lib_nss"; then
+ libdirs="$libdirs -lnss${major_version}"
+ fi
+ if test -n "$lib_nssutil"; then
+ libdirs="$libdirs -lnssutil${major_version}"
+ fi
+ echo $libdirs
+fi
+
diff -urN a/mozilla/security/nss/config/nss.pc.in b/mozilla/security/nss/config/nss.pc.in
--- a/mozilla/security/nss/config/nss.pc.in 1969-12-31 18:00:00.000000000 -0600
+++ b/mozilla/security/nss/config/nss.pc.in 2009-09-14 21:45:45.653637310 -0500
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: NSS
+Description: Network Security Services
+Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
+Requires: nspr >= 4.8
+Libs: -L${libdir} -lssl3 -lsmime3 -lnssutil3 -lnss3
+Cflags: -I${includedir}
+
diff -urN a/mozilla/security/nss/Makefile b/mozilla/security/nss/Makefile
--- a/mozilla/security/nss/Makefile 2008-12-02 17:24:39.000000000 -0600
+++ b/mozilla/security/nss/Makefile 2009-09-14 21:45:45.678657145 -0500
@@ -78,7 +78,7 @@
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
-nss_build_all: build_coreconf build_nspr build_dbm all
+nss_build_all: build_coreconf build_dbm all
nss_clean_all: clobber_coreconf clobber_nspr clobber_dbm clobber
@@ -140,12 +140,6 @@
--with-dist-prefix='$(NSPR_PREFIX)' \
--with-dist-includedir='$(NSPR_PREFIX)/include'
-build_nspr: $(NSPR_CONFIG_STATUS)
- cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE)
-
-clobber_nspr: $(NSPR_CONFIG_STATUS)
- cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE) clobber
-
build_dbm:
ifndef NSS_DISABLE_DBM
cd $(CORE_DEPTH)/dbm ; $(MAKE) export libs
diff -urN a/mozilla/security/nss/manifest.mn b/mozilla/security/nss/manifest.mn
--- a/mozilla/security/nss/manifest.mn 2008-04-04 15:36:59.000000000 -0500
+++ b/mozilla/security/nss/manifest.mn 2009-09-14 21:45:45.703656167 -0500
@@ -42,6 +42,6 @@
RELEASE = nss
-DIRS = lib cmd
+DIRS = lib cmd config

View File

@ -0,0 +1,33 @@
--- nss-3.13.1/mozilla/security/coreconf/SunOS5.mk
+++ nss-3.13.1/mozilla/security/coreconf/SunOS5.mk
@@ -37,6 +37,9 @@
include $(CORE_DEPTH)/coreconf/UNIX.mk
+NS_USE_GCC = 1
+GCC_USE_GNU_LD = 1
+
# Sun's WorkShop defines v8, v8plus and v9 architectures.
# gcc on Solaris defines v8 and v9 "cpus".
# gcc's v9 is equivalent to Workshop's v8plus.
@@ -95,7 +98,7 @@
endif
endif
-INCLUDES += -I/usr/dt/include -I/usr/openwin/include
+#INCLUDES += -I/usr/dt/include -I/usr/openwin/include
RANLIB = echo
CPU_ARCH = sparc
@@ -105,11 +108,6 @@
NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
MKSHLIB = $(CC) $(DSO_LDOPTS) $(RPATH)
-ifdef NS_USE_GCC
-ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1)))
- GCC_USE_GNU_LD = 1
-endif
-endif
ifdef MAPFILE
ifdef NS_USE_GCC
ifdef GCC_USE_GNU_LD

View File

@ -0,0 +1,68 @@
diff -8urN a/mozilla/security/coreconf/Linux.mk b/mozilla/security/coreconf/Linux.mk
--- a/mozilla/security/coreconf/Linux.mk 2012-06-22 07:55:45.228234872 -0500
+++ b/mozilla/security/coreconf/Linux.mk 2012-06-22 07:56:30.171231815 -0500
@@ -60,21 +60,28 @@
else
ifeq ($(OS_TEST),alpha)
OS_REL_CFLAGS = -D_ALPHA_
CPU_ARCH = alpha
else
ifeq ($(OS_TEST),x86_64)
ifeq ($(USE_64),1)
CPU_ARCH = x86_64
+ ARCHFLAG = -m64
+else
+ifeq ($(USE_x32),1)
+ OS_REL_CFLAGS = -Di386
+ CPU_ARCH = x86
+ ARCHFLAG = -mx32
else
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
ARCHFLAG = -m32
endif
+endif
else
ifeq ($(OS_TEST),sparc64)
CPU_ARCH = sparc
else
ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
CPU_ARCH = arm
else
ifeq (,$(filter-out parisc%,$(OS_TEST)))
diff -8urN a/mozilla/security/nss/lib/freebl/Makefile b/mozilla/security/nss/lib/freebl/Makefile
--- a/mozilla/security/nss/lib/freebl/Makefile 2012-06-22 07:55:45.441234854 -0500
+++ b/mozilla/security/nss/lib/freebl/Makefile 2012-06-22 07:56:30.172231808 -0500
@@ -210,22 +210,26 @@
DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
# DEFINES += -DMPI_AMD64_ADD
# comment the next two lines to turn off intel HW accelleration
DEFINES += -DUSE_HW_AES
ASFILES += intel-aes.s
MPI_SRCS += mpi_amd64.c mp_comba.c
endif
ifeq ($(CPU_ARCH),x86)
- ASFILES = mpi_x86.s
- DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
- DEFINES += -DMP_ASSEMBLY_DIV_2DX1D
- DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
- # The floating point ECC code doesn't work on Linux x86 (bug 311432).
- #ECL_USE_FP = 1
+ ifeq ($(USE_x32),1)
+ DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
+ else
+ ASFILES = mpi_x86.s
+ DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
+ DEFINES += -DMP_ASSEMBLY_DIV_2DX1D
+ DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
+ # The floating point ECC code doesn't work on Linux x86 (bug 311432).
+ #ECL_USE_FP = 1
+ endif
endif
ifeq ($(CPU_ARCH),arm)
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
DEFINES += -DMP_USE_UINT_DIGIT
DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
MPI_SRCS += mpi_arm.c
endif
endif # Linux

View File

@ -0,0 +1,21 @@
diff -aurN nss-3.14-urandom/mozilla/security/nss/lib/freebl/unix_rand.c nss-3.14/mozilla/security/nss/lib/freebl/unix_rand.c
--- nss-3.14-urandom/mozilla/security/nss/lib/freebl/unix_rand.c 2012-12-28 16:31:12.017070243 -0800
+++ nss-3.14/mozilla/security/nss/lib/freebl/unix_rand.c 2012-12-28 16:31:49.107466816 -0800
@@ -925,6 +925,17 @@
|| defined(HPUX)
if (bytes)
return;
+
+ /*
+ * Modified to abort the process on Chromium OS if it failed
+ * to read from /dev/urandom.
+ *
+ * See crosbug.com/29623 for details.
+ */
+ fprintf(stderr, "[ERROR:%s(%d)] NSS failed to read from /dev/urandom. "
+ "Abort process.\n", __FILE__, __LINE__);
+ fflush(stderr);
+ abort();
#endif
#ifdef SOLARIS

View File

@ -0,0 +1,164 @@
diff -aurN nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11cert.c nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11cert.c
--- nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11cert.c 2012-12-28 16:34:08.208954371 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11cert.c 2012-12-28 16:36:17.610338570 -0800
@@ -2663,7 +2663,7 @@
nssCryptokiObject *instance = *ip;
PK11SlotInfo *slot = instance->token->pk11slot;
if (slot) {
- PK11_AddSlotToList(slotList, slot);
+ PK11_AddSlotToList(slotList, slot, PR_TRUE);
found = PR_TRUE;
}
}
diff -aurN nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11priv.h nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11priv.h
--- nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11priv.h 2012-12-28 16:34:08.208954371 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11priv.h 2012-12-28 16:36:17.610338570 -0800
@@ -28,7 +28,7 @@
PK11SlotList * PK11_NewSlotList(void);
PK11SlotList * PK11_GetPrivateKeyTokens(CK_MECHANISM_TYPE type,
PRBool needRW,void *wincx);
-SECStatus PK11_AddSlotToList(PK11SlotList *list,PK11SlotInfo *slot);
+SECStatus PK11_AddSlotToList(PK11SlotList *list,PK11SlotInfo *slot, PRBool sorted);
SECStatus PK11_DeleteSlotFromList(PK11SlotList *list,PK11SlotListElement *le);
PK11SlotListElement *PK11_FindSlotElement(PK11SlotList *list,
PK11SlotInfo *slot);
diff -aurN nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11slot.c nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11slot.c
--- nss-3.14-default-token/mozilla/security/nss/lib/pk11wrap/pk11slot.c 2012-12-28 16:34:08.208954371 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11slot.c 2012-12-28 16:36:17.610338570 -0800
@@ -171,11 +171,16 @@
/*
* add a slot to a list
+ * "slot" is the slot to be added. Ownership is not transferred.
+ * "sorted" indicates whether or not the slot should be inserted according to
+ * cipherOrder of the associated module. PR_FALSE indicates that the slot
+ * should be inserted to the head of the list.
*/
SECStatus
-PK11_AddSlotToList(PK11SlotList *list,PK11SlotInfo *slot)
+PK11_AddSlotToList(PK11SlotList *list,PK11SlotInfo *slot, PRBool sorted)
{
PK11SlotListElement *le;
+ PK11SlotListElement *element;
le = (PK11SlotListElement *) PORT_Alloc(sizeof(PK11SlotListElement));
if (le == NULL) return SECFailure;
@@ -184,9 +189,23 @@
le->prev = NULL;
le->refCount = 1;
PZ_Lock(list->lock);
- if (list->head) list->head->prev = le; else list->tail = le;
- le->next = list->head;
- list->head = le;
+ element = list->head;
+ /* Insertion sort, with higher cipherOrders are sorted first in the list */
+ while (element && sorted && (element->slot->module->cipherOrder >
+ le->slot->module->cipherOrder)) {
+ element = element->next;
+ }
+ if (element) {
+ le->prev = element->prev;
+ element->prev = le;
+ le->next = element;
+ } else {
+ le->prev = list->tail;
+ le->next = NULL;
+ list->tail = le;
+ }
+ if (le->prev) le->prev->next = le;
+ if (list->head == element) list->head = le;
PZ_Unlock(list->lock);
return SECSuccess;
@@ -208,11 +227,12 @@
}
/*
- * Move a list to the end of the target list. NOTE: There is no locking
- * here... This assumes BOTH lists are private copy lists.
+ * Move a list to the end of the target list.
+ * NOTE: There is no locking here... This assumes BOTH lists are private copy
+ * lists. It also does not re-sort the target list.
*/
SECStatus
-PK11_MoveListToList(PK11SlotList *target,PK11SlotList *src)
+pk11_MoveListToList(PK11SlotList *target,PK11SlotList *src)
{
if (src->head == NULL) return SECSuccess;
@@ -511,7 +531,7 @@
((NULL == slotName) || (0 == *slotName)) &&
((NULL == tokenName) || (0 == *tokenName)) ) {
/* default to softoken */
- PK11_AddSlotToList(slotList, PK11_GetInternalKeySlot());
+ PK11_AddSlotToList(slotList, PK11_GetInternalKeySlot(), PR_TRUE);
return slotList;
}
@@ -539,7 +559,7 @@
( (!slotName) || (tmpSlot->slot_name &&
(0==PORT_Strcmp(tmpSlot->slot_name, slotName)))) ) {
if (tmpSlot) {
- PK11_AddSlotToList(slotList, tmpSlot);
+ PK11_AddSlotToList(slotList, tmpSlot, PR_TRUE);
slotcount++;
}
}
@@ -910,7 +930,7 @@
CK_MECHANISM_TYPE mechanism = PK11_DefaultArray[i].mechanism;
PK11SlotList *slotList = PK11_GetSlotList(mechanism);
- if (slotList) PK11_AddSlotToList(slotList,slot);
+ if (slotList) PK11_AddSlotToList(slotList,slot,PR_FALSE);
}
}
@@ -937,7 +957,7 @@
/* add this slot to the list */
if (slotList!=NULL)
- result = PK11_AddSlotToList(slotList, slot);
+ result = PK11_AddSlotToList(slotList, slot, PR_FALSE);
} else { /* trying to turn off */
@@ -1910,12 +1930,12 @@
|| PK11_DoesMechanism(slot, type)) {
if (pk11_LoginStillRequired(slot,wincx)) {
if (PK11_IsFriendly(slot)) {
- PK11_AddSlotToList(friendlyList, slot);
+ PK11_AddSlotToList(friendlyList, slot, PR_TRUE);
} else {
- PK11_AddSlotToList(loginList, slot);
+ PK11_AddSlotToList(loginList, slot, PR_TRUE);
}
} else {
- PK11_AddSlotToList(list, slot);
+ PK11_AddSlotToList(list, slot, PR_TRUE);
}
}
}
@@ -1923,9 +1943,9 @@
}
SECMOD_ReleaseReadLock(moduleLock);
- PK11_MoveListToList(list,friendlyList);
+ pk11_MoveListToList(list,friendlyList);
PK11_FreeSlotList(friendlyList);
- PK11_MoveListToList(list,loginList);
+ pk11_MoveListToList(list,loginList);
PK11_FreeSlotList(loginList);
return list;
diff -aurN nss-3.14-default-token/mozilla/security/nss/lib/util/utilpars.c nss-3.14/mozilla/security/nss/lib/util/utilpars.c
--- nss-3.14-default-token/mozilla/security/nss/lib/util/utilpars.c 2012-12-28 16:34:08.218954478 -0800
+++ nss-3.14/mozilla/security/nss/lib/util/utilpars.c 2012-12-28 16:36:08.190237792 -0800
@@ -543,6 +543,8 @@
NSSUTIL_ARG_ENTRY(FORTEZZA,SECMOD_FORTEZZA_FLAG),
NSSUTIL_ARG_ENTRY(RC5,SECMOD_RC5_FLAG),
NSSUTIL_ARG_ENTRY(SHA1,SECMOD_SHA1_FLAG),
+ NSSUTIL_ARG_ENTRY(SHA256,SECMOD_SHA256_FLAG),
+ NSSUTIL_ARG_ENTRY(SHA512,SECMOD_SHA512_FLAG),
NSSUTIL_ARG_ENTRY(MD5,SECMOD_MD5_FLAG),
NSSUTIL_ARG_ENTRY(MD2,SECMOD_MD2_FLAG),
NSSUTIL_ARG_ENTRY(SSL,SECMOD_SSL_FLAG),

View File

@ -0,0 +1,95 @@
diff -aurN nss-3.14-prepared/mozilla/security/nss/lib/nss/nss.def nss-3.14/mozilla/security/nss/lib/nss/nss.def
--- nss-3.14-prepared/mozilla/security/nss/lib/nss/nss.def 2012-12-28 16:27:38.374784755 -0800
+++ nss-3.14/mozilla/security/nss/lib/nss/nss.def 2012-12-28 16:28:42.605473048 -0800
@@ -613,6 +613,7 @@
PK11_GetPQGParamsFromPrivateKey;
PK11_GetPrivateKeyNickname;
PK11_GetPublicKeyNickname;
+PK11_GetCertificateNickname;
PK11_GetSymKeyNickname;
PK11_ImportDERPrivateKeyInfoAndReturnKey;
PK11_ImportPrivateKeyInfoAndReturnKey;
@@ -624,6 +625,7 @@
PK11_ProtectedAuthenticationPath;
PK11_SetPrivateKeyNickname;
PK11_SetPublicKeyNickname;
+PK11_SetCertificateNickname;
PK11_SetSymKeyNickname;
SECKEY_DecodeDERSubjectPublicKeyInfo;
SECKEY_DestroyPublicKeyList;
diff -aurN nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11akey.c nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11akey.c
--- nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11akey.c 2012-12-28 16:27:38.354784541 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11akey.c 2012-12-28 16:28:42.605473048 -0800
@@ -1909,6 +1909,13 @@
return PK11_GetObjectNickname(pubKey->pkcs11Slot,pubKey->pkcs11ID);
}
+char *
+PK11_GetCertificateNickname(CERTCertificate *certificate)
+{
+ return PK11_GetObjectNickname(certificate->slot,
+ certificate->pkcs11ID);
+}
+
SECStatus
PK11_SetPrivateKeyNickname(SECKEYPrivateKey *privKey, const char *nickname)
{
@@ -1923,6 +1930,13 @@
pubKey->pkcs11ID,nickname);
}
+SECStatus
+PK11_SetCertificateNickname(CERTCertificate *certificate, const char *nickname)
+{
+ return PK11_SetObjectNickname(certificate->slot,
+ certificate->pkcs11ID,nickname);
+}
+
SECKEYPQGParams *
PK11_GetPQGParamsFromPrivateKey(SECKEYPrivateKey *privKey)
{
diff -aurN nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11obj.c nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11obj.c
--- nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11obj.c 2012-12-28 16:27:38.354784541 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11obj.c 2012-12-28 16:28:42.605473048 -0800
@@ -1410,7 +1410,10 @@
slot = ((PK11SymKey *)objSpec)->slot;
handle = ((PK11SymKey *)objSpec)->objectID;
break;
- case PK11_TypeCert: /* don't handle cert case for now */
+ case PK11_TypeCert:
+ slot = ((CERTCertificate *)objSpec)->slot;
+ handle = ((CERTCertificate *)objSpec)->pkcs11ID;
+ break;
default:
break;
}
@@ -1460,7 +1463,10 @@
slot = ((PK11SymKey *)objSpec)->slot;
handle = ((PK11SymKey *)objSpec)->objectID;
break;
- case PK11_TypeCert: /* don't handle cert case for now */
+ case PK11_TypeCert:
+ slot = ((CERTCertificate *)objSpec)->slot;
+ handle = ((CERTCertificate *)objSpec)->pkcs11ID;
+ break;
default:
break;
}
diff -aurN nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11pub.h nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11pub.h
--- nss-3.14-prepared/mozilla/security/nss/lib/pk11wrap/pk11pub.h 2012-12-28 16:27:38.354784541 -0800
+++ nss-3.14/mozilla/security/nss/lib/pk11wrap/pk11pub.h 2012-12-28 16:28:42.605473048 -0800
@@ -453,11 +453,14 @@
char * PK11_GetSymKeyNickname(PK11SymKey *symKey);
char * PK11_GetPrivateKeyNickname(SECKEYPrivateKey *privKey);
char * PK11_GetPublicKeyNickname(SECKEYPublicKey *pubKey);
+char * PK11_GetCertificateNickname(CERTCertificate *certificate);
SECStatus PK11_SetSymKeyNickname(PK11SymKey *symKey, const char *nickname);
SECStatus PK11_SetPrivateKeyNickname(SECKEYPrivateKey *privKey,
const char *nickname);
SECStatus PK11_SetPublicKeyNickname(SECKEYPublicKey *pubKey,
const char *nickname);
+SECStatus PK11_SetCertificateNickname(CERTCertificate *certificate,
+ const char *nickname);
/* size to hold key in bytes */
unsigned int PK11_GetKeyLength(PK11SymKey *key);

View File

@ -0,0 +1 @@
nss-3.12.8.ebuild

View File

@ -0,0 +1,116 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.12.8.ebuild,v 1.1 2010/09/30 11:58:39 anarchy Exp $
EAPI=3
inherit eutils flag-o-matic multilib toolchain-funcs
NSPR_VER="4.8.6"
RTM_NAME="NSS_${PV//./_}_RTM"
DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/"
SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz"
LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
DEPEND="dev-util/pkgconfig"
RDEPEND=">=dev-libs/nspr-${NSPR_VER}
>=dev-libs/nss-${PV}
>=dev-db/sqlite-3.5
sys-libs/zlib"
src_prepare() {
# Custom changes for gentoo
epatch "${FILESDIR}/${PN}-3.12.5-gentoo-fixups.diff"
epatch "${FILESDIR}/${PN}-3.12.6-gentoo-fixup-warnings.patch"
epatch "${FILESDIR}"/${P}-shlibsign.patch
epatch "${FILESDIR}"/${P}-chromeos-root-certs.patch
# See https://bugzilla.mozilla.org/show_bug.cgi?id=741481 for details.
epatch "${FILESDIR}"/${P}-cert-initlocks.patch
cd "${S}"/mozilla/security/coreconf
# Explain that linux 3.0+ is just the same as 2.6.
ln -sf Linux2.6.mk Linux$(uname -r | cut -b1-3).mk
# hack nspr paths
echo 'INCLUDES += -I'"${EPREFIX}"'/usr/include/nspr -I$(DIST)/include/dbm' \
>> headers.mk || die "failed to append include"
# modify install path
sed -e 's:SOURCE_PREFIX = $(CORE_DEPTH)/\.\./dist:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
-i source.mk
# Respect LDFLAGS
sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk
# Ensure we stay multilib aware
sed -i -e "s:gentoo\/nss:$(get_libdir):" "${S}"/mozilla/security/nss/config/Makefile || die "Failed to fix for multilib"
# Fix pkgconfig file for Prefix
sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
"${S}"/mozilla/security/nss/config/Makefile
epatch "${FILESDIR}"/${PN}-3.12.4-solaris-gcc.patch # breaks non-gnu tools
# dirty hack
cd "${S}"/mozilla/security/nss
sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
lib/ssl/config.mk || die
sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
cmd/platlibs.mk || die
}
src_compile() {
strip-flags
echo > "${T}"/test.c
$(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o
case $(file "${T}"/test.o) in
*64-bit*|*ppc64*|*x86_64*) export USE_64=1;;
*32-bit*|*ppc*|*i386*) ;;
*) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
esac
export NSPR_INCLUDE_DIR="${ROOT}"/usr/include/nspr
export NSPR_LIB_DIR="${ROOT}"/usr/lib
export BUILD_OPT=1
export NSS_USE_SYSTEM_SQLITE=1
export NSDISTMODE=copy
export NSS_ENABLE_ECC=1
export XCFLAGS="${CFLAGS}"
export FREEBL_NO_DEPEND=1
# Cross-compile Love
( filter-flags -m* ;
cd "${S}"/mozilla/security/coreconf &&
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" LDFLAGS= CC="$(tc-getBUILD_CC)" || die "coreconf make failed" )
cd "${S}"/mozilla/security/dbm
NSINSTALL=$(readlink -f $(find "${S}"/mozilla/security/coreconf -type f -name nsinstall))
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" CC="$(tc-getCC)" NSINSTALL="${NSINSTALL}" OS_TEST=${ARCH} || die "dbm make failed"
cd "${S}"/mozilla/security/nss
if tc-is-cross-compiler; then
SHLIBSIGN_ARG="SHLIBSIGN=/usr/bin/nssshlibsign"
fi
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" CC="$(tc-getCC)" NSINSTALL="${NSINSTALL}" OS_TEST=${ARCH} ${SHLIBSIGN_ARG} || die "nss make failed"
}
src_install () {
local nssutils
# The tests we do not need to install.
#nssutils_test="bltest crmftest dbtest dertimetest
#fipstest remtest sdrtest"
nssutils="addbuiltin atob baddbdir btoa certcgi certutil checkcert
cmsutil conflict crlutil derdump digest makepqg mangle modutil multinit
nonspr10 ocspclnt oidcalc p7content p7env p7sign p7verify pk11mode
pk12util pp rsaperf selfserv shlibsign signtool signver ssltap strsclnt
symkeyutil tstclnt vfychain vfyserv"
cd "${S}"/mozilla/security/dist/*/bin/
for f in $nssutils; do
# TODO(cmasone): switch to normal nss tool names
newbin ${f} nss${f}
done
}

View File

@ -0,0 +1,133 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.14.ebuild,v 1.8 2012/11/29 23:41:51 blueness Exp $
EAPI=3
inherit eutils flag-o-matic multilib toolchain-funcs
NSPR_VER="4.9.2"
RTM_NAME="NSS_${PV//./_}_RTM"
DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/"
SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz"
LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
DEPEND="virtual/pkgconfig
>=dev-libs/nspr-${NSPR_VER}"
RDEPEND=">=dev-libs/nspr-${NSPR_VER}
>=dev-libs/nss-${PV}
>=dev-db/sqlite-3.5
sys-libs/zlib"
src_setup() {
export LC_ALL="C"
}
src_prepare() {
# Custom changes for gentoo
epatch "${FILESDIR}/${PN}-3.13-gentoo-fixup.patch"
epatch "${FILESDIR}/${PN}-3.12.6-gentoo-fixup-warnings.patch"
epatch "${FILESDIR}/${PN}-3.13.5-x32.patch"
# Fix cross-compiling of NSS. This is an alternative to upstream's
# patch at https://bugs.gentoo.org/show_bug.cgi?id=436216
epatch "${FILESDIR}/${PN}-3.12.8-shlibsign.patch"
# Add a public API to set the certificate nickname (PKCS#11 CKA_LABEL
# attribute). See http://crosbug.com/19403 for details.
epatch "${FILESDIR}"/${PN}-3.14-chromeos-cert-nicknames.patch
# Abort the process if /dev/urandom cannot be opened (eg: when sandboxed)
# See http://crosbug.com/29623 for details.
epatch "${FILESDIR}"/${PN}-3.14-abort-on-failed-urandom-access.patch
# Don't default to the TPM for SHA-256. Fixed in NSS 3.14.1
# See https://bugzilla.mozilla.org/show_bug.cgi?id=802429 for details
epatch "${FILESDIR}"/${PN}-3.14-bugzilla-802429.patch
cd "${S}"/mozilla/security/coreconf || die
# hack nspr paths
echo 'INCLUDES += -I'"${EPREFIX}"'/usr/include/nspr -I$(DIST)/include/dbm' \
>> headers.mk || die "failed to append include"
# modify install path
sed -e 's:SOURCE_PREFIX = $(CORE_DEPTH)/\.\./dist:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
-i source.mk || die
# Respect LDFLAGS
sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk || die
# Ensure we stay multilib aware
sed -i -e "s:gentoo\/nss:$(get_libdir):" "${S}"/mozilla/security/nss/config/Makefile || die "Failed to fix for multilib"
# Fix pkgconfig file for Prefix
sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
"${S}"/mozilla/security/nss/config/Makefile || die
epatch "${FILESDIR}/nss-3.13.1-solaris-gcc.patch"
# dirty hack
cd "${S}"/mozilla/security/nss || die
sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
lib/ssl/config.mk || die
sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
cmd/platlibs.mk || die
}
src_compile() {
strip-flags
echo > "${T}"/test.c || die
$(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
case $(file "${T}"/test.o) in
*32-bit*x86-64*) export USE_x32=1;;
*64-bit*|*ppc64*|*x86_64*) export USE_64=1;;
*32-bit*|*ppc*|*i386*) ;;
*) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
esac
export NSPR_INCLUDE_DIR="${ROOT}"/usr/include/nspr
export NSPR_LIB_DIR="${ROOT}"/usr/lib
export BUILD_OPT=1
export NSS_USE_SYSTEM_SQLITE=1
export NSDISTMODE=copy
export NSS_ENABLE_ECC=1
export XCFLAGS="${CFLAGS}"
export FREEBL_NO_DEPEND=1
export ASFLAGS=""
# Cross-compile Love
( filter-flags -m* ;
cd "${S}"/mozilla/security/coreconf &&
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" LDFLAGS= CC="$(tc-getBUILD_CC)" || die "coreconf make failed" )
cd "${S}"/mozilla/security/dbm
NSINSTALL=$(readlink -f $(find "${S}"/mozilla/security/coreconf -type f -name nsinstall))
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" CC="$(tc-getCC)" NSINSTALL="${NSINSTALL}" OS_TEST=${ARCH} || die "dbm make failed"
cd "${S}"/mozilla/security/nss
if tc-is-cross-compiler; then
SHLIBSIGN_ARG="SHLIBSIGN=/usr/bin/nssshlibsign"
fi
emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" CC="$(tc-getCC)" NSINSTALL="${NSINSTALL}" OS_TEST=${ARCH} ${SHLIBSIGN_ARG} || die "nss make failed"
}
src_install () {
local nssutils
# The tests we do not need to install.
#nssutils_test="bltest crmftest dbtest dertimetest
#fipstest remtest sdrtest"
nssutils="addbuiltin atob baddbdir btoa certcgi certutil checkcert
cmsutil conflict crlutil derdump digest makepqg mangle modutil multinit
nonspr10 ocspclnt oidcalc p7content p7env p7sign p7verify pk11mode
pk12util pp rsaperf selfserv signtool signver ssltap strsclnt
symkeyutil tstclnt vfychain vfyserv"
cd "${S}"/mozilla/security/dist/*/bin/ || die
for f in $nssutils; do
# TODO(cmasone): switch to normal nss tool names
newbin ${f} nss${f} || die
done
}

View File

@ -0,0 +1,55 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="2"
CROS_WORKON_COMMIT="310a21ef24ace14b4d6e8095172445494f54ff25"
CROS_WORKON_TREE="33cbcef6b44783d7ece0dcb7f5bdaa49b9e29123"
CROS_WORKON_PROJECT="chromiumos/third_party/tpm-emulator"
inherit cmake-utils cros-workon toolchain-funcs
DESCRIPTION="TPM Emulator with small google-local changes"
LICENSE="GPL-2"
HOMEPAGE="//https://developer.berlios.de/projects/tpm-emulator"
SLOT="0"
IUSE="doc"
KEYWORDS="amd64 arm x86"
DEPEND="app-crypt/trousers
dev-libs/gmp"
RDEPEND="${DEPEND}"
src_configure() {
tc-export CC CXX LD AR RANLIB NM
CHROMEOS=1 cmake-utils_src_configure
}
src_compile() {
cmake-utils_src_compile
# This would be normally done in kernel module build, but we have
# copied the kernel module to the kernel tree.
TPMD_DEV_SRC_DIR="${S}/tpmd_dev/linux"
TPMD_DEV_BUILD_DIR="${CMAKE_BUILD_DIR}/tpmd_dev/linux"
mkdir -p "${TPMD_DEV_BUILD_DIR}"
sed -e "s/\$TPM_GROUP/tss/g" \
< "${TPMD_DEV_SRC_DIR}/tpmd_dev.rules.in" \
> "${TPMD_DEV_BUILD_DIR}/tpmd_dev.rules"
}
src_install() {
# TODO(semenzato): need these for emerge on host, to run tpm_lite tests.
# insinto /usr/lib
# doins "${CMAKE_BUILD_DIR}/tpm/libtpm.a"
# doins "${CMAKE_BUILD_DIR}/crypto/libcrypto.a"
# doins "${CMAKE_BUILD_DIR}/tpmd/unix/libtpmemu.a"
# insinto /usr/include
# doins "${S}/tpmd/unix/tpmemu.h"
exeinto /usr/sbin
doexe "${CMAKE_BUILD_DIR}/tpmd/unix/tpmd"
insinto /etc/udev/rules.d
TPMD_DEV_BUILD_DIR="${CMAKE_BUILD_DIR}/tpmd_dev/linux"
RULES_FILE="${TPMD_DEV_BUILD_DIR}/tpmd_dev.rules"
newins "${RULES_FILE}" 80-tpmd_dev.rules
}

View File

@ -0,0 +1,53 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="2"
CROS_WORKON_PROJECT="chromiumos/third_party/tpm-emulator"
inherit cmake-utils cros-workon toolchain-funcs
DESCRIPTION="TPM Emulator with small google-local changes"
LICENSE="GPL-2"
HOMEPAGE="//https://developer.berlios.de/projects/tpm-emulator"
SLOT="0"
IUSE="doc"
KEYWORDS="~amd64 ~arm ~x86"
DEPEND="app-crypt/trousers
dev-libs/gmp"
RDEPEND="${DEPEND}"
src_configure() {
tc-export CC CXX LD AR RANLIB NM
CHROMEOS=1 cmake-utils_src_configure
}
src_compile() {
cmake-utils_src_compile
# This would be normally done in kernel module build, but we have
# copied the kernel module to the kernel tree.
TPMD_DEV_SRC_DIR="${S}/tpmd_dev/linux"
TPMD_DEV_BUILD_DIR="${CMAKE_BUILD_DIR}/tpmd_dev/linux"
mkdir -p "${TPMD_DEV_BUILD_DIR}"
sed -e "s/\$TPM_GROUP/tss/g" \
< "${TPMD_DEV_SRC_DIR}/tpmd_dev.rules.in" \
> "${TPMD_DEV_BUILD_DIR}/tpmd_dev.rules"
}
src_install() {
# TODO(semenzato): need these for emerge on host, to run tpm_lite tests.
# insinto /usr/lib
# doins "${CMAKE_BUILD_DIR}/tpm/libtpm.a"
# doins "${CMAKE_BUILD_DIR}/crypto/libcrypto.a"
# doins "${CMAKE_BUILD_DIR}/tpmd/unix/libtpmemu.a"
# insinto /usr/include
# doins "${S}/tpmd/unix/tpmemu.h"
exeinto /usr/sbin
doexe "${CMAKE_BUILD_DIR}/tpmd/unix/tpmd"
insinto /etc/udev/rules.d
TPMD_DEV_BUILD_DIR="${CMAKE_BUILD_DIR}/tpmd_dev/linux"
RULES_FILE="${TPMD_DEV_BUILD_DIR}/tpmd_dev.rules"
newins "${RULES_FILE}" 80-tpmd_dev.rules
}

View File

@ -0,0 +1,39 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=2
CROS_WORKON_COMMIT="e3afe51c44ea5b1ebbc6fc6561c46fd0608cde2a"
CROS_WORKON_TREE="c6b3d8822b63163c977a8d4e0bc9ef3c9cd7b011"
CROS_WORKON_PROJECT="chromiumos/third_party/trousers"
inherit cros-workon autotest
DESCRIPTION="Trousers TPM tests"
HOMEPAGE="http://www.chromium.org/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 arm amd64"
DEPEND="app-crypt/trousers
!<chromeos-base/autotest-tests-0.0.1-r1521"
RDEPEND="${DEPEND}"
# Enable autotest by default.
IUSE="${IUSE} +autotest"
IUSE_TESTS="
+tests_hardware_TPM
"
IUSE="${IUSE} ${IUSE_TESTS}"
CROS_WORKON_LOCALNAME=trousers
# path from root of repo
AUTOTEST_CLIENT_SITE_TESTS=autotest
function src_compile {
# for Makefile
export TROUSERS_DIR=${WORKDIR}/${P}
autotest_src_compile
}

View File

@ -0,0 +1,37 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=2
CROS_WORKON_PROJECT="chromiumos/third_party/trousers"
inherit cros-workon autotest
DESCRIPTION="Trousers TPM tests"
HOMEPAGE="http://www.chromium.org/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~arm ~amd64"
DEPEND="app-crypt/trousers
!<chromeos-base/autotest-tests-0.0.1-r1521"
RDEPEND="${DEPEND}"
# Enable autotest by default.
IUSE="${IUSE} +autotest"
IUSE_TESTS="
+tests_hardware_TPM
"
IUSE="${IUSE} ${IUSE_TESTS}"
CROS_WORKON_LOCALNAME=trousers
# path from root of repo
AUTOTEST_CLIENT_SITE_TESTS=autotest
function src_compile {
# for Makefile
export TROUSERS_DIR=${WORKDIR}/${P}
autotest_src_compile
}

View File

@ -0,0 +1,68 @@
# Copyright 1999-2009 Gentoo Foundation
# Copyright 2010 Google, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="2"
CROS_WORKON_COMMIT="e3afe51c44ea5b1ebbc6fc6561c46fd0608cde2a"
CROS_WORKON_TREE="c6b3d8822b63163c977a8d4e0bc9ef3c9cd7b011"
CROS_WORKON_PROJECT="chromiumos/third_party/trousers"
inherit autotools base cros-workon eutils linux-info
DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
HOMEPAGE="http://trousers.sf.net"
LICENSE="CPL-1.0"
KEYWORDS="amd64 arm x86"
SLOT="0"
IUSE="doc tss_trace"
RDEPEND=">=dev-libs/openssl-0.9.7"
DEPEND="${RDEPEND}
dev-util/pkgconfig"
## TODO: Check if this patch is useful for us.
## PATCHES=( "${FILESDIR}/${PN}-0.2.3-nouseradd.patch" )
pkg_setup() {
# New user/group for the daemon
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss
}
src_prepare() {
base_src_prepare
sed -e "s/-Werror //" -i configure.in
if use tss_trace ; then
# Enable tracing of TSS calls.
export CFLAGS="$CFLAGS -DTSS_TRACE"
fi
eautoreconf
}
src_compile() {
tc-export CC CXX AR RANLIB LD NM
export CCFLAGS="$CFLAGS"
emake
}
src_install() {
keepdir /var/lib/tpm
emake DESTDIR="${D}" install || die
dodoc AUTHORS ChangeLog NICETOHAVES README TODO
use doc && dodoc doc/*
newinitd "${FILESDIR}/tcsd.initd" tcsd
newconfd "${FILESDIR}/tcsd.confd" tcsd
# Install the empty system.data files
dodir /etc/trousers
insinto /etc/trousers
doins "${S}"/dist/system.data.*
}
pkg_postinst() {
elog "If you have problems starting tcsd, please check permissions and"
elog "ownership on /dev/tpm* and ~tss/system.data"
}

View File

@ -0,0 +1,66 @@
# Copyright 1999-2009 Gentoo Foundation
# Copyright 2010 Google, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="2"
CROS_WORKON_PROJECT="chromiumos/third_party/trousers"
inherit autotools base cros-workon eutils linux-info
DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
HOMEPAGE="http://trousers.sf.net"
LICENSE="CPL-1.0"
KEYWORDS="~amd64 ~arm ~x86"
SLOT="0"
IUSE="doc tss_trace"
RDEPEND=">=dev-libs/openssl-0.9.7"
DEPEND="${RDEPEND}
dev-util/pkgconfig"
## TODO: Check if this patch is useful for us.
## PATCHES=( "${FILESDIR}/${PN}-0.2.3-nouseradd.patch" )
pkg_setup() {
# New user/group for the daemon
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss
}
src_prepare() {
base_src_prepare
sed -e "s/-Werror //" -i configure.in
if use tss_trace ; then
# Enable tracing of TSS calls.
export CFLAGS="$CFLAGS -DTSS_TRACE"
fi
eautoreconf
}
src_compile() {
tc-export CC CXX AR RANLIB LD NM
export CCFLAGS="$CFLAGS"
emake
}
src_install() {
keepdir /var/lib/tpm
emake DESTDIR="${D}" install || die
dodoc AUTHORS ChangeLog NICETOHAVES README TODO
use doc && dodoc doc/*
newinitd "${FILESDIR}/tcsd.initd" tcsd
newconfd "${FILESDIR}/tcsd.confd" tcsd
# Install the empty system.data files
dodir /etc/trousers
insinto /etc/trousers
doins "${S}"/dist/system.data.*
}
pkg_postinst() {
elog "If you have problems starting tcsd, please check permissions and"
elog "ownership on /dev/tpm* and ~tss/system.data"
}

View File

@ -0,0 +1 @@
DIST qemacs-0.4.0_pre20090420.tar.bz2 1393436 RMD160 69889f79319a44015a45a294499ddd4dbd3b2242 SHA1 68d3b78801a3687e714d91b6f8c890bd37b0ce7e SHA256 14f1ffad569f1bdaaa27d2d7ab0251ce69afc9efc347bb244b11f5e34e818ab5

View File

@ -0,0 +1,44 @@
Gemeinsame Unterverzeichnisse: ../qemacs/fonts und ./fonts.
Gemeinsame Unterverzeichnisse: ../qemacs/libqhtml und ./libqhtml.
Gemeinsame Unterverzeichnisse: ../qemacs/plugin-example und ./plugin-example.
Gemeinsame Unterverzeichnisse: ../qemacs/tests und ./tests.
diff -u ../qemacs/tty.c ./tty.c
--- ../qemacs/tty.c 2007-02-08 00:27:33.000000000 +0100
+++ ./tty.c 2007-02-26 15:07:41.000000000 +0100
@@ -78,7 +78,6 @@
/* input handling */
enum InputState input_state;
int input_param;
- int utf8_state;
int utf8_index;
unsigned char buf[10];
char *term_name;
@@ -374,15 +373,19 @@
/* charset handling */
if (s->charset == &charset_utf8) {
- if (ts->utf8_state == 0) {
- const char *p;
- p = (const char *)ts->buf;
- ch = utf8_decode(&p);
- } else {
- ts->utf8_state = utf8_length[ts->buf[0]] - 1;
- ts->utf8_index = 0;
- return;
- }
+ /* Make sure utf8 input works correctly 20040314 <damm@opensource.se> */
+ ts->utf8_index++;
+
+ if (utf8_length[ts->buf[0]] == ts->utf8_index) {;
+ const char *p;
+ p = (const char *)ts->buf;
+ ch = utf8_decode(&p);
+ ts->utf8_index = 0;
+ }
+ else {
+ return;
+ }
+
} else {
ch = ts->buf[0];
}

View File

@ -0,0 +1,35 @@
--- Makefile.orig 2009-03-07 21:27:48.000000000 +0100
+++ Makefile 2009-03-07 21:28:43.000000000 +0100
@@ -19,32 +19,6 @@
include config.mak
-ifeq ($(CC),gcc)
- CFLAGS := -Wall -g -O2 -funsigned-char
- # do not warn about zero-length formats.
- CFLAGS += -Wno-format-zero-length
- LDFLAGS := -g
-endif
-
-#include local compiler configuration file
--include cflags.mk
-
-ifdef TARGET_GPROF
- CFLAGS += -p
- LDFLAGS += -p
-endif
-
-TLDFLAGS := $(LDFLAGS)
-
-ifdef TARGET_ARCH_X86
- #CFLAGS+=-fomit-frame-pointer
- ifeq ($(GCC_MAJOR),2)
- CFLAGS+=-m386 -malign-functions=0
- else
- CFLAGS+=-march=i386 -falign-functions=0
- endif
-endif
-
DEFINES=-DHAVE_QE_CONFIG_H
########################################################

View File

@ -0,0 +1,64 @@
--- buffer.c.orig 2009-03-07 21:14:02.000000000 +0100
+++ buffer.c 2009-03-07 21:15:40.000000000 +0100
@@ -1657,12 +1657,14 @@
if (stat(filename, &st) == 0)
mode = st.st_mode & 0777;
- /* backup old file if present */
- if (strlen(filename) < MAX_FILENAME_SIZE - 1) {
+ /* backup old file if present and make-backup-files is on */
+ if(mbf == 1) {
+ if (strlen(filename) < MAX_FILENAME_SIZE - 1) {
if (snprintf(buf1, sizeof(buf1), "%s~", filename) < ssizeof(buf1)) {
// should check error code
rename(filename, buf1);
}
+ }
}
/* CG: should pass mode to buffer_save */
--- qe.c.orig 2009-03-07 21:14:09.000000000 +0100
+++ qe.c 2009-03-07 21:17:01.000000000 +0100
@@ -71,6 +71,7 @@
static int screen_height = 0;
static int no_init_file;
static const char *user_option;
+mbf = 1;
/* mode handling */
@@ -5316,6 +5317,14 @@
do_refresh(qs->first_window);
}
+static void make_backup_files(EditState *s) {
+ if(mbf == 1) {
+ mbf = 0;
+ } else {
+ mbf = 1;
+ }
+}
+
/* compute default path for find/save buffer */
static void get_default_path(EditState *s, char *buf, int buf_size)
{
--- qeconfig.h.orig 2009-03-07 21:14:19.000000000 +0100
+++ qeconfig.h 2009-03-07 21:17:37.000000000 +0100
@@ -192,6 +192,7 @@
"downcase-region", do_changecase_region, ESi, -1, "*v")
CMD3( KEY_CTRLX(KEY_CTRL('u')), KEY_NONE,
"upcase-region", do_changecase_region, ESi, 1, "*v")
+ CMD0( KEY_NONE, KEY_NONE, "make-backup-files", make_backup_files)
/*---------------- Command handling ----------------*/
--- qe.h.orig 2009-03-07 21:14:26.000000000 +0100
+++ qe.h 2009-03-07 21:17:53.000000000 +0100
@@ -1765,6 +1765,7 @@
/* image.c */
void fill_border(EditState *s, int x, int y, int w, int h, int color);
int qe_bitmap_format_to_pix_fmt(int format);
+int mbf;
/* shell.c */
EditBuffer *new_shell_buffer(EditBuffer *b0, const char *name,

View File

@ -0,0 +1,36 @@
--- qemacs-orig/Makefile
+++ qemacs/Makefile
@@ -151,7 +151,6 @@
qe$(EXE): qe_g$(EXE) Makefile
rm -f $@
cp $< $@
- -$(STRIP) $@
@ls -l $@
echo `size $@` `wc -c $@` qe $(OPTIONS) \
| cut -d ' ' -f 7-10,13,15-40 >> STATS
@@ -165,7 +164,6 @@
tqe$(EXE): tqe_g$(EXE) Makefile
rm -f $@
cp $< $@
- -$(STRIP) $@
@ls -l $@
echo `size $@` `wc -c $@` tqe $(OPTIONS) \
| cut -d ' ' -f 7-10,13,15-40 >> STATS
@@ -329,7 +327,7 @@
$(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/bin
$(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/man/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/share/qe
- $(INSTALL) -m 755 -s qe$(EXE) $(DESTDIR)$(prefix)/bin/qemacs$(EXE)
+ $(INSTALL) -m 755 qe$(EXE) $(DESTDIR)$(prefix)/bin/qemacs$(EXE)
ln -sf qemacs $(DESTDIR)$(prefix)/bin/qe$(EXE)
ifdef CONFIG_FFMPEG
ln -sf qemacs$(EXE) $(DESTDIR)$(prefix)/bin/ffplay$(EXE)
@@ -337,7 +335,7 @@
$(INSTALL) -m 644 kmaps ligatures $(DESTDIR)$(prefix)/share/qe
$(INSTALL) -m 644 qe.1 $(DESTDIR)$(prefix)/man/man1
ifdef CONFIG_HTML
- $(INSTALL) -m 755 -s html2png$(EXE) $(DESTDIR)$(prefix)/bin
+ $(INSTALL) -m 755 html2png$(EXE) $(DESTDIR)$(prefix)/bin
endif
uninstall:

View File

@ -0,0 +1,76 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-editors/qemacs/qemacs-0.4.0_pre20090420.ebuild,v 1.4 2009/12/08 19:33:49 nixnut Exp $
EAPI=2
inherit eutils flag-o-matic toolchain-funcs
DESCRIPTION="QEmacs is a very small but powerful UNIX editor"
HOMEPAGE="http://savannah.nongnu.org/projects/qemacs"
SRC_URI="mirror://gentoo/${P}.tar.bz2"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="X png unicode xv"
RESTRICT="strip test"
RDEPEND="!app-editors/qe
X? ( x11-libs/libX11
x11-libs/libXext
xv? ( x11-libs/libXv ) )
png? ( media-libs/libpng:1.2 )"
DEPEND="${RDEPEND}
app-text/texi2html"
S="${WORKDIR}/${PN}"
src_prepare() {
# Removes forced march setting and align-functions on x86, as they
# would override user's CFLAGS..
epatch "${FILESDIR}/${PN}-0.4.0_pre20080605-Makefile.patch"
# Make backup files optional
epatch "${FILESDIR}/${PN}-0.4.0_pre20080605-make_backup.patch"
# Suppress stripping
epatch "${FILESDIR}/${P}-nostrip.patch"
use unicode && epatch "${FILESDIR}/${PN}-0.3.2_pre20070226-tty_utf8.patch"
# Change the manpage to reference a /real/ file instead of just an
# approximation. Purely cosmetic!
sed -i "s,^/usr/share/doc/qe,&-${PVR}," qe.1 || die
}
src_configure() {
# when using any other CFLAGS than -O0, qemacs will segfault on startup,
# see bug 92011
replace-flags -O? -O0
econf --cross-prefix="${CHOST}-" \
$(use_enable X x11) \
$(use_enable png) \
$(use_enable xv)
}
src_compile() {
# Does not support parallel building
emake -j1 || die
}
src_install() {
emake install DESTDIR="${D}" || die
dodoc Changelog README TODO config.eg || die
dohtml *.html || die
# Fix man page location
mv "${D}"/usr/{,share/}man || die
# Install headers so users can build their own plugins.
insinto /usr/include/qe
doins cfb.h config.h cutils.h display.h fbfrender.h libfbf.h qe.h \
qeconfig.h qestyles.h qfribidi.h || die
cd libqhtml
insinto /usr/include/qe/libqhtml
doins css.h cssid.h htmlent.h || die
}

View File

@ -0,0 +1,2 @@
DIST vim-7.3.tar.bz2 9080692 RMD160 1846e7f4aa8e0a329d8360a9e05d7e93da23b4b5 SHA1 46faa96c5fab639899b1c655c23d8755b62f036f SHA256 5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d
DIST vim-patches-7.3.266.patch.bz2 482229 RMD160 20399fd3a4366f486ce9edf2d09733647b26d487 SHA1 22f2f52cc703ea3ee06dcf9d9c49e39208fbf72a SHA256 28ebe4e469fad7a9f3a55611323e9235b83ec40c6abca85da485f9df02aa0177

View File

@ -0,0 +1,11 @@
--- src/configure.in
+++ src/configure.in
@@ -2701,7 +2701,7 @@
AC_MSG_CHECKING(whether X_LOCALE needed)
AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
- AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
+ AC_DEFINE(X_LOCALE) ldflags_save="$ldflags_save -lX11"], AC_MSG_RESULT(no)),
AC_MSG_RESULT(no))
fi
CFLAGS=$cflags_save

View File

@ -0,0 +1,11 @@
--- vim73/src/configure.in.orig 2010-08-13 08:15:17.000000000 -0600
+++ vim73/src/configure.in 2010-08-16 17:04:34.000000000 -0600
@@ -3180,7 +3180,7 @@ main() {
}],
AC_MSG_RESULT(ok),
AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]),
-AC_MSG_ERROR([could not compile program using uint32_t.]))
+AC_MSG_WARN([could not check when cross-compiling]))
dnl Check for memmove() before bcopy(), makes memmove() be used when both are
dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.v

View File

@ -0,0 +1,12 @@
diff -ru vim73.orig/src/link.sh vim73/src/link.sh
--- vim73.orig/src/link.sh 2010-10-21 16:29:07 +0200
+++ vim73/src/link.sh 2010-10-21 16:23:15 +0200
@@ -41,7 +41,7 @@
if sh link.cmd; then
touch auto/link.sed
cp link.cmd linkit.sh
- for libname in SM ICE nsl dnet dnet_stub inet socket dir elf iconv Xt Xmu Xp Xpm X11 Xdmcp x w perl dl pthread thread readline m crypt attr; do
+ for libname in dummy; do
cont=yes
while test -n "$cont"; do
if grep "l$libname " linkit.sh >/dev/null; then

View File

@ -0,0 +1,36 @@
# Author: Ciaran McCreesh <ciaranm@gentoo.org>
#
# completion for vim
_vim()
{
local cur prev cmd args
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
cmd=${COMP_WORDS[0]}
if [[ "${prev}" == "--servername" ]] ; then
local servers
servers=$(gvim --serverlist )
COMPREPLY=( $( compgen -W "${servers}" -- $cur ) )
elif [[ "${prev}" == -[uUi] ]] ; then
COMPREPLY=( $( compgen -W "NONE" ) \
$( compgen -f -X "!*vim*" -- "$cur" ) )
elif [[ "${cur}" == -* ]] ; then
args='-t -q -c -S --cmd -A -b -C -d -D -e -E -f --nofork \
-F -g -h -H -i -L -l -m -M -N -n -nb -o -R -r -s \
-T -u -U -V -v -w -W -x -X -y -Y -Z --echo-wid \
--help --literal --noplugin --version'
COMPREPLY=( $( compgen -W "${args}" -- $cur ) )
else
_filedir
fi
}
complete -o filenames -F _vim vim ex view evim rvim rview
# vim: set ft=sh sw=4 et sts=4 :

View File

@ -0,0 +1,93 @@
" Default configuration file for Vim
" Written by Aron Griffis <agriffis@gentoo.org>
" Modified by Ryan Phillips <rphillips@gentoo.org>
" Added Redhat's vimrc info by Seemant Kulleen <seemant@gentoo.org>
" The following are some sensible defaults for Vim for most users.
" We attempt to change as little as possible from Vim's defaults,
" deviating only where it makes sense
set nocompatible " Use Vim defaults (much better!)
set bs=2 " Allow backspacing over everything in insert mode
set ai " Always set auto-indenting on
"set backup " Keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file -- limit to only 50
set history=50 " keep 50 lines of command history
set ruler " Show the cursor position all the time
" Added to default to high security within Gentoo. Fixes bug #14088
set modelines=0
if v:lang =~ "^ko"
set fileencodings=euc-kr
set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
elseif v:lang =~ "^ja_JP"
set fileencodings=euc-jp
set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
elseif v:lang =~ "^zh_TW"
set fileencodings=big5
set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
elseif v:lang =~ "^zh_CN"
set fileencodings=gb2312
set guifontset=*-r-*
endif
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif
" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif
" Don't use Ex mode, use Q for formatting
map Q gq
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if &term=="xterm"
set t_RV= " don't check terminal version
set t_Co=8
set t_Sb=^[4%dm
set t_Sf=^[3%dm
endif
if has("autocmd")
" Gentoo-specific settings for ebuilds. These are the federally-mandated
" required tab settings. See the following for more information:
" http://www.gentoo.org/doc/en/xml/gentoo-howto.xml
augroup gentoo
au!
au BufRead,BufNewFile *.ebuild set tabstop=4 shiftwidth=4 noexpandtab
augroup END
endif " has("autocmd")
" some extra commands for HTML editing
nmap ,mh wbgueyei<<ESC>ea></<ESC>pa><ESC>bba
nmap ,h1 _i<h1><ESC>A</h1><ESC>
nmap ,h2 _i<h2><ESC>A</h2><ESC>
nmap ,h3 _i<h3><ESC>A</h3><ESC>
nmap ,h4 _i<h4><ESC>A</h4><ESC>
nmap ,h5 _i<h5><ESC>A</h5><ESC>
nmap ,h6 _i<h6><ESC>A</h6><ESC>
nmap ,hb wbi<b><ESC>ea</b><ESC>bb
nmap ,he wbi<em><ESC>ea</em><ESC>bb
nmap ,hi wbi<i><ESC>ea</i><ESC>bb
nmap ,hu wbi<u><ESC>ea</i><ESC>bb
nmap ,hs wbi<strong><ESC>ea</strong><ESC>bb
nmap ,ht wbi<tt><ESC>ea</tt><ESC>bb
nmap ,hx wbF<df>f<df>

View File

@ -0,0 +1,30 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-editors/vim/vim-7.3.266.ebuild,v 1.5 2011/10/08 19:05:19 armin76 Exp $
EAPI=3
VIM_VERSION="7.3"
inherit vim
VIM_ORG_PATCHES="vim-patches-${PV}.patch.bz2"
SRC_URI="ftp://ftp.vim.org/pub/vim/unix/vim-${VIM_VERSION}.tar.bz2
http://dev.gentoo.org/~lack/vim/${VIM_ORG_PATCHES}"
S="${WORKDIR}/vim${VIM_VERSION/.}"
DESCRIPTION="Vim, an improved vi-style text editor"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ~ppc ~ppc64 s390 sh sparc x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
src_prepare() {
vim_src_prepare
if [[ ${CHOST} == *-interix* ]]; then
epatch "${FILESDIR}"/${PN}-7.3-interix-link.patch
fi
epatch "${FILESDIR}"/${PN}-7.1.285-darwin-x11link.patch
epatch "${FILESDIR}"/${PN}-7.3-cross.patch
cd src
eautoreconf
}

View File

@ -0,0 +1 @@
DIST qemu-kvm-0.15.1.tar.gz 5915998 RMD160 dba914ca40d6c63e9f3abce409d7daee1d33323b SHA1 2716ddfc49d98fee67a1ff0de9b199d211e72bec SHA256 aed6a3faa76c1e9601b4b5b8adbe5867a70c64567175f44944d88e16bd49733e

View File

@ -0,0 +1,11 @@
--- qemu-0.11.0.orig/linux-user/main.c 2009-10-23 02:19:57.000000000 +0200
+++ qemu-0.11.0/linux-user/main.c 2009-10-23 02:47:09.000000000 +0200
@@ -1469,6 +1469,8 @@
#ifdef TARGET_MIPS
+#define TARGET_QEMU_ESIGRETURN 255
+
#define MIPS_SYS(name, args) args,
static const uint8_t mips_syscall_args[] = {

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/qemu-system-x86_64 --enable-kvm "$@"

View File

@ -0,0 +1,31 @@
--- qemu-kvm-0.15.1.orig/configure 2011-11-14 12:59:21.757440947 -0800
+++ qemu-kvm-0.15.1/configure 2011-11-14 13:08:44.094348302 -0800
@@ -561,6 +561,7 @@ for opt do
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
+ pkg_config="${pkg_config} --static"
;;
--mandir=*) mandir="$optarg"
;;
@@ -1403,9 +1404,11 @@ fi
if $pkg_config sdl --modversion >/dev/null 2>&1; then
sdlconfig="$pkg_config sdl"
_sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
+ _sdlconfig_type="pkg-config"
elif has ${sdl_config}; then
sdlconfig="$sdl_config"
_sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+ _sdlconfig_type="sdl-config"
else
if test "$sdl" = "yes" ; then
feature_not_found "sdl"
@@ -1424,7 +1427,7 @@ if test "$sdl" != "no" ; then
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
- if test "$static" = "yes" ; then
+ if test "$static" = "yes" && test "$_sdlconfig_type" = "sdl-config"; then
sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
else
sdl_libs=`$sdlconfig --libs 2> /dev/null`

View File

@ -0,0 +1,172 @@
From 754fd932bedacfd7de35cf74da6adca89ba28089 Mon Sep 17 00:00:00 2001
From: Peter Maydell <peter.maydell@linaro.org>
Date: Fri, 28 Oct 2011 10:52:40 +0100
Subject: [PATCH 1/3] qemu-tls.h: Add abstraction layer for TLS variables
Add an abstraction layer for defining and using thread-local
variables. For the moment this is implemented only for Linux,
which means they can only be used in restricted circumstances.
The abstraction layer allows us to add POSIX and Win32 support
later.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
qemu-tls.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 qemu-tls.h
diff --git a/qemu-tls.h b/qemu-tls.h
new file mode 100644
index 0000000..5b70f10
--- /dev/null
+++ b/qemu-tls.h
@@ -0,0 +1,52 @@
+/*
+ * Abstraction layer for defining and using TLS variables
+ *
+ * Copyright (c) 2011 Red Hat, Inc
+ * Copyright (c) 2011 Linaro Limited
+ *
+ * Authors:
+ * Paolo Bonzini <pbonzini@redhat.com>
+ * Peter Maydell <peter.maydell@linaro.org>
+ *
+ * This program 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 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QEMU_TLS_H
+#define QEMU_TLS_H
+
+/* Per-thread variables. Note that we only have implementations
+ * which are really thread-local on Linux; the dummy implementations
+ * define plain global variables.
+ *
+ * This means that for the moment use should be restricted to
+ * per-VCPU variables, which are OK because:
+ * - the only -user mode supporting multiple VCPU threads is linux-user
+ * - TCG system mode is single-threaded regarding VCPUs
+ * - KVM system mode is multi-threaded but limited to Linux
+ *
+ * TODO: proper implementations via Win32 .tls sections and
+ * POSIX pthread_getspecific.
+ */
+#ifdef __linux__
+#define DECLARE_TLS(type, x) extern DEFINE_TLS(type, x)
+#define DEFINE_TLS(type, x) __thread __typeof__(type) tls__##x
+#define get_tls(x) tls__##x
+#else
+/* Dummy implementations which define plain global variables */
+#define DECLARE_TLS(type, x) extern DEFINE_TLS(type, x)
+#define DEFINE_TLS(type, x) __typeof__(type) tls__##x
+#define get_tls(x) tls__##x
+#endif
+
+#endif
--
1.7.3.1
From 8a5f7b03a0a711ec8e04aeebe339cdb8b876794b Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 28 Oct 2011 10:52:41 +0100
Subject: [PATCH 2/3] darwin-user/main.c: Drop unused cpu_single_env definition
Drop the cpu_single_env definition as it is unused.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
darwin-user/main.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/darwin-user/main.c b/darwin-user/main.c
index 1a881a0..c0f14f8 100644
--- a/darwin-user/main.c
+++ b/darwin-user/main.c
@@ -729,8 +729,6 @@ static void usage(void)
/* XXX: currently only used for async signals (see signal.c) */
CPUState *global_env;
-/* used only if single thread */
-CPUState *cpu_single_env = NULL;
/* used to free thread contexts */
TaskState *first_task_state;
--
1.7.3.1
From b3c4bbe56dc707102d3abd969f51bb2aa9c6c53d Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 28 Oct 2011 10:52:42 +0100
Subject: [PATCH 3/3] Make cpu_single_env thread-local
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Make cpu_single_env thread-local. This fixes a regression
in handling of multi-threaded programs in linux-user mode
(bug 823902).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Peter Maydell: rename tls_cpu_single_env to cpu_single_env]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
cpu-all.h | 4 +++-
exec.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index 42a5fa0..5f47ab8 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -20,6 +20,7 @@
#define CPU_ALL_H
#include "qemu-common.h"
+#include "qemu-tls.h"
#include "cpu-common.h"
/* some important defines:
@@ -334,7 +335,8 @@ void cpu_dump_statistics(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
extern CPUState *first_cpu;
-extern CPUState *cpu_single_env;
+DECLARE_TLS(CPUState *,cpu_single_env);
+#define cpu_single_env get_tls(cpu_single_env)
/* Flags for use in ENV->INTERRUPT_PENDING.
diff --git a/exec.c b/exec.c
index 54ecbe7..6b92198 100644
--- a/exec.c
+++ b/exec.c
@@ -120,7 +120,7 @@ static MemoryRegion *system_io;
CPUState *first_cpu;
/* current CPU in the current thread. It is only valid inside
cpu_exec() */
-CPUState *cpu_single_env;
+DEFINE_TLS(CPUState *,cpu_single_env);
/* 0 = Do not count executed instructions.
1 = Precise instruction counting.
2 = Adaptive rate instruction counting. */
--
1.7.3.1

View File

@ -0,0 +1,316 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.15.1-r1.ebuild,v 1.1 2011/10/25 17:08:01 cardoe Exp $
#BACKPORTS=1
EAPI="3"
if [[ ${PV} = *9999* ]]; then
# EGIT_REPO_URI="git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git"
EGIT_REPO_URI="git://github.com/avikivity/kvm.git"
GIT_ECLASS="git-2"
fi
inherit eutils flag-o-matic ${GIT_ECLASS} linux-info toolchain-funcs multilib python
if [[ ${PV} = *9999* ]]; then
SRC_URI=""
KEYWORDS=""
else
SRC_URI="mirror://sourceforge/kvm/${PN}/${P}.tar.gz
${BACKPORTS:+
http://dev.gentoo.org/~flameeyes/${PN}/${P}-backports-${BACKPORTS}.tar.bz2
http://dev.gentoo.org/~cardoe/distfiles/${P}-backports-${BACKPORTS}.tar.bz2}"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
fi
DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
HOMEPAGE="http://www.linux-kvm.org"
LICENSE="GPL-2"
SLOT="0"
# xen is disabled until the deps are fixed
# Removed support for ncurses. crosbug 22309.
IUSE="+aio alsa bluetooth brltty curl debug esd fdt hardened jpeg nss \
png pulseaudio qemu-ifup rbd sasl sdl spice ssl static threads vde \
+vhost-net xattr xen"
# static, depends on libsdl being built with USE=static-libs, which can not
# be expressed in current EAPI's
COMMON_TARGETS="i386 x86_64 arm cris m68k microblaze mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64"
IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} mips64 mips64el ppcemb"
IUSE_USER_TARGETS="${COMMON_TARGETS} alpha armeb ppc64abi32 sparc32plus"
# Setup the default SoftMMU targets, while using the loops
# below to setup the other targets. x86_64 should be the only
# defaults on for qemu-kvm
IUSE="${IUSE} +qemu_softmmu_targets_x86_64"
for target in ${IUSE_SOFTMMU_TARGETS}; do
if [ "x${target}" = "xx86_64" ]; then
continue
fi
IUSE="${IUSE} qemu_softmmu_targets_${target}"
done
for target in ${IUSE_USER_TARGETS}; do
IUSE="${IUSE} qemu_user_targets_${target}"
done
RESTRICT="test"
RDEPEND="
!app-emulation/kqemu
!app-emulation/qemu
!app-emulation/qemu-user
>=dev-libs/glib-2.0
sys-apps/pciutils
>=sys-apps/util-linux-2.16.0
sys-libs/zlib
amd64? ( sys-apps/seabios )
x86? ( sys-apps/seabios )
aio? (
static? ( dev-libs/libaio[static-libs] )
!static? ( dev-libs/libaio )
)
alsa? ( >=media-libs/alsa-lib-1.0.13 )
bluetooth? ( net-wireless/bluez )
brltty? ( app-accessibility/brltty )
curl? ( >=net-misc/curl-7.15.4 )
esd? ( media-sound/esound )
fdt? ( >=sys-apps/dtc-1.2.0 )
jpeg? ( virtual/jpeg )
nss? ( dev-libs/nss )
png? ( media-libs/libpng )
pulseaudio? ( media-sound/pulseaudio )
qemu-ifup? ( sys-apps/iproute2 net-misc/bridge-utils )
rbd? ( sys-cluster/ceph )
sasl? ( dev-libs/cyrus-sasl )
sdl? (
static? ( >=media-libs/libsdl-1.2.11[X,static-libs] )
!static? ( >=media-libs/libsdl-1.2.11[X] )
)
spice? ( >=app-emulation/spice-0.6.0 )
ssl? ( net-libs/gnutls )
vde? ( net-misc/vde )
xattr? ( sys-apps/attr )
xen? ( app-emulation/xen )
"
#ncurses? ( sys-libs/ncurses )
DEPEND="${RDEPEND}
app-text/texi2html
>=sys-kernel/linux-headers-2.6.35
ssl? ( dev-util/pkgconfig )
"
kvm_kern_warn() {
eerror "Please enable KVM support in your kernel, found at:"
eerror
eerror " Virtualization"
eerror " Kernel-based Virtual Machine (KVM) support"
eerror
}
pkg_setup() {
if ! use qemu_softmmu_targets_x86_64 && use x86_64 ; then
eerror "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
fi
if ! use qemu_softmmu_targets_x86_64 && use x86 ; then
eerror "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
fi
if kernel_is lt 2 6 25; then
eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
eerror "Either upgrade your kernel"
else
if ! linux_config_exists; then
eerror "Unable to check your kernel for KVM support"
kvm_kern_warn
elif ! linux_chkconfig_present KVM; then
kvm_kern_warn
fi
if use vhost-net && ! linux_chkconfig_present VHOST_NET ; then
ewarn "You have to enable CONFIG_VHOST_NET in the kernel"
ewarn "to have vhost-net support."
fi
fi
python_set_active_version 2
enewgroup kvm
}
src_prepare() {
# prevent docs to get automatically installed
sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
# Alter target makefiles to accept CFLAGS set via flag-o
sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
Makefile Makefile.target || die
# append CFLAGS while linking
sed -i 's/$(LDFLAGS)/$(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS)/' rules.mak || die
# remove part to make udev happy
sed -e 's~NAME="%k", ~~' -i kvm/scripts/65-kvm.rules || die
# ${PN}-guest-hang-on-usb-add.patch was sent by Timothy Jones
# to the qemu-devel ml - bug 337988
epatch "${FILESDIR}/qemu-0.11.0-mips64-user-fix.patch"
# Configuration for libsdl with static libs is broken.
epatch "${FILESDIR}/${P}-configure-static-sdl.patch"
# Backported patch from upstream 1.0 version.
epatch "${FILESDIR}/${PN}-fix_TLS_regression.patch"
[[ -n ${BACKPORTS} ]] && \
EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
epatch
}
src_configure() {
local conf_opts audio_opts user_targets
for target in ${IUSE_SOFTMMU_TARGETS} ; do
use "qemu_softmmu_targets_${target}" && \
softmmu_targets="${softmmu_targets} ${target}-softmmu"
done
for target in ${IUSE_USER_TARGETS} ; do
use "qemu_user_targets_${target}" && \
user_targets="${user_targets} ${target}-linux-user"
done
if [ -z "${softmmu_targets}" ]; then
eerror "All SoftMMU targets are disabled. This is invalid for qemu-kvm"
die "At least 1 SoftMMU target must be enabled"
else
einfo "Building the following softmmu targets: ${softmmu_targets}"
fi
if [ ! -z "${user_targets}" ]; then
einfo "Building the following user targets: ${user_targets}"
conf_opts="${conf_opts} --enable-linux-user"
else
conf_opts="${conf_opts} --disable-linux-user"
fi
# Fix QA issues. QEMU needs executable heaps and we need to mark it as such
conf_opts="${conf_opts} --extra-ldflags=-Wl,-z,execheap"
# Add support for static builds
use static && conf_opts="${conf_opts} --static"
# Support debug USE flag
use debug && conf_opts="${conf_opts} --enable-debug --disable-strip"
# Fix the $(prefix)/etc issue
conf_opts="${conf_opts} --sysconfdir=/etc"
#config options
conf_opts="${conf_opts} $(use_enable aio linux-aio)"
conf_opts="${conf_opts} $(use_enable bluetooth bluez)"
conf_opts="${conf_opts} $(use_enable brltty brlapi)"
conf_opts="${conf_opts} $(use_enable curl)"
conf_opts="${conf_opts} $(use_enable fdt)"
conf_opts="${conf_opts} $(use_enable hardened user-pie)"
conf_opts="${conf_opts} $(use_enable jpeg vnc-jpeg)"
#conf_opts="${conf_opts} $(use_enable ncurses curses)"
conf_opts="${conf_opts} $(use_enable nss smartcard-nss)"
conf_opts="${conf_opts} $(use_enable png vnc-png)"
conf_opts="${conf_opts} $(use_enable rbd)"
conf_opts="${conf_opts} $(use_enable sasl vnc-sasl)"
conf_opts="${conf_opts} $(use_enable sdl)"
conf_opts="${conf_opts} $(use_enable spice)"
conf_opts="${conf_opts} $(use_enable ssl vnc-tls)"
conf_opts="${conf_opts} $(use_enable threads vnc-thread)"
conf_opts="${conf_opts} $(use_enable vde)"
conf_opts="${conf_opts} $(use_enable vhost-net)"
conf_opts="${conf_opts} $(use_enable xen)"
conf_opts="${conf_opts} $(use_enable xattr attr)"
conf_opts="${conf_opts} --disable-darwin-user --disable-bsd-user"
# audio options
audio_opts="oss"
use alsa && audio_opts="alsa ${audio_opts}"
use esd && audio_opts="esd ${audio_opts}"
use pulseaudio && audio_opts="pa ${audio_opts}"
use sdl && audio_opts="sdl ${audio_opts}"
./configure --prefix=/usr \
--disable-strip \
--disable-werror \
--enable-kvm \
--enable-nptl \
--enable-uuid \
${conf_opts} \
--audio-drv-list="${audio_opts}" \
--target-list="${softmmu_targets} ${user_targets}" \
--cc="$(tc-getCC)" \
--host-cc="$(tc-getBUILD_CC)" \
|| die "configure failed"
# this is for qemu upstream's threaded support which is
# in development and broken
# the kvm project has its own support for threaded IO
# which is always on and works
# --enable-io-thread \
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
if [ ! -z "${softmmu_targets}" ]; then
insinto /$(get_libdir)/udev/rules.d/
doins kvm/scripts/65-kvm.rules || die
if use qemu-ifup; then
insinto /etc/qemu/
insopts -m0755
doins kvm/scripts/qemu-ifup || die
fi
if use qemu_softmmu_targets_x86_64 ; then
dobin "${FILESDIR}"/qemu-kvm
dosym /usr/bin/qemu-kvm /usr/bin/kvm
else
elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install"
elog "of /usr/bin/qemu-kvm and /usr/bin/kvm"
fi
fi
dodoc Changelog MAINTAINERS TODO pci-ids.txt || die
newdoc pc-bios/README README.pc-bios || die
dohtml qemu-doc.html qemu-tech.html || die
# FIXME: Need to come up with a solution for non-x86 based systems
if use x86 || use amd64; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${D}/usr/share/qemu/bios.bin"
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
fi
}
pkg_postinst() {
if [ ! -z "${softmmu_targets}" ]; then
elog "If you don't have kvm compiled into the kernel, make sure you have"
elog "the kernel module loaded before running kvm. The easiest way to"
elog "ensure that the kernel module is loaded is to load it on boot."
elog "For AMD CPUs the module is called 'kvm-amd'"
elog "For Intel CPUs the module is called 'kvm-intel'"
elog "Please review /etc/conf.d/modules for how to load these"
elog
elog "Make sure your user is in the 'kvm' group"
elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
elog
elog "You will need the Universal TUN/TAP driver compiled into your"
elog "kernel or loaded as a module to use the virtual network device"
elog "if using -net tap. You will also need support for 802.1d"
elog "Ethernet Bridging and a configured bridge if using the provided"
elog "kvm-ifup script from /etc/kvm."
elog
elog "The gnutls use flag was renamed to ssl, so adjust your use flags."
fi
}

View File

@ -0,0 +1,317 @@
diff -uNr yusukes-ibus-zinnia-910d66d.orig/src/Makefile.am yusukes-ibus-zinnia-910d66d/src/Makefile.am
--- yusukes-ibus-zinnia-910d66d.orig/src/Makefile.am 2011-07-06 12:45:05.000000000 +0900
+++ yusukes-ibus-zinnia-910d66d/src/Makefile.am 2011-08-30 14:34:08.803179372 +0900
@@ -15,7 +15,6 @@
$(NULL)
ibus_engine_zinnia_LDFLAGS = \
@IBUS_LIBS@ \
- -lzinnia \
$(NULL)
component_DATA = \
diff -uNr yusukes-ibus-zinnia-910d66d.orig/src/engine.c yusukes-ibus-zinnia-910d66d/src/engine.c
--- yusukes-ibus-zinnia-910d66d.orig/src/engine.c 2011-07-06 12:45:05.000000000 +0900
+++ yusukes-ibus-zinnia-910d66d/src/engine.c 2011-09-01 15:42:24.849855980 +0900
@@ -1,87 +1,29 @@
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
#include "engine.h"
-#include "zinnia.h"
typedef struct _IBusZinniaEngine IBusZinniaEngine;
typedef struct _IBusZinniaEngineClass IBusZinniaEngineClass;
struct _IBusZinniaEngine {
IBusEngine parent;
- zinnia_character_t *character;
- zinnia_result_t *result;
- size_t stroke_count;
};
struct _IBusZinniaEngineClass {
IBusEngineClass parent;
- zinnia_recognizer_t *recognizer;
};
/* functions prototype */
static void ibus_zinnia_engine_class_init (IBusZinniaEngineClass *klass);
static void ibus_zinnia_engine_init (IBusZinniaEngine *engine);
static void ibus_zinnia_engine_destroy (IBusZinniaEngine *engine);
-static void ibus_zinnia_engine_candidate_clicked (IBusEngine *engine,
- guint index,
- guint button,
- guint state);
-static void ibus_zinnia_engine_process_hand_writing_event
- (IBusEngine *engine,
- const gdouble *coordinates,
- guint coordinates_len);
-static void ibus_zinnia_engine_cancel_hand_writing
- (IBusEngine *engine,
- guint n_strokes);
-static void ibus_zinnia_engine_reset (IBusEngine *engine);
-static void ibus_zinnia_engine_disable (IBusEngine *engine);
-static void ibus_zinnia_engine_focus_out (IBusEngine *engine);
+static gboolean ibus_zinnia_engine_process_key_event (IBusEngine *engine,
+ guint v,
+ guint s,
+ guint m);
G_DEFINE_TYPE (IBusZinniaEngine, ibus_zinnia_engine, IBUS_TYPE_ENGINE)
-static const gint zinnia_xy = 1000;
-static const gchar model_path[] = "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
-/* FIXME support Chinese and other languages */
-
-static gint
-normalize (gdouble x_or_y)
-{
- gint result = (gint)(x_or_y * zinnia_xy);
- if (result < 0)
- return 0;
- if (result > zinnia_xy)
- return zinnia_xy;
- return result;
-}
-
-static void
-maybe_init_zinnia (IBusZinniaEngine *zinnia)
-{
- if (zinnia->stroke_count == 0) {
- g_return_if_fail (zinnia->character == NULL);
- g_return_if_fail (zinnia->result == NULL);
-
- zinnia->character = zinnia_character_new ();
- zinnia_character_clear (zinnia->character);
- zinnia_character_set_width (zinnia->character, zinnia_xy);
- zinnia_character_set_height (zinnia->character, zinnia_xy);
- }
-}
-
-static void
-destroy_zinnia (IBusZinniaEngine *zinnia)
-{
- if (zinnia->character) {
- zinnia_character_destroy (zinnia->character);
- zinnia->character = NULL;
- }
- if (zinnia->result != NULL) {
- zinnia_result_destroy (zinnia->result);
- zinnia->result = NULL;
- }
- zinnia->stroke_count = 0;
-}
-
static void
ibus_zinnia_engine_class_init (IBusZinniaEngineClass *klass)
{
@@ -90,16 +32,7 @@
ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_zinnia_engine_destroy;
- engine_class->candidate_clicked = ibus_zinnia_engine_candidate_clicked;
- engine_class->process_hand_writing_event = ibus_zinnia_engine_process_hand_writing_event;
- engine_class->cancel_hand_writing = ibus_zinnia_engine_cancel_hand_writing;
-
- engine_class->reset = ibus_zinnia_engine_reset;
- engine_class->disable = ibus_zinnia_engine_disable;
- engine_class->focus_out = ibus_zinnia_engine_focus_out;
-
- klass->recognizer = zinnia_recognizer_new ();
- g_return_if_fail (zinnia_recognizer_open (klass->recognizer, model_path));
+ engine_class->process_key_event = ibus_zinnia_engine_process_key_event;
}
static void
@@ -113,100 +46,31 @@
static void
ibus_zinnia_engine_destroy (IBusZinniaEngine *zinnia)
{
- destroy_zinnia (zinnia);
((IBusObjectClass *) ibus_zinnia_engine_parent_class)->destroy ((IBusObject *) zinnia);
}
-static void
-ibus_zinnia_engine_candidate_clicked (IBusEngine *engine,
- guint index,
- guint button,
- guint state)
-{
- IBusZinniaEngine *zinnia = (IBusZinniaEngine *) engine;
- if (zinnia->result == NULL || index >= zinnia_result_size (zinnia->result)) {
- return;
- }
- IBusText *text = ibus_text_new_from_string (zinnia_result_value (zinnia->result, index));
- ibus_engine_commit_text (engine, text);
- ibus_engine_hide_lookup_table (engine);
- destroy_zinnia (zinnia);
-}
-
-static void
-ibus_zinnia_engine_process_hand_writing_event (IBusEngine *engine,
- const gdouble *coordinates,
- guint coordinates_len)
-{
- static const gint max_candidates = 10;
- IBusZinniaEngine *zinnia = (IBusZinniaEngine *) engine;
- guint i;
-
- g_return_if_fail (coordinates_len >= 4);
- g_return_if_fail ((coordinates_len & 1) == 0);
-
- maybe_init_zinnia (zinnia);
- for (i = 1; i < coordinates_len; i += 2) {
- zinnia_character_add (zinnia->character,
- zinnia->stroke_count,
- normalize(coordinates[i - 1]),
- normalize(coordinates[i]));
- }
- zinnia->stroke_count++;
-
- if (zinnia->result != NULL) {
- zinnia_result_destroy (zinnia->result);
+static gunichar
+ibus_zinnia_engine_generate_test_pattern (guint v) {
+ switch (v) {
+ case 37:return 141;case 39:return 1086;case 42:return 88;case 45:return 3654;case 48:return 92;case 49:return 95;case 50:return 149;case 51:return 162;case 52:return 99;case 53:return 120;case 54:return 65257;case 55:return 1017;case 56:return 2407;case 57:return 3695;case 58:return 159;case 59:return 168;case 61:return 1141;case 84:return 195;case 86:return 197;case 91:return 202;case 92:return 2442;case 93:return 3750;case 96:return 199;case 97:return 3701;case 98:return 1612;case 99:return 1068;case 100:return 2460;case 101:return 1599;case 102:return 3739;case 103:return 1059;case 104:return 12592;case 105:return 149;case 106:return 1599;case 107:return 12609;case 108:return 65343;case 111:return 12651;case 112:return 65287;case 113:return 228;case 114:return 1059;case 115:return 65370;case 116:return 214;case 117:return 3703;case 118:return 232;case 119:return 65274;case 120:return 65295;case 121:return 1062;case 122:return 1085;case 123:return 230;
+ }
+ return 0;
+}
+
+static gboolean
+ibus_zinnia_engine_process_key_event (IBusEngine *engine,
+ guint v,
+ guint s,
+ guint m)
+{
+ gunichar c;
+ if (m & (IBUS_RELEASE_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK)) {
+ return FALSE;
+ }
+ if ((c = ibus_zinnia_engine_generate_test_pattern (v)) != 0) {
+ IBusText *text = ibus_text_new_from_unichar (c - v);
+ ibus_engine_commit_text (engine, text);
+ return TRUE;
}
-
- IBusZinniaEngineClass *klass = G_TYPE_INSTANCE_GET_CLASS (zinnia,
- IBusZinniaEngine,
- IBusZinniaEngineClass);
- zinnia->result = zinnia_recognizer_classify (klass->recognizer,
- zinnia->character,
- max_candidates);
-
- if (zinnia->result == NULL || zinnia_result_size (zinnia->result) == 0) {
- ibus_engine_hide_lookup_table (engine);
- } else {
- IBusLookupTable *table = ibus_lookup_table_new (max_candidates, /* page size */
- 0, /* cursur pos */
- FALSE, /* cursor visible */
- TRUE); /* round */
- ibus_lookup_table_set_orientation (table, IBUS_ORIENTATION_VERTICAL);
-
- for (i = 0; i < zinnia_result_size (zinnia->result); i++) {
- IBusText *text = ibus_text_new_from_string (zinnia_result_value (zinnia->result, i));
- ibus_lookup_table_append_candidate (table, text);
- }
- ibus_engine_update_lookup_table (engine, table, TRUE);
- }
-}
-
-static void
-ibus_zinnia_engine_cancel_hand_writing (IBusEngine *engine,
- guint n_strokes)
-{
- IBusZinniaEngine *zinnia = (IBusZinniaEngine *) engine;
- ibus_engine_hide_lookup_table (engine);
- destroy_zinnia (zinnia);
-
- /* FIXME support n_strokes != 0 cases */
-}
-
-static void
-ibus_zinnia_engine_reset (IBusEngine *engine)
-{
- ibus_zinnia_engine_cancel_hand_writing (engine, 0);
-}
-
-static void
-ibus_zinnia_engine_disable (IBusEngine *engine)
-{
- ibus_zinnia_engine_cancel_hand_writing (engine, 0);
-}
-
-static void
-ibus_zinnia_engine_focus_out (IBusEngine *engine)
-{
- ibus_zinnia_engine_cancel_hand_writing (engine, 0);
+ return (v >= 0x21 && v <= 0x7e) ? TRUE : FALSE;
}
diff -uNr yusukes-ibus-zinnia-910d66d.orig/src/main.c yusukes-ibus-zinnia-910d66d/src/main.c
--- yusukes-ibus-zinnia-910d66d.orig/src/main.c 2011-07-06 12:45:05.000000000 +0900
+++ yusukes-ibus-zinnia-910d66d/src/main.c 2011-08-30 11:39:19.193185948 +0900
@@ -52,7 +52,7 @@
}
if (ibus) {
- ibus_bus_request_name (bus, "com.google.IBus.Zinnia", 0);
+ ibus_bus_request_name (bus, "com.google.IBus.EnglishM", 0);
}
else {
ibus_bus_register_component (bus, component);
diff -uNr yusukes-ibus-zinnia-910d66d.orig/src/zinnia.xml.in.in yusukes-ibus-zinnia-910d66d/src/zinnia.xml.in.in
--- yusukes-ibus-zinnia-910d66d.orig/src/zinnia.xml.in.in 2011-07-06 12:45:05.000000000 +0900
+++ yusukes-ibus-zinnia-910d66d/src/zinnia.xml.in.in 2011-08-30 14:41:48.065620488 +0900
@@ -1,8 +1,8 @@
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<component>
- <name>com.google.IBus.Zinnia</name>
+ <name>com.google.IBus.EnglishM</name>
<description>Zinnia hand-writing Component</description>
- <exec>${libexecdir}/ibus-engine-zinnia --ibus</exec>
+ <exec>${libexecdir}/ibus-engine-english-m --ibus</exec>
<version>@VERSION@</version>
<author>The Chromium OS Authors</author>
<license>Apache License 2.0</license>
@@ -10,14 +10,14 @@
<textdomain>ibus-zinnia</textdomain>
<engines>
<engine>
- <name>zinnia-japanese</name>
+ <name>english-m</name>
<longname>Japanese hand-writing engine</longname>
<description>Japanese hand-writing engine</description>
- <language>ja</language>
+ <language>eng</language>
<license>Apache</license>
<author>The Chromium OS authors</author>
<icon></icon>
- <layout>handwriting-vk,us</layout>
+ <layout>us</layout>
<hotkeys></hotkeys>
<rank>0</rank>
</engine>
diff -uNr yusukes-ibus-zinnia-910d66d.orig/src/zinnia_component.c yusukes-ibus-zinnia-910d66d/src/zinnia_component.c
--- yusukes-ibus-zinnia-910d66d.orig/src/zinnia_component.c 2011-07-06 12:45:05.000000000 +0900
+++ yusukes-ibus-zinnia-910d66d/src/zinnia_component.c 2011-08-30 14:11:54.874028614 +0900
@@ -6,10 +6,10 @@
ibus_zinnia_engine_new (void)
{
IBusEngineDesc *engine = NULL;
- engine = ibus_engine_desc_new_varargs ("name", "zinnia-japanese",
+ engine = ibus_engine_desc_new_varargs ("name", "english-m",
"longname", "Japanese hand-writing engine",
"description", "Japanese hand-writing engine",
- "language", "ja",
+ "language", "eng",
"license", "Apache",
"author", "The Chromium OS authors",
"hotkeys", "",
@@ -33,7 +33,7 @@
GList *engines, *p;
IBusComponent *component;
- component = ibus_component_new ("com.google.IBus.Zinnia",
+ component = ibus_component_new ("com.google.IBus.EnglishM",
"Zinnia hand-writing Component",
"0.0.0",
"Apache",

View File

@ -0,0 +1,49 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic
DESCRIPTION="English IME for testing"
HOMEPAGE="http://github.com/yusukes/ibus-zinnia"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/ibus-zinnia-0.0.3.tar.gz"
#RESTRICT="mirror"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm x86"
RDEPEND=">=app-i18n/ibus-1.3.99"
DEPEND="${RDEPEND}
dev-util/pkgconfig
>=sys-devel/gettext-0.16.1"
# Tarballs in github.com use a special directory naming rule:
# "<github_user_name>-<project_name>-<last_commit_in_the_tarball>"
SRC_DIR="yusukes-ibus-zinnia-910d66d"
src_prepare() {
cd "${SRC_DIR}" || die
epatch "${FILESDIR}"/english-m.patch || die
}
src_configure() {
cd "${SRC_DIR}" || die
append-cflags -Wall -Werror
NOCONFIGURE=1 ./autogen.sh || die
econf || die
}
src_install() {
cd "${SRC_DIR}" || die
emake DESTDIR="${T}" install || die
exeinto /usr/libexec || die
newexe "${T}"/usr/libexec/ibus-engine-zinnia ibus-engine-english-m || die
insinto /usr/share/ibus/component || die
newins "${T}"/usr/share/ibus/component/zinnia.xml english-m.xml || die
}

View File

@ -0,0 +1 @@
DIST ibus-m17n-1.3.3.tar.gz 431113 RMD160 ad707cd360bc933b32795e06f98984631e0c457a SHA1 923a3d6416e06c34b63b54c40deff6ab23c6211a SHA256 0374aef2149bcf1a337c39ab642ee39da4dbb17758ee8c095f954ca835dc10bf

View File

@ -0,0 +1,55 @@
From 11730d65d6d62711d7f8a2ce415d1229a86dd16e Mon Sep 17 00:00:00 2001
From: Peng Huang <shawn.p.huang@gmail.com>
Date: Sun, 18 Sep 2011 22:08:00 -0400
Subject: [PATCH] Fix a crash and add some warning log message.
BUG=Crash in Chrome OS
TEST=Linux desktop
Review URL: http://codereview.appspot.com/5050041
---
src/engine.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/engine.c b/src/engine.c
index dcff0c7..db14607 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -816,8 +816,15 @@ ibus_m17n_engine_update_lookup_table (IBusM17NEngine *m17n)
ibus_lookup_table_set_page_size (m17n->table, mtext_len (mt));
buf = ibus_m17n_mtext_to_ucs4 (mt, &nchars);
- for (i = 0; i < nchars; i++) {
- ibus_lookup_table_append_candidate (m17n->table, ibus_text_new_from_unichar (buf[i]));
+ g_warn_if_fail (buf != NULL);
+
+ for (i = 0; buf != NULL && i < nchars; i++) {
+ IBusText *text = ibus_text_new_from_unichar (buf[i]);
+ if (text == NULL) {
+ text = ibus_text_new_from_printf ("INVCODE=U+%04"G_GINT32_FORMAT"X", buf[i]);
+ g_warn_if_reached ();
+ }
+ ibus_lookup_table_append_candidate (m17n->table, text);
}
g_free (buf);
}
@@ -834,9 +841,15 @@ ibus_m17n_engine_update_lookup_table (IBusM17NEngine *m17n)
mtext = (MText *) mplist_value (p);
buf = ibus_m17n_mtext_to_utf8 (mtext);
if (buf) {
- ibus_lookup_table_append_candidate (m17n->table, ibus_text_new_from_string (buf));
+ ibus_lookup_table_append_candidate (m17n->table,
+ ibus_text_new_from_string (buf));
g_free (buf);
}
+ else {
+ ibus_lookup_table_append_candidate (m17n->table,
+ ibus_text_new_from_static_string ("NULL"));
+ g_warn_if_reached();
+ }
}
}
--
1.7.1

View File

@ -0,0 +1,14 @@
diff --git a/src/m17nutil.c b/src/m17nutil.c
index 42aa8f6..dd10bbd 100644
--- a/src/m17nutil.c
+++ b/src/m17nutil.c
@@ -11,7 +11,9 @@
static MConverter *utf8_converter = NULL;
+#ifndef DEFAULT_XML
#define DEFAULT_XML (SETUPDIR "/default.xml")
+#endif
struct _IBusM17NEngineConfigNode {
gchar *name;

View File

@ -0,0 +1,100 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus-m17n/ibus-m17n-1.2.0.20090617.ebuild,v 1.1 2009/06/18 15:40:00 matsuu Exp $
EAPI="2"
inherit eutils
DESCRIPTION="The M17N engine IMEngine for IBus Framework"
HOMEPAGE="http://code.google.com/p/ibus/"
SRC_URI="http://ibus.googlecode.com/files/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE="nls"
RDEPEND=">=app-i18n/ibus-1.3.99
>=dev-libs/m17n-lib-1.6.1
>=dev-db/m17n-db-1.6.1
>=dev-db/m17n-contrib-1.1.10
nls? ( virtual/libintl )"
DEPEND="${RDEPEND}
>=chromeos-base/chromeos-chrome-16
chromeos-base/chromeos-assets
dev-libs/libxml2
dev-util/pkgconfig
>=sys-devel/gettext-0.16.1"
src_prepare() {
# Make it possible to override the DEFAULT_XML macro.
epatch "${FILESDIR}"/ibus-m17n-1.3.3-allow-override-xml-path.patch
epatch "${FILESDIR}"/ibus-m17n-1.3.3-Fix-a-crash-and-add-some-warning-log-message.patch
# Build ibus-engine-m17n for the host platform.
(env -i ./configure && \
env -i make CFLAGS=-DDEFAULT_XML='\"./src/default.xml\"') || die
# Obtain the XML output by running the binary.
src/ibus-engine-m17n --xml > output.xml || die
# Sanity checks.
grep m17n:ar:kbd output.xml || die # in m17n-db
grep m17n:mr:itrans output.xml || die # in m17n-db-contrib
# Clean up.
make distclean || die
}
src_configure() {
econf $(use_enable nls) || die
}
src_compile() {
emake || die
# Rewrite m17n.xml using the XML output.
# input_methods.txt comes from chromeos-base/chromeos-chrome-9999.ebuild
ASSETSIMDIR="${SYSROOT}"/usr/share/chromeos-assets/input_methods
LIST="${ASSETSIMDIR}"/input_methods.txt
if [ -f ${LIST} ] ; then
python "${ASSETSIMDIR}"/filter.py < output.xml \
--whitelist="${LIST}" \
--rewrite=src/m17n.xml || die
else
# TODO(yusukes): Remove ibus_input_methods.txt support in R20.
LIST_OLD="${ASSETSIMDIR}"/ibus_input_methods.txt
if [ -f ${LIST_OLD} ] ; then
python "${ASSETSIMDIR}"/filter.py < output.xml \
--whitelist="${LIST_OLD}" \
--rewrite=src/m17n.xml || die
fi
fi
# Remove spaces from the XML to reduce file size from ~4k to ~3k.
# You can make it readable by 'xmllint --format' (on a target machine).
mv src/m17n.xml "${T}"/ || die
xmllint --noblanks "${T}"/m17n.xml > src/m17n.xml || die
# Sanity checks.
grep m17n:ar:kbd src/m17n.xml 2>&1 > /dev/null \
|| die # in m17n-db, whitelisted
grep m17n:mr:itrans src/m17n.xml 2>&1 > /dev/null \
|| die # in m17n-db-contrib, whitelisted
}
src_install() {
emake DESTDIR="${D}" install || die
rm -rf "${D}/usr/libexec/ibus-setup-m17n" || die
rm -rf "${D}/usr/share/ibus-m17n/icons" || die
# We should not delete default.xml in setup/.
rm -rf "${D}/usr/share/ibus-m17n/setup/ibus-m17n-preferences.ui" \
|| die
dodoc AUTHORS ChangeLog NEWS README
}
pkg_postinst() {
ewarn "This package is very experimental, please report your bugs to"
ewarn "http://ibus.googlecode.com/issues/list"
elog
elog "You should run ibus-setup and enable IM Engines you want to use!"
elog
}

View File

@ -0,0 +1 @@
DIST mozc-1.2.855.102.tar.bz2 40681117 RMD160 fb15df25a56be174c0bc18acad1dd3bd8d1a5bf1 SHA1 c078e9cbc00d3c216aa0d739ae4f4405a2259e94 SHA256 d9d0a0e7fe00ad28a4e99776616157bae05b3d3cea327eac41e8f6a020a28227

View File

@ -0,0 +1,23 @@
diff -urN ../mozc-1.4.1033.102.orig/unix/ibus/mozc_engine.cc ./unix/ibus/mozc_engine.cc
--- ../mozc-1.4.1033.102.orig/unix/ibus/mozc_engine.cc 2012-04-05 18:26:30.601368015 +0900
+++ ./unix/ibus/mozc_engine.cc 2012-04-05 19:31:20.549084704 +0900
@@ -225,15 +225,16 @@
DCHECK(delta);
COMPILE_ASSERT(sizeof(int64) > sizeof(guint), int64_guint_check);
+ COMPILE_ASSERT(sizeof(int64) == sizeof(llabs(0)), int64_llabs_check);
const int64 kInt32AbsMax =
- abs(static_cast<int64>(numeric_limits<int32>::max()));
+ llabs(static_cast<int64>(numeric_limits<int32>::max()));
const int64 kInt32AbsMin =
- abs(static_cast<int64>(numeric_limits<int32>::min()));
+ llabs(static_cast<int64>(numeric_limits<int32>::min()));
const int64 kInt32SafeAbsMax =
min(kInt32AbsMax, kInt32AbsMin);
const int64 diff = static_cast<int64>(from) - static_cast<int64>(to);
- if (abs(diff) > kInt32SafeAbsMax) {
+ if (llabs(diff) > kInt32SafeAbsMax) {
return false;
}

View File

@ -0,0 +1,16 @@
Add missing inclusion header files. "geteuid" needs "sys/types.h" and
"unistd.h", otherwise, gcc 4.7 complains.
diff -urN ./languages/chewing/chewing_session_factory.cc.orig ./languages/chewing/chewing_session_factory.cc
--- ./languages/chewing/chewing_session_factory.cc.orig 2012-03-26 01:39:17.000000000 -0700
+++ ./languages/chewing/chewing_session_factory.cc 2012-04-17 17:36:21.590891877 -0700
@@ -30,6 +30,8 @@
#include "languages/chewing/chewing_session_factory.h"
#include <pwd.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "base/singleton.h"
#include "base/util.h"

View File

@ -0,0 +1,71 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic python toolchain-funcs
DESCRIPTION="The Mozc Chewing engine for IBus Framework"
HOMEPAGE="http://code.google.com/p/mozc"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/mozc-${PV}.tar.bz2"
LICENSE="BSD"
RDEPEND=">=app-i18n/ibus-1.3.99.20110817
>=dev-libs/libchewing-0.3.2
dev-libs/protobuf"
DEPEND="${RDEPEND}"
SLOT="0"
KEYWORDS="amd64 x86 arm"
BUILDTYPE="${BUILDTYPE:-Release}"
src_prepare() {
cd "mozc-${PV}" || die
# TODO(nona): Remove the patch when we upgrade mozc to the next version, 1.5.
epatch "${FILESDIR}"/${P}-arm-build-fix.patch
epatch "${FILESDIR}"/${P}-inclusion-fix.patch
}
src_configure() {
cd "mozc-${PV}" || die
# Generate make files
export GYP_DEFINES="chromeos=1 use_libzinnia=0"
export BUILD_COMMAND="emake"
# Currently --channel_dev=0 is not neccessary for Chewing, but just in case.
$(PYTHON) build_mozc.py gyp --gypdir="third_party/gyp" \
--use_libprotobuf \
--language=chewing \
--target_platform="ChromeOS" --channel_dev=0 || die
}
src_compile() {
cd "mozc-${PV}" || die
# Create build tools for the host platform.
CFLAGS="" CXXFLAGS="" $(PYTHON) build_mozc.py build_tools -c ${BUILDTYPE} \
|| die
# Build artifacts for the target platform.
tc-export CXX CC AR AS RANLIB LD
$(PYTHON) build_mozc.py build \
languages/chewing/chewing.gyp:ibus_mozc_chewing -c ${BUILDTYPE} || die
}
src_install() {
cd "mozc-${PV}" || die
exeinto /usr/libexec || die
newexe "out_linux/${BUILDTYPE}/ibus_mozc_chewing" ibus-engine-mozc-chewing \
|| die
insinto /usr/share/ibus/component || die
doins languages/chewing/unix/ibus/mozc-chewing.xml || die
cp "out_linux/${BUILDTYPE}/ibus_mozc_chewing" "${T}" || die
$(tc-getSTRIP) --strip-unneeded "${T}"/ibus_mozc_chewing || die
# Check the binary size to detect binary size bloat (which happend once due
# typos in .gyp files). Current size of the stripped ibus-mozc-chewing binary
# is about 900k (x86) and 700k (arm).
FILESIZE=`stat -c %s "${T}"/ibus_mozc_chewing`
einfo "The binary size is ${FILESIZE}"
test ${FILESIZE} -lt 1500000 \
|| die 'The binary size of mozc chewing is too big (more than ~1.5MB)'
rm -f "${T}"/ibus_mozc_chewing
}

View File

@ -0,0 +1,23 @@
diff -urN ../mozc-1.4.1033.102.orig/unix/ibus/mozc_engine.cc ./unix/ibus/mozc_engine.cc
--- ../mozc-1.4.1033.102.orig/unix/ibus/mozc_engine.cc 2012-04-05 18:26:30.601368015 +0900
+++ ./unix/ibus/mozc_engine.cc 2012-04-05 19:31:20.549084704 +0900
@@ -225,15 +225,16 @@
DCHECK(delta);
COMPILE_ASSERT(sizeof(int64) > sizeof(guint), int64_guint_check);
+ COMPILE_ASSERT(sizeof(int64) == sizeof(llabs(0)), int64_llabs_check);
const int64 kInt32AbsMax =
- abs(static_cast<int64>(numeric_limits<int32>::max()));
+ llabs(static_cast<int64>(numeric_limits<int32>::max()));
const int64 kInt32AbsMin =
- abs(static_cast<int64>(numeric_limits<int32>::min()));
+ llabs(static_cast<int64>(numeric_limits<int32>::min()));
const int64 kInt32SafeAbsMax =
min(kInt32AbsMax, kInt32AbsMin);
const int64 diff = static_cast<int64>(from) - static_cast<int64>(to);
- if (abs(diff) > kInt32SafeAbsMax) {
+ if (llabs(diff) > kInt32SafeAbsMax) {
return false;
}

View File

@ -0,0 +1,14 @@
diff -urN ../mozc-1.4.1033.102.orig/languages/hangul/session.cc ./languages/hangul/session.cc
--- ../mozc-1.4.1033.102.orig/languages/hangul/session.cc 2012-09-21 16:45:37.703125368 +0900
+++ ./languages/hangul/session.cc 2012-09-21 16:57:41.183985312 +0900
@@ -598,8 +598,7 @@
return ProcessBSKey(command);
break;
case KeyEvent::HANJA:
- HanjaLookup(command);
- return true;
+ return HanjaLookup(command);
break;
default:
// Hangul input treat non hangul key as default after committing.
Binary files ../mozc-1.4.1033.102.orig/languages/hangul/.session.cc.swp and ./languages/hangul/.session.cc.swp differ

View File

@ -0,0 +1,86 @@
diff -urN mozc-1.4.1033.102.orig/unix/ibus/ibus_extra_keysyms.h mozc-1.4.1033.102/unix/ibus/ibus_extra_keysyms.h
--- mozc-1.4.1033.102.orig/unix/ibus/ibus_extra_keysyms.h 1970-01-01 09:00:00.000000000 +0900
+++ mozc-1.4.1033.102/unix/ibus/ibus_extra_keysyms.h 2012-12-19 11:52:50.213523426 +0900
@@ -0,0 +1,51 @@
+// Copyright 2010-2012, Google Inc
+// All rights reserved
+//
+// Redistribution and use in source and binary forms, with or withou
+// modification, are permitted provided that the following conditions ar
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+#define MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+
+// for guint
+#include <ibus.h>
+
+#ifdef OS_CHROMEOS
+// Defines key symbols which are not defined on ibuskeysyms.h to handle
+// some keys on ChromeOS.
+const guint IBUS_Back = 0x1008FF26;
+const guint IBUS_Forward = 0x1008FF27;
+const guint IBUS_Reload = 0x1008FF73;
+const guint IBUS_LaunchB = 0x1008FF4B;
+const guint IBUS_LaunchA = 0x1008FF4A;
+const guint IBUS_MonBrightnessDown = 0x1008FF03;
+const guint IBUS_MonBrightnessUp = 0x1008FF02;
+const guint IBUS_AudioMute = 0x1008FF12;
+const guint IBUS_AudioLowerVolume = 0x1008FF11;
+const guint IBUS_AudioRaiseVolume = 0x1008FF13;
+#endif // OS_CHROMEOS
+
+#endif // MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
diff -urN mozc-1.4.1033.102.orig/unix/ibus/key_translator.cc mozc-1.4.1033.102/unix/ibus/key_translator.cc
--- mozc-1.4.1033.102.orig/unix/ibus/key_translator.cc 2012-03-26 17:39:16.000000000 +0900
+++ mozc-1.4.1033.102/unix/ibus/key_translator.cc 2012-12-19 11:40:20.564275049 +0900
@@ -32,6 +32,7 @@
#include <ibus.h>
#include "base/logging.h"
+#include "unix/ibus/ibus_extra_keysyms.h"
namespace {
@@ -85,6 +86,19 @@
{IBUS_Page_Up, mozc::commands::KeyEvent::PAGE_UP},
{IBUS_Page_Down, mozc::commands::KeyEvent::PAGE_DOWN},
+#ifdef OS_CHROMEOS
+ {IBUS_Back, mozc::commands::KeyEvent::F1},
+ {IBUS_Forward, mozc::commands::KeyEvent::F2},
+ {IBUS_Reload, mozc::commands::KeyEvent::F3},
+ {IBUS_LaunchB, mozc::commands::KeyEvent::F4},
+ {IBUS_LaunchA, mozc::commands::KeyEvent::F5},
+ {IBUS_MonBrightnessDown, mozc::commands::KeyEvent::F6},
+ {IBUS_MonBrightnessUp, mozc::commands::KeyEvent::F7},
+ {IBUS_AudioMute, mozc::commands::KeyEvent::F8},
+ {IBUS_AudioLowerVolume, mozc::commands::KeyEvent::F9},
+ {IBUS_AudioRaiseVolume, mozc::commands::KeyEvent::F10},
+#endif // OS_CHROMEOS 83
+
// Keypad (10-key).
{IBUS_KP_0, mozc::commands::KeyEvent::NUMPAD0},
{IBUS_KP_1, mozc::commands::KeyEvent::NUMPAD1},

View File

@ -0,0 +1,77 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic python toolchain-funcs
DESCRIPTION="The Mozc Hangul engine for IBus Framework"
HOMEPAGE="http://code.google.com/p/mozc"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/mozc-${PV}.tar.bz2"
LICENSE="BSD"
RDEPEND=">=app-i18n/ibus-1.3.99
>=app-i18n/libhangul-0.0.10
dev-libs/protobuf"
DEPEND="${RDEPEND}"
SLOT="0"
KEYWORDS="amd64 x86 arm"
BUILDTYPE="${BUILDTYPE:-Release}"
src_prepare() {
cd "mozc-${PV}" || die
# TODO(hsumita): Remove the patch when we upgrade mozc to 1.5.
epatch "${FILESDIR}"/${P}-arm-build-fix.patch || die
epatch "${FILESDIR}"/${P}-consume-hanja-key.patch || die
# TODO(hsumita): Remove the patch when we upgrade mozc to 1.8 or 1.9.
epatch "${FILESDIR}"/${P}-handle-extra-keysyms.patch || die
}
src_configure() {
cd "mozc-${PV}" || die
# Generate make files
export GYP_DEFINES="chromeos=1 use_libzinnia=0"
export BUILD_COMMAND="emake"
# Currently --channel_dev=0 is not neccessary for Hangul, but just in case.
$(PYTHON) build_mozc.py gyp --gypdir="third_party/gyp" \
--use_libprotobuf \
--language=hangul \
--noqt \
--target_platform="ChromeOS" --channel_dev=0 || die
}
src_compile() {
cd "mozc-${PV}" || die
# Create build tools for the host platform.
CFLAGS="" CXXFLAGS="" $(PYTHON) build_mozc.py build_tools -c ${BUILDTYPE} \
|| die
# Build artifacts for the target platform.
tc-export CXX CC AR AS RANLIB LD
$(PYTHON) build_mozc.py build \
languages/hangul/hangul.gyp:ibus_mozc_hangul -c ${BUILDTYPE} || die
}
src_install() {
cd "mozc-${PV}" || die
exeinto /usr/libexec || die
newexe "out_linux/${BUILDTYPE}/ibus_mozc_hangul" ibus-engine-mozc-hangul \
|| die
insinto /usr/share/ibus/component || die
doins languages/hangul/unix/ibus/mozc-hangul.xml || die
mkdir -p "${D}"/usr/share/ibus-mozc-hangul || die
cp "${WORKDIR}/mozc-${PV}"/data/hangul/korean_symbols.txt "${D}"/usr/share/ibus-mozc-hangul/ || die
chmod o+r "${D}"/usr/share/ibus-mozc-hangul/korean_symbols.txt || die
cp "out_linux/${BUILDTYPE}/ibus_mozc_hangul" "${T}" || die
$(tc-getSTRIP) --strip-unneeded "${T}"/ibus_mozc_hangul || die
# Check the binary size to detect binary size bloat (which happend once due
# typos in .gyp files). Current size of the stripped ibus-mozc-hangul binary
# is about 900k (x86) and 700k (arm).
FILESIZE=`stat -c %s "${T}"/ibus_mozc_hangul`
einfo "The binary size is ${FILESIZE}"
test ${FILESIZE} -lt 1500000 \
|| die 'The binary size of mozc hangul is too big (more than ~1.5MB)'
rm -f "${T}"/ibus_mozc_hangul
}

View File

@ -0,0 +1,13 @@
Clear key state on disable to handle Shift-up correctly.
diff -urN ../mozc.orig/unix/ibus/mozc_engine.cc ./unix/ibus/mozc_engine.cc
--- ../mozc.orig/unix/ibus/mozc_engine.cc 2012-08-31 14:36:43.000000000 +0900
+++ ./unix/ibus/mozc_engine.cc 2012-11-29 16:56:09.216754385 +0900
@@ -285,6 +285,7 @@
void MozcEngine::Disable(IBusEngine *engine) {
RevertSession(engine);
GetCandidateWindowHandler(engine)->Hide(engine);
+ key_event_handler_->Clear();
}
void MozcEngine::Enable(IBusEngine *engine) {

View File

@ -0,0 +1,17 @@
needs a little more space to handle pthread mutex_t with some ABIs
http://code.google.com/p/mozc/issues/detail?id=177
--- a/base/mutex.h
+++ b/base/mutex.h
@@ -52,8 +52,8 @@
#define MOZC_RW_MUTEX_PTR_ARRAYSIZE 32
#else
// Currently following sizes seem to be enough to support all other platforms.
-#define MOZC_MUTEX_PTR_ARRAYSIZE 6
-#define MOZC_RW_MUTEX_PTR_ARRAYSIZE 10
+#define MOZC_MUTEX_PTR_ARRAYSIZE 8
+#define MOZC_RW_MUTEX_PTR_ARRAYSIZE 12
#endif
class LOCKABLE Mutex {

View File

@ -0,0 +1,16 @@
Introduces typo to keep a compatibility with ibus-pinyin.
To fix this typo, we should implements codes to migrate a configuration.
diff -urN ../mozc_origin/languages/pinyin/unix/ibus/mozc_engine_property.cc ./languages/pinyin/unix/ibus/mozc_engine_property.cc
--- ../mozc_origin/languages/pinyin/unix/ibus/mozc_engine_property.cc 2012-04-09 12:28:03.895173124 +0900
+++ ./languages/pinyin/unix/ibus/mozc_engine_property.cc 2012-04-09 18:44:32.013454770 +0900
@@ -73,7 +73,8 @@
"mode.simp",
"\xE7\xAE\x80", // "简"
"hiragana.png",
- "Simplified/Traditional Chinese",
+ // TODO(hsumita): Fixes typo. s/Simplfied/Simplified/
+ "Simplfied/Traditional Chinese",
},
};

View File

@ -0,0 +1,49 @@
Replaces a name from mozc-pinyin to pinyin for a compatibility.
ChromeOS is published on China, so it is not a good idea to replace "pinyin"
tag with "mozc-pinyin" tag because ibus-pinyin user must reconfigure ChormeOS
to use ibus-mozc-pinyin. To avoid this issue, we simply use "pinyin" tag on
ChromeOS.
diff -urN ../mozc_origin/languages/pinyin/unix/ibus/main.h ./languages/pinyin/unix/ibus/main.h
--- ../mozc_origin/languages/pinyin/unix/ibus/main.h 2012-04-09 12:28:03.895173124 +0900
+++ ./languages/pinyin/unix/ibus/main.h 2012-04-09 15:36:18.533924555 +0900
@@ -48,9 +48,11 @@
"us",
"us(dvorak)",
};
+// Using "pinyin*" instead of "mozc-pinyin*" for a compatibility with
+// ibus-pinyin on ChromeOS.
const char *kEngineNameArray[] = {
- "mozc-pinyin",
- "mozc-pinyin-dv",
+ "pinyin",
+ "pinyin-dv",
};
const char *kEngineLongnameArray[] = {
"Mozc Pinyin",
diff -urN ../mozc_origin/languages/pinyin/unix/ibus/mozc-pinyin.xml ./languages/pinyin/unix/ibus/mozc-pinyin.xml
--- ../mozc_origin/languages/pinyin/unix/ibus/mozc-pinyin.xml 2012-04-09 12:28:03.895173124 +0900
+++ ./languages/pinyin/unix/ibus/mozc-pinyin.xml 2012-04-09 15:36:45.563847591 +0900
@@ -14,7 +14,9 @@
<language>zh-CN</language>
<icon>/usr/share/ibus-mozc-pinyin/product_icon.png</icon>
<layout>us</layout>
- <name>mozc-pinyin</name>
+ <!-- Using "pinyin" instead of "mozc-pinyin" for a compatibility
+ with ibus-pinyin on ChromeOS -->
+ <name>pinyin</name>
<longname>Mozc Pinyin</longname>
</engine>
<engine>
@@ -23,7 +25,9 @@
<language>zh-CN</language>
<icon>/usr/share/ibus-mozc-pinyin/product_icon.png</icon>
<layout>us(dvorak)</layout>
- <name>mozc-pinyin-dv</name>
+ <!-- Using "pinyin-dv" instead of "mozc-pinyin-dv" for a compatibility
+ with ibus-pinyin on ChromeOS -->
+ <name>pinyin-dv</name>
<longname>Mozc Pinyin (for US Dvorak keyboard)</longname>
</engine>
</engines>

View File

@ -0,0 +1,75 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic python toolchain-funcs
DESCRIPTION="The Mozc Pinyin engine for IBus Framework"
HOMEPAGE="http://code.google.com/p/mozc"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/mozc-${PV}.tar.bz2"
LICENSE="BSD"
RDEPEND=">=app-i18n/ibus-1.3.99
>=dev-libs/glib-2.26
dev-libs/protobuf
>=dev-libs/pyzy-0.1.0"
DEPEND="${RDEPEND}"
SLOT="0"
KEYWORDS="amd64 x86 arm"
BUILDTYPE="${BUILDTYPE:-Release}"
src_configure() {
cd "mozc" || die
# Generate make files
export GYP_DEFINES="chromeos=1 use_libzinnia=0 use_libprotobuf=1"
export BUILD_COMMAND="emake"
# Currently --channel_dev=0 is not necessary for Pinyin, but just in case.
$(PYTHON) build_mozc.py gyp --gypdir="third_party/gyp" \
--language=pinyin \
--noqt \
--target_platform="ChromeOS" --channel_dev=0 || die
}
src_prepare() {
cd "mozc" || die
epatch "${FILESDIR}"/"${P}"-clear-key-state-on-disable.patch || die
epatch "${FILESDIR}"/"${P}"-x32.patch
# Following 2 patches are required by any version of ibus-mozc-pinyin on
# ChromeOS
epatch "${FILESDIR}"/ibus-mozc-pinyin-introduces-typo-for-compatibility.patch || die
epatch "${FILESDIR}"/ibus-mozc-pinyin-replace-ibus-pinyin.patch || die
}
src_compile() {
cd "mozc" || die
# Create build tools for the host platform.
CFLAGS="" CXXFLAGS="" $(PYTHON) build_mozc.py build_tools -c ${BUILDTYPE} \
|| die
# Build artifacts for the target platform.
tc-export CXX CC AR AS RANLIB LD
$(PYTHON) build_mozc.py build \
pinyin/pinyin.gyp:ibus_mozc_pinyin -c ${BUILDTYPE} || die
}
src_install() {
cd "mozc" || die
exeinto /usr/libexec || die
newexe "out_linux/${BUILDTYPE}/ibus_mozc_pinyin" ibus-engine-mozc-pinyin \
|| die
insinto /usr/share/ibus/component || die
doins languages/pinyin/unix/ibus/mozc-pinyin.xml || die
mkdir -p "${D}"/usr/share/ibus-mozc-pinyin || die
cp "out_linux/${BUILDTYPE}/ibus_mozc_pinyin" "${T}" || die
$(tc-getSTRIP) --strip-unneeded "${T}"/ibus_mozc_pinyin || die
# Unnecessary link may cause size bloat. We expect to detect it by checking binary size.
# NOTE: The binary size for amd64 is 1.1MB in Apr. 2012
FILESIZE=`stat -c %s "${T}"/ibus_mozc_pinyin`
einfo "The binary size is ${FILESIZE}"
test ${FILESIZE} -lt 2000000 \
|| die 'The binary size of ibus_mozc_pinyin is too big (more than ~2.0MB)'
rm -f "${T}"/ibus_mozc_pinyin
}

View File

@ -0,0 +1,2 @@
DIST GoogleJapaneseInputFilesForChromeOS-1.5.1090.102.tar.bz2 23756520 RMD160 4f73f336fa0a3ea9be1a54542d6b3cd4956fb3a4 SHA1 2e8e8d86a83010d49fe985f3dc82ce64ee947b0e SHA256 61346cdddc6000ad1c151626a810014566e8a1d1e6bf367df3ff8ede3a3f58c2
DIST mozc-1.5.1090.102.tar.bz2 54911799 RMD160 5b9b704e68a87d7b4a63bb2ea5ab0561badf90b1 SHA1 9c99333a3a46c190fe14afae573b2ddc2faab64a SHA256 b52c1879c4749041032578ec6c591d9741f521d54993070c050d09ae35bd2107

View File

@ -0,0 +1,62 @@
diff -urN mozc-1.5.1090.102.orig/unix/ibus/ibus_candidate_window_handler.cc mozc-1.5.1090.102/unix/ibus/ibus_candidate_window_handler.cc
--- mozc-1.5.1090.102.orig/unix/ibus/ibus_candidate_window_handler.cc 2012-11-19 16:25:45.757689538 +0900
+++ mozc-1.5.1090.102/unix/ibus/ibus_candidate_window_handler.cc 2012-11-19 16:45:09.165140106 +0900
@@ -142,9 +142,45 @@
}
#endif
+#if defined(OS_CHROMEOS)
+ map<int32, pair<string, string> > usage_map;
+ if (candidates.has_usages()) {
+ const commands::InformationList& usages = candidates.usages();
+ for (size_t i = 0; i < usages.information().size(); ++i) {
+ const commands::Information& information = usages.information(i);
+ if (!information.has_id() || !information.has_description())
+ continue;
+ usage_map[information.id()].first = information.title();
+ usage_map[information.id()].second = information.description();
+ }
+ }
+#endif // OS_CHROMEOS
for (int i = 0; i < candidates.candidate_size(); ++i) {
const commands::Candidates::Candidate &candidate = candidates.candidate(i);
IBusText *text = ibus_text_new_from_string(candidate.value().c_str());
+#if defined(OS_CHROMEOS) && IBUS_CHECK_VERSION(1, 4, 2)
+ if (candidate.has_annotation() &&
+ candidate.annotation().has_description()) {
+ ibus_serializable_set_attachment(
+ IBUS_SERIALIZABLE(text),
+ "annotation",
+ g_variant_new_string(candidate.annotation().description().c_str()));
+ }
+ if (candidate.has_information_id()) {
+ map<int32, pair<string, string> >::iterator it =
+ usage_map.find(candidate.information_id());
+ if (it != usage_map.end()) {
+ ibus_serializable_set_attachment(
+ IBUS_SERIALIZABLE(text),
+ "description_title",
+ g_variant_new_string(it->second.first.c_str()));
+ ibus_serializable_set_attachment(
+ IBUS_SERIALIZABLE(text),
+ "description_body",
+ g_variant_new_string(it->second.second.c_str()));
+ }
+ }
+#endif // OS_CHROMEOS && IBUS_CHECK_VERSION(1, 4, 2)
ibus_lookup_table_append_candidate(table, text);
// |text| is released by ibus_engine_update_lookup_table along with |table|.
@@ -164,6 +200,12 @@
}
#if defined(OS_CHROMEOS) and IBUS_CHECK_VERSION(1, 3, 99)
+ if (candidates.has_category()) {
+ ibus_serializable_set_attachment(
+ IBUS_SERIALIZABLE(table),
+ "show_window_at_composition",
+ g_variant_new_boolean(candidates.category() == commands::SUGGESTION));
+ }
// The function ibus_serializable_set_attachment() had been changed
// to use GVariant in ibus-1.3.99.
// https://github.com/ibus/ibus/commit/ac9dfac13cef34288440a2ecdf067cd827fb2f8f

View File

@ -0,0 +1,139 @@
diff -urN mozc-1.5.1090.102.orig/unix/ibus/ibus_extra_keysyms.h mozc-1.5.1090.102/unix/ibus/ibus_extra_keysyms.h
--- mozc-1.5.1090.102.orig/unix/ibus/ibus_extra_keysyms.h 1970-01-01 09:00:00.000000000 +0900
+++ mozc-1.5.1090.102/unix/ibus/ibus_extra_keysyms.h 2012-12-11 16:32:15.607074442 +0900
@@ -0,0 +1,52 @@
+// Copyright 2010-2012, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+#define MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+
+// for guint
+#include "unix/ibus/ibus_header.h"
+
+#ifdef OS_CHROMEOS
+// Defines key symbols which are not defined on ibuskeysyms.h to handle
+// some keys on ChromeOS.
+const guint IBUS_Back = 0x1008FF26;
+const guint IBUS_Forward = 0x1008FF27;
+const guint IBUS_Reload = 0x1008FF73;
+const guint IBUS_LaunchB = 0x1008FF4B;
+const guint IBUS_LaunchA = 0x1008FF4A;
+const guint IBUS_MonBrightnessDown = 0x1008FF03;
+const guint IBUS_MonBrightnessUp = 0x1008FF02;
+const guint IBUS_AudioMute = 0x1008FF12;
+const guint IBUS_AudioLowerVolume = 0x1008FF11;
+const guint IBUS_AudioRaiseVolume = 0x1008FF13;
+#endif // OS_CHROMEOS
+
+#endif // MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+
diff -urN mozc-1.5.1090.102.orig/unix/ibus/key_translator.cc mozc-1.5.1090.102/unix/ibus/key_translator.cc
--- mozc-1.5.1090.102.orig/unix/ibus/key_translator.cc 2012-12-11 15:59:00.409418570 +0900
+++ mozc-1.5.1090.102/unix/ibus/key_translator.cc 2012-12-11 16:21:17.497854201 +0900
@@ -32,6 +32,7 @@
#include <ibus.h>
#include "base/logging.h"
+#include "unix/ibus/ibus_extra_keysyms.h"
namespace {
@@ -88,6 +89,19 @@
{IBUS_Page_Up, mozc::commands::KeyEvent::PAGE_UP},
{IBUS_Page_Down, mozc::commands::KeyEvent::PAGE_DOWN},
+#ifdef OS_CHROMEOS
+ {IBUS_Back, mozc::commands::KeyEvent::F1},
+ {IBUS_Forward, mozc::commands::KeyEvent::F2},
+ {IBUS_Reload, mozc::commands::KeyEvent::F3},
+ {IBUS_LaunchB, mozc::commands::KeyEvent::F4},
+ {IBUS_LaunchA, mozc::commands::KeyEvent::F5},
+ {IBUS_MonBrightnessDown, mozc::commands::KeyEvent::F6},
+ {IBUS_MonBrightnessUp, mozc::commands::KeyEvent::F7},
+ {IBUS_AudioMute, mozc::commands::KeyEvent::F8},
+ {IBUS_AudioLowerVolume, mozc::commands::KeyEvent::F9},
+ {IBUS_AudioRaiseVolume, mozc::commands::KeyEvent::F10},
+#endif // OS_CHROMEOS
+
// Keypad (10-key).
{IBUS_KP_0, mozc::commands::KeyEvent::NUMPAD0},
{IBUS_KP_1, mozc::commands::KeyEvent::NUMPAD1},
diff -urN mozc-1.5.1090.102.orig/unix/ibus/key_translator_test.cc mozc-1.5.1090.102/unix/ibus/key_translator_test.cc
--- mozc-1.5.1090.102.orig/unix/ibus/key_translator_test.cc 2012-12-11 15:59:00.409418570 +0900
+++ mozc-1.5.1090.102/unix/ibus/key_translator_test.cc 2012-12-11 16:06:14.708927885 +0900
@@ -33,6 +33,7 @@
#include "testing/base/public/gunit.h"
#include "session/commands.pb.h"
#include "unix/ibus/key_translator.h"
+#include "unix/ibus/ibus_extra_keysyms.h"
namespace mozc {
namespace ibus {
@@ -116,6 +117,20 @@
IBUS_Caps_Lock,
IBUS_ISO_Left_Tab,
IBUS_Hangul_Hanja,
+
+
+#ifdef OS_CHROMEOS
+ IBUS_Back,
+ IBUS_Forward,
+ IBUS_Reload,
+ IBUS_LaunchB,
+ IBUS_LaunchA,
+ IBUS_MonBrightnessDown,
+ IBUS_MonBrightnessUp,
+ IBUS_AudioMute,
+ IBUS_AudioLowerVolume,
+ IBUS_AudioRaiseVolume,
+#endif // OS_CHROMEOS
};
const commands::KeyEvent::SpecialKey mapped_special_keys[] = {
@@ -197,6 +212,19 @@
commands::KeyEvent::CAPS_LOCK,
commands::KeyEvent::TAB,
commands::KeyEvent::HANJA,
+
+#ifdef OS_CHROMEOS
+ commands::KeyEvent::F1,
+ commands::KeyEvent::F2,
+ commands::KeyEvent::F3,
+ commands::KeyEvent::F4,
+ commands::KeyEvent::F5,
+ commands::KeyEvent::F6,
+ commands::KeyEvent::F7,
+ commands::KeyEvent::F8,
+ commands::KeyEvent::F9,
+ commands::KeyEvent::F10,
+#endif // OS_CHROMEOS
};
const guint modifier_masks[] = {

View File

@ -0,0 +1,97 @@
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic python toolchain-funcs
DESCRIPTION="The Mozc engine for IBus Framework"
HOMEPAGE="http://code.google.com/p/mozc"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/mozc-${PV}.tar.bz2
internal? ( gs://chromeos-localmirror-private/distfiles/GoogleJapaneseInputFilesForChromeOS-${PV}.tar.bz2 )"
LICENSE="BSD"
IUSE="internal"
# TODO(nona): Remove libcurl dependency.
RDEPEND=">=app-i18n/ibus-1.4.1
dev-libs/openssl
dev-libs/protobuf
internal? (
net-misc/curl
)"
DEPEND="${RDEPEND}"
SLOT="0"
KEYWORDS="amd64 x86 arm"
BUILDTYPE="${BUILDTYPE:-Release}"
RESTRICT="mirror"
src_configure() {
if use internal; then
BRANDING="${BRANDING:-GoogleJapaneseInput}"
SIZE_LIMIT=20000000
else
BRANDING="${BRANDING:-Mozc}"
SIZE_LIMIT=25000000
fi
cd "mozc-${PV}" || die
# Generate make files
export GYP_DEFINES="chromeos=1 use_libzinnia=0"
export BUILD_COMMAND="emake"
$(PYTHON) build_mozc.py gyp --gypdir="third_party/gyp" \
--target_platform="ChromeOS" \
--use_libprotobuf \
--branding="${BRANDING}" || die
}
src_prepare() {
if use internal; then
einfo "Building Google Japanese Input for ChromeOS"
rm -fr "mozc-${PV}/data/dictionary" || die
rm -fr "mozc-${PV}/dictionary" || die
rm -f "mozc-${PV}/mozc_version_template.txt" || die
mv "data/dictionary" "mozc-${PV}/data/" || die
mv "dictionary" "mozc-${PV}/" || die
mv "mozc_version_template.txt" "mozc-${PV}/" || die
# Reduce a binary size.
# TODO(hsumita): Remove this patch when it becomes a default behavior of
# Mozc for ChromeOS.
rm -f "mozc-${PV}/converter/converter_base.gyp" || die
mv "converter/converter_base.gyp" "mozc-${PV}/converter/" || die
else
einfo "Building Mozc for ChromiumOS"
fi
# Remove the patch when new mozc is released.
epatch "${FILESDIR}"/${P}-attachment-cleanup.patch || die
epatch "${FILESDIR}"/${P}-handle-extra-keysyms.patch || die
}
src_compile() {
cd "mozc-${PV}" || die
# Create build tools for the host platform.
CFLAGS="" CXXFLAGS="" $(PYTHON) build_mozc.py build_tools -c ${BUILDTYPE} \
|| die
# Build artifacts for the target platform.
tc-export CXX CC AR AS RANLIB LD
$(PYTHON) build_mozc.py build unix/ibus/ibus.gyp:ibus_mozc -c ${BUILDTYPE} \
|| die
}
src_install() {
cd "mozc-${PV}" || die
exeinto /usr/libexec || die
newexe "out_linux/${BUILDTYPE}/ibus_mozc" ibus-engine-mozc || die
insinto /usr/share/ibus/component || die
doins out_linux/${BUILDTYPE}/obj/gen/unix/ibus/mozc.xml || die
cp "out_linux/${BUILDTYPE}/ibus_mozc" "${T}" || die
$(tc-getSTRIP) --strip-unneeded "${T}"/ibus_mozc || die
# Check the binary size to detect binary size bloat (which happend once due
# typos in .gyp files).
test `stat -c %s "${T}"/ibus_mozc` -lt ${SIZE_LIMIT} \
|| die "The binary size of mozc for Japanese is too big (more than ~${SIZE_LIMIT})"
rm -f "${T}"/ibus_mozc
}

View File

@ -0,0 +1,42 @@
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
inherit eutils flag-o-matic
DESCRIPTION="Zinnia hand-writing engine"
HOMEPAGE="http://github.com/yusukes/ibus-zinnia"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/${P}.tar.gz"
#RESTRICT="mirror"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm x86"
RDEPEND=">=app-i18n/ibus-1.3.99
app-i18n/zinnia
app-i18n/tegaki-zinnia-japanese-light
app-i18n/tegaki-zinnia-simplified-chinese-light
app-i18n/tegaki-zinnia-traditional-chinese-light"
DEPEND="${RDEPEND}
dev-util/pkgconfig
>=sys-devel/gettext-0.16.1"
# Tarballs in github.com use a special directory naming rule:
# "<github_user_name>-<project_name>-<last_commit_in_the_tarball>"
SRC_DIR="yusukes-ibus-zinnia-910d66d"
src_configure() {
cd "${SRC_DIR}" || die
append-cflags -Wall -Werror
NOCONFIGURE=1 ./autogen.sh || die
econf || die
}
src_install() {
cd "${SRC_DIR}" || die
emake DESTDIR="${D}" install || die
dodoc AUTHORS ChangeLog NEWS README
}

View File

@ -0,0 +1 @@
DIST ibus-1.4.0.tar.gz 1452055 RMD160 0583a9690ee5a7bb44ce1cebc189c3a644501ca3 SHA1 c46ea0be728ffd4e431d4a18c6bd1e51ceaf045e SHA256 9e5a17d910eae932dd0cd185d0a102b56ad4a2bf79d54b1e53f70174cd2c2a3f

View File

@ -0,0 +1,326 @@
diff -ur ibus-1.4.99.20120314.orig/conf/memconf/config.c ibus-1.4.99.20120314/conf/memconf/config.c
--- ibus-1.4.99.20120314.orig/conf/memconf/config.c 2012-02-27 06:37:21.000000000 +0900
+++ ibus-1.4.99.20120314/conf/memconf/config.c 2012-04-02 15:05:20.300663070 +0900
@@ -29,6 +29,8 @@
struct _IBusConfigMemconf {
IBusConfigService parent;
GHashTable *values;
+ GHashTable *unread;
+ GHashTable *unwritten;
};
struct _IBusConfigMemconfClass {
@@ -55,6 +57,10 @@
const gchar *section,
const gchar *name,
GError **error);
+static gboolean ibus_config_memconf_get_unused (IBusConfigService *config,
+ GVariant **unread,
+ GVariant **unwritten,
+ GError **error);
G_DEFINE_TYPE (IBusConfigMemconf, ibus_config_memconf, IBUS_TYPE_CONFIG_SERVICE)
@@ -68,6 +74,7 @@
IBUS_CONFIG_SERVICE_CLASS (object_class)->get_value = ibus_config_memconf_get_value;
IBUS_CONFIG_SERVICE_CLASS (object_class)->get_values = ibus_config_memconf_get_values;
IBUS_CONFIG_SERVICE_CLASS (object_class)->unset_value = ibus_config_memconf_unset_value;
+ IBUS_CONFIG_SERVICE_CLASS (object_class)->get_unused = ibus_config_memconf_get_unused;
}
static void
@@ -75,14 +82,25 @@
{
config->values = g_hash_table_new_full (g_str_hash,
g_str_equal,
- (GDestroyNotify)g_free,
- (GDestroyNotify)g_variant_unref);
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) g_variant_unref);
+ config->unread = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) NULL);
+ config->unwritten
+ = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) NULL);
}
static void
ibus_config_memconf_destroy (IBusConfigMemconf *config)
{
g_hash_table_destroy (config->values);
+ g_hash_table_destroy (config->unread);
+ g_hash_table_destroy (config->unwritten);
IBUS_OBJECT_CLASS (ibus_config_memconf_parent_class)->destroy ((IBusObject *)config);
}
@@ -101,6 +119,12 @@
gchar *key = g_strdup_printf ("%s:%s", section, name);
+ if (g_hash_table_lookup (
+ IBUS_CONFIG_MEMCONF (config)->values, key) == NULL) {
+ g_hash_table_insert (IBUS_CONFIG_MEMCONF (config)->unread,
+ g_strdup (key), NULL);
+ }
+
g_hash_table_insert (IBUS_CONFIG_MEMCONF (config)->values,
key, g_variant_ref_sink (value));
@@ -121,16 +145,21 @@
g_assert (error == NULL || *error == NULL);
gchar *key = g_strdup_printf ("%s:%s", section, name);
+
GVariant *value = (GVariant *)g_hash_table_lookup (IBUS_CONFIG_MEMCONF (config)->values, key);
- g_free (key);
- if (value != NULL) {
+ if (value == NULL) {
+ g_hash_table_insert (IBUS_CONFIG_MEMCONF (config)->unwritten,
+ g_strdup (key), NULL);
+ if (error != NULL) {
+ *error = g_error_new (G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "Config value [%s:%s] does not exist.", section, name);
+ }
+ } else {
+ g_hash_table_remove (IBUS_CONFIG_MEMCONF (config)->unread, key);
g_variant_ref (value);
}
- else if (error != NULL) {
- *error = g_error_new (G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
- "Config value [%s:%s] does not exist.", section, name);
- }
+ g_free (key);
return value;
}
@@ -173,13 +202,13 @@
gchar *key = g_strdup_printf ("%s:%s", section, name);
gboolean retval = g_hash_table_remove (IBUS_CONFIG_MEMCONF (config)->values, key);
- g_free (key);
if (retval) {
ibus_config_service_value_changed (config,
section,
name,
g_variant_new_tuple (NULL, 0));
+ g_hash_table_remove (IBUS_CONFIG_MEMCONF (config)->unread, key);
}
else {
if (error && *error) {
@@ -187,9 +216,39 @@
"Config value [%s:%s] does not exist.", section, name);
}
}
+ g_free (key);
return retval;
}
+static gboolean
+ibus_config_memconf_get_unused (IBusConfigService *config,
+ GVariant **unread,
+ GVariant **unwritten,
+ GError **error)
+{
+ GVariantBuilder builder;
+ GList *keys, *p;
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
+ keys = g_hash_table_get_keys (IBUS_CONFIG_MEMCONF (config)->unread);
+ for (p = keys; p != NULL; p = p->next) {
+ g_variant_builder_add (&builder, "s", (const gchar *)p->data);
+ }
+ g_list_free (keys);
+ *unread = g_variant_builder_end (&builder);
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
+ keys = g_hash_table_get_keys (IBUS_CONFIG_MEMCONF (config)->unwritten);
+ for (p = keys; p != NULL; p = p->next) {
+ g_variant_builder_add (&builder, "s", (const gchar *)p->data);
+ }
+ g_list_free (keys);
+
+ *unwritten = g_variant_builder_end (&builder);
+
+ return TRUE;
+}
+
IBusConfigMemconf *
ibus_config_memconf_new (GDBusConnection *connection)
{
diff -ur ibus-1.4.99.20120314.orig/src/ibusconfig.c ibus-1.4.99.20120314/src/ibusconfig.c
--- ibus-1.4.99.20120314.orig/src/ibusconfig.c 2012-03-07 14:39:58.000000000 +0900
+++ ibus-1.4.99.20120314/src/ibusconfig.c 2012-04-02 15:03:18.361126672 +0900
@@ -720,3 +720,37 @@
async_initable_iface->init_async = async_initable_init_async;
async_initable_iface->init_finish = async_initable_init_finish;
}
+
+gboolean
+ibus_config_get_unused (IBusConfig *config,
+ GVariant **unread,
+ GVariant **unwritten)
+{
+ g_assert (IBUS_IS_CONFIG (config));
+ g_assert (unread != NULL && *unread == NULL);
+ g_assert (unwritten != NULL && *unwritten == NULL);
+
+ GError *error = NULL;
+ GVariant *result;
+
+ result = g_dbus_proxy_call_sync ((GDBusProxy *) config,
+ "GetUnused", /* method_name */
+ NULL, /* parameters */
+ G_DBUS_CALL_FLAGS_NONE, /* flags */
+ -1, /* timeout */
+ NULL, /* cancellable */
+ &error /* error */
+ );
+ if (result == NULL) {
+ g_warning ("%s.GetUnused: %s", IBUS_INTERFACE_CONFIG, error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
+ *unread = g_variant_get_child_value (result, 0);
+ *unwritten = g_variant_get_child_value (result, 1);
+
+ g_variant_unref (result);
+
+ return TRUE;
+}
Only in ibus-1.4.99.20120314/src: ibusconfig.c.orig
diff -ur ibus-1.4.99.20120314.orig/src/ibusconfig.h ibus-1.4.99.20120314/src/ibusconfig.h
--- ibus-1.4.99.20120314.orig/src/ibusconfig.h 2012-03-07 14:39:58.000000000 +0900
+++ ibus-1.4.99.20120314/src/ibusconfig.h 2012-04-02 15:03:18.361126672 +0900
@@ -347,6 +347,19 @@
/* FIXME add an asynchronous version of unwatch */
+/**
+ * ibus_config_get_unused:
+ * @config: An IBusConfig
+ * @unread: GVariant that holds a list of values that have been written but not
+ * read.
+ * @unwritten: GVariant that holds a list of values that have been read but not
+ * written.
+ * @returns: TRUE if succeed; FALSE otherwise.
+ *
+ * Get the list of values that haven't been used properly.
+ */
+gboolean ibus_config_get_unused (IBusConfig *config,
+ GVariant **unread,
+ GVariant **unwritten);
G_END_DECLS
#endif
-
Only in ibus-1.4.99.20120314/src: ibusconfig.h.orig
diff -ur ibus-1.4.99.20120314.orig/src/ibusconfigservice.c ibus-1.4.99.20120314/src/ibusconfigservice.c
--- ibus-1.4.99.20120314.orig/src/ibusconfigservice.c 2012-03-07 14:41:10.000000000 +0900
+++ ibus-1.4.99.20120314/src/ibusconfigservice.c 2012-04-02 15:03:18.361126672 +0900
@@ -76,6 +76,10 @@
const gchar *section,
const gchar *name,
GError **error);
+static gboolean ibus_config_service_get_unused (IBusConfigService *config,
+ GVariant **unread,
+ GVariant **unwritten,
+ GError **error);
G_DEFINE_TYPE (IBusConfigService, ibus_config_service, IBUS_TYPE_SERVICE)
@@ -105,6 +109,10 @@
" <arg type='s' name='name' />"
" <arg type='v' name='value' />"
" </signal>"
+ " <method name='GetUnused'>"
+ " <arg direction='out' type='as' name='unread' />"
+ " <arg direction='out' type='as' name='unwritten' />"
+ " </method>"
" </interface>"
"</node>";
@@ -125,6 +133,7 @@
class->get_value = ibus_config_service_get_value;
class->get_values = ibus_config_service_get_values;
class->unset_value = ibus_config_service_unset_value;
+ class->get_unused = ibus_config_service_get_unused;
}
static void
@@ -242,6 +251,25 @@
return;
}
+ if (g_strcmp0 (method_name, "GetUnused") == 0) {
+ GVariant *unread = NULL;
+ GVariant *unwritten = NULL;
+ gboolean retval;
+ GError *error = NULL;
+
+ retval = IBUS_CONFIG_SERVICE_GET_CLASS (config)->get_unused (
+ config, &unread, &unwritten, &error);
+ if (retval) {
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@as@as)", unread, unwritten));
+ }
+ else {
+ g_dbus_method_invocation_return_gerror (invocation, error);
+ g_error_free (error);
+ }
+ return;
+ }
+
/* should not be reached */
g_return_if_reached ();
}
@@ -352,6 +380,19 @@
return IBUS_CONFIG_SERVICE (object);
}
+static gboolean
+ibus_config_service_get_unused (IBusConfigService *config,
+ GVariant **unread,
+ GVariant **unwritten,
+ GError **error)
+{
+ if (error) {
+ *error = g_error_new (G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "Not implemented");
+ }
+ return FALSE;
+}
+
void
ibus_config_service_value_changed (IBusConfigService *config,
const gchar *section,
Only in ibus-1.4.99.20120314/src: ibusconfigservice.c.orig
diff -ur ibus-1.4.99.20120314.orig/src/ibusconfigservice.h ibus-1.4.99.20120314/src/ibusconfigservice.h
--- ibus-1.4.99.20120314.orig/src/ibusconfigservice.h 2011-08-11 09:49:43.000000000 +0900
+++ ibus-1.4.99.20120314/src/ibusconfigservice.h 2012-04-02 15:03:18.361126672 +0900
@@ -203,10 +203,14 @@
GVariant * (* get_values) (IBusConfigService *config,
const gchar *section,
GError **error);
+ gboolean (* get_unused) (IBusConfigService *config,
+ GVariant **unread,
+ GVariant **unwritten,
+ GError **error);
/*< private >*/
/* padding */
- gpointer pdummy[12];
+ gpointer pdummy[11];
};
GType ibus_config_service_get_type (void);
@@ -238,4 +242,3 @@
G_END_DECLS
#endif
-

View File

@ -0,0 +1,14 @@
diff -ur ibus-1.4.99.20120314.orig/bus/inputcontext.c ibus-1.4.99.20120314/bus/inputcontext.c
--- ibus-1.4.99.20120314.orig/bus/inputcontext.c 2012-02-27 06:37:21.000000000 +0900
+++ ibus-1.4.99.20120314/bus/inputcontext.c 2012-04-02 15:24:41.936207367 +0900
@@ -1130,7 +1130,9 @@
bus_input_context_clear_preedit_text (context);
bus_input_context_update_auxiliary_text (context, text_empty, FALSE);
bus_input_context_update_lookup_table (context, lookup_table_empty, FALSE);
- bus_input_context_register_properties (context, props_empty);
+
+ // Workaround for http://crosbug.com/7702
+ // bus_input_context_register_properties (context, props_empty);
if (context->engine) {
bus_engine_proxy_focus_out (context->engine);

View File

@ -0,0 +1,12 @@
diff -ur ibus-1.4.99.20120314.orig/bus/Makefile.am ibus-1.4.99.20120314/bus/Makefile.am
--- ibus-1.4.99.20120314.orig/bus/Makefile.am 2012-03-07 14:39:58.000000000 +0900
+++ ibus-1.4.99.20120314/bus/Makefile.am 2012-04-02 15:37:33.273439550 +0900
@@ -112,8 +112,6 @@
if ENABLE_TESTS
TESTS = \
test-matchrule \
- test-registry \
- test-stress \
$(NULL)
endif

View File

@ -0,0 +1,13 @@
diff -ur ibus-1.4.99.20120314.orig/bus/panelproxy.c ibus-1.4.99.20120314/bus/panelproxy.c
--- ibus-1.4.99.20120314.orig/bus/panelproxy.c 2012-02-27 06:37:21.000000000 +0900
+++ ibus-1.4.99.20120314/bus/panelproxy.c 2012-04-02 15:36:12.633725645 +0900
@@ -481,7 +481,7 @@
g_return_if_fail (panel->focused_context == context);
- bus_panel_proxy_set_cursor_location (panel, x, y, w, h);
+ // bus_panel_proxy_set_cursor_location (panel, x, y, w, h);
}
static void
Only in ibus-1.4.99.20120314/bus: panelproxy.c.orig

View File

@ -0,0 +1,11 @@
diff -urN ibus-1.4.99.20120314.orig/src/ibusserializable.c ibus-1.4.99.20120314/src/ibusserializable.c
--- ibus-1.4.99.20120314.orig/src/ibusserializable.c 2012-11-02 16:48:00.508766644 +0900
+++ ibus-1.4.99.20120314/src/ibusserializable.c 2012-11-02 16:52:34.632899493 +0900
@@ -161,7 +161,6 @@
key,
attachment);
g_variant_unref (attachment);
- g_variant_unref (value);
}
g_variant_iter_free (iter);
return 2;

View File

@ -0,0 +1,15 @@
Index: bus/inputcontext.c
diff --git a/bus/inputcontext.c b/bus/inputcontext.c
index 49c4a2694243f20e73929741ae25f7101b94dbc7..ec97e5499844b57d7f2cb63d039dda9d45a1a0ec 100644
--- a/bus/inputcontext.c
+++ b/bus/inputcontext.c
@@ -2015,6 +2015,9 @@ bus_input_context_unset_engine (BusInputContext *context)
g_signal_handlers_disconnect_by_func (context->engine,
engine_signals[i].callback, context);
}
+ /* focus out to let engine register properties when enabled
+ next time. */
+ bus_engine_proxy_focus_out (context->engine);
g_object_unref (context->engine);
context->engine = NULL;
}

View File

@ -0,0 +1,125 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# How to run the test manually:
# (chroot)$ ./cros_run_unit_tests --packages ibus
# or
# (chroot)$ env FEATURES="test" emerge-$BOARD -a ibus
EAPI="2"
inherit eutils flag-o-matic toolchain-funcs multilib python libtool
DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
HOMEPAGE="http://code.google.com/p/ibus/"
SRC_URI="mirror://gentoo/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE=""
#RESTRICT="mirror"
RDEPEND=">=dev-libs/glib-2.26
x11-libs/libX11"
DEPEND="${RDEPEND}
dev-util/pkgconfig"
src_prepare() {
epatch "${FILESDIR}"/${P}-0003-Add-api-to-ibus-for-retreiving-unused-config-values.patch
epatch "${FILESDIR}"/${P}-0004-Remove-bus_input_context_register_properties-props_e.patch
# TODO(yusukes): Remove this when ibus is upgraded to >= 20120315.
epatch "${FILESDIR}"/${P}-fix-engine-destroy-cb-69902696928e6acb953ab30b1f70e462b5994272.patch
# TODO(nona): Remove the patch when we fix crosbug.com/25335#c1
epatch "${FILESDIR}"/${P}-do-not-send-cursor-location-to-chrome.patch
# TODO(penghuang): Remove the patch when we fix ibus issue 1438.
epatch "${FILESDIR}"/${P}-disable-ibus-daemon-tests.patch
# TODO(nona): Remove the patch when the next ibus update cycle.
epatch "${FILESDIR}"/${P}-fix-double-free.patch
elibtoolize
}
src_configure() {
# TODO(yusukes): Add -Werror back when IBus issue 1437 is fixed.
# append-cflags -Wall -Werror
append-cflags -Wall
# TODO(petkov): Ideally, configure should support --disable-isocodes but
# it seems that the current version doesn't, so use the environment
# variables instead to remove the dependence on iso-codes.
econf \
--enable-surrounding-text \
--disable-gtk2 \
--disable-gtk3 \
--disable-dconf \
--disable-gconf \
--enable-memconf \
--disable-xim \
--disable-key-snooper \
--disable-vala \
--enable-introspection=no \
--disable-gtk-doc \
--disable-nls \
--disable-python-library \
--disable-setup \
CPPFLAGS='-DOS_CHROMEOS=1' \
ISOCODES_CFLAGS=' ' ISOCODES_LIBS=' '
}
test_fail() {
kill $IBUS_DAEMON_PID
rm -rf "${T}"/.ibus-test-socket-*
die
}
src_test() {
# Start ibus-daemon background.
export IBUS_ADDRESS_FILE="`mktemp -d ${T}/.ibus-test-socket-XXXXXXXXXX`/ibus-socket-file"
./bus/ibus-daemon --replace --panel=disable &
IBUS_DAEMON_PID=$!
# Wait for the daemon to start.
if [ ! -f ${IBUS_ADDRESS_FILE} ] ; then
sleep .5
fi
# Run tests.
./src/tests/ibus-bus || test_fail
# TODO(yusukes): Fix 'ERROR:ibus-inputcontext.c:101:test_input_context'
# and reenable the test.
# ./src/tests/ibus-inputcontext || test_fail
./src/tests/ibus-inputcontext-create || test_fail
./src/tests/ibus-configservice || test_fail
./src/tests/ibus-factory || test_fail
./src/tests/ibus-keynames || test_fail
./src/tests/ibus-serializable || test_fail
# Cleanup.
kill $IBUS_DAEMON_PID
rm -rf "${T}"/.ibus-test-socket-*
}
src_install() {
emake DESTDIR="${D}" install || die
if [ -f "${D}/usr/share/ibus/component/gtkpanel.xml" ] ; then
rm "${D}/usr/share/ibus/component/gtkpanel.xml" || die
fi
# Remove unnecessary files
rm -rf "${D}/usr/share/ibus/keymaps" || die
rm -rf "${D}/usr/share/icons" || die
# TODO(yusukes): The latest ibus has --disable-engine option.
rm "${D}/usr/share/ibus/component/simple.xml" || die
rm "${D}/usr/libexec/ibus-engine-simple" || die
rm "${D}/usr/share/applications/ibus.desktop" || die
rm "${D}/etc/bash_completion.d/ibus.bash" || die
rm -rf "${D}/usr/lib/gtk-2.0/2.10.0/immodules/" || die
dodoc AUTHORS ChangeLog NEWS README
}

View File

@ -0,0 +1 @@
DIST libhangul-0.0.10.tar.gz 2828525 RMD160 88c03fbbf954addb8c534491a9e3cfd0fdc373dc SHA1 3fdbb1b4ea2f5f12bd3c6760bb2ad609e2eebbaa SHA256 af0722012632ab2afc2016aa6643bd6979e140facc56a911a5a45f97fe61d4c5

View File

@ -0,0 +1,20 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/libhangul/libhangul-0.0.10.ebuild,v
# 1.1 2009/11/05 23:14:11 matsuu Exp $
DESCRIPTION="libhangul is a generalized and portable library for processing
hangul."
HOMEPAGE="http://kldp.net/projects/hangul/"
SRC_URI="mirror://gentoo/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~x86"
IUSE=""
src_install() {
emake DESTDIR="${D}" install || die "emake install failed"
dodoc AUTHORS ChangeLog NEWS README
}

View File

@ -0,0 +1,19 @@
# Copyright 1999-2010 Gentoo Foundation
EAPI="3"
DESCRIPTION="Zinnia learning data for Japanese"
HOMEPAGE="http://tegaki.org/"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/${P}.zip"
LICENSE="LGPL"
SLOT="0"
KEYWORDS="amd64 x86 arm"
RDEPEND="app-i18n/zinnia"
src_install() {
mkdir -p "${D}/usr/share/tegaki/models/zinnia" || die
install handwriting-ja.meta handwriting-ja.model \
"${D}/usr/share/tegaki/models/zinnia/" || die
}

View File

@ -0,0 +1,19 @@
# Copyright 1999-2011 Gentoo Foundation
EAPI="3"
DESCRIPTION="Zinnia learning data for simplified Chinese"
HOMEPAGE="http://tegaki.org/"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/${P}.zip"
LICENSE="LGPL"
SLOT="0"
KEYWORDS="amd64 x86 arm"
RDEPEND="app-i18n/zinnia"
src_install() {
mkdir -p "${D}/usr/share/tegaki/models/zinnia" || die
install handwriting-zh_CN.meta handwriting-zh_CN.model \
"${D}/usr/share/tegaki/models/zinnia/" || die
}

View File

@ -0,0 +1,19 @@
# Copyright 1999-2011 Gentoo Foundation
EAPI="3"
DESCRIPTION="Zinnia learning data for traditional Chinese"
HOMEPAGE="http://tegaki.org/"
SRC_URI="http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/${P}.zip"
LICENSE="LGPL"
SLOT="0"
KEYWORDS="amd64 x86 arm"
RDEPEND="app-i18n/zinnia"
src_install() {
mkdir -p "${D}/usr/share/tegaki/models/zinnia" || die
install handwriting-zh_TW.meta handwriting-zh_TW.model \
"${D}/usr/share/tegaki/models/zinnia/" || die
}

View File

@ -0,0 +1,60 @@
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/conf.d/ac97-powersave.conf laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/ac97-powersave.conf
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/ac97-powersave.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/ac97-powersave.conf
@@ -18,7 +18,7 @@
###############################################################################
# Control AC97 audio chipset power?
-CONTROL_AC97_POWER="auto"
+CONTROL_AC97_POWER=1
# Enable debug mode for this module
# Set to 1 if you want to debug this module
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-hda-powersave.conf laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/intel-hda-powersave.conf
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-hda-powersave.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/intel-hda-powersave.conf
@@ -20,7 +20,7 @@
# Control INTEL HDA audio chipset power?
# Set to 0 to disable
-CONTROL_INTEL_HDA_POWER="auto"
+CONTROL_INTEL_HDA_POWER=1
# Handle power savings for Intel HDA under specific circumstances
BATT_INTEL_HDA_POWERSAVE=1
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf
@@ -20,7 +20,7 @@
# Control Intel SATA chipset power management?
# Set to 0 to disable
-CONTROL_INTEL_SATA_POWER="auto"
+CONTROL_INTEL_SATA_POWER=1
# Handle power management of the Intel SATA deivce under specific circumstances
BATT_ACTIVATE_SATA_POWER=1
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/usb-autosuspend.conf
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/conf.d/usb-autosuspend.conf
@@ -24,7 +24,7 @@
# Enable USB autosuspend feature?
# Set to 0 to disable
-CONTROL_USB_AUTOSUSPEND="auto"
+CONTROL_USB_AUTOSUSPEND=1
# The list of USB IDs that should not use autosuspend. Use lsusb to find out the
# IDs of your USB devices.
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
--- laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
@@ -283,7 +283,7 @@
# Should laptop mode tools control the hard drive power management settings?
#
# Set to 0 to disable
-CONTROL_HD_POWERMGMT="auto"
+CONTROL_HD_POWERMGMT=1
#

View File

@ -0,0 +1,66 @@
From 349963dc68cebf8d2e60d0f9ece6e95573366a59 Mon Sep 17 00:00:00 2001
From: Sameer Nanda <snanda@chromium.org>
Date: Tue, 16 Feb 2010 16:24:26 -0800
Subject: [PATCH 4/8] Add config knob to control syslog facility
Modified for 1.57
Signed-off-by: Sameer <snanda@chromium.org>
Signed-off-by: Simon Que <sque@chromium.org>
Change-Id: I9192a41ea84ed957fcd2ebb7e03e2defb16412ac
---
.../etc/laptop-mode/laptop-mode.conf | 2 ++
laptop-mode-tools-1.59/usr/sbin/laptop_mode | 13 +++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
index e0a6e06..47a2381 100644
--- laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
@@ -60,6 +60,8 @@ VERBOSE_OUTPUT=0
# Set this to 1 if you want to log messages to syslog
LOG_TO_SYSLOG=1
+# syslog facility passed to logger -t when LOG_TO_SYSLOG is 1
+SYSLOG_FACILITY=daemon
# Run in shell debug mode
# Enable this if you would like to execute the entire laptop-mode-tools program
diff -ruN laptop-mode-tools-1.59/usr/sbin/laptop_mode laptop-mode-tools-1.59.new/usr/sbin/laptop_mode
index 2827569..8acbc68 100644
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59.new/usr/sbin/laptop_mode
@@ -127,6 +127,7 @@ BATT_BRIGHTNESS_COMMAND=false
LM_AC_BRIGHTNESS_COMMAND=false
NOLM_AC_BRIGHTNESS_COMMAND=false
LOG_TO_SYSLOG=1
+SYSLOG_FACILITY=daemon
DEBUG=0
ENABLE_LAPTOP_MODE_TOOLS=1
@@ -160,15 +161,15 @@ if [ x$LOG_TO_SYSLOG = x1 ]; then
# continue
#elif [ "$1" = "MSG" ]; then
if [ "$1" = "MSG" ]; then
- logger -p daemon.info -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.info -t laptop-mode "$2";
elif [ "$1" = "ERR" ]; then
- logger -p daemon.err -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.err -t laptop-mode "$2";
elif [ "$1" = "VERBOSE" ]; then
- if [ x$VERBOSE_OUTPUT = x1 ]; then
- logger -p daemon.debug -t laptop-mode "$2";
- fi
+ if [ x$VERBOSE_OUTPUT = x1 ]; then
+ logger -p $SYSLOG_FACILITY.debug -t laptop-mode "$2";
+ fi
else
- logger -p daemon.notice -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.notice -t laptop-mode "$2";
fi
fi
fi
--
1.7.2.3

View File

@ -0,0 +1,75 @@
From 7c518a4bc8102c179a6a6775aca48d0fe78c5ca4 Mon Sep 17 00:00:00 2001
From: Sameer Nanda <snanda@chromium.org>
Date: Thu, 22 Apr 2010 17:16:47 -0700
Subject: [PATCH 5/8] Added WiFi power management support. Saves 0.3-0.8W at idle.
Review URL: http://codereview.chromium.org/1769003
---
.../etc/laptop-mode/conf.d/wifi-powermgmt.conf | 23 +++++++++++++++++++
.../share/laptop-mode-tools/modules/wifi-powermgmt | 24 ++++++++++++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
create mode 100644 laptop-mode-tools-1.59/etc/laptop-mode/conf.d/wifi-powermgmt.conf
create mode 100755 laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt
diff -ruN /dev/null laptop-mode-tools-1.59/etc/laptop-mode/conf.d/wifi-powermgmt.conf
new file mode 100644
index 0000000..6ec4fec
--- /dev/null
+++ laptop-mode-tools-1.59/etc/laptop-mode/conf.d/wifi-powermgmt.conf
@@ -0,0 +1,23 @@
+#
+# Configuration file for Laptop Mode Tools module wifi-powermgmt.
+#
+# For more information, consult the laptop-mode.conf(8) manual page.
+#
+
+
+###############################################################################
+# WiFi power management settings
+# ------------------------------------
+#
+# If you enable this setting, laptop mode tools will automatically enable the
+# power management for all WiFi devices in the system
+#
+###############################################################################
+
+# Enable debug mode for this module
+# Set to 1 if you want to debug this module
+DEBUG=0
+
+# Control WiFi power management?
+CONTROL_WIFI_POWER=1
+
diff -ruN /dev/null laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt
new file mode 100755
index 0000000..2efb1a6
--- /dev/null
+++ laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt
@@ -0,0 +1,24 @@
+IWCONFIG=iwconfig
+
+if [ x$CONTROL_WIFI_POWER = x1 ] ; then
+ if [ $ON_AC -eq 1 ] ; then
+ power_mgmt="off"
+ else
+ power_mgmt="on"
+ fi
+
+ for DEVICE in /sys/class/net/* ; do
+ if [ -d $DEVICE/wireless ]; then
+ dev=`basename $DEVICE`
+ $IWCONFIG $dev power $power_mgmt
+ ret=$?
+ if [ "$ret" = "0" ]; then
+ log "VERBOSE" "Power Management set to $power_mgmt for $dev."
+ else
+ log "VERBOSE" "Failed to set Power Management to $power_mgmt for $dev."
+ fi
+ fi
+ done
+else
+ log "VERBOSE" "WiFi power setting is disabled."
+fi
--
1.7.2.3

View File

@ -0,0 +1,89 @@
From 3059bdb03918a5acf239a245f5d78f45253ebf94 Mon Sep 17 00:00:00 2001
From: Sam Leffler <sleffler@chromium.org>
Date: Wed, 10 Nov 2010 10:20:56 -0800
Subject: [PATCH 7/8] laptop-mode-tools: switch wifi support to be nl80211-only
We support only nl80211 WiFi devices; no more WEXT support:
- remove old script that used iwconfig
- add new module script that uses iw to ena/dis power save
Note this also fixes wifi power save operation for nl80211 devices as the iwconfig code never worked right due to it checking the wrong file under /sys. This means we should now have lower latency on AC because we'll turn off power save.
BUG=7138
TEST=gmerge to device; suspend+resume and check power save state of wlan0; also run sh -x laptop_mode auto force and verify the right things are happenig for wifi devices
Review URL: http://codereview.chromium.org/4675003
Change-Id: Ifac0b67c7eb6663fb911be267711c44e6e8538b0
---
.../modules/wifi-nl80211-powermgmt | 26 ++++++++++++++++++++
.../share/laptop-mode-tools/modules/wifi-powermgmt | 24 ------------------
2 files changed, 26 insertions(+), 24 deletions(-)
create mode 100755 laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-nl80211-powermgmt
delete mode 100755 laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt
diff -ruN /dev/null laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-nl80211-powermgmt
new file mode 100755
index 0000000..934d080
--- /dev/null
+++ laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-nl80211-powermgmt
@@ -0,0 +1,26 @@
+IW=/usr/sbin/iw
+
+if [ ! -x $IW ]; then
+ log "VERBOSE" "No $IW program, WiFi power setting is disabled."
+elif [ x$CONTROL_WIFI_POWER = x1 ] ; then
+ if [ $ON_AC -eq 1 ] ; then
+ power_mgmt="off"
+ else
+ power_mgmt="on"
+ fi
+
+ for DEVICE in /sys/class/net/* ; do
+ if [ -d $DEVICE/phy80211 ]; then
+ dev=`basename $DEVICE`
+ $IW $dev set power_save $power_mgmt
+ ret=$?
+ if [ "$ret" = "0" ]; then
+ log "VERBOSE" "Power Management set to $power_mgmt for $dev."
+ else
+ log "VERBOSE" "Failed to set Power Management to $power_mgmt for $dev."
+ fi
+ fi
+ done
+else
+ log "VERBOSE" "WiFi power setting is disabled."
+fi
diff -ruN laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt /dev/null
deleted file mode 100755
index 2efb1a6..0000000
--- laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wifi-powermgmt
+++ /dev/null
@@ -1,24 +0,0 @@
-IWCONFIG=iwconfig
-
-if [ x$CONTROL_WIFI_POWER = x1 ] ; then
- if [ $ON_AC -eq 1 ] ; then
- power_mgmt="off"
- else
- power_mgmt="on"
- fi
-
- for DEVICE in /sys/class/net/* ; do
- if [ -d $DEVICE/wireless ]; then
- dev=`basename $DEVICE`
- $IWCONFIG $dev power $power_mgmt
- ret=$?
- if [ "$ret" = "0" ]; then
- log "VERBOSE" "Power Management set to $power_mgmt for $dev."
- else
- log "VERBOSE" "Failed to set Power Management to $power_mgmt for $dev."
- fi
- fi
- done
-else
- log "VERBOSE" "WiFi power setting is disabled."
-fi
--
1.7.2.3

View File

@ -0,0 +1,36 @@
From 88698f32444ee88ce66e40cf54b8ac3563342723 Mon Sep 17 00:00:00 2001
From: Sameer Nanda <snanda@chromium.org>
Date: Mon, 15 Nov 2010 13:38:40 -0800
Subject: [PATCH 8/8] Lowering hard drive idle timeout to 5 seconds from 20 seconds.
This change saves about 200mW of power on SSDs.
Change-Id: I7a7dfdbd7e264386d21da673b1906460ecf1c307
BUG= chromium-os:9180
TEST= ran vmstat & hdparm to see when the last read/write to the disk
happened and when the drive transitioned to standby state. With this
change in place, on battery the hard drive transitioned to standby
state 5 seconds after the last read/write.
Review URL: http://codereview.chromium.org/5032002
---
.../etc/laptop-mode/laptop-mode.conf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
index 47a2381..5dc4b38 100644
--- laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
+++ laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
@@ -273,7 +273,7 @@ CONTROL_HD_IDLE_TIMEOUT=1
# for battery and for AC with laptop mode on.
#
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
-LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
+LM_BATT_HD_IDLE_TIMEOUT_SECONDS=5
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
--
1.7.2.3

View File

@ -0,0 +1,20 @@
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59/usr/sbin/laptop_mode
@@ -133,7 +133,7 @@
LMT_REQ_LOCK="/var/lock/lmt-req.lock"
LMT_INVOC_LOCK="/var/lock/lmt-invoc.lock"
-FLOCK=`which flock`
+FLOCK=`PATH=$PATH which flock`
checkint ()
{
@@ -146,7 +146,7 @@
}
# Function to handle logging
+LOGGER=`PATH=$PATH which logger`;
-LOGGER=`which logger`;
log ()
{

View File

@ -0,0 +1,11 @@
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59/usr/sbin/laptop_mode
@@ -165,7 +165,7 @@
elif [ "$1" = "ERR" ]; then
logger -p $SYSLOG_FACILITY.err -t laptop-mode "$2";
elif [ "$1" = "VERBOSE" ]; then
- if [ x$VERBOSE_OUTPUT = x1 ]; then
+ if [ x$VERBOSE_OUTPUT = x1 -a "$DEBUG" = 1 ]; then
logger -p $SYSLOG_FACILITY.debug -t laptop-mode "$2";
fi
else

View File

@ -0,0 +1,11 @@
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf
+++ laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf
@@ -34,7 +34,7 @@
# The list of USB driver types that should not use autosuspend. The driver
# type is given by "DRIVER=..." in a USB device's uevent file.
# Example: AUTOSUSPEND_USBID_BLACKLIST="usbhid usb-storage"
-AUTOSUSPEND_USBTYPE_BLACKLIST=""
+AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid"
# Trigger auto-suspension of the USB deivce under conditional circumstances
BATT_SUSPEND_USB=1

View File

@ -0,0 +1,36 @@
From 27be03f0dbacd4b078ed18ee43ad3c710b569260 Mon Sep 17 00:00:00 2001
From: Daniel Kurtz <djkurtz@chromium.org>
Date: Wed, 11 May 2011 19:09:52 +0800
Subject: [PATCH] Skip failed globs when finding module scripts
Globs return the glob expression itself if there are no valid expansions (Unless using the bash-specific "setopt -u nullglob").
Fix this by detecting and ignoring SCRIPT when it is not a file.
BUG=chromium-os:15187
TEST=(0) Enable laptop_mode verbose output (set VERBOSE_OUTPUT=1 in /etc/laptop-mode/laptop-mode.conf)
(1) sudo /usr/sbin/laptop_mode auto force
The following should not be present at end of output:
Module /usr/local/lib/laptop-mode-tools/modules/* is not executable or is to be skipped.
Module /usr/local/share/laptop-mode-tools/modules/* is not executable or is to be skipped.
Module /etc/laptop-mode/modules/* is not executable or is to be skipped.
---
usr/sbin/laptop_mode | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/usr/sbin/laptop_mode b/usr/sbin/laptop_mode
index 7877f80..71a5cbe 100755
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59/usr/sbin/laptop_mode
@@ -1038,6 +1038,9 @@ lmt_main_function ()
# Note that the /usr/local/lib path is deprecated.
export FORCE STATE ON_AC ACTIVATE ACTIVATE_WITH_POSSIBLE_DATA_LOSS KLEVEL KMINOR WAS_ACTIVE LM_VERBOSE DEVICES
for SCRIPT in /usr/share/laptop-mode-tools/modules/* /usr/local/lib/laptop-mode-tools/modules/* /usr/local/share/laptop-mode-tools/modules/* /etc/laptop-mode/modules/* ; do
+ # Skip failed globs
+ [ -f "$SCRIPT" ] || continue
+
if [ -z "$MODULES" ] ; then
# If a module list has not been provided, execute all modules
EXECUTE_SCRIPT=1
--
1.7.3.1

View File

@ -0,0 +1,33 @@
From 862029ae5315db204af3b35fc12acaa4ca12c50f Mon Sep 17 00:00:00 2001
From: Daniel Kurtz <djkurtz@chromium.org>
Date: Fri, 13 May 2011 18:59:09 +0800
Subject: [PATCH] wireless-power tries to control wifi even if iwconfig is not found
When iwconfig isn't found, wireless-power still tries to execute
"$IWCONFIG $IFNAME", which fails with "$IFNAME not found" errors.
BUG=chromium-os:15185
TEST=/usr/sbin/laptop_mode auto force
There should be no more errors like this:
/usr/share/laptop-mode-tools/modules/wireless-power: 94: eth0: not found Failed.
/usr/share/laptop-mode-tools/modules/wireless-power: 94: usb0: not found Failed.
/usr/share/laptop-mode-tools/modules/wireless-power: 94: wlan0: not found Failed
---
usr/share/laptop-mode-tools/modules/wireless-power | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/usr/share/laptop-mode-tools/modules/wireless-power b/usr/share/laptop-mode-tools/modules/wireless-power
index 6407d2a..649b40a 100755
--- laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-power
+++ laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-power
@@ -62,6 +62,7 @@ if [ x$CONTROL_WIRELESS_POWER_SAVING = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x
IWCONFIG=/usr/sbin/iwconfig
else
log "VERBOSE" "iwconfig is not installed"
+ exit 1
fi
# Translate 1 => on, 0 => off
--
1.7.3.1

View File

@ -0,0 +1,11 @@
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/ethernet.conf
+++ laptop-mode-tools-1.59/etc/laptop-mode/conf.d/ethernet.conf.new
@@ -22,7 +22,7 @@
DEBUG=0
# Control Ethernet settings?
-CONTROL_ETHERNET="auto"
+CONTROL_ETHERNET=0
# Handle throttling of the ethernet deivce under specific circumstances
BATT_THROTTLE_ETHERNET=1

View File

@ -0,0 +1,11 @@
--- laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
+++ laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
@@ -322,7 +322,7 @@
# disable this. If you do, then your hard drives will probably not spin down
# anymore.
#
-CONTROL_MOUNT_OPTIONS=1
+CONTROL_MOUNT_OPTIONS=0
#

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