You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. set -e
  3. CACHEDIR=.conan-cache
  4. RECIPE="${CACHEDIR}/conanfile.txt"
  5. BUILD="Release"
  6. ARCH_LIST="i686 x86_64"
  7. GENERATOR=visual_studio
  8. # Packages that need building because the binary package doesn’t exist
  9. # or does not contain necessary information such as the PDBs.
  10. BUILD_LIST=
  11. for x in conan cmake; do
  12. if ! which $x >/dev/null 2>&1; then
  13. echo "Error: missing utility '$x'"
  14. exit 1
  15. fi
  16. done
  17. # Initialise recipe file
  18. mkdir -p "${CACHEDIR}"
  19. echo '[requires]' > "${RECIPE}"
  20. case "$1" in
  21. ssl)
  22. BUILD_LIST="openssl"
  23. echo "openssl/1.1.1g" >> "${RECIPE}"
  24. ;;
  25. # Does not work yet
  26. zlib)
  27. echo "zlib/1.2.11@conan/stable" >> "${RECIPE}"
  28. ;;
  29. # Does not work yet
  30. glew)
  31. echo "glew/2.1.0@bincrafters/stable" >> "${RECIPE}"
  32. GENERATOR=
  33. ;;
  34. sdl2)
  35. echo "sdl2/2.0.12@bincrafters/stable" >> "${RECIPE}"
  36. echo "sdl2_image/2.0.5@bincrafters/stable" >> "${RECIPE}"
  37. echo "sdl2_mixer/2.0.4@bincrafters/stable" >> "${RECIPE}"
  38. ;;
  39. *)
  40. echo "Usage: $0 [ssl|glew|sdl2]"
  41. exit 1
  42. esac
  43. echo '[generators]' >> "${RECIPE}"
  44. echo "$GENERATOR" >> "${RECIPE}"
  45. conan remote add -f bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
  46. for arch in $(echo $ARCH_LIST); do
  47. conan_arch="$(echo $arch | sed 's/i686/x86/')"
  48. conan install -s build_type="${BUILD}" -s arch="${conan_arch}" --build ${BUILD_LIST} -if ${CACHEDIR} ${CACHEDIR}
  49. for pkg in $(sed -ne 's@/.*@@p' < "${RECIPE}"); do
  50. install_path="$(awk "/<Conan-${pkg}-Root>/ { gsub(/ *<[^>]*> */, "'""'"); print }" "${CACHEDIR}/conanbuildinfo.props")"
  51. source_path="$(echo "${install_path}" | sed 's@_/package/@_/build/@')"
  52. chunks="$(echo "${install_path}" | sed 's@.*\.conan/data/@@')"
  53. test "${pkg}" = "$(echo "${chunks}" | cut -f1 -d/)"
  54. version="$(echo "$chunks" | cut -f2 -d/)"
  55. lib_path="${pkg}-${version}/lib/${arch}-msvc"
  56. include_path="${pkg}-${version}/include"
  57. rm -rf "${lib_path}" "${include_path}"
  58. mkdir -p "${lib_path}" "${include_path}"
  59. find "${source_path}/source_subfolder" -name '*static.pdb' -exec cp {} "${lib_path}/" ';'
  60. cp -rv "${install_path}"/lib/* "${lib_path}/"
  61. cp -rv "${install_path}"/include/* "${include_path}/"
  62. done
  63. done