From 1eccb1e167832cd07f4584e03554c0cb4933f78a Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Tue, 17 Dec 2019 00:24:07 +0000 Subject: [PATCH] xap/shotwell: Added shotwell-0.30.7. --- xap/shotwell/doinst.sh | 9 ++ xap/shotwell/shotwell-0.30.7.tar.xz.sha256 | 1 + xap/shotwell/shotwell.SlackBuild | 134 +++++++++++++++++++++ xap/shotwell/slack-desc | 12 ++ 4 files changed, 156 insertions(+) create mode 100644 xap/shotwell/doinst.sh create mode 100644 xap/shotwell/shotwell-0.30.7.tar.xz.sha256 create mode 100755 xap/shotwell/shotwell.SlackBuild create mode 100644 xap/shotwell/slack-desc diff --git a/xap/shotwell/doinst.sh b/xap/shotwell/doinst.sh new file mode 100644 index 00000000..20533c2b --- /dev/null +++ b/xap/shotwell/doinst.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database ./usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/glib-compile-schemas ]; then + /usr/bin/glib-compile-schemas ./usr/share/glib-2.0/schemas >/dev/null 2>&1 +fi diff --git a/xap/shotwell/shotwell-0.30.7.tar.xz.sha256 b/xap/shotwell/shotwell-0.30.7.tar.xz.sha256 new file mode 100644 index 00000000..f5ef37c1 --- /dev/null +++ b/xap/shotwell/shotwell-0.30.7.tar.xz.sha256 @@ -0,0 +1 @@ +345d4205760d26f54033d44cf1b778ed9d3fc964de71293bfd5034ff484631d5 shotwell-0.30.7.tar.xz diff --git a/xap/shotwell/shotwell.SlackBuild b/xap/shotwell/shotwell.SlackBuild new file mode 100755 index 00000000..9f5c0455 --- /dev/null +++ b/xap/shotwell/shotwell.SlackBuild @@ -0,0 +1,134 @@ +#!/bin/bash +# Build script for Slackware +# Copyright (C) 2019 Damien Goutte-Gattat +# +# Redistribution and use of this script, with or without modifications, +# is permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. +# +# Contact: Damien Goutte-Gattat +# +# Latest shotwell sourcecode is available at: +# . +# +# Depends: l/libgdata, l/libgee, l/webkit2 + +# Source package infos +NAMESRC=${NAMESRC:-shotwell} +VERSION=${VERSION:-0.30.7} +ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.xz} +WGET=${WGET:-http://ftp.gnome.org/pub/GNOME/sources/shotwell/0.30/$ARCHIVE} + +# Build infos +NAMEPKG=${NAMEPKG:-shotwell} +BUILD=${BUILD:-1GGD} +ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')} +JOBS=${JOBS:-1} +EXT=${EXT:-txz} + +# Directories +TMP=${TMP:-/tmp} +OUT=${OUT:-$TMP/build} +PKG=${PKG:-$OUT/$NAMEPKG} +CWD=$(pwd) + +set -e # Quit if a command returns non-zero + +# Sanity checks +if [ $UID -eq 0 ]; then + echo "You should NOT run this script as ROOT!" + exit 1 +fi +if [ ! -d $TMP ]; then + echo "$TMP does not exists or is not a directory!" + exit 1 +fi + +# Compilation flags +LIBDIRSUFFIX="" +case "$ARCH" in +i?86) + CPUOPT="-O2 -march=$ARCH -mtune=i686" + ;; +x86_64) + CPUOPT="-O2 -fPIC" + LIBDIRSUFFIX="64" + ;; +*) + CPUOPT="-O2" + ;; +esac + +# Get and verify the source archive +if [ ! -r $ARCHIVE ]; then + wget -c -O $ARCHIVE.part "$WGET" + mv $ARCHIVE.part $ARCHIVE +fi +sha256sum -c $ARCHIVE.sha256 +NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1) + +# Compile +cd $TMP +echo "Building $ARCHIVE..." +tar xf $CWD/$ARCHIVE +cd $NAME +CFLAGS=$CPUOPT \ +CXXFLAGS=$CPUOPT \ +meson \ + --prefix /usr \ + --libdir /usr/lib$LIBDIRSUFFIX \ + --mandir /usr/man \ + build . +ninja -C build -j $JOBS +DESTDIR=$PKG ninja -C build install + +# Strip binaries +find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \ + xargs strip --strip-unneeded 2> /dev/null + +# Compress man pages +find $PKG/usr/man -type f -exec gzip -9 {} \; + +# Install the documentation +mkdir -p $PKG/usr/doc/$NAME +install -m 644 AUTHORS COPYING MAINTAINERS NEWS README.md THANKS $PKG/usr/doc/$NAME + +# Copy slack-desc and doinst.sh files +install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc +install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh + +# Add dependency infos +cat < $PKG/install/slack-required +libgdata +libgee +webkit2 +EOF + +# Package the tree +cd $PKG +mkdir -p $OUT +PACKAGING=" +chown root:root . -R +/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT +rm -rf $PKG +rm -rf $TMP/$NAME +" +if type -p fakeroot ; then + echo "$PACKAGING" | fakeroot +else + su -c "$PACKAGING" +fi diff --git a/xap/shotwell/slack-desc b/xap/shotwell/slack-desc new file mode 100644 index 00000000..31f43ed8 --- /dev/null +++ b/xap/shotwell/slack-desc @@ -0,0 +1,12 @@ + |-----handy-ruler-----------------------------------------------------| +shotwell: shotwell (photo manager) +shotwell: +shotwell: Shotwell is a digital photo manager designed for the GNOME desktop +shotwell: environment. It allows you to import photos from disk or camera, +shotwell: organize them by keywords and events, view them in full-window or +shotwell: fullscreen mode, and share them with others via social networking +shotwell: and more. +shotwell: +shotwell: +shotwell: +shotwell: