Skip to content

Commit

Permalink
Merge pull request #27565 from ehfd/xorg-libxv
Browse files Browse the repository at this point in the history
Create xorg-libxv feedstock
  • Loading branch information
hmaarrfk authored Sep 12, 2024
2 parents 4190801 + 6b55aa3 commit 402bb74
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 0 deletions.
18 changes: 18 additions & 0 deletions recipes/xorg-libxv/bld.bat
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions recipes/xorg-libxv/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/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
)

if [[ "${CONDA_BUILD_CROSS_COMPILATION}" == "1" ]] ; then
configure_args+=(
--enable-malloc0returnsnull
)
fi
./configure "${configure_args[@]}"
make -j$CPU_COUNT
make install
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
62 changes: 62 additions & 0 deletions recipes/xorg-libxv/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% set xorg_name = "libXv" %}
{% set xorg_category = "lib" %}
{% set name = "xorg-" ~ xorg_name %}
{% set version = "1.0.12" %}
{% set sha256 = "ce706619a970a580a0e35e9b5c98bdd2af243ac6494c65f44608a89a86100126" %}
{% 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: 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]
- {{ compiler('m2w64_c') }} # [win]
host:
- xorg-libx11
- xorg-libxext
- xorg-videoproto
- xorg-xproto
- xorg-util-macros

test:
commands:
{% set lib_idents = [ "Xv" ] %}
{% 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: Xlib-based library for the X Video (Xv) extension to the X Window System

extra:
recipe-maintainers:
- ehfd

0 comments on commit 402bb74

Please sign in to comment.