Skip to content

Commit

Permalink
Use $LIBRARY_PREFIX and autoreconf on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkgw committed Feb 3, 2017
1 parent a9bc50f commit 465263f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 13 deletions.
18 changes: 16 additions & 2 deletions recipe/bld.bat
@@ -1,3 +1,17 @@
:: Just delegate to the Unixy script.
bash %RECIPE_DIR%\build.sh
:: 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 "%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
40 changes: 33 additions & 7 deletions recipe/build.sh
Expand Up @@ -3,14 +3,40 @@
set -e
IFS=$' \t\n' # workaround for conda 4.2.13+toolchain bug

# Fresh OS-guessing scripts from xorg-util-macros for win64
for f in config.guess config.sub ; do
cp -p $PREFIX/share/util-macros/$f .
done
# Adopt a Unix-friendly path if we're on Windows (see bld.bat).
[ -n "$PATH_OVERRIDE" ] && export PATH="$PATH_OVERRIDE"

export PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig
# 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

# On Windows we need to regenerate the configure scripts.
if [ -n "$VS_MAJOR" ] ; 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 "$mprefix/mingw-w64/share/aclocal" # note: this is correct for win32 also!
)
autoreconf "${autoreconf_args[@]}"
fi

export PKG_CONFIG_LIBDIR=$uprefix/lib/pkgconfig:$uprefix/share/pkgconfig
configure_args=(
--prefix=$PREFIX
--prefix=$mprefix
--disable-dependency-tracking
--disable-selective-werror
--disable-silent-rules
Expand All @@ -19,4 +45,4 @@ configure_args=(
make -j$CPU_COUNT
make install
make check
rm -rf $PREFIX/share/doc/${PKG_NAME#xorg-}
rm -rf $uprefix/share/doc/${PKG_NAME#xorg-}
13 changes: 9 additions & 4 deletions recipe/meta.yaml
Expand Up @@ -3,6 +3,7 @@
{% set name = "xorg-" ~ xorg_name %}
{% set version = "0.11.1" %}
{% set sha256 = "06735a5b92b20759204e4751ecd6064a2ad8a6246bb65b3078b862a00def2537" %}
{% set am_version = "1.15" %} # keep synchronized with build.sh

package:
name: {{ name|lower }}
Expand All @@ -14,28 +15,32 @@ source:
sha256: {{ sha256 }}

build:
number: 0
number: 1
detect_binary_files_with_prefix: true

requirements:
build:
- m2-autoconf # [win]
- m2-automake{{ am_version }} # [win]
- m2-libtool # [win]
- m2w64-pkg-config # [win]
- m2w64-toolchain # [win]
- pkg-config # [not win]
- posix # [win]
- toolchain
- xorg-util-macros

test:
commands:
- conda inspect linkages -p $PREFIX {{ name }} # [not win]
- conda inspect objects -p $PREFIX {{ name }} # [osx]
- conda inspect linkages -p $PREFIX $PKG_NAME # [not win]
- conda inspect objects -p $PREFIX $PKG_NAME # [osx]

about:
home: https://www.x.org/
license: MIT
license_family: MIT
license_file: COPYING
summary: 'Definitions for the XRender protocol.'
summary: 'C prototypes for the XRender extension to X11.'

extra:
recipe-maintainers:
Expand Down

0 comments on commit 465263f

Please sign in to comment.