diff --git a/mingw-w64-ruby-head/0002-Don-t-add-an-exe-file-manifest.patch b/mingw-w64-ruby-head/0002-Don-t-add-an-exe-file-manifest.patch deleted file mode 100644 index 3a19bd6..0000000 --- a/mingw-w64-ruby-head/0002-Don-t-add-an-exe-file-manifest.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 61a79dda62aa64edd1648ca97d4fe01ce9f69811 Mon Sep 17 00:00:00 2001 -From: Lars Kanis -Date: Thu, 10 Jun 2021 21:10:33 +0200 -Subject: [PATCH] Don't add an exe file manifest - -It is later added as part of the rubyinstaller2 build process. -The manifest was introduced in: https://github.com/ruby/ruby/pull/4505 ---- - win32/resource.rb | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/win32/resource.rb b/win32/resource.rb -index bc3eda5630..e0e7323dc7 100755 ---- a/win32/resource.rb -+++ b/win32/resource.rb -@@ -61,7 +61,6 @@ def icons.find(path) - #include - - #{icon || ''} --#{type == 'VFT_APP' ? "1 RT_MANIFEST ruby.manifest" : ""} - VS_VERSION_INFO VERSIONINFO - FILEVERSION #{nversion} - PRODUCTVERSION #{nversion} --- -2.30.0.windows.1 - diff --git a/mingw-w64-ruby-head/PKGBUILD b/mingw-w64-ruby-head/PKGBUILD index ed44ba6..b9efa80 100644 --- a/mingw-w64-ruby-head/PKGBUILD +++ b/mingw-w64-ruby-head/PKGBUILD @@ -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` } @@ -23,9 +23,9 @@ 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" @@ -33,32 +33,33 @@ noextract=("snapshot-master.tar.xz") 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} \ @@ -67,14 +68,15 @@ 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 @@ -82,10 +84,14 @@ check() { } 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 } diff --git a/mingw-w64-ruby-head/placeholder.manifest.xml b/mingw-w64-ruby-head/placeholder.manifest.xml new file mode 100644 index 0000000..bd88130 --- /dev/null +++ b/mingw-w64-ruby-head/placeholder.manifest.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +