From d588342419c5285f97bae09e302878b5cd3130a7 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:04:37 +0900 Subject: [PATCH 01/20] Create xorg-libxshmfence feedstock --- recipes/xorg-libxshmfence/bld.bat | 18 ++++++++ recipes/xorg-libxshmfence/build.sh | 69 +++++++++++++++++++++++++++++ recipes/xorg-libxshmfence/meta.yaml | 59 ++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 recipes/xorg-libxshmfence/bld.bat create mode 100644 recipes/xorg-libxshmfence/build.sh create mode 100644 recipes/xorg-libxshmfence/meta.yaml diff --git a/recipes/xorg-libxshmfence/bld.bat b/recipes/xorg-libxshmfence/bld.bat new file mode 100644 index 0000000000000..d2d47f89334c4 --- /dev/null +++ b/recipes/xorg-libxshmfence/bld.bat @@ -0,0 +1,18 @@ +:: Trailing semicolon in this variable as set by current (2017/01) +:: conda-build breaks us. Manual fix: +set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out" +:: Delegate to the Unixy script. We need to translate the key path variables +:: to be Unix-y rather than Windows-y, though. +set "saved_recipe_dir=%RECIPE_DIR%" +FOR /F "delims=" %%i IN ('cygpath.exe -u -p "%PATH%"') DO set "PATH_OVERRIDE=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -m "%BUILD_PREFIX%"') DO set "BUILD_PREFIX_M=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -m "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_M=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_U=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PYTHON%"') DO set "PYTHON=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%RECIPE_DIR%"') DO set "RECIPE_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SP_DIR%"') DO set "SP_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SRC_DIR%"') DO set "SRC_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%STDLIB_DIR%"') DO set "STDLIB_DIR=%%i" +bash -x %saved_recipe_dir%\build.sh +if errorlevel 1 exit 1 diff --git a/recipes/xorg-libxshmfence/build.sh b/recipes/xorg-libxshmfence/build.sh new file mode 100644 index 0000000000000..4b3e2b7e45617 --- /dev/null +++ b/recipes/xorg-libxshmfence/build.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/gnuconfig/config.* . + +set -e +IFS=$' \t\n' # workaround for conda 4.2.13+toolchain bug + +# Adopt a Unix-friendly path if we're on Windows (see bld.bat). +[ -n "$PATH_OVERRIDE" ] && export PATH="$PATH_OVERRIDE" + +# On Windows we want $LIBRARY_PREFIX in both "mixed" (C:/Conda/...) and Unix +# (/c/Conda) forms, but Unix form is often "/" which can cause problems. +if [ -n "$LIBRARY_PREFIX_M" ] ; then + mprefix="$LIBRARY_PREFIX_M" + if [ "$LIBRARY_PREFIX_U" = / ] ; then + uprefix="" + else + uprefix="$LIBRARY_PREFIX_U" + fi +else + mprefix="$PREFIX" + uprefix="$PREFIX" +fi + +# Cf. https://github.com/conda-forge/staged-recipes/issues/673, we're in the +# process of excising Libtool files from our packages. Existing ones can break +# the build while this happens. We have "/." at the end of $uprefix to be safe +# in case the variable is empty. +find $uprefix/. -name '*.la' -delete + +# On Windows we need to regenerate the configure scripts. +if [ -n "$CYGWIN_PREFIX" ] ; then + am_version=1.15 # keep sync'ed with meta.yaml + export ACLOCAL=aclocal-$am_version + export AUTOMAKE=automake-$am_version + autoreconf_args=( + --force + --install + -I "$mprefix/share/aclocal" + -I "$BUILD_PREFIX_M/Library/mingw-w64/share/aclocal" + ) + autoreconf "${autoreconf_args[@]}" + + # And we need to add the search path that lets libtool find the + # msys2 stub libraries for ws2_32. + platlibs=$(cd $(dirname $(gcc --print-prog-name=ld))/../lib && pwd -W) + export LDFLAGS="$LDFLAGS -L$platlibs" +fi + +export PKG_CONFIG_LIBDIR=$uprefix/lib/pkgconfig:$uprefix/share/pkgconfig +configure_args=( + --prefix=$mprefix + --disable-static + --disable-dependency-tracking + --disable-selective-werror + --disable-silent-rules +) + +./configure "${configure_args[@]}" +make -j$CPU_COUNT +make install +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then +make check +fi +rm -rf $uprefix/share/man $uprefix/share/doc/${PKG_NAME#xorg-} + +# Remove any new Libtool files we may have installed. It is intended that +# conda-build will eventually do this automatically. +find $uprefix/. -name '*.la' -delete diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml new file mode 100644 index 0000000000000..3d38446f58123 --- /dev/null +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -0,0 +1,59 @@ +{% set xorg_name = "libxshmfence" %} +{% set xorg_category = "lib" %} +{% set name = "xorg-" ~ xorg_name %} +{% set version = "1.3.2" %} +{% set sha256 = "e93a85099604beb244ee756dcaf70e18b08701c1ca84c4de0126cd71bd6c8181" %} +{% set am_version = "1.15" %} # keep synchronized with build.sh + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + fn: {{ name }}-{{ version }}.tar.gz + url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz + sha256: {{ sha256 }} + +build: + number: 1 + detect_binary_files_with_prefix: true + run_exports: + - {{ pin_subpackage(name|lower) }} + +requirements: + build: + - m2-autoconf # [win] + - m2-automake{{ am_version }} # [win] + - m2-libtool # [win] + - m2w64-pkg-config # [win] + - make + - pkg-config # [not win] + - posix # [win] + - gnuconfig # [unix] + - {{ stdlib('c') }} # [unix] + - {{ compiler('c') }} # [unix] + - {{ stdlib('m2w64_c') }} # [win] + - {{ compiler('m2w64_c') }} # [win] + host: + - xorg-util-macros + +test: + commands: + {% set lib_idents = [ "xshmfence" ] %} + {% for lib_ident in lib_idents %} + - test -f $PREFIX/lib/lib{{ lib_ident }}.dylib # [osx] + - test -f $PREFIX/lib/lib{{ lib_ident }}.so # [linux] + - if not exist %PREFIX%/Library/lib/lib{{ lib_ident }}.dll.a exit /b 1 # [win] + - if not exist %PREFIX%/Library/bin/msys-{{ lib_ident }}-*.dll exit /b 1 # [win] + {% endfor %} + +about: + home: https://www.x.org/ + license: LicenseRef-libxshmfence + license_family: MIT + license_file: COPYING + summary: Shared memory 'SyncFence' synchronization primitive + +extra: + recipe-maintainers: + - ehfd From 1b8866a6d1846e03783cdc002cb021a8f01b97c5 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:06:45 +0900 Subject: [PATCH 02/20] Fix build number --- recipes/xorg-libxshmfence/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 3d38446f58123..5534af3de0528 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -15,7 +15,7 @@ source: sha256: {{ sha256 }} build: - number: 1 + number: 0 detect_binary_files_with_prefix: true run_exports: - {{ pin_subpackage(name|lower) }} From 90c5fe7d2f9875a53a77477e9c1008226451ac0d Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:12:53 +0900 Subject: [PATCH 03/20] Add xorg-xproto --- recipes/xorg-libxshmfence/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 5534af3de0528..c6f10105cabd6 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -35,6 +35,7 @@ requirements: - {{ stdlib('m2w64_c') }} # [win] - {{ compiler('m2w64_c') }} # [win] host: + - xorg-xproto - xorg-util-macros test: From 754c8f1a5db1030d2acd58a026a6a3de8c999bf1 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:29:39 +0900 Subject: [PATCH 04/20] Fix compilation --- recipes/xorg-libxshmfence/build.sh | 3 --- recipes/xorg-libxshmfence/meta.yaml | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/xorg-libxshmfence/build.sh b/recipes/xorg-libxshmfence/build.sh index 4b3e2b7e45617..0ff8735bf9fc4 100644 --- a/recipes/xorg-libxshmfence/build.sh +++ b/recipes/xorg-libxshmfence/build.sh @@ -59,9 +59,6 @@ configure_args=( ./configure "${configure_args[@]}" make -j$CPU_COUNT make install -if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then -make check -fi rm -rf $uprefix/share/man $uprefix/share/doc/${PKG_NAME#xorg-} # Remove any new Libtool files we may have installed. It is intended that diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index c6f10105cabd6..5b718b4f3d1fb 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -35,10 +35,13 @@ requirements: - {{ stdlib('m2w64_c') }} # [win] - {{ compiler('m2w64_c') }} # [win] host: + - pthread-stubs - xorg-xproto - xorg-util-macros test: + requires: + - xorg-xproto commands: {% set lib_idents = [ "xshmfence" ] %} {% for lib_ident in lib_idents %} @@ -50,7 +53,7 @@ test: about: home: https://www.x.org/ - license: LicenseRef-libxshmfence + license: MIT license_family: MIT license_file: COPYING summary: Shared memory 'SyncFence' synchronization primitive From 26a946679936e8e18dcf54df3a66c8b73837e7ef Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:29:52 +0900 Subject: [PATCH 05/20] Fix compilation --- recipes/xorg-libxshmfence/meta.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 5b718b4f3d1fb..5397a9d2e7b1c 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -40,8 +40,6 @@ requirements: - xorg-util-macros test: - requires: - - xorg-xproto commands: {% set lib_idents = [ "xshmfence" ] %} {% for lib_ident in lib_idents %} From 66eba493cd0cfc1f28f84e59ca8597ab4f2ed66b Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:45:14 +0900 Subject: [PATCH 06/20] Add windows patch --- recipes/xorg-libxshmfence/meta.yaml | 2 ++ recipes/xorg-libxshmfence/windows.patch | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 recipes/xorg-libxshmfence/windows.patch diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 5397a9d2e7b1c..7e76fcd348f99 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -13,6 +13,8 @@ source: fn: {{ name }}-{{ version }}.tar.gz url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz sha256: {{ sha256 }} + patches: + - windows.patch # [win] build: number: 0 diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch new file mode 100644 index 0000000000000..d629617270566 --- /dev/null +++ b/recipes/xorg-libxshmfence/windows.patch @@ -0,0 +1,10 @@ +--- a/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 ++++ b/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +@@ -25,7 +25,6 @@ + + #include + #include +-#include + #include "xshmfence.h" + + #if HAVE_FUTEX From 6c47418a8c95a1fcbc5aad991682031e12c4070a Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:56:56 +0900 Subject: [PATCH 07/20] Fix patch --- recipes/xorg-libxshmfence/windows.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index d629617270566..bfc7512ccc61a 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,5 +1,5 @@ ---- a/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 -+++ b/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +--- a/src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 ++++ b/src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 @@ -25,7 +25,6 @@ #include From d1f00cf3210f0a1e43493181f83aee18fd6b0b10 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:07:38 +0900 Subject: [PATCH 08/20] Fix patch --- recipes/xorg-libxshmfence/windows.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index bfc7512ccc61a..41f612e1072c7 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,5 +1,5 @@ ---- a/src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 -+++ b/src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +--- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 ++++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 @@ -25,7 +25,6 @@ #include From 9cdd092f51ff83ce03affd25d89b7978bdb92495 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:16:52 +0900 Subject: [PATCH 09/20] Fix line ending --- recipes/xorg-libxshmfence/meta.yaml | 126 ++++++++++++------------ recipes/xorg-libxshmfence/windows.patch | 20 ++-- 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 7e76fcd348f99..b3d105744ee30 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -1,63 +1,63 @@ -{% set xorg_name = "libxshmfence" %} -{% set xorg_category = "lib" %} -{% set name = "xorg-" ~ xorg_name %} -{% set version = "1.3.2" %} -{% set sha256 = "e93a85099604beb244ee756dcaf70e18b08701c1ca84c4de0126cd71bd6c8181" %} -{% set am_version = "1.15" %} # keep synchronized with build.sh - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - fn: {{ name }}-{{ version }}.tar.gz - url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz - sha256: {{ sha256 }} - patches: - - windows.patch # [win] - -build: - number: 0 - detect_binary_files_with_prefix: true - run_exports: - - {{ pin_subpackage(name|lower) }} - -requirements: - build: - - m2-autoconf # [win] - - m2-automake{{ am_version }} # [win] - - m2-libtool # [win] - - m2w64-pkg-config # [win] - - make - - pkg-config # [not win] - - posix # [win] - - gnuconfig # [unix] - - {{ stdlib('c') }} # [unix] - - {{ compiler('c') }} # [unix] - - {{ stdlib('m2w64_c') }} # [win] - - {{ compiler('m2w64_c') }} # [win] - host: - - pthread-stubs - - xorg-xproto - - xorg-util-macros - -test: - commands: - {% set lib_idents = [ "xshmfence" ] %} - {% for lib_ident in lib_idents %} - - test -f $PREFIX/lib/lib{{ lib_ident }}.dylib # [osx] - - test -f $PREFIX/lib/lib{{ lib_ident }}.so # [linux] - - if not exist %PREFIX%/Library/lib/lib{{ lib_ident }}.dll.a exit /b 1 # [win] - - if not exist %PREFIX%/Library/bin/msys-{{ lib_ident }}-*.dll exit /b 1 # [win] - {% endfor %} - -about: - home: https://www.x.org/ - license: MIT - license_family: MIT - license_file: COPYING - summary: Shared memory 'SyncFence' synchronization primitive - -extra: - recipe-maintainers: - - ehfd +{% set xorg_name = "libxshmfence" %} +{% set xorg_category = "lib" %} +{% set name = "xorg-" ~ xorg_name %} +{% set version = "1.3.2" %} +{% set sha256 = "e93a85099604beb244ee756dcaf70e18b08701c1ca84c4de0126cd71bd6c8181" %} +{% set am_version = "1.15" %} # keep synchronized with build.sh + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + fn: {{ name }}-{{ version }}.tar.gz + url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz + sha256: {{ sha256 }} + patches: + - windows.patch # [win] + +build: + number: 0 + detect_binary_files_with_prefix: true + run_exports: + - {{ pin_subpackage(name|lower) }} + +requirements: + build: + - m2-autoconf # [win] + - m2-automake{{ am_version }} # [win] + - m2-libtool # [win] + - m2w64-pkg-config # [win] + - make + - pkg-config # [not win] + - posix # [win] + - gnuconfig # [unix] + - {{ stdlib('c') }} # [unix] + - {{ compiler('c') }} # [unix] + - {{ stdlib('m2w64_c') }} # [win] + - {{ compiler('m2w64_c') }} # [win] + host: + - pthread-stubs + - xorg-xproto + - xorg-util-macros + +test: + commands: + {% set lib_idents = [ "xshmfence" ] %} + {% for lib_ident in lib_idents %} + - test -f $PREFIX/lib/lib{{ lib_ident }}.dylib # [osx] + - test -f $PREFIX/lib/lib{{ lib_ident }}.so # [linux] + - if not exist %PREFIX%/Library/lib/lib{{ lib_ident }}.dll.a exit /b 1 # [win] + - if not exist %PREFIX%/Library/bin/msys-{{ lib_ident }}-*.dll exit /b 1 # [win] + {% endfor %} + +about: + home: https://www.x.org/ + license: MIT + license_family: MIT + license_file: COPYING + summary: Shared memory 'SyncFence' synchronization primitive + +extra: + recipe-maintainers: + - ehfd diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index 41f612e1072c7..0f9b3275746e9 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,10 +1,10 @@ ---- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 -+++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 -@@ -25,7 +25,6 @@ - - #include - #include --#include - #include "xshmfence.h" - - #if HAVE_FUTEX +--- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 ++++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +@@ -25,7 +25,6 @@ + + #include + #include +-#include + #include "xshmfence.h" + + #if HAVE_FUTEX From 5499da8e3a825fd3b8b6e39a9bedd834f73b2769 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:39:17 +0900 Subject: [PATCH 10/20] Deactivate mmap in Windows --- recipes/xorg-libxshmfence/windows.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index 0f9b3275746e9..66deedbc0c09f 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,3 +1,27 @@ +--- src/xshmfence_alloc.c 2024-09-01 01:01:01.000000000 +0000 ++++ src/xshmfence_alloc.c 2024-09-01 02:01:01.000000000 +0000 +@@ -124,13 +124,7 @@ + struct xshmfence * + xshmfence_map_shm(int fd) + { +- struct xshmfence *addr; +- addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); +- if (addr == MAP_FAILED) { +- close (fd); +- return 0; +- } +- return addr; ++ return 0; + } + + /** +@@ -141,5 +135,5 @@ + void + xshmfence_unmap_shm(struct xshmfence *f) + { +- munmap(f, sizeof (struct xshmfence)); ++ return; + } --- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 +++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 @@ -25,7 +25,6 @@ From 99546372ca67bd877be163a61ac2ec3be92eb601 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:05:20 +0900 Subject: [PATCH 11/20] Fix patch --- recipes/xorg-libxshmfence/windows.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index 66deedbc0c09f..6d373d072476e 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,5 +1,5 @@ ---- src/xshmfence_alloc.c 2024-09-01 01:01:01.000000000 +0000 -+++ src/xshmfence_alloc.c 2024-09-01 02:01:01.000000000 +0000 +--- src/xshmfence_alloc.c 2024-09-01 01:01:01.000000000 +0000 ++++ src/xshmfence_alloc.c 2024-09-01 02:01:01.000000000 +0000 @@ -124,13 +124,7 @@ struct xshmfence * xshmfence_map_shm(int fd) @@ -13,7 +13,7 @@ - return addr; + return 0; } - + /** @@ -141,5 +135,5 @@ void @@ -22,13 +22,13 @@ - munmap(f, sizeof (struct xshmfence)); + return; } ---- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 -+++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +--- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 ++++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 @@ -25,7 +25,6 @@ - + #include #include -#include #include "xshmfence.h" - + #if HAVE_FUTEX From cfcffd2e101bdadaa16018043d9353a255c5048e Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:33:08 +0900 Subject: [PATCH 12/20] Fix patch --- recipes/xorg-libxshmfence/windows.patch | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index 6d373d072476e..eb4691f769a31 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,34 +1,34 @@ ---- src/xshmfence_alloc.c 2024-09-01 01:01:01.000000000 +0000 -+++ src/xshmfence_alloc.c 2024-09-01 02:01:01.000000000 +0000 -@@ -124,13 +124,7 @@ +--- src/xshmfence_alloc.c ++++ src/xshmfence_alloc.c +@@ -124,13 +124,7 @@ xshmfence_alloc_shm(void) struct xshmfence * xshmfence_map_shm(int fd) { -- struct xshmfence *addr; -- addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); -- if (addr == MAP_FAILED) { -- close (fd); -- return 0; -- } -- return addr; -+ return 0; +- struct xshmfence *addr; +- addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); +- if (addr == MAP_FAILED) { +- close (fd); +- return 0; +- } +- return addr; ++ return 0; } - + /** -@@ -141,5 +135,5 @@ +@@ -141,5 +135,5 @@ xshmfence_map_shm(int fd) void xshmfence_unmap_shm(struct xshmfence *f) { - munmap(f, sizeof (struct xshmfence)); + return; } ---- src/xshmfenceint.h 2024-09-01 01:01:01.000000000 +0000 -+++ src/xshmfenceint.h 2024-09-01 02:01:01.000000000 +0000 +--- src/xshmfenceint.h ++++ src/xshmfenceint.h @@ -25,7 +25,6 @@ - + #include #include -#include #include "xshmfence.h" - + #if HAVE_FUTEX From e2e81602f3eb82394488675bc9c48a01324e39bf Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:53:55 +0900 Subject: [PATCH 13/20] Remove Windows build --- recipes/xorg-libxshmfence/meta.yaml | 3 +-- recipes/xorg-libxshmfence/windows.patch | 34 ------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 recipes/xorg-libxshmfence/windows.patch diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index b3d105744ee30..fea1df8a08da3 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -13,12 +13,11 @@ source: fn: {{ name }}-{{ version }}.tar.gz url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz sha256: {{ sha256 }} - patches: - - windows.patch # [win] build: number: 0 detect_binary_files_with_prefix: true + skip: true # [win] run_exports: - {{ pin_subpackage(name|lower) }} diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch deleted file mode 100644 index eb4691f769a31..0000000000000 --- a/recipes/xorg-libxshmfence/windows.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- src/xshmfence_alloc.c -+++ src/xshmfence_alloc.c -@@ -124,13 +124,7 @@ xshmfence_alloc_shm(void) - struct xshmfence * - xshmfence_map_shm(int fd) - { -- struct xshmfence *addr; -- addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); -- if (addr == MAP_FAILED) { -- close (fd); -- return 0; -- } -- return addr; -+ return 0; - } - - /** -@@ -141,5 +135,5 @@ xshmfence_map_shm(int fd) - void - xshmfence_unmap_shm(struct xshmfence *f) - { -- munmap(f, sizeof (struct xshmfence)); -+ return; - } ---- src/xshmfenceint.h -+++ src/xshmfenceint.h -@@ -25,7 +25,6 @@ - - #include - #include --#include - #include "xshmfence.h" - - #if HAVE_FUTEX From d9aeb50be4ae50b7cd2ff710d644565c84fb2635 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:26:01 +0900 Subject: [PATCH 14/20] Restore Windows build --- recipes/xorg-libxshmfence/meta.yaml | 1 - recipes/xorg-libxshmfence/windows.patch | 51 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 recipes/xorg-libxshmfence/windows.patch diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index fea1df8a08da3..92246d1ae3107 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -17,7 +17,6 @@ source: build: number: 0 detect_binary_files_with_prefix: true - skip: true # [win] run_exports: - {{ pin_subpackage(name|lower) }} diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch new file mode 100644 index 0000000000000..8c0eb00363700 --- /dev/null +++ b/recipes/xorg-libxshmfence/windows.patch @@ -0,0 +1,51 @@ +--- src/xshmfence_alloc.c ++++ src/xshmfence_alloc.c +@@ -97,11 +97,11 @@ xshmfence_alloc_shm(void) + return fd; + unlink(template); + #ifndef HAVE_MKOSTEMP +- flags = fcntl(fd, F_GETFD); +- if (flags != -1) { +- flags |= FD_CLOEXEC; +- fcntl(fd, F_SETFD, &flags); +- } ++ flags = 0; //fcntl(fd, F_GETFD); ++ //if (flags != -1) { ++ //flags |= FD_CLOEXEC; ++ //fcntl(fd, F_SETFD, &flags); ++ //} + #endif + } + } +@@ -124,13 +124,7 @@ xshmfence_alloc_shm(void) + struct xshmfence * + xshmfence_map_shm(int fd) + { +- struct xshmfence *addr; +- addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); +- if (addr == MAP_FAILED) { +- close (fd); +- return 0; +- } +- return addr; ++ return 0; + } + + /** +@@ -141,5 +135,5 @@ xshmfence_map_shm(int fd) + void + xshmfence_unmap_shm(struct xshmfence *f) + { +- munmap(f, sizeof (struct xshmfence)); ++ return; + } +--- src/xshmfenceint.h ++++ src/xshmfenceint.h +@@ -25,7 +25,6 @@ + + #include + #include +-#include + #include "xshmfence.h" + + #if HAVE_FUTEX From b2820f4fe7f510947603e73116aef0284b5a91cc Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:26:28 +0900 Subject: [PATCH 15/20] Fix patch --- recipes/xorg-libxshmfence/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 92246d1ae3107..c0bac8feb3558 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -13,6 +13,8 @@ source: fn: {{ name }}-{{ version }}.tar.gz url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz sha256: {{ sha256 }} + patch: + - windows.patch # [win] build: number: 0 From 7648bb2bcbb468badf39dd5e060a0451d78df793 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:27:27 +0900 Subject: [PATCH 16/20] Fix syntax --- recipes/xorg-libxshmfence/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index c0bac8feb3558..b3d105744ee30 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -13,7 +13,7 @@ source: fn: {{ name }}-{{ version }}.tar.gz url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.gz sha256: {{ sha256 }} - patch: + patches: - windows.patch # [win] build: From 561f23e57af50f68c20b65bc5f631ff5f6eadea1 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:59:44 +0900 Subject: [PATCH 17/20] Prevent overlinking error --- recipes/xorg-libxshmfence/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index b3d105744ee30..11e4a09bcf7ec 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -34,12 +34,12 @@ requirements: - gnuconfig # [unix] - {{ stdlib('c') }} # [unix] - {{ compiler('c') }} # [unix] - - {{ stdlib('m2w64_c') }} # [win] - {{ compiler('m2w64_c') }} # [win] host: - pthread-stubs - xorg-xproto - xorg-util-macros + - m2w64-libwinpthread-git # [win] test: commands: From e5d642658eb6b05421cd6680de41ee7ebd1cfa60 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 19:15:52 +0900 Subject: [PATCH 18/20] Fix Windows --- recipes/xorg-libxshmfence/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/xorg-libxshmfence/meta.yaml b/recipes/xorg-libxshmfence/meta.yaml index 11e4a09bcf7ec..71500da2920aa 100644 --- a/recipes/xorg-libxshmfence/meta.yaml +++ b/recipes/xorg-libxshmfence/meta.yaml @@ -39,6 +39,7 @@ requirements: - pthread-stubs - xorg-xproto - xorg-util-macros + run: - m2w64-libwinpthread-git # [win] test: From 6f0b244f3dc53a2f33a1246bfb34e2c59f40a6b6 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 21:42:36 +0900 Subject: [PATCH 19/20] Simplify patch --- recipes/xorg-libxshmfence/windows.patch | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/recipes/xorg-libxshmfence/windows.patch b/recipes/xorg-libxshmfence/windows.patch index 8c0eb00363700..4edca33784800 100644 --- a/recipes/xorg-libxshmfence/windows.patch +++ b/recipes/xorg-libxshmfence/windows.patch @@ -1,6 +1,6 @@ --- src/xshmfence_alloc.c +++ src/xshmfence_alloc.c -@@ -97,11 +97,11 @@ xshmfence_alloc_shm(void) +@@ -97,11 +97,7 @@ xshmfence_alloc_shm(void) return fd; unlink(template); #ifndef HAVE_MKOSTEMP @@ -9,15 +9,11 @@ - flags |= FD_CLOEXEC; - fcntl(fd, F_SETFD, &flags); - } -+ flags = 0; //fcntl(fd, F_GETFD); -+ //if (flags != -1) { -+ //flags |= FD_CLOEXEC; -+ //fcntl(fd, F_SETFD, &flags); -+ //} ++ flags = 0; #endif } } -@@ -124,13 +124,7 @@ xshmfence_alloc_shm(void) +@@ -124,13 +120,7 @@ xshmfence_alloc_shm(void) struct xshmfence * xshmfence_map_shm(int fd) { @@ -32,7 +28,7 @@ } /** -@@ -141,5 +135,5 @@ xshmfence_map_shm(int fd) +@@ -141,5 +131,5 @@ xshmfence_map_shm(int fd) void xshmfence_unmap_shm(struct xshmfence *f) { From cf98f2a5e732ac79f7b746439e8aab137fb6be82 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:47:45 +0900 Subject: [PATCH 20/20] Minor edit --- recipes/xorg-libxshmfence/build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/xorg-libxshmfence/build.sh b/recipes/xorg-libxshmfence/build.sh index 0ff8735bf9fc4..0d062dbd5e5f7 100644 --- a/recipes/xorg-libxshmfence/build.sh +++ b/recipes/xorg-libxshmfence/build.sh @@ -56,6 +56,11 @@ configure_args=( --disable-silent-rules ) +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" == "1" ]] ; then + configure_args+=( + --enable-malloc0returnsnull + ) +fi ./configure "${configure_args[@]}" make -j$CPU_COUNT make install