Initial checkin of Pika from heckimp

This commit is contained in:
2023-09-25 15:35:21 -07:00
commit 891e999216
6761 changed files with 5240685 additions and 0 deletions

View File

@ -0,0 +1,70 @@
crossroad source msys2
mkdir _deps && cd _deps
# babl
crossroad install lcms2 && \
git clone --depth 1 https://gitlab.gnome.org/GNOME/babl.git && cd babl && \
crossroad meson setup _build/ -Denable-gir=false -Dlibdir=lib && \
ninja -C _build install || exit 1
cd ..
# GEGL
crossroad install cairo graphviz json-glib && \
git clone --depth 1 https://gitlab.gnome.org/GNOME/gegl.git && cd gegl && \
crossroad meson setup _build/ -Dintrospection=false -Dsdl2=disabled -Dlibdir=lib && \
ninja -C _build install || exit 1
cd ..
# preparing PIKA
LIBMNG=
if [ "x$CROSSROAD_PLATFORM" = "xw64" ]; then
# For some reason, file-mng plug-in fails to link in its i686 build.
# Just disable it for now on i686 only.
LIBMNG="libmng"
fi
crossroad install appstream-glib \
aalib \
atk \
cfitsio \
drmingw \
gexiv2 \
glib2 \
glib-networking \
json-c \
ghostscript \
gobject-introspection \
gobject-introspection-runtime \
iso-codes \
libheif \
libiff \
libilbm \
libjxl \
$LIBMNG \
libmypaint mypaint-brushes \
libwebp \
libwmf \
openexr \
poppler poppler-data \
qoi \
xpm-nox
if [ $? -ne 0 ]; then
echo "Installation of pre-built dependencies failed.";
exit 1;
fi
if [ "x$CROSSROAD_PLATFORM" = "xw64" ]; then
# Generate the loaders.cache file for GUI image support.
# Note: this is mostly for distribution so I initially wanted to
# have these in "win64-nightly" job but "win32-nightly" also
# requires the same file (and I fail to install wine32) whereas
# Gitlab "needs" field requires jobs to be from a prior stage. So I
# generate this here, with dependencies.
wine ${CROSSROAD_PREFIX}/bin/gdk-pixbuf-query-loaders.exe ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll > ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
sed -i "s&$CROSSROAD_PREFIX/&&" ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
sed -i '/.dll\"/s*/*\\\\*g' ${CROSSROAD_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
fi

View File

@ -0,0 +1,74 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export ARTIFACTS_SUFFIX="-w32"
export MSYS2_ARCH="i686"
# vapi build fails on 32-bit, with no error output. Let's just drop
# it for this architecture.
export BABL_OPTIONS="-Denable-vapi=false"
export GEGL_OPTIONS="-Dvapigen=disabled"
export MSYS_PREFIX="/c/msys64/mingw32/"
else
export ARTIFACTS_SUFFIX="-w64"
export MSYS2_ARCH="x86_64"
export BABL_OPTIONS=""
export GEGL_OPTIONS=""
export MSYS_PREFIX="/c/msys64/mingw64/"
fi
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-autotools \
mingw-w64-$MSYS2_ARCH-meson \
\
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-crt-git \
mingw-w64-$MSYS2_ARCH-glib-networking \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-lcms2 \
mingw-w64-$MSYS2_ARCH-lensfun \
mingw-w64-$MSYS2_ARCH-libspiro \
mingw-w64-$MSYS2_ARCH-maxflow \
mingw-w64-$MSYS2_ARCH-openexr \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-suitesparse \
mingw-w64-$MSYS2_ARCH-vala
export GIT_DEPTH=1
export PIKA_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
export PATH="$PIKA_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="${PIKA_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="${PIKA_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${PIKA_PREFIX}/lib:${LD_LIBRARY_PATH}"
export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal"
export XDG_DATA_DIRS="${PIKA_PREFIX}/share:/mingw64/share/"
## babl and GEGL (follow master branch) ##
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
mkdir _babl/_build
cd _babl/_build
meson setup -Dprefix="${PIKA_PREFIX}" -Dwith-docs=false \
${BABL_OPTIONS} ..
ninja
ninja install
mkdir ../../_gegl/_build
cd ../../_gegl/_build
meson setup -Dprefix="${PIKA_PREFIX}" -Ddocs=false \
-Dcairo=enabled -Dumfpack=enabled \
-Dopenexr=enabled -Dworkshop=true \
${GEGL_OPTIONS} ..
ninja
ninja install
cd ../..

View File

@ -0,0 +1,120 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export ARTIFACTS_SUFFIX="-w32"
export MSYS2_ARCH="i686"
export MSYS2_PREFIX="/c/msys64/mingw32"
export PIKA_OPTIONS="-Dvala=disabled"
else
export ARTIFACTS_SUFFIX="-w64"
export MSYS2_ARCH="x86_64"
export MSYS2_PREFIX="/c/msys64/mingw64/"
fi
export ACLOCAL_FLAGS="-I${MSYS2_PREFIX}/share/aclocal"
export PATH="${MSYS2_PREFIX}/bin:$PATH"
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-autotools \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-meson \
\
mingw-w64-$MSYS2_ARCH-aalib \
mingw-w64-$MSYS2_ARCH-appstream-glib \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-brotli \
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-cfitsio \
mingw-w64-$MSYS2_ARCH-drmingw \
mingw-w64-$MSYS2_ARCH-gexiv2 \
mingw-w64-$MSYS2_ARCH-ghostscript \
mingw-w64-$MSYS2_ARCH-gi-docgen \
mingw-w64-$MSYS2_ARCH-glib-networking \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-gobject-introspection-runtime \
mingw-w64-$MSYS2_ARCH-graphviz \
mingw-w64-$MSYS2_ARCH-gtk3 \
mingw-w64-$MSYS2_ARCH-headers-git \
mingw-w64-$MSYS2_ARCH-iso-codes \
mingw-w64-$MSYS2_ARCH-json-c \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-lcms2 \
mingw-w64-$MSYS2_ARCH-lensfun \
mingw-w64-$MSYS2_ARCH-libarchive \
mingw-w64-$MSYS2_ARCH-libheif \
mingw-w64-$MSYS2_ARCH-libiff \
mingw-w64-$MSYS2_ARCH-libilbm \
mingw-w64-$MSYS2_ARCH-libjxl \
mingw-w64-$MSYS2_ARCH-libmypaint \
mingw-w64-$MSYS2_ARCH-libspiro \
mingw-w64-$MSYS2_ARCH-libwebp \
mingw-w64-$MSYS2_ARCH-libwmf \
mingw-w64-$MSYS2_ARCH-luajit \
mingw-w64-$MSYS2_ARCH-maxflow \
mingw-w64-$MSYS2_ARCH-mypaint-brushes \
mingw-w64-$MSYS2_ARCH-openexr \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-poppler \
mingw-w64-$MSYS2_ARCH-poppler-data \
mingw-w64-$MSYS2_ARCH-python \
mingw-w64-$MSYS2_ARCH-python-gobject \
mingw-w64-$MSYS2_ARCH-qoi \
mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-suitesparse \
mingw-w64-$MSYS2_ARCH-vala \
mingw-w64-$MSYS2_ARCH-xpm-nox
# XXX We've got a weird error when the prefix is in the current dir.
# Until we figure it out, this trick seems to work, even though it's
# completely ridiculous.
mv "_install${ARTIFACTS_SUFFIX}" ~
export PIKA_PREFIX="`realpath ~/_install`${ARTIFACTS_SUFFIX}"
export PATH="$PIKA_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="${PIKA_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="${PIKA_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${PIKA_PREFIX}/lib:${LD_LIBRARY_PATH}"
export ACLOCAL_FLAGS="-I/c/msys64/mingw32/share/aclocal"
export XDG_DATA_DIRS="${PIKA_PREFIX}/share:/mingw64/share/"
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# XXX Do not enable ccache this way because it breaks
# gobject-introspection rules. Let's see later for ccache.
# See: https://github.com/msys2/MINGW-packages/issues/9677
#export CC="ccache gcc"
#ccache --zero-stats
#ccache --show-stats
mkdir "_build${ARTIFACTS_SUFFIX}"
cd "_build${ARTIFACTS_SUFFIX}"
# We disable javascript as we are not able for the time being to add a
# javascript interpreter with GObject Introspection (GJS/spidermonkey
# and Seed/Webkit are the 2 contenders so far, but they are not
# available on MSYS2 and we are told it's very hard to build them).
# TODO: re-enable javascript plug-ins when we can figure this out.
meson .. -Dprefix="${PIKA_PREFIX}" \
-Ddirectx-sdk-dir="${MSYS2_PREFIX}" \
-Djavascript=disabled \
-Dbuild-id=technology.heckin.PIKA_official \
-Dgi-docgen=disabled \
${PIKA_OPTIONS}
ninja
ninja install
cd ..
#ccache --show-stats
# XXX Moving back the prefix to be used as artifacts.
mv "${PIKA_PREFIX}" .

View File

@ -0,0 +1,169 @@
#!/usr/bin/python3
################################################################################
# Small python script to retrieve DLL dependencies with objdump
################################################################################
################################################################################
# Usage example
#
# python3 dll_link.py /path/to/run.exe /winenv/ /path/install
#
# In this case, the DLL dependencies for executable run.exe will be extracted
# and copied into /path/install/bin folder. To copy the DLL, the root path to
# Windows environnment should be passed, here /winenv/.
import argparse
import os
import subprocess
import re
import shutil
import sys
################################################################################
# Global variables
# Sets for executable and system DLL
dlls = set()
sys_dlls = set()
# Previously done DLLs in previous runs
done_dlls = set()
# Common paths
bindir = 'bin'
################################################################################
# Functions
# Main function
def main(binary, srcdirs, destdir, debug, dll_file):
global done_dlls
try:
if dll_file is not None:
with open(dll_file, 'r') as f:
done_dlls = { line.strip() for line in f if len(line.strip()) != 0 }
except FileNotFoundError:
pass
sys.stdout.write("{} (INFO): searching for dependencies of {} in {}.\n".format(os.path.basename(__file__),
binary, ', '.join(srcdirs)))
find_dependencies(os.path.abspath(binary), srcdirs)
if debug in ['debug-only', 'debug-run']:
if debug == 'debug-only':
print("Running in debug-only mode (no DLL moved) for '{}'".format(binary))
else:
print("Running with debug output for '{}'".format(binary))
if len(dlls) > 0:
sys.stdout.write("Needed DLLs:\n\t- ")
sys.stdout.write("\n\t- ".join(list(dlls)))
print()
if len(sys_dlls) > 0:
sys.stdout.write('System DLLs:\n\t- ')
sys.stdout.write("\n\t- ".join(sys_dlls))
print()
removed_dlls = sys_dlls & dlls
if len(removed_dlls) > 0:
sys.stdout.write('Non installed DLLs:\n\t- ')
sys.stdout.write("\n\t- ".join(removed_dlls))
print()
installed_dlls = dlls - sys_dlls
if len(installed_dlls) > 0:
sys.stdout.write('Installed DLLs:\n\t- ')
sys.stdout.write("\n\t- ".join(installed_dlls))
print()
if debug == 'debug-run':
copy_dlls(dlls - sys_dlls, srcdirs, destdir)
else:
copy_dlls(dlls - sys_dlls, srcdirs, destdir)
if dll_file is not None:
with open(dll_file, 'w') as f:
f.write("\n".join(set.union(done_dlls, dlls, sys_dlls)))
def find_dependencies(obj, srcdirs):
'''
List DLLs of an object file in a recursive way.
'''
if obj in set.union(done_dlls, sys_dlls):
# Already processed, either in a previous run of the script
# (done_dlls) or in this one.
return True
if not os.path.isabs(obj):
for srcdir in srcdirs:
abs_dll = os.path.join(srcdir, bindir, obj)
abs_dll = os.path.abspath(abs_dll)
if find_dependencies(abs_dll, srcdirs):
return True
else:
# Found in none of the srcdirs: consider it a system DLL
sys_dlls.add(os.path.basename(obj))
return False
elif os.path.exists(obj):
# If DLL exists, extract dependencies.
objdump = None
result = subprocess.run(['file', obj], stdout=subprocess.PIPE)
file_type = result.stdout.decode('utf-8')
if 'PE32+' in file_type:
objdump = 'x86_64-w64-mingw32-objdump'
elif 'PE32' in file_type:
objdump = 'i686-w64-mingw32-objdump'
if objdump is None:
sys.stderr.write('File type of {} unknown: {}\n'.format(obj, file_type))
sys.exit(1)
elif shutil.which(objdump) is None:
# For native objdump case.
objdump = 'objdump.exe'
if shutil.which(objdump) is None:
sys.stderr.write("Executable doesn't exist: {}\n".format(objdump))
sys.exit(1)
result = subprocess.run([objdump, '-p', obj], stdout=subprocess.PIPE)
out = result.stdout.decode('utf-8')
# Parse lines with DLL Name instead of lib*.dll directly
for match in re.finditer(r"DLL Name: *(\S+.dll)", out, re.MULTILINE):
dll = match.group(1)
if dll not in set.union(done_dlls, dlls, sys_dlls):
dlls.add(dll)
find_dependencies(dll, srcdirs)
return True
else:
return False
# Copy a DLL set into the /destdir/bin directory
def copy_dlls(dll_list, srcdirs, destdir):
destbin = os.path.join(destdir, bindir)
os.makedirs(destbin, exist_ok=True)
for dll in dll_list:
if not os.path.exists(os.path.join(destbin, dll)):
# Do not overwrite existing files.
for srcdir in srcdirs:
full_file_name = os.path.join(srcdir, bindir, dll)
if os.path.isfile(full_file_name):
sys.stdout.write("{} (INFO): copying {} to {}\n".format(os.path.basename(__file__), full_file_name, destbin))
shutil.copy(full_file_name, destbin)
break
else:
# This should not happen. We determined that the dll is in one
# of the srcdirs.
sys.stderr.write("Missing DLL: {}\n".format(dll))
sys.exit(1)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--debug', dest='debug',
choices=['debug-only', 'debug-run', 'run-only'], default = 'run-only')
parser.add_argument('--output-dll-list', dest='dll_file', action = 'store', default = None)
parser.add_argument('bin')
parser.add_argument('src', nargs='+')
parser.add_argument('dest')
args = parser.parse_args(sys.argv[1:])
main(args.bin, args.src, args.dest, args.debug, args.dll_file)

View File

@ -0,0 +1,97 @@
# Install Inno Setup.
wget https://jrsoftware.org/download.php/is.exe
./is.exe //SILENT //SUPPRESSMSGBOXES //CURRENTUSER //SP- //LOG="innosetup.log"
# Install unofficial language files. These are translations of "unknown
# translation quality or might not be maintained actively".
# Cf. https://jrsoftware.org/files/istrans/
ISCCDIR=`grep "Dest filename:.*ISCC.exe" innosetup.log | sed 's/.*Dest filename: *\|ISCC.exe//g'`
ISCCDIR=`cygpath -u "$ISCCDIR"`
mkdir -p "${ISCCDIR}/Languages/Unofficial"
cd "${ISCCDIR}/Languages/Unofficial"
download_lang ()
{
langfile="$1"
rm -f "$langfile"
wget "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/$langfile"
downloaded="$?"
if [ $downloaded -ne 0 ]; then
echo "Download of '$langfile' failed."
exit 1
fi
}
download_lang_official ()
{
langfile="$1"
rm -f "$langfile"
wget "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/$langfile"
downloaded="$?"
if [ $downloaded -ne 0 ]; then
echo "Download of '$langfile' failed."
exit 1
fi
}
add_bom ()
{
langfile="$1"
file "$langfile" |grep "with BOM" 2>&1 > /dev/null
has_bom="$?"
if [ $has_bom -ne 0 ]; then
sed -i "1s/^/\xEF\xBB\xBF/" "$langfile"
fi
}
download_lang Basque.isl
download_lang ChineseSimplified.isl
download_lang ChineseTraditional.isl
# Supposed to be UTF-8 yet missing BOM.
add_bom ChineseTraditional.isl
download_lang EnglishBritish.isl
download_lang Esperanto.isl
download_lang Galician.isl
download_lang Georgian.isl
download_lang Greek.isl
download_lang Indonesian.isl
download_lang Korean.isl
download_lang Latvian.isl
download_lang Lithuanian.isl
download_lang Malaysian.isl
download_lang Marathi.islu
download_lang Romanian.isl
download_lang Swedish.isl
download_lang Vietnamese.isl
cd -
# Hungarian is not in a release yet, but was moved from Unofficial
cd "${ISCCDIR}/Languages/"
download_lang_official Hungarian.isl
cd -
# Copy generated language files into the source directory.
cp _build/build/windows/installer/lang/*isl build/windows/installer/lang
# Copy generated welcome images into the source directory.
cp _build/build/windows/installer/*bmp build/windows/installer/
# Construct now the installer.
VERSION=`grep -rI '\<version *:' meson.build | head -1 | sed "s/^.*version *: *'\([0-9]\+\.[0-9]\+\.[0-9]\+\)' *,.*$/\1/"`
#MAJOR_VERSION=`echo $VERSION | sed "s/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)$/\1/"`
#MINOR_VERSION=`echo $VERSION | sed "s/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)$/\2/"`
#MICRO_VERSION=`echo $VERSION | sed "s/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)$/\3/"`
cd build/windows/installer
./compile.bat ${VERSION} ../../.. pika-w32 pika-w64 ../../.. pika-w32 pika-w64
# Test if the installer was created and return success/failure.
if [ -f "_Output/pika-${VERSION}-setup.exe" ]; then
cd _Output/
INSTALLER="pika-${VERSION}-setup.exe"
sha256sum $INSTALLER > ${INSTALLER}.SHA256SUMS
sha512sum $INSTALLER > ${INSTALLER}.SHA512SUMS
exit 0
else
exit 1
fi

View File

@ -0,0 +1,218 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export ARTIFACTS_SUFFIX="-w32"
export MSYS2_ARCH="i686"
export MSYS_PREFIX="/c/msys64/mingw32/"
export PATH="/mingw32/bin:$PATH"
export PIKA_DISTRIB=`realpath ./pika-w32`
else
export ARTIFACTS_SUFFIX="-w64"
export MSYS2_ARCH="x86_64"
export MSYS_PREFIX="/c/msys64/mingw64/"
export PATH="/mingw64/bin:$PATH"
export PIKA_DISTRIB=`realpath ./pika-w64`
fi
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-binutils \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
\
mingw-w64-$MSYS2_ARCH-aalib \
mingw-w64-$MSYS2_ARCH-appstream-glib \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-brotli \
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-cfitsio \
mingw-w64-$MSYS2_ARCH-drmingw \
mingw-w64-$MSYS2_ARCH-gexiv2 \
mingw-w64-$MSYS2_ARCH-ghostscript \
mingw-w64-$MSYS2_ARCH-glib2 \
mingw-w64-$MSYS2_ARCH-glib-networking \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-gobject-introspection-runtime \
mingw-w64-$MSYS2_ARCH-graphviz \
mingw-w64-$MSYS2_ARCH-gtk3 \
mingw-w64-$MSYS2_ARCH-iso-codes \
mingw-w64-$MSYS2_ARCH-json-c \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-lcms2 \
mingw-w64-$MSYS2_ARCH-lensfun \
mingw-w64-$MSYS2_ARCH-libarchive \
mingw-w64-$MSYS2_ARCH-libheif \
mingw-w64-$MSYS2_ARCH-libjxl \
mingw-w64-$MSYS2_ARCH-libmypaint \
mingw-w64-$MSYS2_ARCH-libspiro \
mingw-w64-$MSYS2_ARCH-libwebp \
mingw-w64-$MSYS2_ARCH-libwmf \
mingw-w64-$MSYS2_ARCH-lua51-lgi \
mingw-w64-$MSYS2_ARCH-luajit \
mingw-w64-$MSYS2_ARCH-maxflow \
mingw-w64-$MSYS2_ARCH-mypaint-brushes \
mingw-w64-$MSYS2_ARCH-openexr \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-poppler \
mingw-w64-$MSYS2_ARCH-poppler-data \
mingw-w64-$MSYS2_ARCH-python \
mingw-w64-$MSYS2_ARCH-python3-gobject \
mingw-w64-$MSYS2_ARCH-qoi \
mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-suitesparse \
mingw-w64-$MSYS2_ARCH-vala \
mingw-w64-$MSYS2_ARCH-xpm-nox
export PIKA_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
export PATH="$PIKA_PREFIX/bin:$PATH"
# Package ressources.
mkdir -p ${PIKA_DISTRIB}
cp -fr ${PIKA_PREFIX}/etc ${PIKA_DISTRIB}
cp -fr ${PIKA_PREFIX}/include ${PIKA_DISTRIB}
#cp -fr ${PIKA_PREFIX}/ssl ${PIKA_DISTRIB}
cp -fr ${PIKA_PREFIX}/share ${PIKA_DISTRIB}
# Package executables.
mkdir ${PIKA_DISTRIB}/bin
cp -fr ${PIKA_PREFIX}/bin/pika*.exe ${PIKA_DISTRIB}/bin/
# With the native Windows build, it's directly in bin/
#mkdir ${PIKA_DISTRIB}/libexec
#cp -fr ${PIKA_PREFIX}/libexec/pika*.exe ${PIKA_DISTRIB}/libexec/
# Add a wrapper at tree root, less messy than having to look for the
# binary inside bin/, in the middle of all the DLLs.
echo "bin\pika-2.99.exe" > ${PIKA_DISTRIB}/pika.cmd
# Package library data and modules.
cp -fr ${MSYS_PREFIX}/etc/fonts ${PIKA_DISTRIB}/etc/
cp -fr ${MSYS_PREFIX}/etc/gtk-3.0 ${PIKA_DISTRIB}/etc/
mkdir ${PIKA_DISTRIB}/lib/
cp -fr ${PIKA_PREFIX}/lib/pika ${PIKA_DISTRIB}/lib/
cp -fr ${PIKA_PREFIX}/lib/gegl-0.4 ${PIKA_DISTRIB}/lib/
cp -fr ${PIKA_PREFIX}/lib/babl-0.1 ${PIKA_DISTRIB}/lib/
cp -fr ${MSYS_PREFIX}/lib/girepository-1.0 ${PIKA_DISTRIB}/lib/
cp -fr ${PIKA_PREFIX}/lib/girepository-1.0/* ${PIKA_DISTRIB}/lib/girepository-1.0/
cp -fr ${MSYS_PREFIX}/lib/gio ${PIKA_DISTRIB}/lib/
cp -fr ${MSYS_PREFIX}/lib/gdk-pixbuf-2.0 ${PIKA_DISTRIB}/lib/
cp -fr ${MSYS_PREFIX}/lib/gtk-3.0 ${PIKA_DISTRIB}/lib/
cp -fr ${MSYS_PREFIX}/lib/python3.11 ${PIKA_DISTRIB}/lib/
cp -fr ${MSYS_PREFIX}/share/ghostscript ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/glib-2.0 ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/libthai ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/libwmf ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/mypaint-data ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/poppler ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/share/lua/ ${PIKA_DISTRIB}/share/
cp -fr ${MSYS_PREFIX}/lib/lua/ ${PIKA_DISTRIB}/lib/
# XXX Are these themes really needed?
cp -fr ${MSYS_PREFIX}/share/themes ${PIKA_DISTRIB}/share/
# Only copy from langs supported in PIKA.
for dir in ${PIKA_DISTRIB}/share/locale/*/; do
lang=`basename "$dir"`;
# TODO: ideally we could be a bit more accurate and copy only the
# language files from our dependencies and iso_639.mo. But let's go
# with this for now, especially as each lang may have different
# translation availability.
if [ -d "${MSYS_PREFIX}/share/locale/${lang}/LC_MESSAGES/" ]; then
cp -fr "${MSYS_PREFIX}/share/locale/${lang}/LC_MESSAGES/"*.mo "${PIKA_DISTRIB}/share/locale/${lang}/LC_MESSAGES/"
fi
done;
# Only one iso-codes file is useful.
mkdir -p ${PIKA_DISTRIB}/share/xml/iso-codes
cp -fr ${MSYS_PREFIX}/share/xml/iso-codes/iso_639.xml ${PIKA_DISTRIB}/share/xml/iso-codes/
# Adwaita can be used as the base icon set.
cp -fr ${MSYS_PREFIX}/share/icons/Adwaita ${PIKA_DISTRIB}/share/icons/
# XXX Why are these for exactly?
cp -fr ${MSYS_PREFIX}/bin/gspawn*.exe ${PIKA_DISTRIB}/bin/
# We save the list of already copied DLLs to keep a state between dll_link runs.
rm -f done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/gspawn-win*-helper.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX} ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/gspawn-win*-helper-console.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
# XXX Does not look like it's needed anymore. Check?
cp -fr ${MSYS_PREFIX}/bin/gdk-pixbuf-query-loaders.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/gdk-pixbuf-query-loaders.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
# XXX Why is bzip2.exe needed?
cp -fr ${MSYS_PREFIX}/bin/bzip2.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/bzip2.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
# Executables for supported interpreters.
cp -fr ${MSYS_PREFIX}/bin/pythonw.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pythonw.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
cp -fr ${MSYS_PREFIX}/bin/python3w.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/python3w.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
cp -fr ${MSYS_PREFIX}/bin/python3.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/python3.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
cp -fr ${MSYS_PREFIX}/bin/luajit.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/luajit.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
# Executable for "gegl:introspect" from graphviz package.
cp -fr ${MSYS_PREFIX}/bin/dot.exe ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/dot.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
# Generate share/glib-2.0/schemas/gschemas.compiled
glib-compile-schemas --targetdir=${PIKA_DISTRIB}/share/glib-2.0/schemas ${PIKA_DISTRIB}/share/glib-2.0/schemas
# Package needed DLLs only
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pika-2.99.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pika-console-2.99.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pika-debug-resume.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pika-debug-tool-2.99.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pika-test-clipboard-2.99.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/pikatool-2.99.exe ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
for dll in ${PIKA_DISTRIB}/lib/babl-0.1/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
for dll in ${PIKA_DISTRIB}/lib/gegl-0.4/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
for dll in ${PIKA_DISTRIB}/lib/gio/modules/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
for dll in ${PIKA_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
for dll in ${PIKA_DISTRIB}/lib/pika/2.99/modules/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
for dll in ${PIKA_DISTRIB}/lib/pika/2.99/plug-ins/*/*.exe; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done
# Libraries for GObject Introspection.
cp -fr ${MSYS_PREFIX}/bin/libgirepository-1.0-1.dll ${PIKA_DISTRIB}/bin/
python3 build/windows/gitlab-ci/dll_link.py ${PIKA_DISTRIB}/bin/libgirepository-1.0-1.dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list
for dll in ${PIKA_DISTRIB}/lib/python3.11/site-packages/*/*.dll; do
python3 build/windows/gitlab-ci/dll_link.py $dll ${PIKA_PREFIX}/ ${MSYS_PREFIX}/ ${PIKA_DISTRIB} --output-dll-list done-dll.list;
done

View File

@ -0,0 +1,22 @@
#!/bin/bash
if [ -z "$1" ]
then
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v --only-keep-debug '{}' '{}'.debug \;
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v --add-gnu-debuglink='{}'.debug '{}' --strip-unneeded \;
find . -iname '*.debug' -exec "$0" {} +
else
while [ -n "$1" ]
do
FP="$1"
NAME="${FP##*/}"
DIR="${FP%/*}"
echo "$FP -> $DIR/.debug"
if [ ! -d "$DIR/.debug" ]
then
mkdir "$DIR/.debug"
fi
mv "$FP" "$DIR/.debug"
shift
done
fi