# Maintainer: Jomar Milan pkgname=aseprite pkgver=1.3.7 pkgrel=1 pkgdesc='Create animated sprites and pixel art' arch=('amd64') url='https://www.aseprite.org' license=('LicenseRef-Aseprite-EULA') makedepends=('g++' 'clang' 'libc++-dev' 'libc++abi-dev' 'cmake' 'ninja-build' 'libx11-dev' 'libxcursor-dev' 'libxi-dev' 'libgl1-mesa-dev' 'libfontconfig1-dev' 'gn' 'python3' 'python-is-python3') depends=() _skiaver='m102-861e4743af' source=("https://github.com/aseprite/aseprite/releases/download/v$pkgver/Aseprite-v$pkgver-Source.zip" "https://github.com/aseprite/skia/archive/refs/tags/$_skiaver.tar.gz") noextract=("Aseprite-v$pkgver-Source.zip") sha256sums=('6524b4dd38adac22f954122846ccca7377983cee2e0f17c1482294cf09cbdcfc' '8d76c1ad3693e1fc019eb14d806082148eb4ed7d601474aeeaae601b05a9b3ad') prepare() { mkdir -p "$srcdir/Aseprite-v$pkgver-Source" bsdtar -xf "Aseprite-v$pkgver-Source.zip" -C "$srcdir/Aseprite-v$pkgver-Source" # Remove -dev from version (eg. 1.3.6-dev -> 1.3.6) sed -i 's/-dev//' "$srcdir/Aseprite-v$pkgver-Source/src/ver/CMakeLists.txt" } build() { cd "$srcdir/skia-$_skiaver" python3 tools/git-sync-deps gn gen out/Release --args='is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_sfntly=false skia_use_freetype=true skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true skia_use_system_freetype2=false skia_use_system_harfbuzz=false cc="clang" cxx="clang++" extra_cflags_cc=["-stdlib=libc++"] extra_ldflags=["-stdlib=libc++"]' ninja -C out/Release skia modules cd "$srcdir/Aseprite-v$pkgver-Source" mkdir -p build cd build export CC=clang export CXX=clang++ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS:STRING=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS:STRING=-stdlib=libc++ -DLAF_BACKEND=skia -DSKIA_DIR="$srcdir/skia-$_skiaver" -DSKIA_LIBRARY_DIR="$srcdir/skia-$_skiaver/out/Release" -DSKIA_LIBRARY="$srcdir/skia-$_skiaver/out/Release/libskia.a" -G Ninja ninja aseprite } package() { install -Dm 755 "$srcdir/Aseprite-v$pkgver-Source/build/bin/aseprite" "$pkgdir/usr/bin/aseprite" install -Dm 644 "$srcdir/Aseprite-v$pkgver-Source/src/desktop/linux/aseprite.desktop" "$pkgdir/usr/share/applications/aseprite.desktop" install -Dm 644 "$srcdir/Aseprite-v$pkgver-Source/src/desktop/linux/mime/aseprite.xml" "$pkgdir/usr/share/mime/packages/aseprite.xml" install -Dm 755 "$srcdir/Aseprite-v$pkgver-Source/src/desktop/linux/aseprite-thumbnailer" "$pkgdir/usr/bin/aseprite-thumbnailer" install -Dm 644 "$srcdir/Aseprite-v$pkgver-Source/src/desktop/linux/gnome/aseprite.thumbnailer" "$pkgdir/usr/share/thumbnailers/aseprite.thumbnailer" local _size for _size in 16 32 48 64 128 256; do install -Dm 644 "$srcdir/Aseprite-v$pkgver-Source/build/bin/data/icons/ase$_size.png" "$pkgdir/usr/share/icons/hicolor/${_size}x${_size}/apps/aseprite.png" done cd "$srcdir/Aseprite-v$pkgver-Source/build/bin/data" find . -path "icons" -prune -o -type f -exec install -Dm 644 "{}" "$pkgdir/usr/share/aseprite/data/{}" \; }