Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions mingw-w64-ruby-head/0002-Don-t-add-an-exe-file-manifest.patch

This file was deleted.

36 changes: 21 additions & 15 deletions mingw-w64-ruby-head/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_realname=ruby
pkgbase=mingw-w64-ruby-head
pkgname="${MINGW_PACKAGE_PREFIX}-ruby-head"
pkgver=r20241214
pkgver=r20250109
pkgver() {
echo r`date +%Y%m%d`
}
Expand All @@ -23,42 +23,43 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
options=('staticlibs' 'strip')
source=("https://cache.ruby-lang.org/pub/ruby/snapshot/snapshot-master.tar.xz"
0001-Add-C-ext-win32-dll_directory-as-an-alternative-to-f.patch
0002-Don-t-add-an-exe-file-manifest.patch
ruby.ico
rubyw.ico)
rubyw.ico
placeholder.manifest.xml)
noextract=("snapshot-master.tar.xz")

# To update SHA256 hashs run: ridk exec sh -c "updpkgsums PKGBUILD"
# and set first entry to 'SKIP'

sha256sums=('SKIP'
'a50c81ab8c178689485257f8eaa70bd8184b878a798780084668f838912e2832'
'da079dbfdc3d4e1b976ed15d58244ed6e0df201ec829bead578fb4a7177b9cab'
'6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22'
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a')
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a'
'c7a555d4826453efe7e33a2ebf78462b1fa665dffd7e4972143b48b1c9c71375')

prepare() {
bsdtar -xf snapshot-master.tar.xz || true
cd ${srcdir}/snapshot-master
rm -rf ext/win32/dll_directory
patch -p1 -i ${srcdir}/0001-Add-C-ext-win32-dll_directory-as-an-alternative-to-f.patch
patch -p1 -i ${srcdir}/0002-Don-t-add-an-exe-file-manifest.patch
autoreconf -fi
}

build() {
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
CFLAGS="-O3 -fstack-protector-strong"
LDFLAGS="-pipe -s -fstack-protector-strong"
PLACEHOLDER_DLL_RES=`cygpath -m ${srcdir}/build-${MSYSTEM}/placeholder-manifest-dll.res`
LDFLAGS="-pipe -s -fstack-protector-strong ${PLACEHOLDER_DLL_RES}"
if [[ ${MSYSTEM} == CLANG* ]]; then
CFLAGS+=" -Wno-dll-attribute-on-redeclaration"
CFLAGS+=" -Wno-dll-attribute-on-redeclaration -Wno-shorten-64-to-32"
else
CFLAGS+=" -Wno-incompatible-pointer-types"
fi

[[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}"

cp ${srcdir}/*.ico .
cp ${srcdir}/placeholder.manifest.xml .
echo "2 24 placeholder.manifest.xml" > placeholder-manifest-dll.rc
windres --input placeholder-manifest-dll.rc --output ${srcdir}/build-${MSYSTEM}/placeholder-manifest-dll.res --output-format=coff

../snapshot-master/configure \
--prefix=${MINGW_PREFIX} \
Expand All @@ -67,25 +68,30 @@ build() {
--target=${MINGW_CHOST} \
--with-out-ext=readline,pty,syslog

make showflags main
make showflags main V=1

echo "Generate RI and HTML documentation"
# Make rdoc outputs so many lines -> print dots only
make rdoc html 2>&1 | ./miniruby -ne "STDERR.print '.'"
}

check() {
cd "${srcdir}/build-${MINGW_CHOST}"
cd build-${MSYSTEM}
echo $PATH
make -l "TESTOPTS=-q" btest test-basic
# TODO: Full tests fail currently
# make -l "TESTOPTS=-q" test-all || true
}

package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make -f GNUMakefile DESTDIR="${pkgdir}" install
cd build-${MSYSTEM}
make -f GNUmakefile DESTDIR="${pkgdir}" install
for script in gem; do
install ${srcdir}/snapshot-master/bin/${script} \
${pkgdir}${MINGW_PREFIX}/bin/
done

# Remove placeholder manifest from packaged rbconfig
# The flags are inherited from the ruby build but not inteded for builds on the target system
sed -i "s# ${PLACEHOLDER_DLL_RES}##g" ${pkgdir}/${MINGW_PREFIX}/lib/ruby/*/*/rbconfig.rb
}
43 changes: 43 additions & 0 deletions mingw-w64-ruby-head/placeholder.manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
<!-- Enough space for a valid manifest in the DLL -->
</assembly>