Browse Source

ap/a2jmidid: Updated for Slackware-14.1.

slackware-14.2
Damien Goutte-Gattat 8 years ago
parent
commit
fd7a6f2902
  1. 51
      ap/a2jmidid/a2jmidid.SlackBuild

51
ap/a2jmidid/a2jmidid.SlackBuild

@ -1,6 +1,6 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2010,2011,2012 Damien Goutte-Gattat
# Copyright (C) 2010,2011,2012,2013 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
@ -35,7 +35,7 @@ WGET=${WGET:-http://download.gna.org/a2jmidid/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-a2jmidid}
BUILD=${BUILD:-1GGD}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -59,12 +59,14 @@ if [ ! -d $TMP ]; then
fi
# Compilation flags
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
CPUOPT="-O2"
@ -79,24 +81,51 @@ fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile
# Extract
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./waf configure --prefix=/usr --mandir=/usr/man
./waf build -j $JOBS
./waf install --destdir=$PKG
# Strip binaries
find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \
xargs strip --strip-unneeded 2> /dev/null
# No way to do something as simple as to modify LDFLAGS with waf...
# Just forget that useless piece of crap and build by hand
cat > config.h <<EOC
#ifndef _CONFIG_H
#define _CONFIG_H
#define HAVE_ALSA 1
#define HAVE_JACK 1
#define HAVE_DBUS_1 1
#define HAVE_GETOPT_H 1
#define A2J_VERSION "8"
#endif
EOC
LDFLAGS="-ldl -ldbus-1 -lasound -ljack -lpthread"
gcc $CFLAGS -c -I. -I/usr/include/dbus-1.0 \
-I/usr/lib$LIBDIRSUFFIX/dbus-1.0/include \
a2jmidid.c log.c port.c port_*.c paths.c jack.c list.c \
dbus.c dbus_*.c sigsegv.c j2amidi_bridge.c a2jmidi_bridge.c
gcc -o a2jmidid a2jmidid.o log.o port.o port_*.o paths.o jack.o \
list.o dbus.o dbus_*.o sigsegv.o $LDFLAGS
gcc -o j2amidi_bridge j2amidi_bridge.o $LDFLAGS
gcc -o a2jmidi_bridge a2jmidi_bridge.o $LDFLAGS
# Install
mkdir -p $PKG/usr/bin $PKG/usr/man/man1
install -s -m 755 a2jmidid j2amidi_bridge a2jmidi_bridge $PKG/usr/bin
install -m 755 a2j a2j_control $PKG/usr/bin
install -m 644 man/*.1 $PKG/usr/man/man1
# Compress man pages
find $PKG/usr/man -type f -exec gzip -9 {} \;
# Install D-Bus service file
mkdir -p $PKG/usr/share/dbus-1/services
cat > $PKG/usr/share/dbus-1/services/org.gna.home.a2jmidi2.service <<EOS
[D-BUS Service]
Name=org.gna.home.a2jmidid
Exec=/usr/bin/a2jmidid dbus
EOS
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 AUTHORS NEWS README gpl2.txt internals.txt $PKG/usr/doc/$NAME

Loading…
Cancel
Save