diff --git a/conda_build_config.yaml b/conda_build_config.yaml index ea2ce3fa1..44329efad 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -567,7 +567,7 @@ poco: poppler: - '22.01' proj: - - 8.2.0 + - 9.4.1 pybind11_abi: - 4 diff --git a/recipes/recipes_emscripten/libtiff/build.sh b/recipes/recipes_emscripten/libtiff/build.sh index aaf1647f4..925938bda 100644 --- a/recipes/recipes_emscripten/libtiff/build.sh +++ b/recipes/recipes_emscripten/libtiff/build.sh @@ -7,7 +7,8 @@ emcmake cmake .. -GNinja \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_PREFIX_PATH=$PREFIX \ -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=OFF + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON ninja ninja install diff --git a/recipes/recipes_emscripten/libtiff/recipe.yaml b/recipes/recipes_emscripten/libtiff/recipe.yaml index dcc22fc28..d751097cc 100644 --- a/recipes/recipes_emscripten/libtiff/recipe.yaml +++ b/recipes/recipes_emscripten/libtiff/recipe.yaml @@ -10,7 +10,7 @@ source: sha256: c7a1d9296649233979fa3eacffef3fa024d73d05d589cb622727b5b08c423464 build: - number: 0 + number: 1 # Does a very good job of maintaining compatibility. # https://abi-laboratory.pro/tracker/timeline/libtiff/ # run_exports: diff --git a/recipes/recipes_emscripten/proj/build.sh b/recipes/recipes_emscripten/proj/build.sh index 4ea063ded..0f4fedc7d 100644 --- a/recipes/recipes_emscripten/proj/build.sh +++ b/recipes/recipes_emscripten/proj/build.sh @@ -4,7 +4,7 @@ mkdir -p build cd build -export LIBS=${BUILD_PREFIX}/include + # to build without curl we need to disable projsync too emcmake cmake ${CMAKE_ARGS} .. \ @@ -14,10 +14,12 @@ emcmake cmake ${CMAKE_ARGS} .. \ -DBUILD_TESTING=OFF \ -DENABLE_CURL=OFF \ -DBUILD_PROJSYNC=OFF \ - -DSQLite3_INCLUDE_DIR=${LIBS} \ - -DSQLite3_LIBRARY=${LIBS} \ - -DTIFF_INCLUDE_DIR=${LIBS} \ - -DTIFF_LIBRARY=${LIBS} \ + -DSQLite3_INCLUDE_DIR=$PREFIX/include \ + -DSQLite3_LIBRARY=$PREFIX/lib/libsqlite3.a \ + -DTIFF_INCLUDE_DIR=$PREFIX/include \ + -DTIFF_LIBRARY=$PREFIX/lib/libtiff.a \ + -DCMAKE_PROJECT_INCLUDE=${RECIPE_DIR}/overwriteProp.cmake \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON emmake make -j${CPU_COUNT} #${VERBOSE_CM} diff --git a/recipes/recipes_emscripten/proj/overwriteProp.cmake b/recipes/recipes_emscripten/proj/overwriteProp.cmake new file mode 100644 index 000000000..f2e14b337 --- /dev/null +++ b/recipes/recipes_emscripten/proj/overwriteProp.cmake @@ -0,0 +1,4 @@ +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) # does not need to be global :) +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1") +set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1") +set(CMAKE_STRIP FALSE) # used by default in pybind11 on .so modules # only for needed when using pybind11 diff --git a/recipes/recipes_emscripten/proj/recipe.yaml b/recipes/recipes_emscripten/proj/recipe.yaml index b777032c0..c7f155207 100644 --- a/recipes/recipes_emscripten/proj/recipe.yaml +++ b/recipes/recipes_emscripten/proj/recipe.yaml @@ -19,8 +19,6 @@ requirements: - make - ${{ compiler('c') }} - ${{ compiler('cxx') }} - - sqlitecpp - - libtiff - requests host: - sqlitecpp @@ -32,7 +30,6 @@ requirements: tests: - script: - test -f ${PREFIX}/include/proj.h - - test -f ${PREFIX}/lib/libproj.a about: homepage: https://proj.org/ diff --git a/recipes/recipes_emscripten/pyproj/build.sh b/recipes/recipes_emscripten/pyproj/build.sh new file mode 100644 index 000000000..f163116b3 --- /dev/null +++ b/recipes/recipes_emscripten/pyproj/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# override the wasm-ld command to a wrapper +# otherwise -R gets passed as flag +alias emcc=$PWD"/wasm-ld-wrapper.sh" + +# # the binary is needed .... +# cp $BUILD_PREFIX/bin/proj $PREFIX/bin/proj +export PROJ_DIR=$PREFIX + +# if version is not set, the python build script +# tries to call the proj binary to get the version +export PROJ_VERSION="9.4.1" + +${PYTHON} -m pip install -vv . + + +# rm $PREFIX/bin/proj diff --git a/recipes/recipes_emscripten/pyproj/recipe.yaml b/recipes/recipes_emscripten/pyproj/recipe.yaml new file mode 100644 index 000000000..73231af25 --- /dev/null +++ b/recipes/recipes_emscripten/pyproj/recipe.yaml @@ -0,0 +1,41 @@ +context: + name: pyproj + version: 3.6.1 + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://pypi.io/packages/source/p/pyproj/pyproj-${{ version }}.tar.gz + sha256: 44aa7c704c2b7d8fb3d483bbf75af6cb2350d30a63b144279a09b75fead501bf + +build: + number: 0 + +requirements: + build: + - python + - cross-python_${{ target_platform }} + - cython + - ${{ compiler('c') }} + host: + - python + - pip + - proj + run: + - python + - proj + - certifi + +about: + homepage: https://github.com/pyproj4/pyproj + license: MIT + license_file: + - LICENSE + - LICENSE_proj + summary: Python interface to PROJ library + +extra: + recipe-maintainers: + - KGB99 diff --git a/recipes/recipes_emscripten/pyproj/wasm-ld-wrapper.sh b/recipes/recipes_emscripten/pyproj/wasm-ld-wrapper.sh new file mode 100644 index 000000000..f02ea4cac --- /dev/null +++ b/recipes/recipes_emscripten/pyproj/wasm-ld-wrapper.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +echo "Using wasm-ld wrapper..." + +# Filter out the -R flags from the arguments +filtered_args=() +skip_next=false + +for arg in "$@"; do + if [ "$skip_next" = true ]; then + skip_next=false + continue + fi + + case "$arg" in + -R) + skip_next=true + ;; + *) + filtered_args+=("$arg") + ;; + esac +done + +# Call the actual wasm-ld command with the filtered arguments +emcc "${filtered_args[@]}"