#!/bin/bash set -euo pipefail cp $PATCH_DIR/*.patch debian/patches/ echo 'fix-32bit-build.patch' >> debian/patches/series patch --no-backup-if-mismatch -p1 <<'PATCH' --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,10 @@ ORIG_CPPFLAGS := $(CPPFLAGS) ORIG_CXXFLAGS := $(CXXFLAGS) +ifneq (,$(filter mips mipsel,$(DEB_HOST_ARCH))) +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed +endif + # --[[ maintainer notes ]]-- # How to dump the flags for the upstream built instance: # $ python3 -c 'import torch as th; print(th.__version__, th.__config__.show())' PATCH sed -i "s|Architecture: |Architecture: mips mipsel |g" $PACKAGE_DSC debian/control sed -i "s|arch=|arch=mips,mipsel|g" $PACKAGE_DSC