Skip to content

Commit

Permalink
[new package] libresprite 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
podsvirov authored and lazka committed Jan 17, 2025
1 parent 981f795 commit 4876c52
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/app/resource_finder.cpp b/src/app/resource_finder.cpp
index 284392dbe..dc0cc43d0 100644
--- a/src/app/resource_finder.cpp
+++ b/src/app/resource_finder.cpp
@@ -87,13 +87,13 @@ void ResourceFinder::includeDataDir(const char* filename)
{
char buf[4096];

-#ifdef _WIN32
+#if defined(_WIN32) && 0

snprintf(buf, sizeof(buf), "data/%s", filename);
includeHomeDir(buf); // %AppData%/LibreSprite/data/filename
includeBinDir(buf); // $BINDIR/data/filename

-#elif __APPLE__
+#elif defined(__APPLE__) && 0

snprintf(buf, sizeof(buf), "data/%s", filename);
includeUserDir(buf); // $HOME/Library/Application Support/LibreSprite/data/filename
69 changes: 69 additions & 0 deletions mingw-w64-libresprite/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Maintainer: Konstantin Podsvirov <[email protected]>

_realname=libresprite
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.1
pkgrel=1
pkgdesc='Animated sprite editor & pixel art tool -- Fork of the last GPLv2 commit of Aseprite (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://libresprite.github.io/'
msys2_repository_url='https://github.com/LibreSprite/LibreSprite'
license=('spdx:GPL-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-giflib"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-libwebp"
"${MINGW_PACKAGE_PREFIX}-pixman"
"${MINGW_PACKAGE_PREFIX}-SDL2"
"${MINGW_PACKAGE_PREFIX}-SDL2_image"
"${MINGW_PACKAGE_PREFIX}-tinyxml2"
"${MINGW_PACKAGE_PREFIX}-v8"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-libarchive")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-cc"
'git')
source=("${_realname}"::"git+${msys2_repository_url}.git#tag=v${pkgver}"
'0001-librescprite-1.1-resource-finder-fix.patch')
sha256sums=('0e13be335a1eeadb3116dc9bf6519ed35b56f6ed4bbe1572895e3d9b784f2158'
'9fe1100a8723ce8e9695cfe1e3b425c91664581f35054191f4d1ba78945ee705')

prepare() {
cd "${_realname}"

git submodule init
git submodule update

patch -Np1 -i "${srcdir}"/0001-librescprite-1.1-resource-finder-fix.patch
}

build() {
declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
"${extra_config[@]}" \
-DBUILD_{SHARED,STATIC}_LIBS=ON \
-S "${_realname}" \
-B "build-${MSYSTEM}"

cmake --build "build-${MSYSTEM}"
}

package() {
DESTDIR="${pkgdir}" cmake --install "build-${MSYSTEM}"

install -Dm644 "${srcdir}/${_realname}/LICENSE.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.txt"
}

0 comments on commit 4876c52

Please sign in to comment.