;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2017 Alex Kost ;;; Copyright © 2016 Danny Milosavljevic ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix 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 GNU Guix. If not, see . (define-module (gnu packages lirc) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) #:use-module (gnu packages pkg-config) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (gnu packages python)) (define-public lirc (package (name "lirc") (version "0.10.1") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/lirc/LIRC/" version "/lirc-" version ".tar.bz2")) (sha256 (base32 "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb")) (patches (search-patches "lirc-localstatedir.patch")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--localstatedir=/var" ;; "configure
eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
  & eval 'exec perl -wS "$0" $argv:q'
    if 0;
# Convert git log output to ChangeLog format.

my $VERSION = '2012-07-29 06:11'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job.  Otherwise, update this string manually.

# Copyright (C) 2008-2013 Free Software Foundation, Inc.

# 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 3 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/>.

# Written by Jim Meyering

use strict;
use warnings;
use Getopt::Long;
use POSIX qw(strftime);

(my $ME = $0) =~ s|.*/||;

# use File::Coda; # http://meyering.net/code/Coda/
END {
  defined fileno STDOUT or return;
  close STDOUT and return;
  warn "$ME: failed to close standard output: $!\n";
  $? ||= 1;
}

sub usage ($)
{
  my ($exit_code) = @_;
  my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
  if ($exit_code != 0)
    {
      print $STREAM "Try '$ME --help' for more information.\n";
    }
  else
    {
      print $STREAM <<EOF;
Usage: $ME [OPTIONS] [ARGS]

Convert git log output to ChangeLog format.  If present, any ARGS
are passed to "git log".  To avoid ARGS being parsed as options to
$ME, they may be preceded by '--'.

OPTIONS:

   --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
                  makes a change to SHA1's commit log text or metadata.
   --append-dot append a dot to the first line of each commit message if
                  there is no other punctuation or blank at the end.
   --no-cluster never cluster commit messages under the same date/author
                  header; the default is to cluster adjacent commit messages
                  if their headers are the same and neither commit message
                  contains multiple paragraphs.
   --srcdir=DIR the root of the source tree, from which the .git/
                  directory can be derived.
   --since=DATE convert only the logs since DATE;
                  the default is to convert all log entries.
   --format=FMT set format string for commit subject and body;
                  see 'man git-log' for the list of format metacharacters;
                  the default is '%s%n%b%n'
   --strip-tab  remove one additional leading TAB from commit message lines.
   --strip-cherry-pick  remove data inserted by "git cherry-pick";
                  this includes the "cherry picked from commit ..." line,
                  and the possible final "Conflicts:" paragraph.
   --help       display this help and exit
   --version    output version information and exit

EXAMPLE:

  $ME --since=2008-01-01 > ChangeLog
  $ME -- -n 5 foo > last-5-commits-to-branch-foo

SPECIAL SYNTAX:

The following types of strings are interpreted specially when they appear
at the beginning of a log message line.  They are not copied to the output.

  Copyright-paperwork-exempt: Yes
    Append the "(tiny change)" notation to the usual "date name email"
    ChangeLog header to mark a change that does not require a copyright
    assignment.
  Co-authored-by: Joe User <user\@example.com>
    List the specified name and email address on a second
    ChangeLog header, denoting a co-author.
  Signed-off-by: Joe User <user\@example.com>
    These lines are simply elided.

In a FILE specified via --amend, comment lines (starting with "#") are ignored.
FILE must consist of <SHA,CODE+> pairs where SHA is a 4