#!/bin/bash

rm -rf gimp-gap
git clone --depth 1 https://github.com/GNOME/gimp-gap.git gimp-gap
GHASH=$( git --git-dir ./gimp-gap/.git reflog | cut -d' ' -f1 )
rm -rf gimp-gap/.git
# Remove legally problematic files
rm -rf gimp-gap/extern_libs gimp-gap/vid_enc_avi gimp-gap/vid_enc_ffmpeg gimp-gap/gap/gap_mpege.c gimp-gap/gap/gap_mpege.h \
       gimp-gap/libgapvidapi/gap_vid_api_ffmpeg.c gimp-gap/libgapvidapi/gap_vid_api_mpeg3.c gimp-gap/libgapvidapi/gap_vid_api_mpeg3toc.c
TARF=gimp-gap-$GHASH-clean.tar.xz
tar -cJf $TARF gimp-gap
echo "[$TARF] created"
